mirror of
https://github.com/TracksApp/tracks.git
synced 2025-09-21 21:40:48 +02:00
Allow changing the ordering of the user list
This commit is contained in:
parent
08791e0457
commit
c4d7169cb8
4 changed files with 19 additions and 13 deletions
|
@ -7,16 +7,20 @@ class UsersController < ApplicationController
|
|||
# GET /users GET /users.xml
|
||||
def index
|
||||
respond_to do |format|
|
||||
order_by = 'login'
|
||||
if params[:order] && User.column_names.include?(params[:order])
|
||||
order_by = params[:order]
|
||||
end
|
||||
format.html do
|
||||
@page_title = "TRACKS::Manage Users"
|
||||
@users = User.order('login ASC').paginate :page => params[:page]
|
||||
@page_title = t('users.manage_users_title')
|
||||
@users = User.order(order_by + ' ASC').paginate :page => params[:page]
|
||||
@total_users = User.count
|
||||
# When we call users/signup from the admin page we store the URL so that
|
||||
# we get returned here when signup is successful
|
||||
store_location
|
||||
end
|
||||
format.xml do
|
||||
@users = User.order('login')
|
||||
@users = User.order(order_by)
|
||||
render :xml => @users.to_xml(:root => :users, :except => [:password])
|
||||
end
|
||||
end
|
||||
|
|
|
@ -4,24 +4,24 @@
|
|||
|
||||
<table class="users_table">
|
||||
<tr>
|
||||
<th><%= User.human_attribute_name('login') %></th>
|
||||
<th><%= User.human_attribute_name('display_name') %></th>
|
||||
<th><%= User.human_attribute_name('email') %></th>
|
||||
<th><%= User.human_attribute_name('auth_type') %></th>
|
||||
<th><%= User.human_attribute_name('open_id_url') %></th>
|
||||
<th><%= link_to User.human_attribute_name('login'), url_for(:order => 'login') %></th>
|
||||
<th><%= h User.human_attribute_name('display_name') %></th>
|
||||
<th><%= link_to User.human_attribute_name('email'), url_for(:order => 'email') %></th>
|
||||
<th><%= link_to User.human_attribute_name('auth_type'), url_for(:order => 'auth_type') %></th>
|
||||
<th><%= link_to User.human_attribute_name('open_id_url'), url_for(:order => 'open_id_url') %></th>
|
||||
<th><%= t('users.total_actions') %></th>
|
||||
<th><%= t('users.total_contexts') %></th>
|
||||
<th><%= t('users.total_projects') %></th>
|
||||
<th><%= t('users.total_notes') %></th>
|
||||
<th><%= User.human_attribute_name('created_at') %></th>
|
||||
<th><%= User.human_attribute_name('last_login_at') %></th>
|
||||
<th><%= link_to User.human_attribute_name('created_at'), url_for(:order => 'created_at') %></th>
|
||||
<th><%= link_to User.human_attribute_name('last_login_at'), url_for(:order => 'last_login_at') %></th>
|
||||
<th> </th>
|
||||
</tr>
|
||||
<% for user in @users %>
|
||||
<tr <%= "class=\"highlight\"" if user.is_admin? %> id="user-<%= user.id %>">
|
||||
<td><%=h user.login %></td>
|
||||
<td><%=h user.display_name %></td>
|
||||
<td><%=h user.email %></td>
|
||||
<td><%= h user.login %></td>
|
||||
<td><%= h user.display_name %></td>
|
||||
<td><%= h user.email %></td>
|
||||
<td><%= h user.auth_type %></td>
|
||||
<td><%= h user.open_id_url || '-' %></td>
|
||||
<td><%= h user.todos.size %></td>
|
||||
|
|
|
@ -1091,6 +1091,7 @@ en:
|
|||
identity_url: Identity URL
|
||||
label_auth_type: Authentication type
|
||||
manage_users: Manage users
|
||||
manage_users_title: TRACKS::Manage Users
|
||||
new_password_label: New password
|
||||
new_token_generated: New token successfully generated
|
||||
new_user_heading: 'Sign up a new user:'
|
||||
|
|
|
@ -1091,6 +1091,7 @@ fi:
|
|||
identity_url: Identity URL
|
||||
label_auth_type: Authentication type
|
||||
manage_users: Manage users
|
||||
manage_users_title: TRACKS::Hallitse käyttäjiä
|
||||
new_password_label: New password
|
||||
new_token_generated: New token successfully generated
|
||||
new_user_heading: 'Sign up a new user:'
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue