Added meta where and jquery observe field. Fixed members view.
This commit is contained in:
parent
6c98c7c755
commit
c87ead8da9
10 changed files with 102 additions and 51 deletions
|
|
@ -5,7 +5,7 @@
|
|||
%td
|
||||
= pagination_links_remote @users, :update => :users
|
||||
%td{:style => "text-align:right"}
|
||||
- if @total > 20
|
||||
- if @users.size > 20
|
||||
= items_per_page :update => :users
|
||||
%table.list
|
||||
%thead
|
||||
|
|
@ -17,7 +17,8 @@
|
|||
%th Bestellgruppe
|
||||
%th Arbeitsgruppe(n)
|
||||
%tbody
|
||||
- for user in @users
|
||||
- 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, user_message_path(user), :title => _('Send user an email')
|
||||
%td=h user.name if @current_user.role_admin? || user.settings["profile.nameIsPublic"] == '1'
|
||||
|
|
|
|||
|
|
@ -1,3 +1,14 @@
|
|||
- content_for :head do
|
||||
:javascript
|
||||
$(function() {
|
||||
$('#query').observe_field(1, function() {
|
||||
$('#user_search').submit();
|
||||
});
|
||||
$('#sort_by_ordergroups').click(function() {
|
||||
$('#user_search').submit();
|
||||
});
|
||||
});
|
||||
|
||||
%h1 Mitglieder der Foodcoop
|
||||
%p
|
||||
%i
|
||||
|
|
@ -13,20 +24,11 @@
|
|||
.column_content
|
||||
- unless params[:sort_by_ordergroups]
|
||||
#user_filter{:style => "float:left; margin-right:2em;"}
|
||||
%form{:name=>"sform", :action=>"", :style=>"display:inline;"}
|
||||
= form_tag foodcoop_users_path, :method => :get, :style=>"display:inline;", :id => 'user_search', :remote => true do
|
||||
%label{:for => 'article_name'} Suche nach Name:
|
||||
= text_field_tag("query", params['query'], :size => 10 )
|
||||
|
||||
= observe_field 'query', :frequency => 2, |
|
||||
:before => "Element.show('loader')", |
|
||||
:success => "Element.hide('loader')", |
|
||||
:url => foodcoop_users_path, |
|
||||
:update => :users, |
|
||||
:with => 'query', |
|
||||
:method => :get |
|
||||
|
||||
=_ "Nach Bestellgruppen sortieren:"
|
||||
- form_tag(foodcoop_users_path, :method => "get", :style=>"display:inline;") do
|
||||
= check_box_tag :sort_by_ordergroups, 1, params[:sort_by_ordergroups], :onclick => "submit();"
|
||||
= text_field_tag(:query, params[:query], :size => 10 )
|
||||
|
||||
Nach Bestellgruppen sortieren:
|
||||
= check_box_tag :sort_by_ordergroups, 1, params[:sort_by_ordergroups]
|
||||
#users
|
||||
= render :partial => "users"
|
||||
1
app/views/foodcoop/users/index.js.erb
Normal file
1
app/views/foodcoop/users/index.js.erb
Normal file
|
|
@ -0,0 +1 @@
|
|||
$('#users').html('<%= escape_javascript(render("users")) %>');
|
||||
Loading…
Add table
Add a link
Reference in a new issue