Basic feature implemented, very basic poc
This commit is contained in:
parent
216089a3e7
commit
48c0067076
118 changed files with 2113 additions and 20 deletions
28
app/views/checklists/_checklist.html.erb
Normal file
28
app/views/checklists/_checklist.html.erb
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
<div id="<%= dom_id checklist %>">
|
||||
<p>
|
||||
<strong>Code:</strong>
|
||||
<%= checklist.code %>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<strong>Name:</strong>
|
||||
<%= checklist.name %>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<strong>Description:</strong>
|
||||
<%= checklist.description %>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<strong>Checks</strong>
|
||||
<ul>
|
||||
<% checklist.checklist_entries.each do |entry| %>
|
||||
<li>
|
||||
<%= entry.position %> <%= entry.check.name %>
|
||||
</li>
|
||||
<% end %>
|
||||
</ul>
|
||||
</p>
|
||||
|
||||
</div>
|
||||
2
app/views/checklists/_checklist.json.jbuilder
Normal file
2
app/views/checklists/_checklist.json.jbuilder
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
json.extract! checklist, :id, :code, :name, :description, :created_at, :updated_at
|
||||
json.url checklist_url(checklist, format: :json)
|
||||
13
app/views/checklists/_form.html.erb
Normal file
13
app/views/checklists/_form.html.erb
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
<%= bootstrap_form_with(model: checklist) do |form| %>
|
||||
<%= form.text_field :code %>
|
||||
<%= form.text_field :name %>
|
||||
<%= form.text_area :description %>
|
||||
<h2>Checks</h2>
|
||||
<% checklist.checklist_entries.each do |entry| %>
|
||||
<%= form.fields_for(:checklist_entries, entry) do |eform| %>
|
||||
<%= eform.number_field :position %>
|
||||
<%= eform.collection_select :check_id, Check.all, :id, :name %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<%= form.submit %>
|
||||
<% end %>
|
||||
8
app/views/checklists/edit.html.erb
Normal file
8
app/views/checklists/edit.html.erb
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
<h1><%= t("scaffold.pagetitle_edit", model: Checklist.model_name.human) %></h1>
|
||||
|
||||
<%= render "form", checklist: @checklist %>
|
||||
|
||||
<div class="action-row">
|
||||
<%= link_to t("scaffold.link_show", model: Checklist.model_name.human), @checklist %>
|
||||
<%= link_to t("scaffold.link_index", model: Checklist.model_name.human(count: 2)), checklists_path %>
|
||||
</div>
|
||||
33
app/views/checklists/index.html.erb
Normal file
33
app/views/checklists/index.html.erb
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
<h1><%= t("scaffold.pagetitle_index", model: Checklist.model_name.human(count: 2)) %></h1>
|
||||
|
||||
<table class="table table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th><%= Checklist.human_attribute_name(:id) %></th>
|
||||
|
||||
<th><%= Checklist.human_attribute_name(:code) %></th>
|
||||
|
||||
<th><%= Checklist.human_attribute_name(:name) %></th>
|
||||
|
||||
<th><%= Checklist.human_attribute_name(:description) %></th>
|
||||
|
||||
</thead>
|
||||
<tbody>
|
||||
<% @checklists.each do |checklist| %>
|
||||
<tr>
|
||||
<td><%= link_to(checklist.id, url_for(checklist)) %></td>
|
||||
|
||||
<td><%= link_to(checklist.code, url_for(checklist)) %></td>
|
||||
|
||||
<td><%= link_to(checklist.name, url_for(checklist)) %></td>
|
||||
|
||||
<td><%= link_to(checklist.description, url_for(checklist)) %></td>
|
||||
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<div class="action-row">
|
||||
<%= link_to t("scaffold.link_new", model: Checklist.model_name.human), new_checklist_path %>
|
||||
</div>
|
||||
1
app/views/checklists/index.json.jbuilder
Normal file
1
app/views/checklists/index.json.jbuilder
Normal file
|
|
@ -0,0 +1 @@
|
|||
json.array! @checklists, partial: "checklists/checklist", as: :checklist
|
||||
7
app/views/checklists/new.html.erb
Normal file
7
app/views/checklists/new.html.erb
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
<h1><%= t("scaffold.pagetitle_new", model: Checklist.model_name.human) %></h1>
|
||||
|
||||
<%= render "form", checklist: @checklist %>
|
||||
|
||||
<div class="action-row">
|
||||
<%= link_to t("scaffold.link_index", model: Checklist.model_name.human(count: 2)), checklists_path %>
|
||||
</div>
|
||||
9
app/views/checklists/show.html.erb
Normal file
9
app/views/checklists/show.html.erb
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
<h1><%= t("scaffold.pagetitle_show", model: @checklist.class.model_name.human) %></h1>
|
||||
|
||||
<%= render @checklist %>
|
||||
|
||||
<div class="action-row">
|
||||
<%= link_to t("scaffold.link_edit", model: @checklist.model_name.human), edit_checklist_path(@checklist) %>
|
||||
<%= link_to t("scaffold.link_index", model: @checklist.model_name.human(count: 2)), checklists_path %>
|
||||
<%= button_to t("scaffold.link_destroy", model: @checklist.model_name.human), @checklist, method: :delete, class: "btn btn-warning" %>
|
||||
</div>
|
||||
1
app/views/checklists/show.json.jbuilder
Normal file
1
app/views/checklists/show.json.jbuilder
Normal file
|
|
@ -0,0 +1 @@
|
|||
json.partial! "checklists/checklist", checklist: @checklist
|
||||
Loading…
Add table
Add a link
Reference in a new issue