Some fixes for tasks.
This commit is contained in:
parent
03d84aed1d
commit
2e56bfe895
12 changed files with 53 additions and 87 deletions
|
|
@ -1,10 +1,16 @@
|
|||
module TasksHelper
|
||||
|
||||
|
||||
def task_assignments(task)
|
||||
task.assignments.map do |ass|
|
||||
content_tag :span, ass.user.nick, :class => (ass.accepted? ? 'accepted' : 'unaccepted')
|
||||
end.join(", ").html_safe
|
||||
end
|
||||
|
||||
# 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>"
|
||||
"<small style='color:red;font-weight:bold'>(#{still_required})</small>".html_safe
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue