Basic feature implemented, very basic poc

This commit is contained in:
David Schärer 2024-07-16 20:22:59 +02:00
parent 216089a3e7
commit 48c0067076
118 changed files with 2113 additions and 20 deletions

View 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>

View 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)

View 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 %>

View 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>

View 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>

View file

@ -0,0 +1 @@
json.array! @checks, partial: "checks/check", as: :check

View 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>

View 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>

View file

@ -0,0 +1 @@
json.partial! "checks/check", check: @check