Basic feature implemented, very basic poc
This commit is contained in:
parent
216089a3e7
commit
48c0067076
118 changed files with 2113 additions and 20 deletions
5
app/views/reports/_form.html.erb
Normal file
5
app/views/reports/_form.html.erb
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
<%= bootstrap_form_with(model: report) do |form| %>
|
||||
<%= form.text_field :name %>
|
||||
<%= form.text_area :comment %>
|
||||
<%= form.submit %>
|
||||
<% end %>
|
||||
12
app/views/reports/_report.html.erb
Normal file
12
app/views/reports/_report.html.erb
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
<div id="<%= dom_id report %>">
|
||||
<p>
|
||||
<strong>Name:</strong>
|
||||
<%= report.name %>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<strong>Comment:</strong>
|
||||
<%= report.comment %>
|
||||
</p>
|
||||
|
||||
</div>
|
||||
2
app/views/reports/_report.json.jbuilder
Normal file
2
app/views/reports/_report.json.jbuilder
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
json.extract! report, :id, :name, :comment, :created_at, :updated_at
|
||||
json.url report_url(report, format: :json)
|
||||
8
app/views/reports/edit.html.erb
Normal file
8
app/views/reports/edit.html.erb
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
<h1><%= t("scaffold.pagetitle_edit", model: Report.model_name.human) %></h1>
|
||||
|
||||
<%= render "form", report: @report %>
|
||||
|
||||
<div class="action-row">
|
||||
<%= link_to t("scaffold.link_show", model: Report.model_name.human), @report %>
|
||||
<%= link_to t("scaffold.link_index", model: Report.model_name.human(count: 2)), reports_path %>
|
||||
</div>
|
||||
29
app/views/reports/index.html.erb
Normal file
29
app/views/reports/index.html.erb
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
<h1><%= t("scaffold.pagetitle_index", model: Report.model_name.human(count: 2)) %></h1>
|
||||
|
||||
<table class="table table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th><%= Report.human_attribute_name(:id) %></th>
|
||||
|
||||
<th><%= Report.human_attribute_name(:name) %></th>
|
||||
|
||||
<th><%= Report.human_attribute_name(:comment) %></th>
|
||||
|
||||
</thead>
|
||||
<tbody>
|
||||
<% @reports.each do |report| %>
|
||||
<tr>
|
||||
<td><%= link_to(report.id, url_for([:work, report])) %></td>
|
||||
|
||||
<td><%= link_to(report.name, url_for([:work, report])) %></td>
|
||||
|
||||
<td><%= link_to(report.comment, url_for([:work, report])) %></td>
|
||||
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<div class="action-row">
|
||||
<%= link_to t("scaffold.link_new", model: Report.model_name.human), new_report_path %>
|
||||
</div>
|
||||
1
app/views/reports/index.json.jbuilder
Normal file
1
app/views/reports/index.json.jbuilder
Normal file
|
|
@ -0,0 +1 @@
|
|||
json.array! @reports, partial: "reports/report", as: :report
|
||||
7
app/views/reports/new.html.erb
Normal file
7
app/views/reports/new.html.erb
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
<h1><%= t("scaffold.pagetitle_new", model: Report.model_name.human) %></h1>
|
||||
|
||||
<%= render "form", report: @report %>
|
||||
|
||||
<div class="action-row">
|
||||
<%= link_to t("scaffold.link_index", model: Report.model_name.human(count: 2)), reports_path %>
|
||||
</div>
|
||||
9
app/views/reports/show.html.erb
Normal file
9
app/views/reports/show.html.erb
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
<h1><%= t("scaffold.pagetitle_show", model: @report.class.model_name.human) %></h1>
|
||||
|
||||
<%= render @report %>
|
||||
|
||||
<div class="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-warning" %>
|
||||
</div>
|
||||
1
app/views/reports/show.json.jbuilder
Normal file
1
app/views/reports/show.json.jbuilder
Normal file
|
|
@ -0,0 +1 @@
|
|||
json.partial! "reports/report", report: @report
|
||||
21
app/views/reports/work.html.erb
Normal file
21
app/views/reports/work.html.erb
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
<div class="container">
|
||||
<h1><i class="bi bi-journal-text me-2"></i><%= @report.name %></h1>
|
||||
|
||||
<% @report.elements.each do |element| %>
|
||||
<%= render element %>
|
||||
<% end %>
|
||||
<hr>
|
||||
<h2><i class="bi bi-plus"></i>Element hinzufügen</h2>
|
||||
<%= bootstrap_form_with(model: @report.elements.build, layout: :horizontal) do |form| %>
|
||||
<%= form.collection_select(:checklist_id, Checklist.all, :id, :name) %>
|
||||
<%= form.hidden_field :report_id %>
|
||||
<%= form.text_field :path %>
|
||||
<%= form.submit %>
|
||||
<% end %>
|
||||
|
||||
<div class="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-warning" %>
|
||||
</div>
|
||||
</div>
|
||||
Loading…
Add table
Add a link
Reference in a new issue