YaleSTC/shifts

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

Summary

Maintainability
Test Coverage
<% title "Create the first user" %>
<%= form_for @user, url: create_first_user_path, :html=>{:id=>"first_user_form"} do |f| %>
  <%= f.error_messages %>
  <p>
    <%= f.label :login %><br />
    <%= f.text_field :login %>
  </p>
  <p>
    <%= f.label :first_name %><br />
    <%= f.text_field :first_name %>
  </p>
  <p>
    <%= f.label :nick_name %><br />
    <%= f.text_field :nick_name %>
  </p>
  <p>
    <%= f.label :last_name %><br />
    <%= f.text_field :last_name %>
  </p>
  <p>
    <%= f.label :email %><br />
    <%= f.text_field :email %>
  </p>
  <p>
    <%= f.label :employee_id, text = "Employee ID" %><br />
    <%= f.text_field :employee_id %>
  </p>
 <% if @appconfig.login_options.size >1 %>
  <p>
    <%= f.label :login_type %><br />
    <%= f.select(:auth_type, @appconfig.login_options, {selected: @user.auth_type || "CAS"}) %>
  </p>
  <% end %>
  <%# if @appconfig.login_options.include?('built-in') %>
<h4> If you plan on using built-in authentication for this user, please provide a password. If you're just using CAS, feel free to leave in blank. </h4>
  <p>
    <%= f.label :password %><br />
    <%= f.password_field :password %>
  </p>
  <p>
    <%= f.label :password_confirmation %><br />
    <%= f.password_field :password_confirmation %>
  </p>
  <%# end %>
  <h4>After clicking "Submit", you will be redirected to a login page, after which you may use the app normally.</h4>
  <p><%= f.submit "Submit" %></p>
<% end %>
<% if @appconfig.use_ldap %>
<%#= observe_form :first_user_form, url: { action: 'ldap_search' }, frequency: 1, :loading=> "$('#loading_icon').css({'display' : 'inline'})"%>
<% end %>