foodsoft/app/views/orders/index.haml

42 lines
1.6 KiB
Text
Raw Normal View History

- title "Bestellungen verwalten"
2009-01-06 11:49:19 +01:00
- if @current_user.role_orders?
%p
- form_tag do
Neue Bestellung anlegen für
2009-01-06 11:49:19 +01:00
%select{:onchange => "redirectTo(this)", :style => "font-size: 0.9em;margin-left:1em;"}
%option{:selected => 'selected'}=_ "Choose a supplier..."
= options_for_select(Supplier.find(:all).collect {|s| [ s.name, url_for(:action => "new", :supplier_id => s)] })
2009-01-06 11:49:19 +01:00
%br/
.left_column{:style => "width:55em"}
.box_title
%h2 Laufende Bestellungen
2009-01-06 11:49:19 +01:00
.column_content
- unless @open_orders.empty?
2009-01-06 11:49:19 +01:00
%table.list
%thead
%tr
%th Lieferant
%th Ende
%th Notiz
2009-01-06 11:49:19 +01:00
%th{:colspan => "2"}
%tbody
- for order in @open_orders
- active = (order.open? and order.ends < Time.now) ? " active" : ""
%tr{:class => cycle('even', 'odd', :name => 'open_orders') + active}
%td=h order.name
2009-01-06 11:49:19 +01:00
%td=h format_time(order.ends) unless order.ends.nil?
%td=h truncate(order.note)
%td= link_to "Beenden", finish_order_path(order), :confirm => _("Are you really sure to finish the order?"), :method => :post
2009-01-06 11:49:19 +01:00
%td
= link_to "Anzeigen", order
= link_to icon(:edit), edit_order_path(order)
= link_to icon(:delete), order, :confirm => _("Are you really sure you want to destroy the order?"), :method => :delete
2009-01-06 11:49:19 +01:00
- else
=_ "There aren't open orders at the moment."
2009-01-06 11:49:19 +01:00
.left_column{:style => "width:75em"}
.box_title
%h2 Beendete Bestellungen
2009-01-06 11:49:19 +01:00
.column_content#orders_table
= render :partial => 'orders'