-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2238 from alphagov/context-overview
Add "overview:" to titles where an attachment has the same name
- Loading branch information
Showing
5 changed files
with
69 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<% context_string = t("content_item.schema_name.#{@content_item.document_type}", count: 1) %> | ||
|
||
<% @content_item&.featured_attachments.each do |fa| %> | ||
<% return if !@content_item.attachment_details(fa).present? %> | ||
<% if @content_item.attachment_details(fa)['title'] == @content_item.title %> | ||
<% content_for :title do %> | ||
<%= t("content_item.schema_name.#{@content_item.document_type}.overview", count: 1) %>: <%= @content_item.title %> | ||
<% end %> | ||
<% | ||
context_string = t("content_item.schema_name.#{@content_item.document_type}.overview", count: 1) << ":" | ||
context_inside = true | ||
%> | ||
<% break %> | ||
<% end %> | ||
<% end %> | ||
|
||
<%= render 'govuk_publishing_components/components/title', | ||
context: context_string, | ||
context_locale: t_locale_fallback("content_item.schema_name.#{@content_item.document_type}", count: 1), | ||
context_inside: context_inside ||= false, | ||
title: @content_item.title, | ||
average_title_length: "long" | ||
%> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters