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 a367309 commit b39bc88
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 16 deletions.
8 changes: 0 additions & 8 deletions app/controllers/concerns/content_item_loader.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ module ContentItemLoader

included do
before_action :load_content_item
before_action :set_expiry

helper_method :view_context
end
Expand All @@ -22,11 +21,4 @@ def ordered_related_items(links)
"suggested_ordered_related_items", []
)
end

def set_expiry
expires_in(
@content_item.content_item.cache_control.max_age,
public: @content_item.content_item.cache_control.public?,
)
end
end
6 changes: 5 additions & 1 deletion app/controllers/take_part_controller.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
class TakePartController < ApplicationController
class TakePartController < ContentItemsController
include ContentItemLoader

def model_type
TakePart
end

def content_item_slug
request.path
end
end
2 changes: 2 additions & 0 deletions app/models/content_item.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ def parsed_content_item
content_item
end

delegate :to_h, to: :content_item

private

def mapped_locales(translations)
Expand Down
7 changes: 0 additions & 7 deletions app/views/layouts/application.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,6 @@
<% unless current_page?(root_path) || !(publication || @calendar) %>
<%= render 'govuk_publishing_components/components/contextual_breadcrumbs', content_item: content_item_hash %>
<% end %>
<% if @content_item.try(: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
6 changes: 6 additions & 0 deletions config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,11 @@ en:
components:
figure:
image_credit: 'Image credit: %{credit}'
content_item:
schema_name:
take_part:
one: Take part
other: Take part
continue: Continue
cookies:
always_on: They always need to be on.
Expand Down Expand Up @@ -652,6 +657,7 @@ en:
'no': 'No'
or: or
language_names:
cy:
en: English
place:
children_social_care: You can call the children's social care team at the council in
Expand Down

0 comments on commit b39bc88

Please sign in to comment.