Default task broadcast
This commit is contained in:
@@ -10,6 +10,8 @@ class Task < ApplicationRecord
|
|||||||
|
|
||||||
has_rich_text :description
|
has_rich_text :description
|
||||||
|
|
||||||
|
broadcasts_to ->(task) { [task.project, :tasks] }, template: 'tasks/_table_row'
|
||||||
|
|
||||||
def to_param
|
def to_param
|
||||||
return full_number if association(:project).loaded?
|
return full_number if association(:project).loaded?
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,8 @@
|
|||||||
|
- cache task do
|
||||||
|
tr id="task_#{task.id}"
|
||||||
|
td= link_to task.full_number, task_path(task)
|
||||||
|
td
|
||||||
|
= task_status_selector task, selector_class: 'small', id: "task_status_selector_#{task.id}", with_form: true
|
||||||
|
td= task.title
|
||||||
|
td
|
||||||
|
= link_to 'Edit', edit_task_path(task)
|
||||||
@@ -1,20 +1,12 @@
|
|||||||
h1= tasks_index_title
|
h1= tasks_index_title
|
||||||
|
|
||||||
.row
|
section.row
|
||||||
= link_to 'New', new_task_path(project: current_project&.code)
|
= link_to 'New', new_task_path(project: current_project&.code)
|
||||||
|
|
||||||
- if @tasks.exists?
|
table.tasks-table
|
||||||
table.tasks-table
|
|
||||||
thead
|
thead
|
||||||
tbody
|
tbody#tasks
|
||||||
- @tasks.each do |task|
|
= render partial: 'table_row', collection: @tasks, as: :task
|
||||||
- cache task do
|
|
||||||
tr
|
- if current_project
|
||||||
td= link_to task.full_number, task_path(task)
|
= turbo_stream_from current_project, :tasks
|
||||||
td
|
|
||||||
= task_status_selector task, with_form: true
|
|
||||||
td= task.title
|
|
||||||
td
|
|
||||||
= link_to 'Edit', edit_task_path(task)
|
|
||||||
- else
|
|
||||||
p No tasks
|
|
||||||
|
|||||||
Reference in New Issue
Block a user