Basic feature implemented, very basic poc
This commit is contained in:
parent
216089a3e7
commit
48c0067076
118 changed files with 2113 additions and 20 deletions
22
app/views/checks/_check.html.erb
Normal file
22
app/views/checks/_check.html.erb
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
<div id="<%= dom_id check %>">
|
||||
<p>
|
||||
<strong><%= Check.human_attribute_name(:position) %>:</strong>
|
||||
<%= check.position %>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<strong><%= Check.human_attribute_name(:name) %>:</strong>
|
||||
<%= check.name %>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<strong><%= Check.human_attribute_name(:success_criterion) %>:</strong>
|
||||
<%= check.success_criterion %>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<strong><%= Check.human_attribute_name(:level) %>:</strong>
|
||||
<%= check.level %>
|
||||
</p>
|
||||
|
||||
</div>
|
||||
2
app/views/checks/_check.json.jbuilder
Normal file
2
app/views/checks/_check.json.jbuilder
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
json.extract! check, :id, :position, :name, :success_criterion, :level, :created_at, :updated_at
|
||||
json.url check_url(check, format: :json)
|
||||
7
app/views/checks/_form.html.erb
Normal file
7
app/views/checks/_form.html.erb
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
<%= bootstrap_form_with(model: check, remote: true) do |form| %>
|
||||
<%= form.text_field :position %>
|
||||
<%= form.text_field :name %>
|
||||
<%= form.text_area :success_criterion %>
|
||||
<%= form.select :level, Check.levels.keys, add_blank: !form.object.level.present? %>
|
||||
<%= form.submit %>
|
||||
<% end %>
|
||||
10
app/views/checks/edit.html.erb
Normal file
10
app/views/checks/edit.html.erb
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
<h1><%= t("scaffold.pagetitle_edit", model: @check.class.model_name.human) %></h1>
|
||||
|
||||
<%= render "form", check: @check %>
|
||||
|
||||
<br>
|
||||
|
||||
<div class="action-row">
|
||||
<%= link_to t("scaffold.link_show", model: @check.class.model_name.human), @check %>
|
||||
<%= link_to t("scaffold.link_index", model: @check.class.model_name.human(count: 2)), checks_path %>
|
||||
</div>
|
||||
25
app/views/checks/index.html.erb
Normal file
25
app/views/checks/index.html.erb
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
<h1><%= t("scaffold.pagetitle_index", model: Check.model_name.human(count: 2)) %></h1>
|
||||
|
||||
<table class="table table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th><%= Check.human_attribute_name(:id) %></th>
|
||||
<th><%= Check.human_attribute_name(:level) %></th>
|
||||
<th><%= Check.human_attribute_name(:name) %></th>
|
||||
<th><%= Check.human_attribute_name(:success_criterion) %></th>
|
||||
</thead>
|
||||
<tbody>
|
||||
<% @checks.each do |check| %>
|
||||
<tr>
|
||||
<td><%= check.id %></td>
|
||||
<td><%= check.level %></td>
|
||||
<td><%= link_to(check.name, url_for(check)) %></td>
|
||||
<td><%= link_to(truncate(check.success_criterion), url_for(check)) %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<div class="action-row">
|
||||
<%= link_to t("scaffold.link_new", model: Check.model_name.human), new_check_path %>
|
||||
</div>
|
||||
1
app/views/checks/index.json.jbuilder
Normal file
1
app/views/checks/index.json.jbuilder
Normal file
|
|
@ -0,0 +1 @@
|
|||
json.array! @checks, partial: "checks/check", as: :check
|
||||
7
app/views/checks/new.html.erb
Normal file
7
app/views/checks/new.html.erb
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
<h1><%= t("scaffold.pagetitle_new", model: @check.class.model_name.human) %></h1>
|
||||
|
||||
<%= render "form", check: @check %>
|
||||
|
||||
<div class="action-row">
|
||||
<%= link_to t("scaffold.link_index", model: Check.model_name.human(count: 2)), checks_path %>
|
||||
</div>
|
||||
9
app/views/checks/show.html.erb
Normal file
9
app/views/checks/show.html.erb
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
<h1><%= t("scaffold.pagetitle_show", model: @check.class.model_name.human) %></h1>
|
||||
|
||||
<%= render @check %>
|
||||
|
||||
<div class="action-row">
|
||||
<%= link_to t("scaffold.link_edit", model: @check.model_name.human), edit_check_path(@check) %>
|
||||
<%= link_to t("scaffold.link_index", model: @check.model_name.human(count: 2)), checks_path %>
|
||||
<%= button_to t("scaffold.link_destroy", model: @check.model_name.human), @check, method: :delete, class: "btn btn-warning" %>
|
||||
</div>
|
||||
1
app/views/checks/show.json.jbuilder
Normal file
1
app/views/checks/show.json.jbuilder
Normal file
|
|
@ -0,0 +1 @@
|
|||
json.partial! "checks/check", check: @check
|
||||
Loading…
Add table
Add a link
Reference in a new issue