Fixed some bugs in tasks, apple feature:

* Update ordergroup stats when task is destroyed.
* Removed assigned caching attribute in task object.
* A lot of eager loading for tasks controller.
This commit is contained in:
benni 2012-12-16 19:03:04 +01:00
parent 9919183cb0
commit 0dff5ea784
10 changed files with 52 additions and 46 deletions

View file

@ -28,15 +28,15 @@
.form-actions
- if @order.open?
= link_to "Bearbeiten", edit_order_path(@order), class: 'btn'
= link_to 'Beenden!', finish_order_path(@order), method: :post,
confirm: "Willst Du wirklich die Bestellung beenden?\nEs gibt kein zurück..", class: 'btn'
= link_to 'Beenden!', finish_order_path(@order), method: :post, class: 'btn btn-success',
confirm: "Willst Du wirklich die Bestellung beenden?\nEs gibt kein zurück.."
- unless @order.closed?
= link_to "Löschen", @order, confirm: "Willst du wirklich die Bestellung löschen?", method: :delete,
class: 'btn btn-danger'
- unless @order.open?
%ul.nav.nav-pills
%li.active= update_articles_link(@order, "Artikelübersicht", :default)
%li= update_articles_link(@order, "Artikelübersicht", :default)
%li= update_articles_link(@order, "Sortiert nach Gruppen", :groups)
%li= update_articles_link(@order, "Sortiert nach Artikeln", :articles)
%li= link_to 'Kommentare', '#comments'

View file

@ -14,6 +14,4 @@
%tr
%td= task.due_date unless task.due_date.nil?
%td= link_to "#{task.name} (#{task.duration}h)", :controller => "tasks", :action => "show", :id => task
%td
- unless task.users.empty?
= task.users.map(&:nick).join(", ")
%td= task_assignments task

View file

@ -5,10 +5,12 @@
%dl.dl-horizontal
%dt Name
%dd= @task.name
%dt Beschreibung
%dd= simple_format(@task.description)
%dt Fälligkeitsdatum
%dd= format_date(@task.due_date)
- if @task.description.present?
%dt Beschreibung
%dd= simple_format(@task.description)
- if @task.due_date.present?
%dt Fälligkeitsdatum
%dd= format_date(@task.due_date)
%dt Dauer in Stunden
%dd= @task.duration
%dt Verantwortliche Menschen