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})
|
||||
|
||||
|
|
|
|||
|
|
@ -1,24 +1,23 @@
|
|||
%h1 Mitglieder der Foodcoop
|
||||
%p
|
||||
%i
|
||||
- title "Mitglieder"
|
||||
|
||||
%section
|
||||
%p
|
||||
Hier kannst Du den Mitgliedern Deiner Foodcoop eine Nachricht schreiben.
|
||||
%br/
|
||||
Damit Deine Kontaktdaten einzusehen sind, musst Du sie unter
|
||||
= link_to "Einstellungen", my_profile_path
|
||||
freigeben.
|
||||
|
||||
.left_column{:style => "width:100%"}
|
||||
.box_title
|
||||
%h2 Übersicht
|
||||
.column_content
|
||||
- unless params[:sort_by_ordergroups]
|
||||
#user_filter{:style => "float:left; margin-right:2em;"}
|
||||
= form_tag foodcoop_users_path, :method => :get, :style=>"display:inline;", :id => 'user_search',
|
||||
:remote => true, 'data-submit-onchange' => true do
|
||||
%label{:for => 'article_name'} Suche nach Name:
|
||||
= text_field_tag :query, params[:query], :size => 10
|
||||
.well
|
||||
= form_tag foodcoop_users_path, :method => :get, :remote => true,
|
||||
'data-submit-onchange' => true, class: 'form-search' do
|
||||
|
||||
Nach Bestellgruppen sortieren:
|
||||
= check_box_tag :sort_by_ordergroups, 1, params[:sort_by_ordergroups]
|
||||
#users
|
||||
= render :partial => "users"
|
||||
= text_field_tag :user_name, params[:user_name], class: 'input-medium search-query',
|
||||
placeholder: 'Name ...'
|
||||
= text_field_tag :ordergroup_name, params[:ordergroup_name], class: 'input-medium search-query',
|
||||
placeholder: 'Bestelllgruppe ...'
|
||||
%button.btn
|
||||
%i.icon-search
|
||||
|
||||
#users
|
||||
= render :partial => "users"
|
||||
|
|
@ -1 +1 @@
|
|||
$('#users').html('<%= escape_javascript(render("users")) %>');
|
||||
$('#users').html('<%= escape_javascript(render("users")) %>');
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue