Module: TasksHelper

Defined in:
app/helpers/tasks_helper.rb

Instance Method Summary collapse

Instance Method Details

#highlighted_required_users(task) ⇒ Object

generate colored number of still required users



9
10
11
12
13
14
# File 'app/helpers/tasks_helper.rb', line 9

def highlighted_required_users(task)
  return if task.enough_users_assigned?

   :span, task.still_required_users, class: 'badge badge-important',
                                                title: I18n.t('helpers.tasks.required_users', count: task.still_required_users)
end

#task_assignments(task) ⇒ Object



2
3
4
5
6
# File 'app/helpers/tasks_helper.rb', line 2

def task_assignments(task)
  task.assignments.map do |ass|
     :span, show_user(ass.user), class: (ass.accepted? ? 'accepted' : 'unaccepted')
  end.join(', ').html_safe
end

#task_title(task) ⇒ Object



16
17
18
# File 'app/helpers/tasks_helper.rb', line 16

def task_title(task)
  I18n.t('helpers.tasks.task_title', name: task.name, duration: task.duration)
end