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
|
|
@ -1 +1,2 @@
|
|||
<%= turbo_stream.remove dom_id(@checklist_entry) %>
|
||||
<%= turbo_stream.remove dom_id(@checklist_entry) %>
|
||||
<%= turbo_stream_toast("Check wurde aus Checkliste entfernt", true) %>
|
||||
|
|
|
|||
|
|
@ -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>
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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>
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
.toast class="#{alert ? "text-bg-danger" : ""}" role="alert" aria-live="assertive" aria-atomic="true" data={ controller: "toast" }
|
||||
.toast class="#{alert ? "text-bg-danger" : "text-bg-info"}" role="alert" aria-live="assertive" aria-atomic="true" data={ controller: "toast" }
|
||||
.toast-header
|
||||
/img src="..." class="rounded me-2" alt="...">
|
||||
/strong.me-auto = heading
|
||||
|
|
|
|||
|
|
@ -17,11 +17,10 @@ html data-bs-theme="#{cookies[:"modeTheme"] || "light"}" data-controller="set-th
|
|||
#main-content[data-controller="rich-text-link-targets"]
|
||||
= yield
|
||||
|
||||
.toast-container.position-fixed.bottom-0.start-0.p-3 id="toasts"
|
||||
.toast-container.position-fixed.top-0.end-0.p-3 id="toasts"
|
||||
- if flash.alert
|
||||
= render partial: "layouts/toast", locals: { content: flash.alert, alert: true }
|
||||
- if flash.notice
|
||||
= render partial: "layouts/toast", locals: { content: flash.notice, alert: false }
|
||||
|
||||
/footer.container-fluid.mt-auto.border-top
|
||||
= Rails.configuration.build_version && "Version: #{Rails.configuration.build_version}"
|
||||
= turbo_frame_tag "modal"
|
||||
|
|
|
|||
9
app/views/layouts/modal.html.slim
Normal file
9
app/views/layouts/modal.html.slim
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
= turbo_frame_tag "modal" do
|
||||
dialog.bg-body id="modal" data={ controller: :dialog }
|
||||
.float-end
|
||||
form method="dialog"
|
||||
button.btn.btn-outline-danger
|
||||
i.bi.bi-x-lg
|
||||
= yield
|
||||
|
||||
data-action="turbo:submit-end->turbo-modal#submitEnd"
|
||||
|
|
@ -11,5 +11,5 @@
|
|||
<% end %>
|
||||
</div>
|
||||
|
||||
<%= link_to("Sprinte zum ersten Element", "##{dom_id(page.elements.first)}", class: "visually-hidden", data: {controller: :hotkey, hotkey: "e", turbo: false}) if page.elements.first %>
|
||||
<%= link_to("Springe zum ersten Element", "##{dom_id(page.elements.first)}", class: "visually-hidden", data: {controller: :hotkey, hotkey: "e", turbo: false}) if page.elements.first %>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -2,7 +2,9 @@
|
|||
|
||||
<%= render "form", page: @page %>
|
||||
|
||||
<% unless modal? %>
|
||||
<div class="action-row">
|
||||
<%= link_to t("scaffold.link_show", model: Page.model_name.human), @page %>
|
||||
<%= link_to t("scaffold.link_index", model: Page.model_name.human(count: 2)), report_pages_path(@page.report) %>
|
||||
</div>
|
||||
<% end %>
|
||||
|
|
|
|||
|
|
@ -11,7 +11,8 @@ h2
|
|||
= turbo_frame_tag(dom_id(@page, :notes)) do
|
||||
= render partial: "pages/notes", locals: { page: @page }
|
||||
|
||||
.action-row
|
||||
= link_to t("scaffold.link_edit", model: @page.model_name.human), edit_page_path(@page)
|
||||
= link_to t("scaffold.link_index", model: @page.model_name.human(count: 2)), report_pages_path(@page.report)
|
||||
= button_to t("scaffold.link_destroy", model: @page.model_name.human), @page, method: :delete, class: "btn btn-outline-danger"
|
||||
- unless modal?
|
||||
.action-row
|
||||
= link_to t("scaffold.link_edit", model: @page.model_name.human), edit_page_path(@page)
|
||||
= link_to t("scaffold.link_index", model: @page.model_name.human(count: 2)), report_pages_path(@page.report)
|
||||
= button_to t("scaffold.link_destroy", model: @page.model_name.human), @page, method: :delete, class: "btn btn-outline-danger"
|
||||
|
|
|
|||
|
|
@ -1,29 +1,32 @@
|
|||
.border-bottom.mb-3
|
||||
h1
|
||||
i.bi.bi-journal-text.me-2
|
||||
= @report.name
|
||||
div
|
||||
small.float-end
|
||||
| Erstellt am
|
||||
small
|
||||
'Erstellt am
|
||||
= l(@report.created_at, format: :short)
|
||||
| , zuletzt bearbeitet am
|
||||
', zuletzt bearbeitet am
|
||||
= l(@report.updated_at, format: :short)
|
||||
h1
|
||||
i.bi.bi-journal-text.me-2
|
||||
= @report.name
|
||||
- if @report.comment
|
||||
.smb-4.lead.mb-3
|
||||
= @report.comment
|
||||
.smb-4.lead.mb-5
|
||||
= @report.comment || tag.i("leer")
|
||||
- if @current_page
|
||||
h2
|
||||
i.bi.bi-file-earmark-check
|
||||
=< @current_page.position
|
||||
=< @current_page.path
|
||||
p
|
||||
'URL:
|
||||
= safe_display(@current_page.full_url) { link_to(_1, _1, target: :_blank) }
|
||||
p.actions
|
||||
.d-flex.justify-content-end data-controller="details-list" data-target-id="element_list"
|
||||
.btn-group.me-3
|
||||
= link_to("Alle zu [s]", "#", data: { action: "click->details-list#closeAll", controller: :hotkey, hotkey: "s" }, class: "btn btn-outline-secondary")
|
||||
= link_to("Alle auf [a]", "#", data: { action: "click->details-list#openAll", controller: :hotkey, hotkey: "a" }, class: "btn btn-outline-secondary")
|
||||
= button_to(tag.i(class: "bi bi-trash"), page_path(@current_page), method: :delete, class: "btn btn-outline-danger", form: {data: { turbo_confirm: "Bist du sicher?" }})
|
||||
.current_page data-controller="details-list" data-target-id="element_list"
|
||||
.border-bottom.mb-3.d-flex
|
||||
h2
|
||||
i.bi.bi-file-earmark-check
|
||||
=< @current_page.position
|
||||
=< @current_page.path
|
||||
= page_menu(@current_page)
|
||||
p
|
||||
'URL:
|
||||
= safe_display(@current_page.full_url) { link_to(_1, _1, target: :_blank) }
|
||||
p.actions
|
||||
.d-flex.justify-content-end
|
||||
.btn-group.me-3.visually-hidden
|
||||
= link_to("Alle zu [s]", "#", data: { action: "click->details-list#closeAll", controller: :hotkey, hotkey: "s" }, class: "btn btn-outline-secondary")
|
||||
= link_to("Alle auf [a]", "#", data: { action: "click->details-list#openAll", controller: :hotkey, hotkey: "a" }, class: "btn btn-outline-secondary")
|
||||
/= button_to(tag.i(class: "bi bi-trash"), page_path(@current_page), method: :delete, class: "btn btn-outline-danger", form: {data: { turbo_confirm: "Bist du sicher?" }})
|
||||
.row
|
||||
.col-lg-3.col-md-4.col-sm-12
|
||||
.page_nav.sticky-top
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@
|
|||
.text-end.fw-bold = SuccessCriterion.human_attribute_name(:quick_fix)
|
||||
.col-md-8.col-lg-9
|
||||
= success_criterion.quick_fix
|
||||
.row.mb-3
|
||||
.row
|
||||
.col-md-4.col-lg-3
|
||||
.text-end.fw-bold = SuccessCriterion.human_attribute_name(:test_instructions)
|
||||
.col-md-8.col-lg-9
|
||||
|
|
|
|||
|
|
@ -6,4 +6,5 @@
|
|||
= form.rich_text_area :quick_fix
|
||||
= form.rich_text_area :test_comment
|
||||
= form.submit class: "btn btn-primary"
|
||||
= link_to "Abbrechen", success_criterion.persisted? ? success_criterion : success_criterion.element, class: "btn btn-outline-secondary"
|
||||
- unless modal?
|
||||
=< link_to "Abbrechen", success_criterion.persisted? ? success_criterion : success_criterion.element, class: "btn btn-outline-secondary"
|
||||
|
|
|
|||
|
|
@ -19,4 +19,4 @@ summary.d-flex.align-items-start id=dom_id(success_criterion, :header)
|
|||
= success_criterion_badge(success_criterion.check.external_number, extra_classes: "text-bg-info me-1")
|
||||
|
||||
= success_criterion_badge(success_criterion.level, extra_classes: "sc-level-#{success_criterion.level.to_s.downcase} me-1")
|
||||
i.bi.bi-grip-vertical.handle
|
||||
i.bi.bi-grip-vertical.handle.me-1
|
||||
|
|
|
|||
|
|
@ -1,4 +1,6 @@
|
|||
= turbo_stream.remove dom_id(@success_criterion)
|
||||
- @success_criterion.element.success_criteria.reject { _1 == @success_criterion }.each do |sc|
|
||||
- Rails.logger.debug "Send to sc #{sc.id}"
|
||||
= turbo_stream.update dom_id(sc, :position), "#{sc.page.position}.#{sc.element.position}.#{sc.position}"
|
||||
= turbo_stream.update dom_id(sc, :position), "#{sc.page.position}.#{sc.element.position}.#{sc.position}"
|
||||
|
||||
= turbo_stream_toast("Erfolgskriterium wurde gelöscht", true)
|
||||
|
|
|
|||
|
|
@ -1,19 +1,7 @@
|
|||
h1
|
||||
= t("scaffold.pagetitle_edit", model: SuccessCriterion.model_name.human)
|
||||
= turbo_frame_tag(dom_id(@success_criterion, :frame)) do
|
||||
.d-flex
|
||||
h2.my-2 Bearbeiten
|
||||
.ms-auto
|
||||
= success_criterion_menu(@success_criterion, false)
|
||||
/= dropdown_menu(klass: "mt-3 b-0") do
|
||||
ul.list-group
|
||||
li.list-group-item
|
||||
= success_criterion_edit_button(@success_criterion, true)
|
||||
li.list-group-item
|
||||
= button_to(tag.i(class: "bi bi-trash") + " Löschen".html_safe, @success_criterion, method: :delete, class: "btn text-danger", data: { turbo_confirm: "Bist du sicher?"})
|
||||
|
||||
.mb-3
|
||||
= render "form", success_criterion: @success_criterion
|
||||
.action-row
|
||||
= link_to t("scaffold.link_show", model: SuccessCriterion.model_name.human), @success_criterion
|
||||
= link_to t("scaffold.link_index", model: SuccessCriterion.model_name.human(count: 2)), element_success_criteria_path(@success_criterion.element)
|
||||
h2 Erfolgskriterium bearbeiten
|
||||
.mb-3
|
||||
= render "form", success_criterion: @success_criterion
|
||||
- unless modal?
|
||||
.action-row
|
||||
= link_to t("scaffold.link_show", model: SuccessCriterion.model_name.human), @success_criterion
|
||||
= link_to t("scaffold.link_index", model: SuccessCriterion.model_name.human(count: 2)), element_success_criteria_path(@success_criterion.element)
|
||||
|
|
|
|||
|
|
@ -3,5 +3,4 @@
|
|||
|
||||
- @success_criterion.element.success_criteria.each do |sc|
|
||||
= turbo_stream.update(dom_id(sc, :position), sc.number)
|
||||
|
||||
= turbo_stream_toast("Erfolgskriterium gespeichert: #{t("activerecord.attributes.success_criterion.results/#{@success_criterion.result}")}", false)
|
||||
= turbo_stream_toast("Erfolgskriterium gespeichert: #{t("activerecord.attributes.success_criterion.results/#{@success_criterion.result}")}", false)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue