foodsoft/app/views/tasks/workgroup.haml

60 lines
2.2 KiB
Text
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
%th= _('Date')
%th= _('Who will make it?')
%th= _('Accept task')
- i = 0
- for nextTask in @group.next_weekly_tasks
%tr{:class => cycle("even","odd")}
%td= nextTask.strftime("%a, %d.%m.%Y")
- if task = @group.tasks.find(:first, :conditions => ["due_date = ? AND name = ?",nextTask.strftime("%Y-%m-%d"),@group.task_name])
- 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(", ")
%small= link_to _('more'), :action => "edit", :id => task
- else
%td
= link_to _('Assign people'), :action => "edit", :id => task
%td
- unless task.is_accepted?(@current_user)
%span{:style => "float:left"}= button_to _('Accept task'), :controller => "tasks", :action => "accept", :id => task
= button_to _('Reject task'), :controller => "tasks", :action => "reject", :id => task if task.is_assigned?(@current_user)
- else
%td= link_to _('Assign people'), :action => "new", :id => @group, :task_from_now => i
%td
- i += 1
%br/
- else
= _('No weekly tasks defined yet')
- if @current_user.member_of?(@group) or @current_user.role_admin?
= link_to _('Edit weekly tasks'), :controller => "foodcoop", :action => "edit_group", :id => @group
2009-01-06 11:49:19 +01:00
.left_column{:style => "width:75%"}
.box_title
%h2= _('all tasks')
.column_content
- @tasks = @group.open_tasks
= render :partial => "list"
%br/
= link_to_top