Model menus, modal edit and layout improvements
Some checks failed
/ Run tests (push) Successful in 2m44s
/ Run system tests (push) Failing after 2m43s
/ Build, push and deploy image (push) Successful in 4m3s

This commit is contained in:
david 2024-11-23 19:10:09 +01:00
parent 7b0f05a448
commit 70500c49a1
35 changed files with 1079 additions and 148 deletions

View file

@ -35,10 +35,10 @@ module ApplicationHelper
def dropdown_menu(items, klass: "")
tag.details(class: "details-dropdown #{klass}") do
tag.details(class: "details-dropdown #{klass}", data: { controller: "dropdown-menu" }) do
tag.summary do
tag.div(class: "details-dropdown-trigger") do
tag.div(tag.i(class: "bi bi-three-dots-vertical"), class: "btn btn-outline-secondary")
tag.div(tag.i(class: "bi bi-three-dots"), class: "btn btn-outline-body")
end
end +
tag.div(class: "details-dropdown-content bg-secondary") do
@ -48,7 +48,7 @@ module ApplicationHelper
text = item[:icon] ? tag.i(class: "bi bi-#{item[:icon]} me-2") + " #{item[:text]}".html_safe : item[:text]
case item[:method]
when nil, :get
link_to(text, item[:href], class: "#{c}")
link_to(text, item[:href], class: "#{c}", data: { turbo_frame: item[:turbo_frame], action: item[:action] })
else
button_to(text,
item[:href],
@ -61,4 +61,8 @@ module ApplicationHelper
end
end
end
def modal?
turbo_frame_request_id == "modal"
end
end