diff options
| author | mo khan <mo@mokhan.ca> | 2014-10-19 18:24:15 -0600 |
|---|---|---|
| committer | mo khan <mo@mokhan.ca> | 2014-10-19 18:24:15 -0600 |
| commit | d8e204f69c8317f04dcfc5f43c6f992d4fbfa9a3 (patch) | |
| tree | 6b1681ea837ce52a0841f4b3e7cd3071e4a436d2 /app/views/admin | |
| parent | c35586ca5319e8b1333d577cd5ced786d0c0c0a8 (diff) | |
allow for sorting and searching the admin users listing.
Diffstat (limited to 'app/views/admin')
| -rw-r--r-- | app/views/admin/users/_index.html.erb | 26 |
1 files changed, 21 insertions, 5 deletions
diff --git a/app/views/admin/users/_index.html.erb b/app/views/admin/users/_index.html.erb index d2f4e2a3..3f9539f9 100644 --- a/app/views/admin/users/_index.html.erb +++ b/app/views/admin/users/_index.html.erb @@ -1,19 +1,35 @@ <table class="table table-striped table-condensed"> <thead> <tr> - <td>cakes</td> + <td></td> <td>name</td> <td>email</td> - <td>created at</td> + <td>urls</td> + <td> + created at + <%= link_to url_for(params.merge(sort: "newest")), remote: true do %> + <i class="fa fa-sort-up"></i> + <% end %> + <%= link_to url_for(params.merge(sort: "oldest")), remote: true do %> + <i class="fa fa-sort-down"></i> + <% end %> + </td> </tr> </thead> <tbody> <%- @users.each do |user| %> <tr> - <td><%= user.creations_count %></td> - <td><%= link_to user.name, admin_user_path(user) %></td> + <td>edit</td> + <td><%= link_to "#{user.name} (#{user.creations_count})", admin_user_path(user) %></td> <td><%= mail_to user.email %></td> - <td><%= time_ago_in_words(user.created_at) %></td> + <td> + <ul> + <%= "<li>#{user.website}</li>".html_safe unless user.website.blank? %> + <%= "<li>#{user.twitter}</li>".html_safe unless user.twitter.blank? %> + <%= "<li>#{user.facebook}</li>".html_safe unless user.facebook.blank? %> + </ul> + </td> + <td><%= user.created_at.strftime("%Y-%m-%d") %></td> </tr> <% end %> </tbody> |
