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
|
2011-05-14 19:02:52 +02:00
|
|
|
"<small style='color:red;font-weight:bold'>(#{still_required})</small>".html_safe
|
2009-01-06 11:49:19 +01:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|