2009-01-06 11:49:19 +01:00
|
|
|
module TasksHelper
|
2011-05-14 19:02:52 +02:00
|
|
|
|
|
|
|
def task_assignments(task)
|
|
|
|
task.assignments.map do |ass|
|
|
|
|
content_tag :span, ass.user.nick, :class => (ass.accepted? ? 'accepted' : 'unaccepted')
|
|
|
|
end.join(", ").html_safe
|
|
|
|
end
|
|
|
|
|
2009-01-06 11:49:19 +01:00
|
|
|
# generate colored number of still required users
|
|
|
|
def highlighted_required_users(task)
|
|
|
|
unless task.enough_users_assigned?
|
|
|
|
still_required = task.required_users - task.assignments.select { |ass| ass.accepted }.size
|
2012-10-08 21:52:03 +02:00
|
|
|
content_tag :span, still_required, class: 'badge badge-important',
|
|
|
|
title: "Es fehlen #{still_required} Mitstreiterinnen!"
|
2009-01-06 11:49:19 +01:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|