Adds links to locked users when current user is admin.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@10673 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang committed 2012-10-18 17:08:42 +00:00
1 parent 50037b18c4
commit 7729178d9d
6 files changed
+38 -9

No files matched your search

+2 -2
View File
@@ -47,8 +47,8 @@ module ApplicationHelper
def link_to_user(user, options={})
if user.is_a?(User)
name = h(user.name(options[:format]))
if user.active?
link_to name, :controller => 'users', :action => 'show', :id => user
if user.active? || (User.current.admin? && user.logged?)
link_to name, {:controller => 'users', :action => 'show', :id => user}, :class => user.css_classes
else
name
end
+11
View File
@@ -387,6 +387,17 @@ class User < Principal
name
end
CSS_CLASS_BY_STATUS = {
STATUS_ANONYMOUS => 'anon',
STATUS_ACTIVE => 'active',
STATUS_REGISTERED => 'registered',
STATUS_LOCKED => 'locked'
}
def css_classes
"user #{CSS_CLASS_BY_STATUS[status]}"
end
# Returns the current day according to user's time zone
def today
if time_zone.nil?
+1 -1
View File
@@ -36,7 +36,7 @@
</tr></thead>
<tbody>
<% for user in @users -%>
<tr class="user <%= cycle("odd", "even") %> <%= %w(anon active registered locked)[user.status] %>">
<tr class="<%= user.css_classes %> <%= cycle("odd", "even") %>">
<td class="username"><%= avatar(user, :size => "14") %><%= link_to h(user.login), edit_user_path(user) %></td>
<td class="firstname"><%= h(user.firstname) %></td>
<td class="lastname"><%= h(user.lastname) %></td>