foodsoft/app/views/foodcoop/users/_users.html.haml

30 lines
1.1 KiB
Text
Raw Normal View History

2009-01-06 11:49:19 +01:00
- unless params[:sort_by_ordergroups]
%p
%table{:style => "width:100%"}
%tr
%td
= pagination_links_remote @users, :update => :users
2009-01-06 11:49:19 +01:00
%td{:style => "text-align:right"}
- if @users.size > 20
= items_per_page :update => :users
2009-01-06 11:49:19 +01:00
%table.list
%thead
%tr
%th Benutzername
%th Name
2009-01-06 11:49:19 +01:00
%th Email
%th Telefon
%th Bestellgruppe
%th Arbeitsgruppe(n)
%tbody
- users = params[:sort_by_ordergroups] ? @users.sort { |a,b| a.ordergroup.name <=> b.ordergroup.name } : @users
- for user in users
2009-01-06 11:49:19 +01:00
%tr{:class => cycle('even','odd', :name => 'users')}
%td= link_to user.nick, new_message_path(:message => {:mail_to => user.id}), :title => _('Send user an email')
%td=h user.name if @current_user.role_admin? || user.settings["profile.nameIsPublic"] == '1'
2009-01-06 11:49:19 +01:00
%td=h user.email if @current_user.role_admin? || user.settings["profile.emailIsPublic"] == '1'
%td=h user.phone if @current_user.role_admin? || user.settings["profile.phoneIsPublic"] == '1'
%td=h user.ordergroup_name
%td=h user.workgroups.collect(&:name).join(', ')
2009-01-06 11:49:19 +01:00