start of iteration 2
This commit is contained in:
parent
9fb87a74ce
commit
729ed13521
75 changed files with 705 additions and 170 deletions
|
|
@ -1,5 +1,5 @@
|
|||
<%= bootstrap_form_with(model: report) do |form| %>
|
||||
<%= form.text_field :name %>
|
||||
<%= form.rich_text_area :comment_html %>
|
||||
<%= form.rich_text_area :comment %>
|
||||
<%= form.submit %>
|
||||
<% end %>
|
||||
|
|
|
|||
|
|
@ -1 +0,0 @@
|
|||
<%= link_to "#{tag.i(class: "bi bi-plus-lg")} Neues Element".html_safe, new_element_path(report_id: report.id), class: "btn btn-primary" %>
|
||||
1
app/views/reports/_new_page_button.html.erb
Normal file
1
app/views/reports/_new_page_button.html.erb
Normal file
|
|
@ -0,0 +1 @@
|
|||
<%= link_to "#{tag.i(class: "bi bi-plus-lg")} Neuer Pfad".html_safe, new_report_page_path(report), class: "btn btn-primary" %>
|
||||
|
|
@ -6,7 +6,7 @@
|
|||
|
||||
<p>
|
||||
<strong>Comment:</strong>
|
||||
<%= report.comment_html %>
|
||||
<%= report.comment %>
|
||||
</p>
|
||||
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
json.extract! report, :id, :name, :comment_html, :created_at, :updated_at
|
||||
json.extract! report, :id, :name, :comment, :created_at, :updated_at
|
||||
json.url report_url(report, format: :json)
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@
|
|||
|
||||
<th><%= Report.human_attribute_name(:name) %></th>
|
||||
|
||||
<th><%= Report.human_attribute_name(:comment_html) %></th>
|
||||
<th><%= Report.human_attribute_name(:comment) %></th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
</thead>
|
||||
|
|
@ -18,7 +18,7 @@
|
|||
|
||||
<td><%= link_to(report.name, url_for(report)) %></td>
|
||||
|
||||
<td><%= link_to(truncate(report.comment_html.to_plain_text), url_for(report)) if report.comment_html %></td>
|
||||
<td><%= link_to(truncate(report.comment.to_plain_text), url_for(report)) if report.comment %></td>
|
||||
<td><%= l(report.created_at, format: :short) %></td>
|
||||
<td><%= l(report.updated_at, format: :short) %></td>
|
||||
</tr>
|
||||
|
|
|
|||
|
|
@ -4,22 +4,22 @@
|
|||
zuletzt bearbeitet am <%= l(@report.updated_at, format: :short) %>
|
||||
</p>
|
||||
|
||||
<% if @report.comment_html %>
|
||||
<% if @report.comment %>
|
||||
<div class="mt-2 mb-4 lead">
|
||||
<%= @report.comment_html %>
|
||||
<%= @report.comment %>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<div class="border-top pt-3">
|
||||
<%= turbo_frame_tag "new_element_frame" do %>
|
||||
<%= render partial: "reports/new_element_button", locals: { report: @report } %>
|
||||
<%= turbo_frame_tag "new_page_frame" do %>
|
||||
<%= render partial: "reports/new_page_button", locals: { report: @report } %>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<div id="element_list">
|
||||
<% @report.elements.each do |element| %>
|
||||
<%= turbo_frame_tag dom_id(element, :frame) do %>
|
||||
<%= render element %>
|
||||
<div id="page_list">
|
||||
<% @report.pages.each do |page| %>
|
||||
<%= turbo_frame_tag dom_id(page, :frame) do %>
|
||||
<%= render page %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</div>
|
||||
47
app/views/reports/show.html.slim
Normal file
47
app/views/reports/show.html.slim
Normal file
|
|
@ -0,0 +1,47 @@
|
|||
h1
|
||||
i.bi.bi-journal-text.me-2
|
||||
= @report.name
|
||||
p.small
|
||||
| Erstellt am
|
||||
= l(@report.created_at, format: :short)
|
||||
| , zuletzt bearbeitet am
|
||||
= l(@report.updated_at, format: :short)
|
||||
- if @report.comment
|
||||
.mt-2.mb-4.lead
|
||||
= @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(page.path, report_path(@report, page_id: page.id), class: "nav-link#{@current_page&.id == page.id ? " active" : nil }")
|
||||
= turbo_frame_tag "new_page_frame" do
|
||||
= render partial: "reports/new_page_button", locals: { report: @report }
|
||||
.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
|
||||
| PDF
|
||||
= link_to report_path(@report, format: :docx), class: "btn btn-secondary", target: "_blank" do
|
||||
i.bi.bi-filetype-docx
|
||||
| DOCX
|
||||
= link_to report_path(@report, format: :xlsx), class: "btn btn-secondary", target: "_blank" do
|
||||
i.bi.bi-filetype-xlsx
|
||||
| XLSX
|
||||
= link_to report_path(@report, format: :rtf), class: "btn btn-secondary", target: "_blank" do
|
||||
i.bi.bi-file-richtext
|
||||
| RTF
|
||||
= link_to report_path(@report, format: :xml), class: "btn btn-secondary", target: "_blank" do
|
||||
i.bi.bi-filetype-html
|
||||
| HTML
|
||||
= link_to report_path(@report, format: :odt), class: "btn btn-secondary", target: "_blank" do
|
||||
i.bi.bi-file-richtext
|
||||
| ODT
|
||||
.action-row
|
||||
= link_to t("scaffold.link_edit", model: @report.model_name.human), edit_report_path(@report)
|
||||
= link_to t("scaffold.link_index", model: @report.model_name.human(count: 2)), reports_path
|
||||
= button_to t("scaffold.link_destroy", model: @report.model_name.human), @report, method: :delete, class: "btn btn-outline-danger"
|
||||
|
|
@ -8,9 +8,9 @@
|
|||
zuletzt bearbeitet am <%= l(@report.updated_at, format: :short) %>
|
||||
</small>
|
||||
|
||||
<% if @report.comment_html %>
|
||||
<% if @report.comment %>
|
||||
<div>
|
||||
<%= @report.comment_html %>
|
||||
<%= @report.comment %>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
|
|
|
|||
|
|
@ -4,13 +4,13 @@
|
|||
zuletzt bearbeitet am <%= l(@report.updated_at, format: :short) %>
|
||||
</p>
|
||||
|
||||
<% if @report.comment_html %>
|
||||
<% if @report.comment %>
|
||||
<div class="mt-2 mb-4 lead">
|
||||
<%= @report.comment_html %>
|
||||
<%= @report.comment %>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<div class="border-top pt-3">
|
||||
<div class="pt-3">
|
||||
<%= turbo_frame_tag "new_element_frame" do %>
|
||||
<%= render partial: "reports/new_element_button", locals: { report: @report } %>
|
||||
<% end %>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue