Gui improvements and ideas
This commit is contained in:
parent
3f4c7d17bf
commit
2ae0b55e42
54 changed files with 639 additions and 237 deletions
|
|
@ -1,28 +1,3 @@
|
|||
<div id="<%= dom_id checklist %>">
|
||||
<p>
|
||||
<strong>Code:</strong>
|
||||
<%= checklist.code %>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<strong>Name:</strong>
|
||||
<%= checklist.name %>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<strong>Description (formatted):</strong>
|
||||
<%= checklist.description_html %>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<strong>Checks</strong>
|
||||
<ul>
|
||||
<% checklist.checklist_entries.each do |entry| %>
|
||||
<li>
|
||||
<%= entry.position %> <%= entry.check.name %>
|
||||
</li>
|
||||
<% end %>
|
||||
</ul>
|
||||
</p>
|
||||
|
||||
<%= checklist.description_html %>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
<%= bootstrap_form_with(model: checklist) do |form| %>
|
||||
<%= form.text_field :code %>
|
||||
<%# form.text_field :code %>
|
||||
<%= form.text_field :name %>
|
||||
<%= form.rich_text_area :description_html %>
|
||||
<%= form.rich_text_area :description_html, rows: 12 %>
|
||||
<%= form.submit %>
|
||||
<% end %>
|
||||
|
|
@ -1,24 +1,7 @@
|
|||
<h1><%= t("scaffold.pagetitle_edit", model: Checklist.model_name.human) %></h1>
|
||||
|
||||
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<%= render "form", checklist: @checklist %>
|
||||
</div>
|
||||
<div class="col">
|
||||
<h2>Checks</h2>
|
||||
<div class="mb-2">
|
||||
<%= turbo_frame_tag "new_checklist_entry" do %>
|
||||
<%= link_to tag.i(class: "bi bi-plus"), new_checklist_entry_path(checklist_id: @checklist.id), class: "btn btn-primary", data: { turbo_frame: "new_checklist_entry"} %>
|
||||
<% end %>
|
||||
</div>
|
||||
<% @checklist.checklist_entries.each do |entry| %>
|
||||
<%= turbo_frame_tag dom_id(entry, :frame) do %>
|
||||
<%= render entry %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
<%= render "form", checklist: @checklist %>
|
||||
|
||||
<div class="action-row">
|
||||
<%= link_to t("scaffold.link_show", model: Checklist.model_name.human), @checklist %>
|
||||
|
|
|
|||
|
|
@ -5,8 +5,6 @@
|
|||
<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_html) %></th>
|
||||
|
|
@ -17,8 +15,6 @@
|
|||
<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(truncate(strip_tags(checklist.description_html.to_s)), url_for(checklist)) %></td>
|
||||
|
|
|
|||
|
|
@ -2,6 +2,12 @@
|
|||
|
||||
<%= render "form", checklist: @checklist %>
|
||||
|
||||
<% @checklist.checklist_entries.each do |entry| %>
|
||||
<%= turbo_frame_tag dom_id(entry, :frame) do %>
|
||||
<%= render entry %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
||||
<div class="action-row">
|
||||
<%= link_to t("scaffold.link_index", model: Checklist.model_name.human(count: 2)), checklists_path %>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -1,9 +1,29 @@
|
|||
<h1><%= t("scaffold.pagetitle_show", model: @checklist.class.model_name.human) %></h1>
|
||||
<h1><i class="bi bi-card-checklist me-2"></i><%= "#{@checklist.name}" %></h1>
|
||||
|
||||
<div class="row">
|
||||
<div class="col col-md-12">
|
||||
<%= render @checklist %>
|
||||
</div>
|
||||
<div class="col col-md-12">
|
||||
<div class="mt-3">
|
||||
<%= link_to tag.i(class: "bi bi-plus-lg"), new_checklist_entry_path(checklist_id: @checklist.id), class: "btn btn-primary float-end", data: { turbo_frame: "checklist_entries" } %>
|
||||
<h2>Checks</h2>
|
||||
</div>
|
||||
<div class="mb-2">
|
||||
<%= turbo_frame_tag "new_checklist_entry" do %>
|
||||
<% end %>
|
||||
</div>
|
||||
<%= turbo_frame_tag "checklist_entries" do %>
|
||||
<% @checklist.checklist_entries.each do |entry| %>
|
||||
<%= turbo_frame_tag dom_id(entry, :frame) do %>
|
||||
<%= render entry %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<%= tag.i "Es sind (noch) keine Checks definiert." if @checklist.empty? %>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<%= render @checklist %>
|
||||
<pre>Dashboard
|
||||
is
|
||||
sidebar</pre>
|
||||
<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 %>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue