YaleSTC/shifts

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

Summary

Maintainability
Test Coverage
<% title "User Profiles" %>

<p><%= link_to "Edit Your Profile", edit_user_profile_path(current_user.login), class: 'btn btn-default' %></p>


<!-- tablesorting and search conflict -->
<!-- <div id="searchbox" style="margin-bottom: 1em"> -->
  <%# form_tag(user_profiles_path, method: :get) do %>
<!--    Search for a user by name or login:--> <%#= text_field_tag :search %>
    <%#= submit_tag "Submit", id: "search_submit" %>
  <%# end %>
<!-- </div> -->

<table id="user_profiles_table" class="tablesorter">
  <thead>
        <tr>
        <th align="left">Users</th>
            <% unless mobile_device? %>
            <% @user_profile_fields.each do |upf| %>
                <th align="left"><%= upf.name %></th>
            <% end %>
            <% end %>
        </tr>
  </thead>
    <tbody id="profile_list">
      <%= render partial: "profile_list" %>
    </tbody>
</table>

<script type="text/javascript">
  $('input#search_submit').toggle();
</script>
<%#= observe_field :search, frequency: 0.2, url: search_user_profiles_path, with: :search %>