Move foodcoop/ordergroups into nwe namespace foodcoop. Made it more restful.

This commit is contained in:
Benjamin Meichsner 2009-08-02 18:12:13 +02:00
parent 709425855e
commit 1a8026c5a7
8 changed files with 175 additions and 29 deletions

View file

@ -0,0 +1,25 @@
%p
%table{:style => "width:100%"}
%tr
%td
= pagination_links_remote @ordergroups, :update => :ordergroups
%td{:style => "text-align:right"}
- if @total > 20
= items_per_page :update => :ordergroups
%table.list
%thead
%tr
%th Name
%th Mitglieder
%th zuletzt bestellt
%tbody
- for ordergroup in @ordergroups
%tr{:class => cycle('even','odd', :name => 'ordergroup')}
%td= link_to h(ordergroup.name), {:controller => 'messages', :action => 'group', :id => ordergroup}, :title => "Bestellgruppe eine Nachricht schicken"
%td=h ordergroup.users.collect { |u| u.nick }.join(", ")
%td
- order = ordergroup.orders.first(:order => 'starts DESC')
= order ? format_date(order.starts) : "-"

View file

@ -0,0 +1,23 @@
%h1 Bestellgruppen der Foodcoop
.left_column{:style => "width:100%"}
.box_title
%h2 Übersicht
.column_content
#user_filter{:style => "margin-right:2em;"}
%form{:id=>"sform", :action=>"", :style=>"display:inline;"}
%label{:for => 'article_name'} Suche nach Name:
= text_field_tag("query", params['query'], :size => 10 )
%label{:for => 'only_active'} Nur aktive:
= check_box_tag('only_active')
%small (mindestens einmal in den letzten 3 Monaten bestellt)
= observe_form 'sform', :frequency => 2, |
:before => "Element.show('loader')", |
:success => "Element.hide('loader')", |
:url => {:action => 'ordergroups'}, |
:update => :ordergroups, |
:method => :get |
#ordergroups
= render :partial => "ordergroups"