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