Skip to content

Commit

Permalink
use govuk formbuilder for submissions
Browse files Browse the repository at this point in the history
- govuk formbuilder by default out of the box has double click
  prevention enabled
  • Loading branch information
asmega committed Oct 14, 2024
1 parent 252d737 commit 5b612ef
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 25 deletions.
14 changes: 8 additions & 6 deletions app/views/additional_payments/claims/check_your_answers.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,16 @@

<%= render partial: "claims/check_your_answers_section", locals: {heading: "Payment details", answers: journey.answers_for_claim(@form.journey_session).payment_answers} %>

<%= form_with url: claim_submission_path do |form| %>
<h2 class="govuk-heading-m"><%= t("additional_payments.check_your_answers.heading_send_application") %></h2>
<%= form_with url: claim_submission_path, builder: GOVUKDesignSystemFormBuilder::FormBuilder do |f| %>
<h2 class="govuk-heading-m">
<%= t("additional_payments.check_your_answers.heading_send_application") %>
</h2>

<p class="govuk-body"><%= t("additional_payments.check_your_answers.statement") %></p>
<p class="govuk-body">
<%= t("additional_payments.check_your_answers.statement") %>
</p>

<div class="govuk-form-group">
<%= form.submit t("additional_payments.check_your_answers.btn_text"), class: "govuk-button" %>
</div>
<%= f.govuk_submit t("additional_payments.check_your_answers.btn_text") %>
<% end %>
</div>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,19 @@
</h1>

<%= render partial: "claims/check_your_answers_section", locals: {heading: nil, answers: journey.answers_for_claim(@form.journey_session).claim_answers} %>
<%= form_with model: @form, url: claim_path(current_journey_routing_name), method: :patch, builder: GOVUKDesignSystemFormBuilder::FormBuilder do |form| %>
<h2 class="govuk-heading-m"><%= t("early_years_payment_provider_authenticated.check_your_answers.heading_send_application") %></h2>

<p class="govuk-body"><%= t("early_years_payment_provider_authenticated.check_your_answers.statement") %></p>
<%= form_with model: @form, url: claim_path(current_journey_routing_name), method: :patch, builder: GOVUKDesignSystemFormBuilder::FormBuilder do |f| %>
<h2 class="govuk-heading-m">
<%= t("early_years_payment_provider_authenticated.check_your_answers.heading_send_application") %>
</h2>

<%= form.govuk_text_field :provider_contact_name, label: { text: "Your full name" }, spellcheck: "false" %>
<p class="govuk-body">
<%= t("early_years_payment_provider_authenticated.check_your_answers.statement") %>
</p>

<div class="govuk-form-group">
<%= form.submit t("early_years_payment_provider_authenticated.check_your_answers.btn_text"), class: "govuk-button" %>
</div>
<%= f.govuk_text_field :provider_contact_name, label: { text: "Your full name" }, spellcheck: "false" %>

<%= f.govuk_submit t("early_years_payment_provider_authenticated.check_your_answers.btn_text") %>
<% end %>
</div>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,16 @@

<%= render partial: "claims/check_your_answers_section", locals: {heading: "Payment details", answers: journey.answers_for_claim(@form.journey_session).payment_answers} %>

<%= form_with url: claim_submission_path do |form| %>
<h2 class="govuk-heading-m"><%= t("further_education_payments.check_your_answers.heading_send_application") %></h2>
<%= form_with url: claim_submission_path, builder: GOVUKDesignSystemFormBuilder::FormBuilder do |f| %>
<h2 class="govuk-heading-m">
<%= t("further_education_payments.check_your_answers.heading_send_application") %>
</h2>

<p class="govuk-body"><%= t("further_education_payments.check_your_answers.statement") %></p>
<p class="govuk-body">
<%= t("further_education_payments.check_your_answers.statement") %>
</p>

<div class="govuk-form-group">
<%= form.submit t("further_education_payments.check_your_answers.btn_text"), class: "govuk-button" %>
</div>
<%= f.govuk_submit t("further_education_payments.check_your_answers.btn_text") %>
<% end %>
</div>
</div>
14 changes: 8 additions & 6 deletions app/views/student_loans/claims/check_your_answers.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,16 @@

<%= render partial: "claims/check_your_answers_section", locals: {heading: "Payment details", answers: journey.answers_for_claim(@form.journey_session).payment_answers} %>

<%= form_with url: claim_submission_path do |form| %>
<h2 class="govuk-heading-m"><%= t("check_your_answers.heading_send_application") %></h2>
<%= form_with url: claim_submission_path, builder: GOVUKDesignSystemFormBuilder::FormBuilder do |f| %>
<h2 class="govuk-heading-m">
<%= t("check_your_answers.heading_send_application") %>
</h2>

<p class="govuk-body"><%= t("check_your_answers.statement") %></p>
<p class="govuk-body">
<%= t("check_your_answers.statement") %>
</p>

<div class="govuk-form-group">
<%= form.submit t("check_your_answers.btn_text"), class: "govuk-button" %>
</div>
<%= f.govuk_submit t("check_your_answers.btn_text") %>
<% end %>
</div>
</div>

0 comments on commit 5b612ef

Please sign in to comment.