foodsoft/app/helpers/tasks_helper.rb

20 lines
682 B
Ruby
Raw Permalink Normal View History

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, 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)
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
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