Skip to content

Commit

Permalink
use govuk formbuilder for reminders OTP form
Browse files Browse the repository at this point in the history
  • Loading branch information
asmega committed Jun 17, 2024
1 parent c4d7f71 commit 692a387
Showing 1 changed file with 21 additions and 21 deletions.
42 changes: 21 additions & 21 deletions app/views/additional_payments/reminders/_one_time_password.html.erb
Original file line number Diff line number Diff line change
@@ -1,35 +1,35 @@
<div class="govuk-grid-row">
<div class="govuk-grid-column-two-thirds">
<%= render("shared/error_summary", instance: @form) if @form.errors.any? %>

<span class="govuk-caption-xl">Email verification</span>

<%= form_for @form, url: reminder_path(current_journey_routing_name) do |f| %>
<%= form_group_tag @form do %>
<h1 class="govuk-label-wrapper">
<label class="govuk-label govuk-label--l" for="form_one_time_password"><%= t("one_time_password.title") %></label>
</h1>
<%= form_for @form, url: reminder_path(current_journey_routing_name), builder: GOVUKDesignSystemFormBuilder::FormBuilder do |f| %>
<%= f.govuk_error_summary %>

<div id="one-time-password-hint" class="govuk-hint">
<%= t("one_time_password.hint1_html", email_or_mobile_message: "an email", email_or_mobile_value: @form.email_address) %>
<br><br>
<%= t("one_time_password.validity_duration", duration_valid: one_time_password_validity_duration) %>
</div>
<%= f.govuk_text_field :one_time_password,
autocomplete: "off",
width: 5,
label: {
text: t("one_time_password.title"),
size: "l",
tag: "h1"
},
hint: -> do %>
<p>
<%= t("one_time_password.hint1_html", email_or_mobile_message: "an email", email_or_mobile_value: @form.email_address) %>
</p>

<%= errors_tag @form, :one_time_password %>
<%= f.text_field :one_time_password,
autocomplete: "off",
class: css_classes_for_input(@form, :one_time_password, 'govuk-input--width-5'),
"aria-describedby" => "one-time-password-hint" %>
<% end %>
<p>
<%= t("one_time_password.validity_duration", duration_valid: one_time_password_validity_duration) %>
</p>
<% end %>

<div class="govuk-body govuk-!-margin-bottom-6">
<%= link_to "Resend passcode (you will be sent back to the email address page)", new_reminder_path, class: "govuk-link govuk-link--no-visited-state" %>
<%= govuk_link_to "Resend passcode (you will be sent back to the email address page)", new_reminder_path, no_visited_state: true %>
</div>

<div class="govuk-button-group">
<%= f.submit "Confirm", class: "govuk-button" %>
<%= link_to "Change email address", new_reminder_path, class: "govuk-button govuk-button--secondary", role: "button", data: {module: "govuk-button"} %>
<%= f.govuk_submit "Confirm" %>
<%= govuk_button_link_to "Change email address", new_reminder_path, secondary: true %>
</div>
<% end %>
</div>
Expand Down

0 comments on commit 692a387

Please sign in to comment.