Improved tasks.

This commit is contained in:
benni 2012-10-08 21:52:03 +02:00
parent 52e62f8ddb
commit acdb331e36
29 changed files with 1186 additions and 198 deletions

View file

@ -1,25 +1,29 @@
%table
%tr
%th Fälligkeit
%th Betreff
%th{:colspan => '2'}
Wer machts?
%small (Wie viele werden noch benötigt?)
- for task in @tasks
- done = task.done ? " done" : ""
%tr{:class => cycle('even','odd', :name => "tasks") + done }
%td= format_date(task.due_date) unless task.due_date.nil?
%td= link_to "#{task.name} (#{task.duration}h)", task_path(task)
%td
= task_assignments task
= highlighted_required_users task
%td
- unless task.is_accepted?(@current_user)
%span{:style => "float:left"}= button_to "Aufgabe übernehmen", :controller => "tasks", :action => "accept", :id => task
= button_to "Aufgabe ablehnen", :controller => "tasks", :action => "reject", :id => task if task.is_assigned?(@current_user)
- else
- form_for :task, :url => {:action => "update_status", :id => task} do |f|
Erledigt?
= f.check_box :done, {:onchange => "submit()", :title => "Die Aufgabe wandert in das Archiv"}
= "Erledigt" if task.done
- reset_cycle("tasks")
%table.table.table-striped
%thead
%tr
%th Fälligkeit
%th Betreff
%th{:colspan => '2'}
Wer machts?
%small (Wie viele werden noch benötigt?)
%tbody
- tasks.each do |task|
- done = task.done ? " done" : ""
%tr{:class => done }
%td= format_date(task.due_date) unless task.due_date.nil?
%td= link_to "#{task.name} (#{task.duration}h)", task_path(task)
%td
= task_assignments task
= highlighted_required_users task
%td
- if !task.is_accepted?(current_user)
= link_to "Aufgabe übernehmen", accept_task_path(task), method: :post, class: 'btn'
= link_to "Aufgabe ablehnen", reject_task_path(task), method: :post, class: 'btn' if task.is_assigned?(current_user)
- elsif !task.done
= link_to set_done_task_path(task), method: :post, class: 'btn',
title: 'Aufgabe als erledigt markieren' do
%i.icon-ok
Erledigt?
- else
%i.icon-ok
Erledigt