2009-01-30 19:02:35 +01:00
- title "Bestellungen verwalten"
2009-01-06 11:49:19 +01:00
- if @current_user.role_orders?
%p
- form_tag do
2009-01-29 01:57:51 +01:00
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;"}
2009-03-22 13:56:54 +01:00
%option{:selected => 'selected'} Lieferantin auswählen...
2009-02-11 15:23:59 +01:00
= options_for_suppliers_to_select
2009-01-06 11:49:19 +01:00
%br/
.left_column{:style => "width:55em"}
.box_title
2009-01-29 01:57:51 +01:00
%h2 Laufende Bestellungen
2009-01-06 11:49:19 +01:00
.column_content
2009-01-29 01:57:51 +01:00
- unless @open_orders.empty?
2009-01-06 11:49:19 +01:00
%table.list
%thead
%tr
2009-03-22 13:56:54 +01:00
%th Lieferantin
2009-01-29 01:57:51 +01:00
%th Ende
%th Notiz
2009-01-06 11:49:19 +01:00
%th{:colspan => "2"}
%tbody
2009-01-29 01:57:51 +01:00
- for order in @open_orders
2010-06-19 12:23:18 +02:00
- tr_class = cycle('even', 'odd', :name => 'open_orders')
- tr_class += " active" if order.expired?
%tr{:class => tr_class}
2009-02-05 16:40:02 +01:00
%td=h order.name
2009-01-06 11:49:19 +01:00
%td=h format_time(order.ends) unless order.ends.nil?
2009-01-29 01:57:51 +01:00
%td=h truncate(order.note)
2009-03-24 22:57:24 +01:00
%td= link_to "Beenden", finish_order_path(order), :confirm => "Willst Du wirklich die Bestellung \"#{order.name}\" beenden?\nEs gibt kein zurück.", :method => :post
2009-01-06 11:49:19 +01:00
%td
2009-01-29 01:57:51 +01:00
= link_to "Anzeigen", order
= link_to icon(:edit), edit_order_path(order)
2009-03-01 18:45:34 +01:00
= link_to icon(:delete), order, :confirm => "Bist Du sicher die Bestellung zu beenden?", :method => :delete
2009-01-06 11:49:19 +01:00
- else
2009-03-01 18:45:34 +01:00
Derzeit gibt es keine laufende Bestellungen.
2009-01-06 11:49:19 +01:00
.left_column{:style => "width:75em"}
.box_title
2009-01-29 01:57:51 +01:00
%h2 Beendete Bestellungen
2009-01-06 11:49:19 +01:00
.column_content#orders_table
2009-01-29 01:57:51 +01:00
= render :partial => 'orders'