Use header component for masthead

Replaces the following blocks/variables with the
`header` block filled by the `header` component:
- header_class
- proposition_header
- global_header_text
- homepage_url

Also rewrites code that selects header nav items

The original code inserts a class name to mark the
nav item as selected.

The GOVUK Frontend header just needs a boolean to
be passed to indicate an item is selected.

This uses the `header_navigation.is_selected`
method, as before, but changes its return value to
a boolean.
This commit is contained in:
Tom Byers
2019-10-09 16:00:45 +01:00
parent af95b4b45a
commit 2271ff3d56
2 changed files with 93 additions and 30 deletions

View File

@@ -328,6 +328,12 @@ class HeaderNavigation(Navigation):
'whitelist',
}
# header HTML now comes from GOVUK Frontend so requires a boolean, not an attribute
def is_selected(self, navigation_item):
if request.endpoint in self.mapping[navigation_item]:
return True
return False
class MainNavigation(Navigation):