Skip to content

Commit

Permalink
Remove overview text
Browse files Browse the repository at this point in the history
Remove the loops around the attachments and just apply the context_inside in all cases.

Switch from using the text string of {@content_item.document_type}.overview {@content_item.document_type}
  • Loading branch information
Chris Yoong committed Nov 25, 2021
1 parent dab1815 commit a319727
Showing 1 changed file with 2 additions and 21 deletions.
23 changes: 2 additions & 21 deletions app/views/content_items/_context_and_title.html.erb
Original file line number Diff line number Diff line change
@@ -1,26 +1,7 @@
<%
context_string = t("content_item.schema_name.#{@content_item.document_type}", count: 1);
context_inside = false;
%>

<% @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: t("content_item.schema_name.#{@content_item.document_type}", count: 1),
context_locale: t_locale_fallback("content_item.schema_name.#{@content_item.document_type}", count: 1),
context_inside: context_inside,
context_inside: true,
title: @content_item.title,
average_title_length: "long"
%>

0 comments on commit a319727

Please sign in to comment.