foodsoft/app/views/tasks/workgroup.haml

60 lines
2.2 KiB
Plaintext
Raw Normal View History

2009-01-06 11:49:19 +01:00
%h1
Aufgaben verwalten für
2009-01-06 11:49:19 +01:00
= @group.name
= render :partial => "nav"
.left_column{:style => "width:45em"}
.box_title
%h2
Wöchentliche Aufgaben
2009-01-06 11:49:19 +01:00
= @group.task_name
.column_content
- if @group.weekly_task
%table.list
%tr
2009-03-23 11:08:56 +01:00
%th Datum
%th Wer machts?
%th Aufgabe übernehmen
2009-01-06 11:49:19 +01:00
- i = 0
2009-03-23 11:08:56 +01:00
- for next_task in @group.next_weekly_tasks
2009-01-06 11:49:19 +01:00
%tr{:class => cycle("even","odd")}
2009-03-23 11:08:56 +01:00
%td= I18n.l next_task, :format => "%a, %d.%m.%Y"
- if task = @group.tasks.find(:first, :conditions => ["due_date = ? AND name = ?",next_task.strftime("%Y-%m-%d"),@group.task_name])
2009-01-06 11:49:19 +01:00
- unless task.users.empty?
- owner = Array.new
- task.assignments.each do |ass|
- if ass.accepted?
- nick = "<span class='accepted'>#{ass.user.nick.to_s}</span>"
- else
- nick = "<span class='unaccepted'>#{ass.user.nick.to_s} ?</span>"
- owner << nick
%td
= owner.join(", ")
2009-03-23 11:08:56 +01:00
%small= link_to "mehr", :action => "edit", :id => task
2009-01-06 11:49:19 +01:00
- else
%td
2009-03-23 11:08:56 +01:00
= link_to "Verantwortliche zuweisen", :action => "edit", :id => task
2009-01-06 11:49:19 +01:00
%td
- unless task.is_accepted?(@current_user)
2009-03-23 11:08:56 +01:00
%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)
2009-01-06 11:49:19 +01:00
- else
2009-03-23 11:08:56 +01:00
%td= link_to "Verantwortliche zuweisen", :action => "new", :id => @group, :task_from_now => i
2009-01-06 11:49:19 +01:00
%td
- i += 1
%br/
- else
2009-03-23 11:08:56 +01:00
Noch keine Wochenaufgaben angelegt.
- if @current_user.member_of?(@group) or @current_user.role_admin?
= link_to "Wochenaufgaben bearbeiten", edit_foodcoop_workgroup_path(@group)
2009-01-06 11:49:19 +01:00
.left_column{:style => "width:75%"}
.box_title
2009-03-23 11:08:56 +01:00
%h2 Alle Aufgaben der Gruppe
2009-01-06 11:49:19 +01:00
.column_content
- @tasks = @group.open_tasks
= render :partial => "list"
%br/
= link_to_top