Class: GovukPublishingComponents::Presenters::PublicLayoutHelper
- Inherits:
-
Object
- Object
- GovukPublishingComponents::Presenters::PublicLayoutHelper
- Defined in:
- lib/govuk_publishing_components/presenters/public_layout_helper.rb
Constant Summary collapse
- BLUE_BAR_BACKGROUND_COLOURS =
%w[browse].freeze
- FOOTER_NAVIGATION_COLUMNS =
[2, 1].freeze
- FOOTER_META =
{ items: [ { href: "/help", text: "Help", }, { href: "/help/privacy-notice", text: "Privacy", }, { href: "/help/cookies", text: "Cookies", }, { href: "/help/accessibility-statement", text: "Accessibility statement", }, { href: "/contact", text: "Contact", }, { href: "/help/terms-conditions", text: "Terms and conditions", }, { href: "/cymraeg", text: "Rhestr o Wasanaethau Cymraeg", attributes: { lang: "cy", }, }, { href: "/government/organisations/government-digital-service", text: "Government Digital Service", }, ], }.freeze
Instance Attribute Summary collapse
-
#cookie_banner_data ⇒ Object
readonly
Returns the value of attribute cookie_banner_data.
-
#footer_meta ⇒ Object
readonly
Returns the value of attribute footer_meta.
-
#footer_navigation ⇒ Object
readonly
Returns the value of attribute footer_navigation.
Instance Method Summary collapse
- #blue_bar_background_colours ⇒ Object
- #footer_navigation_columns ⇒ Object
-
#initialize(local_assigns) ⇒ PublicLayoutHelper
constructor
A new instance of PublicLayoutHelper.
- #navigation_link_generation_from_locale(links) ⇒ Object
Constructor Details
#initialize(local_assigns) ⇒ PublicLayoutHelper
Returns a new instance of PublicLayoutHelper.
48 49 50 51 52 |
# File 'lib/govuk_publishing_components/presenters/public_layout_helper.rb', line 48 def initialize(local_assigns) @footer_navigation = local_assigns[:footer_navigation] || (I18n.t("components.layout_footer.navigation_links")) @footer_meta = local_assigns[:footer_meta] || { items: FOOTER_META[:items] } @cookie_banner_data = local_assigns[:cookie_banner_data] || {} end |
Instance Attribute Details
#cookie_banner_data ⇒ Object (readonly)
Returns the value of attribute cookie_banner_data.
46 47 48 |
# File 'lib/govuk_publishing_components/presenters/public_layout_helper.rb', line 46 def @cookie_banner_data end |
#footer_meta ⇒ Object (readonly)
Returns the value of attribute footer_meta.
46 47 48 |
# File 'lib/govuk_publishing_components/presenters/public_layout_helper.rb', line 46 def @footer_meta end |
#footer_navigation ⇒ Object (readonly)
Returns the value of attribute footer_navigation.
46 47 48 |
# File 'lib/govuk_publishing_components/presenters/public_layout_helper.rb', line 46 def @footer_navigation end |
Instance Method Details
#blue_bar_background_colours ⇒ Object
68 69 70 |
# File 'lib/govuk_publishing_components/presenters/public_layout_helper.rb', line 68 def BLUE_BAR_BACKGROUND_COLOURS end |
#footer_navigation_columns ⇒ Object
64 65 66 |
# File 'lib/govuk_publishing_components/presenters/public_layout_helper.rb', line 64 def FOOTER_NAVIGATION_COLUMNS end |
#navigation_link_generation_from_locale(links) ⇒ Object
54 55 56 57 58 59 60 61 62 |
# File 'lib/govuk_publishing_components/presenters/public_layout_helper.rb', line 54 def (links) links.each_with_index.map do |, i| { title: [:title], columns: [i], items: [:menu_contents], } end end |