foodsoft/app/helpers/tasks_helper.rb
Philipp Rothmann fb2b4d8a8a chore: rubocop
chore: fix api test conventions

chore: rubocop -A spec/

chore: more rubocop -A

fix failing test

rubocop fixes

removes helper methods that are in my opinion dead code

more rubocop fixes

rubocop -a --auto-gen-config
2023-06-09 17:35:05 +02:00

19 lines
682 B
Ruby

module TasksHelper
def task_assignments(task)
task.assignments.map do |ass|
content_tag :span, show_user(ass.user), class: (ass.accepted? ? 'accepted' : 'unaccepted')
end.join(', ').html_safe
end
# generate colored number of still required users
def highlighted_required_users(task)
return if 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)
end
def task_title(task)
I18n.t('helpers.tasks.task_title', name: task.name, duration: task.duration)
end
end