18F/identity-idp

View on GitHub
app/views/sign_up/registrations/new.html.erb

Summary

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

<%= render 'shared/sp_alert', section: 'sign_up' %>

<% if decorated_sp_session.sp_name %>
  <%= render 'sign_up/registrations/sp_registration_heading' %>
<% end %>

<%= render TabNavigationComponent.new(
      label: t('account.login.tab_navigation'),
      routes: [
        { text: t('links.sign_in'), path: new_user_session_url },
        { text: t('links.create_account'), path: sign_up_email_path },
      ],
      class: 'margin-bottom-4',
    ) %>

<%= render PageHeadingComponent.new.with_content(t('headings.create_account_new_users')) %>

<% if FeatureManagement.account_creation_device_profiling_collecting_enabled? %>
  <%= render partial: 'shared/threat_metrix_profiling',
             locals: {
               threatmetrix_session_id:,
               threatmetrix_javascript_urls:,
               threatmetrix_iframe_url:,
             } %>
<% end %>

<%= simple_form_for(@register_user_email_form, url: sign_up_register_path) do |f| %>
  <%= render ValidatedFieldComponent.new(
        form: f,
        name: :email,
        as: :email,
        label: t('forms.registration.labels.email'),
        required: true,
        input_html: { autocorrect: 'off' },
      ) %>

  <%= render partial: 'shared/email_languages',
             locals: { f: f, selection: @register_user_email_form.email_language } %>

  <%= render ValidatedFieldComponent.new(
        form: f,
        name: :terms_accepted,
        as: :boolean,
        label: capture do %>
          <%= t('sign_up.terms', app_name: APP_NAME) %>
          <%= new_tab_link_to(t('titles.rules_of_use'), MarketingSite.rules_of_use_url) %>
        <% end,
        label_html: { class: 'margin-y-0' },
        required: true,
      ) %>

  <%= f.submit t('forms.buttons.submit.default'), class: 'display-block margin-y-5' %>
<% end %>

<%= render 'shared/cancel', link: decorated_sp_session.cancel_link_url %>

<p class='margin-top-2'>
  <%= new_tab_link_to(
        t('notices.privacy.security_and_privacy_practices'),
        policy_redirect_url(
          policy: :security_and_privacy_practices,
          flow: :create_account,
          step: :enter_email,
        ),
      ) %>
</p>

<p>
  <%= new_tab_link_to(
        t('notices.privacy.privacy_act_statement'),
        policy_redirect_url(
          policy: :privacy_act_statement,
          flow: :create_account,
          step: :enter_email,
        ),
      ) %>
</p>