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,12 @@
<div id="<%= dom_id element %>" class="mt-3">
<h2><i class="bi bi-card-checklist me-2"></i>
<%= element.title %></h2>
<p>
<strong>Path:</strong>
<%= element.path %>
</p>
<% element.success_criteria.each do |sc| %>
<%= render sc %>
<% end %>
</div>

View file

@ -0,0 +1,2 @@
json.extract! element, :id, :report_id, :path, :title, :description, :created_at, :updated_at
json.url element_url(element, format: :json)

View file

@ -0,0 +1,7 @@
<%= bootstrap_form_with(model: element) do |form| %>
<%= form.text_field :report_id %>
<%= form.text_field :path %>
<%= form.text_field :title %>
<%= form.text_area :description %>
<%= form.submit %>
<% end %>

View file

@ -0,0 +1,8 @@
<h1><%= t("scaffold.pagetitle_edit", model: Element.model_name.human) %></h1>
<%= render "form", element: @element %>
<div class="action-row">
<%= link_to t("scaffold.link_show", model: Element.model_name.human), @element %>
<%= link_to t("scaffold.link_index", model: Element.model_name.human(count: 2)), elements_path %>
</div>

View file

@ -0,0 +1,37 @@
<h1><%= t("scaffold.pagetitle_index", model: Element.model_name.human(count: 2)) %></h1>
<table class="table table-striped">
<thead>
<tr>
<th><%= Element.human_attribute_name(:id) %></th>
<th><%= Element.human_attribute_name(:report_id) %></th>
<th><%= Element.human_attribute_name(:path) %></th>
<th><%= Element.human_attribute_name(:title) %></th>
<th><%= Element.human_attribute_name(:description) %></th>
</thead>
<tbody>
<% @elements.each do |element| %>
<tr>
<td><%= link_to(element.id, url_for(element)) %></td>
<td><%= link_to(element.report_id, url_for(element)) %></td>
<td><%= link_to(element.path, url_for(element)) %></td>
<td><%= link_to(element.title, url_for(element)) %></td>
<td><%= link_to(element.description, url_for(element)) %></td>
</tr>
<% end %>
</tbody>
</table>
<div class="action-row">
<%= link_to t("scaffold.link_new", model: Element.model_name.human), new_element_path %>
</div>

View file

@ -0,0 +1 @@
json.array! @elements, partial: "elements/element", as: :element

View file

@ -0,0 +1,7 @@
<h1><%= t("scaffold.pagetitle_new", model: Element.model_name.human) %></h1>
<%= render "form", element: @element %>
<div class="action-row">
<%= link_to t("scaffold.link_index", model: Element.model_name.human(count: 2)), elements_path %>
</div>

View file

@ -0,0 +1,9 @@
<h1><%= t("scaffold.pagetitle_show", model: @element.class.model_name.human) %></h1>
<%= render @element %>
<div class="action-row">
<%= link_to t("scaffold.link_edit", model: @element.model_name.human), edit_element_path(@element) %>
<%= link_to t("scaffold.link_index", model: @element.model_name.human(count: 2)), elements_path %>
<%= button_to t("scaffold.link_destroy", model: @element.model_name.human), @element, method: :delete, class: "btn btn-warning" %>
</div>

View file

@ -0,0 +1 @@
json.partial! "elements/element", element: @element