Delete stuff in report view
This commit is contained in:
parent
644969c613
commit
50e853098b
16 changed files with 64 additions and 31 deletions
|
|
@ -4,8 +4,10 @@
|
|||
<h3 class="h4">
|
||||
<i class="bi bi-boxes">
|
||||
</i>
|
||||
<%= element.page.position %>.<%= element.position %>
|
||||
<%= element.title %>
|
||||
<span id="<%= dom_id(element, :title) %>">
|
||||
<%= element.page.position %>.<%= element.position %>
|
||||
<%= element.title %>
|
||||
</span>
|
||||
</h3>
|
||||
<%= link_to [:edit, element], class: "btn btn-link text-secondary" do %>
|
||||
<i class="bi bi-pencil">
|
||||
|
|
@ -17,6 +19,11 @@
|
|||
<%= element.description %>
|
||||
</div>
|
||||
<% end %>
|
||||
<p class="actions">
|
||||
<%= button_to(element_path(element), method: :delete, class: "btn btn-outline-danger", data: { turbo_confirm: "Bist du sicher?"}) do %>
|
||||
<i class="bi bi-trash"></i>
|
||||
<% end %>
|
||||
</p>
|
||||
<% end %>
|
||||
|
||||
<div id="<%= dom_id(element, :success_criteria_list) %>" class="mb-3">
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
li
|
||||
li id=dom_id(element, :page_nav_row)
|
||||
- if current_page
|
||||
=< link_to("##{dom_id(element)}", data: { "turbo": false }) do
|
||||
i.bi.bi-boxes.me-1
|
||||
|
|
|
|||
5
app/views/elements/destroy.turbo_stream.slim
Normal file
5
app/views/elements/destroy.turbo_stream.slim
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
= turbo_stream.remove dom_id(@element)
|
||||
= turbo_stream.remove dom_id(@element, :page_nav_row)
|
||||
- @element.page.elements.reject { _1 == @element }.each do |e|
|
||||
= turbo_stream.update dom_id(e, :title), "#{e.page.position}.#{e.position} #{e.title}"
|
||||
= turbo_stream.replace dom_id(e, :page_nav_row), partial: "elements/page_nav_row", locals: { element: e, current_page: true }
|
||||
Loading…
Add table
Add a link
Reference in a new issue