2012-10-15 21:19:17 +02:00
|
|
|
- title "Bestellungen verwalten"
|
|
|
|
|
2012-11-12 13:13:01 +01:00
|
|
|
- content_for :actionbar do
|
|
|
|
.btn-group
|
2012-10-30 00:20:47 +01:00
|
|
|
= link_to '#', data: {toggle: 'dropdown'}, class: 'btn btn-primary dropdown-toggle' do
|
2012-11-12 13:13:01 +01:00
|
|
|
Neue Bestellung anlegen
|
2012-10-30 00:20:47 +01:00
|
|
|
%span.caret
|
|
|
|
%ul.dropdown-menu
|
2013-03-16 17:53:24 +01:00
|
|
|
- Supplier.undeleted.order('suppliers.name ASC').each do |supplier|
|
2012-10-30 00:20:47 +01:00
|
|
|
%li= link_to supplier.name, new_order_path(supplier_id: supplier.id), tabindex: -1
|
|
|
|
|
2012-11-12 13:13:01 +01:00
|
|
|
.well
|
2012-10-15 21:19:17 +02:00
|
|
|
%h2 Laufende Bestellungen
|
|
|
|
- unless @open_orders.empty?
|
|
|
|
%table.table.table-striped
|
|
|
|
%thead
|
|
|
|
%tr
|
|
|
|
%th Lieferantin
|
|
|
|
%th Ende
|
|
|
|
%th Notiz
|
|
|
|
%th{colspan: "2"}
|
|
|
|
%tbody
|
|
|
|
- for order in @open_orders
|
|
|
|
- tr_class = " active" if order.expired?
|
|
|
|
%tr{class: tr_class}
|
|
|
|
%td= order.name
|
|
|
|
%td= format_time(order.ends) unless order.ends.nil?
|
|
|
|
%td= truncate(order.note)
|
|
|
|
%td= link_to "Beenden", finish_order_path(order),
|
2012-11-12 13:13:01 +01:00
|
|
|
confirm: "Willst Du wirklich die Bestellung \"#{order.name}\" beenden? Es gibt kein zurück.",
|
2012-10-15 21:19:17 +02:00
|
|
|
method: :post, class: 'btn btn-small btn-success'
|
|
|
|
|
|
|
|
%td
|
|
|
|
= link_to "Anzeigen", order, class: 'btn btn-small'
|
|
|
|
= link_to "Bearbeiten", edit_order_path(order), class: 'btn btn-small'
|
|
|
|
= link_to "Löschen", order, confirm: "Willst Du wirklich die Bestellung löschen?", method: :delete,
|
|
|
|
class: 'btn btn-small btn-danger'
|
|
|
|
- else
|
|
|
|
Derzeit gibt es keine laufende Bestellungen.
|
|
|
|
|
|
|
|
%h2 Beendete Bestellungen
|
|
|
|
#orders_table
|
|
|
|
= render partial: 'orders'
|