diff --git a/app/presenters/html_publication_presenter.rb b/app/presenters/html_publication_presenter.rb index 6bfebdbf6..37a78f0a4 100644 --- a/app/presenters/html_publication_presenter.rb +++ b/app/presenters/html_publication_presenter.rb @@ -4,6 +4,7 @@ class HtmlPublicationPresenter < ContentItemPresenter include ContentItem::ContentsList include ContentItem::Political include ContentItem::NationalApplicability + include ContentItem::Metadata def isbn content_item["details"]["isbn"] @@ -21,17 +22,6 @@ def format_sub_type end end - def last_changed - timestamp = display_date(public_timestamp) - - # This assumes that a translation doesn't need the date to come beforehand. - if content_item["details"]["first_published_version"] - "#{I18n.t('content_item.metadata.published')} #{timestamp}" - else - "#{I18n.t('content_item.metadata.updated')} #{timestamp}" - end - end - def organisations content_item["links"]["organisations"] || [] end @@ -44,6 +34,20 @@ def organisation_logo(organisation) end end + def publisher_metadata + super.tap do |m| + orgs = organisations.map do |organisation| + view_context.link_to(organisation["title"], organisation["base_path"], class: "govuk-link govuk-link--inverse") + end + m.merge!(from: orgs) + + if content_item["details"]["first_published_version"] + m.delete(:see_updates_link) + m.delete(:last_updated) + end + end + end + def full_path(request) request.base_url + request.path end diff --git a/app/views/content_items/html_publication.html.erb b/app/views/content_items/html_publication.html.erb index 4f804de9f..d083d46db 100644 --- a/app/views/content_items/html_publication.html.erb +++ b/app/views/content_items/html_publication.html.erb @@ -9,31 +9,23 @@ content_for :simple_header, true %> -<% if @content_item.organisations %> -
<%= @content_item.last_changed %>
-<% end %> +