start of iteration 2
Some checks failed
/ Run tests (push) Failing after 1m19s
/ Run system tests (push) Failing after 1m18s
/ Build, push and deploy image (push) Has been skipped

This commit is contained in:
david 2024-10-31 23:13:18 +01:00
parent 9fb87a74ce
commit 729ed13521
75 changed files with 705 additions and 170 deletions

View file

@ -0,0 +1,6 @@
<%= bootstrap_form_with(model: [:report, page], data: { turbo: false }) do |form| %>
<%= form.text_field :path %>
<%= form.text_field :url %>
<%# <%= form.rich_text_area :comment %>
<%= form.submit %>
<% end %>

View file

@ -0,0 +1 @@
<%= link_to "#{tag.i(class: "bi bi-plus-lg")} Neues Element".html_safe, new_page_element_path(page_id: page.id), class: "btn btn-primary" %>

View file

@ -0,0 +1,13 @@
<div id="<%= dom_id page %>">
<div id="element_list">
<% page.elements.each do |element| %>
<%= render element %>
<% end %>
</div>
<div class="pt-3">
<%= turbo_frame_tag "new_element_frame" do %>
<%= render partial: "pages/new_element_button", locals: { page: page } %>
<% end %>
</div>
</div>

View file

@ -0,0 +1,2 @@
json.extract! page, :id, :position, :path, :url, :report_id, :created_at, :updated_at
json.url page_url(page, format: :json)

View file

@ -0,0 +1,8 @@
<h1><%= t("scaffold.pagetitle_edit", model: Page.model_name.human) %></h1>
<%= render "form", page: @page %>
<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>

View file

@ -0,0 +1,37 @@
<h1><%= t("scaffold.pagetitle_index", model: Page.model_name.human(count: 2)) %></h1>
<table class="table table-striped">
<thead>
<tr>
<th><%= Page.human_attribute_name(:id) %></th>
<th><%= Page.human_attribute_name(:position) %></th>
<th><%= Page.human_attribute_name(:path) %></th>
<th><%= Page.human_attribute_name(:url) %></th>
<th><%= Page.human_attribute_name(:report_id) %></th>
</thead>
<tbody>
<% @pages.each do |page| %>
<tr>
<td><%= link_to(page.id, url_for(page)) %></td>
<td><%= link_to(page.position, url_for(page)) %></td>
<td><%= link_to(page.path, url_for(page)) %></td>
<td><%= link_to(page.url, url_for(page)) %></td>
<td><%= link_to(page.report_id, url_for(page)) %></td>
</tr>
<% end %>
</tbody>
</table>
<div class="action-row">
<%= link_to t("scaffold.link_new", model: Page.model_name.human), new_report_page_path(@report) %>
</div>

View file

@ -0,0 +1 @@
json.array! @pages, partial: "pages/page", as: :page

View file

@ -0,0 +1,12 @@
<h1><%= t("scaffold.pagetitle_new", model: Page.model_name.human) %></h1>
<%= turbo_frame_tag "new_page_frame" do %>
<div class="border border-info p-3">
<%= render "form", page: @page %>
<%= link_to "Abbrechen", report_path(@page.report) %>
</div>
<% end %>
<div class="action-row">
<%= link_to t("scaffold.link_index", model: Page.model_name.human(count: 2)), report_pages_path(@page.report) %>
</div>

View file

@ -0,0 +1,9 @@
<h1><%= t("scaffold.pagetitle_show", model: @page.class.model_name.human) %></h1>
<%= render @page %>
<div class="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" %>
</div>

View file

@ -0,0 +1 @@
json.partial! "pages/page", page: @page