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

@ -1,6 +1,6 @@
<div id="<%= dom_id element %>" class="mb-5">
<%= turbo_frame_tag dom_id(element, :frame) do %>
<div class="d-flex">
<div class="d-flex border-bottom mb-3">
<h3 class="h4">
<i class="bi bi-boxes">
</i>
@ -9,13 +9,7 @@
<%= element.title %>
</span>
</h3>
<%= link_to [:edit, element], class: "btn btn-link text-secondary" do %>
<i class="bi bi-pencil">
</i>
<% end %>
<%= button_to(element_path(element), method: :delete, class: "btn btn-link text-danger", data: { turbo_confirm: "Bist du sicher?"}) do %>
<i class="bi bi-trash"></i>
<% end %>
<%= element_menu(element) %>
</div>
<div class="d-flex flex-column flex-sm-row">
@ -28,7 +22,7 @@
<div class="mb-3" data-controller="lightbox">
<%= link_to(s) do %>
<%= image_tag(s.variant(:thumbnail), class: "img-fluid", alt: "Screenshot des getesteten Elements") %>
<% end %>
<% end rescue nil %>
</div>
<% end %>
</div>

View file

@ -5,4 +5,4 @@
= turbo_stream.replace dom_id(e, :page_nav_row), partial: "elements/page_nav_row", locals: { element: e, current_page: true }
= turbo_stream_toast("Element wurde gelöscht", false)
= turbo_stream_toast("Element wurde gelöscht", true)

View file

@ -1,19 +1,17 @@
<h1><%= t("scaffold.pagetitle_edit", model: Element.model_name.human) %></h1>
<%= turbo_frame_tag dom_id(@element, :frame) do %>
<div>
<div class="d-flex">
<h2 class="h3">
<i class="bi bi-boxes">
</i>
<%= @element.title %>
<%= link_to(tag.i(class: "bi bi-pencil"), @element, class: "btn btn-link text-warning") %>
</div>
<%= render "form", element: @element %>
</div>
<% unless modal? %>
<div class="action-row">
<%= link_to t("scaffold.link_show", model: Element.model_name.human), @element %>
<%= link_to t("scaffold.link_index", model: Element.model_name.human(count: 2)), page_elements_path(@element.page) %>
</div>
<% end %>
<div class="action-row">
<%= link_to t("scaffold.link_show", model: Element.model_name.human), @element %>
<%= link_to t("scaffold.link_index", model: Element.model_name.human(count: 2)), page_elements_path(@element.page) %>
</div>