18F/identity-dashboard

View on GitHub
app/views/service_config_wizard/authentication.html.erb

Summary

Maintainability
Test Coverage
<h1 class="usa-display"><%= t('service_provider_form.wizard_steps.authentication') %></h1>
<p class="usa-intro"><%= t('simple_form.lead.authentication_html') %></p>
<div class="wizard-main">
<%= wizard_form do |form| %>
  <%= render partial: 'fieldset', locals: {
      form: form,
      fieldname: 'identity_protocol',
      description: true,
      html_desc: false,
      db_fieldname: :identity_protocol,
      input_type: 'radio',
      required: true,
      inputs: ServiceProvider.identity_protocols.map { |k,v|
        [titleize(k), k] }.to_h,
    } %>

  <%= render partial: 'fieldset', locals: {
      form: form,
      fieldname: 'ial',
      description: true,
      html_desc: true,
      db_fieldname: :ial,
      input_type: 'radio',
      required: true,
      inputs: {
        t('service_provider_form.ial_option_1') => 1,
        t('service_provider_form.ial_option_2') => 2,
      }
    } %>

  <%= render partial: 'fieldset', locals: {
      form: form,
      fieldname: 'ial',
      description: false,
      html_desc: false,
      db_fieldname: :default_aal,
      input_type: 'radio',
      required: true,
      inputs: {
        t('service_provider_form.aal_option_default') => nil,
        t('service_provider_form.aal_option_2') => 2,
        t('service_provider_form.aal_option_3') => 3,
      }
    } %>

  <%= render partial: 'fieldset', locals: {
      form: form,
      fieldname: 'attribute_bundle',
      description: true,
      html_desc: false,
      db_fieldname: :attribute_bundle,
      input_type: 'checkbox',
      required: false,
      inputs: ServiceProvider.possible_attributes
    } %>
  <%= render partial:'footer', locals: { form: form } %>
<% end %>
</div>
<%= javascript_include_tag 'wizard_step_authentication_form' %>