mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-19 14:09:20 -04:00
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:
@@ -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):
|
||||
|
||||
|
||||
Reference in New Issue
Block a user