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


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

def highlighted_required_users(task)
  unless 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
end

#task_assignments(task) ⇒ Object


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

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


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

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