From f9e2712f169a01f66aff46fa6730f7a77db5d244 Mon Sep 17 00:00:00 2001 From: davidtrussler Date: Thu, 10 Oct 2024 10:19:20 +0100 Subject: [PATCH] Update grid to allow display of sidebar on some tabs --- .../secondary_nav_tabs/_metadata.html.erb | 108 +++++++++--------- app/views/editions/show.html.erb | 4 +- 2 files changed, 56 insertions(+), 56 deletions(-) diff --git a/app/views/editions/secondary_nav_tabs/_metadata.html.erb b/app/views/editions/secondary_nav_tabs/_metadata.html.erb index 608688bc2..cdeec5fbd 100644 --- a/app/views/editions/secondary_nav_tabs/_metadata.html.erb +++ b/app/views/editions/secondary_nav_tabs/_metadata.html.erb @@ -1,57 +1,59 @@ -<%= render "govuk_publishing_components/components/heading", { - text: "Metadata", - heading_level: 2, - margin_bottom: 5, -} %> +
+ <%= render "govuk_publishing_components/components/heading", { + text: "Metadata", + heading_level: 2, + margin_bottom: 5, + } %> -<% if Edition::PUBLISHING_API_DRAFT_STATES.include? publication.state %> - <%= form_for(@artefact, :html => { :class => "artefact", :id => "edit_artefact" }) do |f| %> - <%= f.hidden_field :id, value: @artefact.id %> + <% if Edition::PUBLISHING_API_DRAFT_STATES.include? publication.state %> + <%= form_for(@artefact, :html => { :class => "artefact", :id => "edit_artefact" }) do |f| %> + <%= f.hidden_field :id, value: @artefact.id %> - <%= render "govuk_publishing_components/components/input", { - label: { - text: "Slug", - }, - hint: "If you change the slug of a published page, the old slug will automatically redirect to the new one.", - name: "artefact[slug]", - value: publication.slug, - heading_level: 3, - heading_size: "m", - } %> - - <%= render "govuk_publishing_components/components/radio", { - heading: "Language", - name: "artefact[language]", - heading_level: 3, - heading_size: "m", - inline: true, - items: [ - { - value: "en", - text: "English", - checked: publication.artefact.language == "en" ? true : false, - }, - { - value: "cy", - text: "Welsh", - checked: publication.artefact.language == "cy" ? true : false, + <%= render "govuk_publishing_components/components/input", { + label: { + text: "Slug", }, - ], - } %> - <%= render "govuk_publishing_components/components/button", { - text: "Update", - } %> - <% end %> -<% else %> - <% @artefact.attributes.slice("slug", "language").each do |key, value| %> - <%= render "govuk_publishing_components/components/heading", { - text: key.humanize, - heading_level: 3, - font_size: "m", - margin_bottom: 3, - } %> -

- <%= key.eql?("slug") ? value : locale_to_language(value) %> -

+ hint: "If you change the slug of a published page, the old slug will automatically redirect to the new one.", + name: "artefact[slug]", + value: publication.slug, + heading_level: 3, + heading_size: "m", + } %> + + <%= render "govuk_publishing_components/components/radio", { + heading: "Language", + name: "artefact[language]", + heading_level: 3, + heading_size: "m", + inline: true, + items: [ + { + value: "en", + text: "English", + checked: publication.artefact.language == "en" ? true : false, + }, + { + value: "cy", + text: "Welsh", + checked: publication.artefact.language == "cy" ? true : false, + }, + ], + } %> + <%= render "govuk_publishing_components/components/button", { + text: "Update", + } %> + <% end %> + <% else %> + <% @artefact.attributes.slice("slug", "language").each do |key, value| %> + <%= render "govuk_publishing_components/components/heading", { + text: key.humanize, + heading_level: 3, + font_size: "m", + margin_bottom: 3, + } %> +

+ <%= key.eql?("slug") ? value : locale_to_language(value) %> +

+ <% end %> <% end %> -<% end %> +
diff --git a/app/views/editions/show.html.erb b/app/views/editions/show.html.erb index 3335165bc..f6ec4f2bd 100644 --- a/app/views/editions/show.html.erb +++ b/app/views/editions/show.html.erb @@ -27,7 +27,5 @@ <%= render partial: "secondary_navigation" %> -
- <%= render partial: "secondary_nav_tabs/#{current_tab_name}", :locals => { :publication => @resource } %> -
+ <%= render partial: "secondary_nav_tabs/#{current_tab_name}", :locals => { :publication => @resource } %>