Make checklist entries sortable by d&d
This commit is contained in:
parent
1e1d80a2c3
commit
7acc0559ae
10 changed files with 98 additions and 20 deletions
|
|
@ -1,10 +1,7 @@
|
|||
<h1><i class="bi bi-card-checklist me-2"></i><%= "#{@checklist.name}" %></h1>
|
||||
|
||||
<div class="row">
|
||||
<div class="col col-md-12">
|
||||
<%= render @checklist %>
|
||||
</div>
|
||||
<div class="col col-md-12">
|
||||
<div class="col col-12 col-lg-8">
|
||||
<div class="mt-3">
|
||||
<%= link_to tag.i(class: "bi bi-plus-lg"), new_checklist_entry_path(checklist_id: @checklist.id), class: "btn btn-primary float-end", data: { turbo_frame: "checklist_entries" } %>
|
||||
<h2>Checks</h2>
|
||||
|
|
@ -14,13 +11,18 @@
|
|||
<% end %>
|
||||
</div>
|
||||
<%= turbo_frame_tag "checklist_entries" do %>
|
||||
<% @checklist.checklist_entries.each do |entry| %>
|
||||
<%= turbo_frame_tag dom_id(entry, :frame) do %>
|
||||
<%= render entry %>
|
||||
<div data-controller="drag">
|
||||
<% @checklist.checklist_entries.each do |entry| %>
|
||||
<%= turbo_frame_tag dom_id(entry, :frame), data: { id: entry.id, "sortable-url": url_for(entry) } do %>
|
||||
<%= render entry %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<%= tag.i "Es sind keine Checks zugewiesen." if @checklist.empty? %>
|
||||
<% end %>
|
||||
<%= tag.i "Es sind keine Checks zugewiesen." if @checklist.empty? %>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col col-12 col-lg-4">
|
||||
<%= render @checklist %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue