Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
KludgeKML committed Sep 4, 2024
1 parent 8ddf701 commit eccf200
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 1 deletion.
8 changes: 8 additions & 0 deletions app/models/content_item.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,14 @@ def sorted_locales(translations)
translations.sort_by { |t| t["locale"] == I18n.default_locale.to_s ? "" : t["locale"] }
end

def show_default_breadcrumbs?
true
end

def parsed_content_item
content_item
end

private

def mapped_locales(translations)
Expand Down
7 changes: 7 additions & 0 deletions app/views/layouts/application.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,13 @@
<% unless current_page?(root_path) || !(publication || @calendar) %>
<%= render 'govuk_publishing_components/components/contextual_breadcrumbs', content_item: content_item_hash %>
<% end %>
<% if @content_item&.show_default_breadcrumbs? %>
<% if @content_item.try(:back_link) %>
<%= render 'govuk_publishing_components/components/back_link', href: @content_item.back_link %>
<% else %>
<%= render 'govuk_publishing_components/components/contextual_breadcrumbs', content_item: @content_item.parsed_content_item %>
<% end %>
<% end %>
<% if local_assigns %>
<%= yield %>
<%= yield :after_content %>
Expand Down
2 changes: 1 addition & 1 deletion app/views/take_part/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<div class="govuk-grid-row">
<div class="govuk-grid-column-two-thirds">
<%= render 'govuk_publishing_components/components/title', title_and_context(@content_item.title, @content_item.document_type, view_context) %>
<%= render 'govuk_publishing_components/components/title', title_and_context(@content_item.title, @content_item.document_type, view_context).except(:average_title_length) %>
<%= render 'govuk_publishing_components/components/lead_paragraph', text: @content_item.description %>
</div>

Expand Down
2 changes: 2 additions & 0 deletions config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -656,6 +656,8 @@ en:
link: /vat-rates
'no': 'No'
or: or
language_names:
en: English
place:
children_social_care: You can call the children's social care team at the council in
go_to_website: Go to their website
Expand Down

0 comments on commit eccf200

Please sign in to comment.