YaleSTC/shifts

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

Summary

Maintainability
Test Coverage
<%= form_for @user_config do |f| %>
  <%= f.error_messages %>
  <% unless @dept_select.length == 1 %>
    <fieldset class = "index">
      <legend>Default Department Preferences</legend>
      <small>Control which department your account will be logged into when you sign in to the
      application.  You can then change it through the department chooser.  If you
      leave this blank, then it will default to your first department.</small><br /><br />
      <%= f.select :default_dept, @dept_select %>
    </fieldset>
  <% end %>
  <p>
  <fieldset class = "checkboxes" id = "location_groups_prefs">
  <legend>Location Groups</legend>

    <small>Control which location groups to view on your shift
    schedule and on the notices index page.</small><br /><br />
    <%= render partial: 'loc_groups' %>

  </fieldset>

  <fieldset class = "index">
    <legend>Schedule View</legend>
    <small>Control which portion of the shift schedule you would like to see.</small><br /><br />
    <%= f.select :view_week, UserConfig::VIEW_WEEK_OPTIONS %>
  </fieldset>
  <fieldset class = "checkboxes" id = "data_objects_prefs">
    <legend>Data</legend>
    <small>Control which data objects will show updates on your
    dashboard.</small><br /><br />
    <%= render partial: 'dt_objects' %>

  </fieldset>
  <fieldset class = "index">
    <legend>Email Notifications</legend>
    <small>Control your notification preferences.</small><br /><br />
     <%= f.check_box :taken_sub_email %>
     <%= f.label :taken_sub_email, text = "Enable email notifications for all taken sub requests" %><br />
     <%= f.check_box :send_due_payform_email %>
     <%= f.label :send_due_payform_email, text = "Enable email notifications for due payforms" %><br />
    <% if current_user.is_admin_of?(@department) %>
        <%= f.submit "Reset" %> <span id="reset_txt">Reset preference to send email reminders for all users in the current department</span>
    <% end %>
    </fieldset>
  <p>
    <%= f.submit "Submit" %>
  </p>
<% end %>