Skip to content

Commit

Permalink
Merge pull request #2157 from alphagov/consolidation-reskin-intermedi…
Browse files Browse the repository at this point in the history
…ate-section-edit-page

Migrate section show page to design system
  • Loading branch information
ryanb-gds authored Sep 8, 2023
2 parents 205fc01 + 2f68525 commit 6438446
Show file tree
Hide file tree
Showing 9 changed files with 54 additions and 294 deletions.
76 changes: 0 additions & 76 deletions app/controllers/legacy_link_check_reports_controller.rb

This file was deleted.

1 change: 1 addition & 0 deletions app/controllers/sections_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ def show

render(
:show,
layout: "design_system",
locals: {
manual:,
section:,
Expand Down
3 changes: 0 additions & 3 deletions app/views/admin/legacy_link_check_reports/_form.html.erb

This file was deleted.

This file was deleted.

1 change: 0 additions & 1 deletion app/views/admin/legacy_link_check_reports/create.js.erb

This file was deleted.

3 changes: 0 additions & 3 deletions app/views/admin/legacy_link_check_reports/show.js.erb

This file was deleted.

76 changes: 53 additions & 23 deletions app/views/sections/show.html.erb
Original file line number Diff line number Diff line change
@@ -1,32 +1,62 @@
<% content_for :page_title, "Summary" %>
<% content_for :title, section.title %>
<% content_for :breadcrumbs do %>
<li><%= link_to "Your manuals", manuals_path %></li>
<li><%= link_to manual.title, manual_path(manual) %></li>
<li class="active"><%= section.title %></li>
<%= render "govuk_publishing_components/components/breadcrumbs", {
collapse_on_mobile: true,
breadcrumbs: [
{
title: "Your manuals",
url: manuals_path
},
{
title: manual.title,
url: manual_path(manual)
},
{
title: section.title
},
]
} %>
<% end %>

<h1 class="page-header">
<%= section.title %>
</h1>
<div class="govuk-grid-row">
<div class="govuk-grid-column-two-thirds">
<%= render "govuk_publishing_components/components/heading", {
text: section.title,
heading_level: 1,
font_size: "xl",
margin_bottom: 8
} %>
</div>
</div>

<div class="row">
<div class="sidebar col-md-8">
<div class="row">
<div class="col-md-12">
<h2>Summary</h2>
<p><%= section.summary %></p>
</div>
<div class="col-md-12">
<div class="actions well">
<%= link_to("Edit section", edit_manual_section_path(manual, section), class: "action-link btn btn-success") %>
<%= link_to("Withdraw section", withdraw_manual_section_path(manual, section), class: "action-link btn btn-danger") %>
</div>
</div>
</div>
<div class="govuk-grid-row">
<div class="govuk-grid-column-two-thirds">
<p class="govuk-body"><%= section.summary %></p>
</div>

<div class="col-md-4">
<%= render "admin/legacy_link_check_reports/link_check_report", reportable: { manual_id: manual.to_param, section_id: section.to_param }, report: section.link_check_report %>
<div class="govuk-grid-column-one-third">
<div class="app-view-manuals__sidebar-actions">
<ul class="govuk-list govuk-list--spaced">
<li>
<%= render("govuk_publishing_components/components/button", {
text: "Edit section",
href: edit_manual_section_path(manual, section),
}) %>
</li>
<li>
<%= render("govuk_publishing_components/components/button", {
text: "Withdraw section",
href: withdraw_manual_section_path(manual, section),
destructive: true,
}) %>
</li>
</ul>
</div>

<%= render("admin/link_check_reports/link_check_report", {
reportable: { manual_id: manual.to_param, section_id: section.to_param },
report: section.link_check_report
}) %>
</div>
</div>
1 change: 0 additions & 1 deletion config/routes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
put :original_publication_date, on: :member, action: :update_original_publication_date
end

resources :legacy_link_check_reports, only: %i[create show]
resources :link_check_reports, only: %i[create show]

post "/link-checker-api-callback" => "link_checker_api_callback#callback", as: "link_checker_api_callback"
Expand Down
143 changes: 0 additions & 143 deletions spec/controllers/legacy_link_check_reports_controller_spec.rb

This file was deleted.

0 comments on commit 6438446

Please sign in to comment.