YaleSTC/shifts

View on GitHub
app/views/first_run/new_app_config.html.erb

Summary

Maintainability
Test Coverage
<%= render partial: 'progress_bar', locals: {current_step: 1} %>
<% title "Configure Application Settings" %>
<%= form_for @app_config, url: create_first_app_config_path do |f| %>
  <%= f.error_messages %>
  <p>
    <%= f.label :auth_types, text = "Authentication Method", class: "form_label_large" %>
  </p>
  <small>If your university uses CAS for authentication, select CAS; otherwise, select Built-in Authentication</small><br/>
  <p>
    <%= f.select :auth_types, AppConfig::LOGIN_OPTIONS %>
  <p>

  <p>
    <%= f.label :use_ldap, text = "LDAP", class: "form_label_large" %> <br />
  </p>
  <small>If you have an LDAP server, you can use it to auto-complete information as you add users.</small><br/>
  <p>
    <%= f.check_box :use_ldap, {id: "ldap_check_box"} %> Enable
  </p>

<div class="ldap_fields" <%unless @app_config.use_ldap%>id="hide"<%end%>>
  <p>
    <%= f.label :ldap_host_address, text = "LDAP Server Hostname:" %> <br />
    <%= f.text_field :ldap_host_address %>
  </p>
  <p>
    <%= f.label :ldap_port, text = "Port:" %> <br />
    <%= f.text_field :ldap_port %>
  </p>
    <p>
    <%= f.label :ldap_base, text = "Search Base (e.g. 'ou=people'):" %> <br />
    <%= f.text_field :ldap_base %>
  </p>
  <p>
    <%= f.label :ldap_login, text = "LDAP Field for login information:" %> <br />
    <%= f.text_field :ldap_login %>
  </p>
    <p>
    <%= f.label :ldap_first_name, text = "LDAP Field for first name:" %> <br />
    <%= f.text_field :ldap_first_name %>
  </p>
  <p>
    <%= f.label :ldap_last_name, text = "LDAP Field for last name:" %> <br />
    <%= f.text_field :ldap_last_name %>
  </p>
  <p>
    <%= f.label :ldap_email, text = "LDAP Field for email address:" %> <br />
    <%= f.text_field :ldap_email %>
  </p>
  </div>

  <p>
    <%= f.label :mailer_address, text = 'App email address' %><br />
    <small>This is used for the "From" field on any generated email that is not department-specific.</small><br />
    <%= f.text_field :mailer_address %>
  </p>

  <p>
    <%= f.label :admin_email, text = 'Admin email address' %> <br />
    <small>This is the administrator email that any non-department-specific correspondences are sent to. </small><br />
    <%= f.text_field :admin_email %>
  </p>

  <p>
    <%= f.label :footer, text = "Footer Text", class: "form_label_large" %><br />
    <small>Any text or HTML you place here will be placed in the footer of each page. Be careful to close your tags,
    or you may produce broken pages.</small><br/>
    <%= f.text_area :footer, {class: "settings", size: "80x10"} %>
  </p>

  <p><%= f.submit "Submit" %></p>

<% end %>