more user display changes
This commit is contained in:
parent
6d3db7636a
commit
f6c2fd9a9d
5 changed files with 8 additions and 7 deletions
|
@ -161,7 +161,7 @@ module ApplicationHelper
|
|||
end
|
||||
|
||||
# show a user, depending on settings
|
||||
def show_user(user=@current_user, options = {})#full: false, markup: false, unique: false)
|
||||
def show_user(user=@current_user, options = {})
|
||||
if user.nil?
|
||||
"?"
|
||||
elsif FoodsoftConfig[:use_nick]
|
||||
|
|
|
@ -2,7 +2,7 @@ module TasksHelper
|
|||
|
||||
def task_assignments(task)
|
||||
task.assignments.map do |ass|
|
||||
content_tag :span, ass.user.nick, :class => (ass.accepted? ? 'accepted' : 'unaccepted')
|
||||
content_tag :span, show_user(ass.user), :class => (ass.accepted? ? 'accepted' : 'unaccepted')
|
||||
end.join(", ").html_safe
|
||||
end
|
||||
|
||||
|
|
|
@ -17,7 +17,7 @@ class Group < ActiveRecord::Base
|
|||
|
||||
# Returns all NONmembers and a checks for possible multiple Ordergroup-Memberships
|
||||
def non_members
|
||||
User.all(:order => 'nick').reject { |u| users.include?(u) }
|
||||
User.natural_order.all.reject { |u| users.include?(u) }
|
||||
end
|
||||
|
||||
def user_tokens=(ids)
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<ul class="autocomplete">
|
||||
<% for user in @users do -%>
|
||||
<li><span class="nick"><%=h user.nick %></span><span class="informal"> (<%= user.ordergroup.name.to_s if user.ordergroup %>)</span></li>
|
||||
<li><span class="nick"><%= show_user(user) %></span><span class="informal"> (<%= user.ordergroup.try(:name) %>)</span></li>
|
||||
<% end -%>
|
||||
</ul>
|
||||
</ul>
|
||||
|
|
|
@ -8,7 +8,8 @@
|
|||
%div{id: "collapse#{workgroup.id}", class: 'accordion-body collapse'}
|
||||
.accordion-inner
|
||||
%ul.unstyled
|
||||
- workgroup.users.includes(:groups).order('nick').each do |user|
|
||||
- workgroup.users.includes(:groups).natural_order.each do |user|
|
||||
%li
|
||||
= user.nick
|
||||
= show_user(user)
|
||||
%small (#{user.ordergroup.try(:name)})
|
||||
|
||||
|
|
Loading…
Reference in a new issue