foodsoft/app/helpers/tasks_helper.rb

20 lines
696 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|
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?
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
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