18F/identity-idp

View on GitHub
app/views/sign_up/select_email/show.html.erb

Summary

Maintainability
Test Coverage
<% self.title = t('titles.select_email') %>

<%= render StatusPageComponent.new(status: :info, icon: :question) do |c| %>
  <% c.with_header(id: 'select-email-heading') { t('titles.select_email') } %>

  <p id="select-email-intro">
    <%= I18n.t('help_text.select_preferred_email', sp: @sp_name, app_name: APP_NAME) %>
  </p>

  <%= simple_form_for(@select_email_form, url: sign_up_select_email_path) do |f| %>
    <%= f.input(
          :selected_email_id,
          as: :radio_buttons,
          label: false,
          wrapper_html: {
            aria: {
              labelledby: 'select-email-heading',
              describedby: 'select-email-intro',
            },
          },
          collection: @user_emails.map do |email|
            [
              email.email,
              email.id,
              checked: email.email == @last_sign_in_email_address,
            ]
          end,
        ) %>
    <%= f.submit t('help_text.requested_attributes.change_email_link'), class: 'margin-top-1' %>
  <% end %>

  <%= render ButtonComponent.new(
        url: add_email_path,
        outline: true,
        big: true,
        wide: true,
        class: 'margin-top-2',
      ).with_content(t('account.index.email_add')) %>

  <%= render PageFooterComponent.new do %>
    <%= link_to t('forms.buttons.back'), sign_up_completed_path %>
  <% end %>
<% end %>