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?
|
2012-12-16 19:03:04 +01:00
|
|
|
content_tag :span, task.still_required_users, class: 'badge badge-important',
|
2013-04-10 17:29:06 +02:00
|
|
|
title: I18n.t('helpers.tasks.required_users', :count => task.still_required_users)
|
2009-01-06 11:49:19 +01:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|