Sortable handles
This commit is contained in:
parent
e569bcb246
commit
37e9c5461c
6 changed files with 24 additions and 12 deletions
|
|
@ -14,14 +14,15 @@
|
|||
- is_current = current_page == page
|
||||
li data={ "sortable-url": page_path(page), "form-name": "page", "position-attribute": "position" }
|
||||
details.tree open=current_page_displayed(page) class=""
|
||||
summary class=(is_current ? "active" : nil)
|
||||
.content
|
||||
summary.d-flex class=(is_current ? "active" : nil)
|
||||
.content.flex-fill
|
||||
i.bi.me-1 class="bi-file-earmark-check#{is_current ? "" : "" }"
|
||||
- if is_current
|
||||
span id=dom_id(page, :title) =< "#{page.position} #{page.path}"
|
||||
- else
|
||||
=< link_to(report_path(report, page_id: page.id), data: { "turbo-frame": :_top }) do
|
||||
span id=dom_id(page, :title) =< "#{page.position} #{page.path}"
|
||||
i.bi.bi-grip-vertical.align-self-end.handle
|
||||
ul id=dom_id(page, :page_nav_elements) data={ controller: "sortable", "linked-element-id": "element_list" }
|
||||
- page.elements.each do |element|
|
||||
= render partial: "elements/page_nav_row", locals: { element: element, current_page: current_page == element.page }
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue