Workflow statuses editing
This commit is contained in:
@@ -13,6 +13,12 @@ module Tasks
|
||||
tool: 'tool_line'
|
||||
}.freeze
|
||||
|
||||
def self.icon(status)
|
||||
ICONS.fetch(status.icon.to_sym)
|
||||
end
|
||||
|
||||
delegate :icon, to: :'self.class'
|
||||
|
||||
def initialize(task, with_form: false)
|
||||
@task = task
|
||||
@with_form = with_form
|
||||
@@ -27,8 +33,7 @@ module Tasks
|
||||
view_context.render(
|
||||
partial: 'tasks/status_selector',
|
||||
locals: { task: @task, id: dom_id, with_form: @with_form,
|
||||
workflow_task_statuses:,
|
||||
task_status_badge: ->(status) { task_status_badge(status, view_context) } }
|
||||
workflow_task_statuses: }
|
||||
)
|
||||
end
|
||||
|
||||
@@ -37,17 +42,6 @@ module Tasks
|
||||
def workflow_task_statuses
|
||||
@task.workflow.task_statuses.sort_by { |e| [e.position, e.name] }
|
||||
end
|
||||
|
||||
def task_status_badge(status, view_context)
|
||||
view_context.content_tag(
|
||||
:span, view_context.mask_icon(icon(status)) + status.name,
|
||||
class: ['badge', 'task-status', status.color]
|
||||
)
|
||||
end
|
||||
|
||||
def icon(status)
|
||||
ICONS.fetch(status.icon.to_sym)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user