Model menus, modal edit and layout improvements
This commit is contained in:
parent
7b0f05a448
commit
70500c49a1
35 changed files with 1079 additions and 148 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue