Replace will_paginate with kaminari. Fixed foodcoop/users page.
This commit is contained in:
parent
1708df3f6c
commit
ab81ef09d5
17 changed files with 162 additions and 64 deletions
|
|
@ -1,13 +1,8 @@
|
|||
- unless params[:sort_by_ordergroups]
|
||||
%p
|
||||
%table{:style => "width:100%"}
|
||||
%tr
|
||||
%td
|
||||
= pagination_links_remote @users, :update => :users
|
||||
%td{:style => "text-align:right"}
|
||||
- if @users.size > 20
|
||||
= items_per_page :update => :users
|
||||
%table.list
|
||||
- if User.count > 20
|
||||
= items_per_page
|
||||
= pagination_links_remote @users
|
||||
%table.table.table-striped
|
||||
%thead
|
||||
%tr
|
||||
%th Benutzername
|
||||
|
|
@ -17,13 +12,13 @@
|
|||
%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
|
||||
%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'
|
||||
%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(', ')
|
||||
- for user in @users
|
||||
%tr
|
||||
%td= user.nick
|
||||
%td= user.name if @current_user.role_admin? || user.settings["profile.nameIsPublic"] == '1'
|
||||
%td= user.email if @current_user.role_admin? || user.settings["profile.emailIsPublic"] == '1'
|
||||
%td= user.phone if @current_user.role_admin? || user.settings["profile.phoneIsPublic"] == '1'
|
||||
%td= user.ordergroup_name
|
||||
%td= user.workgroups.collect(&:name).join(', ')
|
||||
%td= link_to_new_message(message_params: {mail_to: user.id})
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue