18F/identity-dashboard

View on GitHub
app/views/service_providers/_form_custom_help_text.html.erb

Summary

Maintainability
Test Coverage
<%= form.fields_for :help_text do |h| %>
  <%= h.fields_for :sign_in do |s| %>
    <br><legend><span class="text-heavy">Sign-in help text:</span></legend>
    <%= s.input :en, label: "English", as: :text, required: false, input_html: { value: localized_help_text.dig("sign_in", "en"), readonly: readonly_help_text? } %>
    <%= s.input :es, label: "Español", as: :text, required: false, input_html: { value: localized_help_text.dig("sign_in", "es"), readonly: readonly_help_text?  } %>
    <%= s.input :fr, label: "Français", as: :text, required: false, input_html: { value: localized_help_text.dig("sign_in", "fr"), readonly: readonly_help_text? } %>
  <% end %>

  <%= h.fields_for :sign_up do |s| %>
    <br><legend><b>Sign-up help text:</b></legend>
    <%= s.input :en, label: "English", as: :text, required: false, input_html: { value: localized_help_text.dig("sign_up", "en"),readonly: readonly_help_text? } %>
    <%= s.input :es, label: "Español", as: :text, required: false, input_html: { value: localized_help_text.dig("sign_up", "es"), readonly: readonly_help_text? } %>
    <%= s.input :fr, label: "Français", as: :text, required: false, input_html: { value: localized_help_text.dig("sign_up", "fr"), readonly: readonly_help_text? } %>
  <% end %>

  <%= h.fields_for :forgot_password do |f| %>
    <br><legend><b>Forgot password help text:</b></legend>
    <%= f.input  :en, label: "English", as: :text, required: false, input_html: { value: localized_help_text.dig("forgot_password", "en"), readonly: readonly_help_text? } %>
    <%= f.input :es, label: "Español", as: :text, required: false, input_html: { value: localized_help_text.dig("forgot_password", "es"), readonly: readonly_help_text? } %>
    <%= f.input :fr, label: "Français", as: :text, required: false, input_html: { value: localized_help_text.dig("forgot_password", "fr"), readonly: readonly_help_text? } %>
  <% end %>
<% end %>