Make checklist entries sortable by d&d
Some checks failed
/ Run tests (push) Failing after 15s
/ Run system tests (push) Failing after 14s
/ Build, push and deploy image (push) Has been skipped

This commit is contained in:
david 2024-10-27 22:37:11 +01:00
parent 1e1d80a2c3
commit 7acc0559ae
10 changed files with 98 additions and 20 deletions

View file

@ -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>