YaleSTC/shifts

View on GitHub
app/views/user_profile_fields/index.html.erb

Summary

Maintainability
Test Coverage
<% title "User Profile Fields" %>

<p><%= link_to "New User Profile Field", new_user_profile_field_path, class: 'btn btn-default' %></p>

<table class="tablesorter">
 <thead>
  <tr>
    <th>Name</th>
    <th>Display Type</th>
    <th>Values</th>
    <th>Displayed in Index
    <th>Public</th>
    <th>User Editable</th>
  </tr>
 </thead>
 <tbody>
  <% for user_profile_field in @user_profile_fields %>
    <tr>
      <td><%= link_to user_profile_field.name, user_profile_field %></td>
      <td><%= UserProfileField::DISPLAY_TYPE_VIEW[user_profile_field.display_type] %></td>
      <td><%= user_profile_field.values %></td>
      <td><%= user_profile_field.index_display %></td>
      <td><%= user_profile_field.public %></td>
      <td><%= user_profile_field.user_editable %></td>
      <td><%= link_to "Edit", edit_user_profile_field_path(user_profile_field) %></td>
      <td><%= link_to "Destroy", user_profile_field, confirm: 'Are you sure?', method: :delete %></td>
    </tr>
  <% end %>
 </tbody>
</table>