Basic feature implemented, very basic poc
This commit is contained in:
parent
216089a3e7
commit
48c0067076
118 changed files with 2113 additions and 20 deletions
12
app/views/elements/_element.html.erb
Normal file
12
app/views/elements/_element.html.erb
Normal 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>
|
||||
2
app/views/elements/_element.json.jbuilder
Normal file
2
app/views/elements/_element.json.jbuilder
Normal 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)
|
||||
7
app/views/elements/_form.html.erb
Normal file
7
app/views/elements/_form.html.erb
Normal 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 %>
|
||||
8
app/views/elements/edit.html.erb
Normal file
8
app/views/elements/edit.html.erb
Normal 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>
|
||||
37
app/views/elements/index.html.erb
Normal file
37
app/views/elements/index.html.erb
Normal 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>
|
||||
1
app/views/elements/index.json.jbuilder
Normal file
1
app/views/elements/index.json.jbuilder
Normal file
|
|
@ -0,0 +1 @@
|
|||
json.array! @elements, partial: "elements/element", as: :element
|
||||
7
app/views/elements/new.html.erb
Normal file
7
app/views/elements/new.html.erb
Normal 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>
|
||||
9
app/views/elements/show.html.erb
Normal file
9
app/views/elements/show.html.erb
Normal 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>
|
||||
1
app/views/elements/show.json.jbuilder
Normal file
1
app/views/elements/show.json.jbuilder
Normal file
|
|
@ -0,0 +1 @@
|
|||
json.partial! "elements/element", element: @element
|
||||
Loading…
Add table
Add a link
Reference in a new issue