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|
|
2013-09-22 02:15:35 +02:00
|
|
|
content_tag :span, show_user(ass.user), :class => (ass.accepted? ? 'accepted' : 'unaccepted')
|
2011-05-14 19:02:52 +02:00
|
|
|
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
|
2013-12-10 17:58:32 +01:00
|
|
|
|
|
|
|
def task_title(task)
|
|
|
|
I18n.t('helpers.tasks.task_title', name: task.name, duration: task.duration)
|
|
|
|
end
|
2009-01-06 11:49:19 +01:00
|
|
|
end
|