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|
|
2023-05-12 13:01:12 +02:00
|
|
|
content_tag :span, show_user(ass.user), class: (ass.accepted? ? 'accepted' : 'unaccepted')
|
|
|
|
end.join(', ').html_safe
|
2011-05-14 19:02:52 +02:00
|
|
|
end
|
|
|
|
|
2009-01-06 11:49:19 +01:00
|
|
|
# generate colored number of still required users
|
|
|
|
def highlighted_required_users(task)
|
2023-05-12 13:01:12 +02:00
|
|
|
return if task.enough_users_assigned?
|
|
|
|
|
|
|
|
content_tag :span, task.still_required_users, class: 'badge badge-important',
|
|
|
|
title: I18n.t('helpers.tasks.required_users', count: task.still_required_users)
|
2009-01-06 11:49:19 +01:00
|
|
|
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
|