Refactorings and gui improvements
Some checks failed
/ Run tests (push) Successful in 1m22s
/ Run system tests (push) Failing after 1m33s
/ Build, push and deploy image (push) Successful in 3m22s

This commit is contained in:
david 2024-11-03 21:58:25 +01:00
parent c965e03e5a
commit d1294c2fc4
46 changed files with 358 additions and 128020 deletions

View file

@ -1 +1 @@
<%= link_to "#{tag.i(class: "bi bi-plus-lg")} Neuer Pfad".html_safe, new_report_page_path(report), class: "btn btn-primary mb-3" %>
<%= link_to "#{tag.i(class: "bi bi-plus-lg")}".html_safe, new_report_page_path(report), class: "btn btn-primary" %>

View file

@ -0,0 +1,26 @@
div id=dom_id(report, :page_nav)
- if report.pages.any?
details open=true
summary Struktur
nav
ul
- report.pages.each do |page|
- is_current = current_page == page
li
details open=current_page_displayed(page) class=""
summary
i.bi.me-1 class="bi-file-earmark-check#{is_current ? "-fill" : "" }"
- if is_current
=< "#{page.position} #{page.path}"
- else
=< link_to("#{page.position} #{page.path}", report_path(report, page_id: page.id), class: "#{is_current ? " active text-decoration-underline" : nil }", data: { "turbo-frame": :_top })
ul id=dom_id(page, :page_nav_elements)
- page.elements.each do |element|
li
i.bi.bi-boxes.me-1
- if current_page == page
=< link_to("#{element.number} #{element.title}", "##{dom_id(element)}", data: { "turbo": false })
- else
=< link_to("#{element.number} #{element.title}", report_path(report, page_id: page.id, anchor: dom_id(element)), data: { "turbo": false })
= turbo_frame_tag "new_page_frame" do
= render partial: "reports/new_page_button", locals: { report: report }

View file

@ -1,33 +1,27 @@
small.float-end
| Erstellt am
= l(@report.created_at, format: :short)
| , zuletzt bearbeitet am
= l(@report.updated_at, format: :short)
div
small.float-end
| Erstellt am
= l(@report.created_at, format: :short)
| , 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
= turbo_frame_tag "nav" do
.row
.col-lg-3.col-md-6.col-sm-12
nav.nav.nav-pills.flex-column.mb-3#page_list
- @report.pages.each do |page|
/= link_to(report_path(@report, page_id: page.id), class: "nav-link#{@current_page&.id == page.id ? " active" : nil }", data: { "turbo-action": :advance }) do
i.bi.bi-file
=< "#{page.position} #{page.path}"
= link_to(page.path, report_path(@report, page_id: page.id), class: "nav-link#{@current_page&.id == page.id ? " active" : nil }", data: { "turbo-action": :advance })
= turbo_frame_tag "new_page_frame" do
= render partial: "reports/new_page_button", locals: { report: @report }
.row
.col-lg-3.col-md-6.col-sm-12
.page_nav.sticky-top
= render partial: "reports/page_nav", locals: { report: @report, current_page: @current_page }
- if @current_page
= turbo_frame_tag(dom_id(@current_page, :notes)) do
= render partial: "pages/notes", locals: { page: @current_page }
.col-lg-9.col-md-6.col-sm-12
- if @current_page
= render @current_page
- else
'Gehen Sie weiter, hier gibt es nichts zu sehen.
.col-lg-9.col-md-6.col-sm-12
- if @current_page
= render @current_page
- else
'Gehen Sie weiter, hier gibt es nichts zu sehen.
.action-row
= link_to report_path(@report, format: :pdf), class: "btn btn-secondary", target: "_blank" do
i.bi.bi-filetype-pdf