foodsoft/app/helpers/tasks_helper.rb

11 lines
345 B
Ruby
Raw Normal View History

2009-01-06 11:49:19 +01:00
module TasksHelper
# generate colored number of still required users
def highlighted_required_users(task)
unless task.enough_users_assigned?
still_required = task.required_users - task.assignments.select { |ass| ass.accepted }.size
"<small style='color:red;font-weight:bold'>(#{still_required})</small>"
end
end
end