Removed contact data from ordergroups-page. Added names of users and date of last order.
This commit is contained in:
parent
ecc0340a70
commit
e8fa912e8c
3 changed files with 14 additions and 12 deletions
|
@ -61,7 +61,7 @@ class FoodcoopController < ApplicationController
|
||||||
end
|
end
|
||||||
|
|
||||||
@total = Ordergroup.count(:conditions => conditions, :include => "orders")
|
@total = Ordergroup.count(:conditions => conditions, :include => "orders")
|
||||||
@order_groups = Ordergroup.paginate(:page => params[:page], :per_page => @per_page, :conditions => conditions, :order => "name", :include => "orders")
|
@ordergroups = Ordergroup.paginate(:page => params[:page], :per_page => @per_page, :conditions => conditions, :order => "name", :include => "orders")
|
||||||
|
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.html # index.html.erb
|
format.html # index.html.erb
|
||||||
|
|
|
@ -2,22 +2,24 @@
|
||||||
%table{:style => "width:100%"}
|
%table{:style => "width:100%"}
|
||||||
%tr
|
%tr
|
||||||
%td
|
%td
|
||||||
= pagination_links_remote @order_groups, :update => :order_groups
|
= pagination_links_remote @ordergroups, :update => :ordergroups
|
||||||
%td{:style => "text-align:right"}
|
%td{:style => "text-align:right"}
|
||||||
- if @total > 20
|
- if @total > 20
|
||||||
= items_per_page :update => :order_groups
|
= items_per_page :update => :ordergroups
|
||||||
|
|
||||||
%table.list
|
%table.list
|
||||||
%thead
|
%thead
|
||||||
%tr
|
%tr
|
||||||
%th Name
|
%th Name
|
||||||
%th= "#Mitglieder"
|
%th Mitglieder
|
||||||
%th Kontakt
|
%th zuletzt bestellt
|
||||||
|
|
||||||
%tbody
|
%tbody
|
||||||
- for order_group in @order_groups
|
- for ordergroup in @ordergroups
|
||||||
%tr{:class => cycle('even','odd', :name => 'order_group')}
|
%tr{:class => cycle('even','odd', :name => 'ordergroup')}
|
||||||
%td= link_to h(order_group.name), {:controller => 'messages', :action => 'group', :id => order_group}, :title => "Bestellgruppe eine Nachricht schicken"
|
%td= link_to h(ordergroup.name), {:controller => 'messages', :action => 'group', :id => ordergroup}, :title => "Bestellgruppe eine Nachricht schicken"
|
||||||
%th=h order_group.users.length
|
%td=h ordergroup.users.collect { |u| u.nick }.join(", ")
|
||||||
%td=h order_group.contact
|
%td
|
||||||
|
- order = ordergroup.orders.first(:order => 'starts DESC')
|
||||||
|
= order ? format_date(order.starts) : "-"
|
||||||
|
|
||||||
|
|
|
@ -16,8 +16,8 @@
|
||||||
:before => "Element.show('loader')", |
|
:before => "Element.show('loader')", |
|
||||||
:success => "Element.hide('loader')", |
|
:success => "Element.hide('loader')", |
|
||||||
:url => {:action => 'ordergroups'}, |
|
:url => {:action => 'ordergroups'}, |
|
||||||
:update => :order_groups, |
|
:update => :ordergroups, |
|
||||||
:method => :get |
|
:method => :get |
|
||||||
|
|
||||||
#order_groups
|
#ordergroups
|
||||||
= render :partial => "ordergroups"
|
= render :partial => "ordergroups"
|
Loading…
Reference in a new issue