Skip to content

Commit

Permalink
AP-5608: add moj components helper method
Browse files Browse the repository at this point in the history
  • Loading branch information
agoldstone93 committed Jan 6, 2025
1 parent 4330a15 commit d3d8dcb
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 17 deletions.
7 changes: 7 additions & 0 deletions app/helpers/moj_components_helper.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
module MojComponentsHelper
def interruption_card(heading:, next_url:, &body)
body = capture(&body) if body

render("shared/moj_components_templates/interruption_card_template", heading:, next_url:, body:)
end
end
22 changes: 5 additions & 17 deletions app/views/providers/no_national_insurance_numbers/show.html.erb
Original file line number Diff line number Diff line change
@@ -1,17 +1,5 @@
<div class="moj-interruption-card">
<div class="moj-interruption-card__content">
<%= page_template(page_title: t(".tab_title"), template: :basic) do %>
<h1 class="govuk-heading-l moj-interruption-card__heading"><%= t(".title") %></h1>

<p class="govuk-body moj-interruption-card__body"><%= t(".body") %></p>

<%= next_action_buttons_with_form(
url: providers_legal_aid_application_no_national_insurance_number_path,
method: :patch,
show_draft: true,
inverse_continue: true,
continue_button_text: t("generic.continue"),
) %>
<% end %>
</div>
</div>
<%= page_template(page_title: t(".tab_title"), template: :basic, column_width: "full") do %>
<%= interruption_card(heading: t(".title"), next_url: providers_legal_aid_application_no_national_insurance_number_path) do %>
<p class="govuk-body moj-interruption-card__body"><%= t(".body") %></p>
<% end %>
<% end %>
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<div class="moj-interruption-card">
<div class="moj-interruption-card__content">
<div class="govuk-grid-row">
<div class="govuk-grid-column-two-thirds">
<h1 class="govuk-heading-l moj-interruption-card__heading"><%= heading %></h1>

<%= body %>

<%= next_action_buttons_with_form(
url: next_url,
method: :patch,
show_draft: true,
inverse_continue: true,
continue_button_text: t("generic.continue"),
) %>
</div>
</div>
</div>
</div>

0 comments on commit d3d8dcb

Please sign in to comment.