start of iteration 2
This commit is contained in:
parent
9fb87a74ce
commit
729ed13521
75 changed files with 705 additions and 170 deletions
6
app/views/pages/_form.html.erb
Normal file
6
app/views/pages/_form.html.erb
Normal 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 %>
|
||||
1
app/views/pages/_new_element_button.html.erb
Normal file
1
app/views/pages/_new_element_button.html.erb
Normal 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" %>
|
||||
13
app/views/pages/_page.html.erb
Normal file
13
app/views/pages/_page.html.erb
Normal 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>
|
||||
2
app/views/pages/_page.json.jbuilder
Normal file
2
app/views/pages/_page.json.jbuilder
Normal 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)
|
||||
8
app/views/pages/edit.html.erb
Normal file
8
app/views/pages/edit.html.erb
Normal 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>
|
||||
37
app/views/pages/index.html.erb
Normal file
37
app/views/pages/index.html.erb
Normal 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>
|
||||
1
app/views/pages/index.json.jbuilder
Normal file
1
app/views/pages/index.json.jbuilder
Normal file
|
|
@ -0,0 +1 @@
|
|||
json.array! @pages, partial: "pages/page", as: :page
|
||||
12
app/views/pages/new.html.erb
Normal file
12
app/views/pages/new.html.erb
Normal 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>
|
||||
9
app/views/pages/show.html.erb
Normal file
9
app/views/pages/show.html.erb
Normal 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>
|
||||
1
app/views/pages/show.json.jbuilder
Normal file
1
app/views/pages/show.json.jbuilder
Normal file
|
|
@ -0,0 +1 @@
|
|||
json.partial! "pages/page", page: @page
|
||||
Loading…
Add table
Add a link
Reference in a new issue