Gui improvements and ideas
This commit is contained in:
parent
3f4c7d17bf
commit
2ae0b55e42
54 changed files with 639 additions and 237 deletions
|
|
@ -1,8 +1,10 @@
|
|||
<div id="<%= dom_id checklist_entry %>">
|
||||
<p>
|
||||
<div id="<%= dom_id checklist_entry %>" class="row hover-row py-1 p-1">
|
||||
<div class="col">
|
||||
<%= button_to tag.i(class: "bi bi-arrow-down"), checklist_entry_path(checklist_entry), method: :patch, class: "btn btn-link p-0 float-start", data: { turbo_frame: "checklist_entries" }, params: { checklist_entry: { position: checklist_entry.position + 1 }} %>
|
||||
<%= button_to tag.i(class: "bi bi-arrow-up"), checklist_entry_path(checklist_entry), method: :patch, class: "btn btn-link p-0 pe-3 float-start", data: { turbo_frame: "checklist_entries" }, params: { checklist_entry: { position: checklist_entry.position - 1 }} %>
|
||||
<%= button_to tag.i(class: "bi bi-trash"), checklist_entry_path(checklist_entry), method: :delete, class: "btn btn-link p-0 ps-3 float-end" %>
|
||||
<%= link_to "edit", edit_checklist_entry_path(checklist_entry), class: "float-end" %>
|
||||
<%= checklist_entry.position %>
|
||||
<%= link_to tag.i(class: "bi bi-pencil"), edit_checklist_entry_path(checklist_entry), class: "float-end" %>
|
||||
<%# checklist_entry.position %>
|
||||
<%= link_to(checklist_entry.check.name, checklist_entry.check, data: { turbo_frame: "_top" }) %>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
<%= bootstrap_form_with(model: checklist_entry, layout: :horizontal) do |form| %>
|
||||
<%= link_to "Abbrechen", checklist_entry.persisted? ? checklist_entry : checklist_entry.checklist, class: "btn btn-outline-secondary float-end", data: { turbo_frame: "checklist_entries" } %>
|
||||
<%= form.submit class: "btn btn-secondary float-end me-2" %>
|
||||
<%= form.hidden_field :checklist_id %>
|
||||
<%= form.collection_select :check_id, Check.all.order(:name), :id, :name %>
|
||||
<%= form.number_field :position %>
|
||||
<%= form.submit %>
|
||||
<%# form.number_field :position %>
|
||||
<% end %>
|
||||
1
app/views/checklist_entries/destroy.turbo_stream.erb
Normal file
1
app/views/checklist_entries/destroy.turbo_stream.erb
Normal file
|
|
@ -0,0 +1 @@
|
|||
<%= turbo_stream.remove dom_id(@checklist_entry) %>
|
||||
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
<%= turbo_frame_tag dom_id(@checklist_entry, :frame) do %>
|
||||
<%= render "form", checklist_entry: @checklist_entry %>
|
||||
<%= link_to "cancel", @checklist_entry %>
|
||||
|
||||
<% end %>
|
||||
|
||||
<div class="action-row">
|
||||
|
|
|
|||
|
|
@ -1,32 +1,12 @@
|
|||
<h1><%= t("scaffold.pagetitle_index", model: ChecklistEntry.model_name.human(count: 2)) %></h1>
|
||||
|
||||
<table class="table table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th><%= ChecklistEntry.human_attribute_name(:id) %></th>
|
||||
|
||||
<th><%= ChecklistEntry.human_attribute_name(:checklist_id) %></th>
|
||||
|
||||
<th><%= ChecklistEntry.human_attribute_name(:check_id) %></th>
|
||||
|
||||
<th><%= ChecklistEntry.human_attribute_name(:position) %></th>
|
||||
|
||||
</thead>
|
||||
<tbody>
|
||||
<% @checklist_entries.each do |checklist_entry| %>
|
||||
<tr>
|
||||
<td><%= link_to(checklist_entry.id, url_for(checklist_entry)) %></td>
|
||||
|
||||
<td><%= link_to(checklist_entry.checklist_id, url_for(checklist_entry)) %></td>
|
||||
|
||||
<td><%= link_to(checklist_entry.check_id, url_for(checklist_entry)) %></td>
|
||||
|
||||
<td><%= link_to(checklist_entry.position, url_for(checklist_entry)) %></td>
|
||||
|
||||
</tr>
|
||||
<%= turbo_frame_tag "checklist_entries" do %>
|
||||
<% @checklist_entries.each do |entry| %>
|
||||
<%= turbo_frame_tag dom_id(entry, :frame) do %>
|
||||
<%= render entry %>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
||||
<div class="action-row">
|
||||
<%= link_to t("scaffold.link_new", model: ChecklistEntry.model_name.human), new_checklist_entry_path %>
|
||||
|
|
|
|||
|
|
@ -1,7 +1,8 @@
|
|||
<h1><%= t("scaffold.pagetitle_new", model: ChecklistEntry.model_name.human) %></h1>
|
||||
|
||||
<%= turbo_frame_tag "new_checklist_entry" do %>
|
||||
<%= turbo_frame_tag "checklist_entries" do %>
|
||||
<%= render "form", checklist_entry: @checklist_entry %>
|
||||
<%= render @checklist_entry.checklist.checklist_entries.reject { _1 == @checklist_entry } %>
|
||||
<% end %>
|
||||
|
||||
<div class="action-row">
|
||||
|
|
|
|||
|
|
@ -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 %>
|
||||
|
|
|
|||
|
|
@ -1,16 +1,32 @@
|
|||
<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>
|
||||
<div id="<%= dom_id element %>" class="mt-4 border-top pt-3">
|
||||
<%= turbo_frame_tag dom_id(element, :frame) do %>
|
||||
<div class="d-flex">
|
||||
<h2 class="h3">
|
||||
<i class="bi bi-card-checklist">
|
||||
</i>
|
||||
<%= element.title %>
|
||||
<div class="badge text-bg-secondary">
|
||||
<%= element.path %>
|
||||
</div>
|
||||
</h2>
|
||||
<%= link_to [:edit, element], class: "btn btn-link text-secondary" do %>
|
||||
<i class="bi bi-pencil">
|
||||
</i>
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="">
|
||||
|
||||
<%= element.description_html %>
|
||||
</div>
|
||||
|
||||
<%= element.description_html %>
|
||||
<% end %>
|
||||
|
||||
<% element.success_criteria.each do |sc| %>
|
||||
<%= turbo_frame_tag(dom_id(sc, :frame)) do %>
|
||||
<%= render sc %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% if element.success_criteria.none? %>
|
||||
<p><i>Es sind (noch) keine Erfolgskriterien definiert.</i></p>
|
||||
<% end %>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -1,8 +1,15 @@
|
|||
<%= bootstrap_form_with(model: element, data: { turbo_frame: "_top"}) do |form| %>
|
||||
<%= bootstrap_form_with(model: element) do |form| %>
|
||||
<%= form.hidden_field :report_id %>
|
||||
<%= form.collection_select(:checklist_id, Checklist.all, :id, :name) %>
|
||||
<%= form.text_field :path %>
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<%= form.text_field :path %>
|
||||
</div>
|
||||
<div class="col">
|
||||
<%= form.collection_select(:checklist_id, Checklist.all, :id, :name) %>
|
||||
</div>
|
||||
</div>
|
||||
<%= form.text_field :title %>
|
||||
<%= form.rich_text_area :description_html %>
|
||||
<%= form.submit %>
|
||||
<%= form.submit class: "btn btn-warning" %>
|
||||
<%= link_to("Abbrechen", element.report, class: "btn btn-outline-secondary") %>
|
||||
<% end %>
|
||||
|
|
|
|||
|
|
@ -1,6 +1,18 @@
|
|||
<h1><%= t("scaffold.pagetitle_edit", model: Element.model_name.human) %></h1>
|
||||
|
||||
<%= render "form", element: @element %>
|
||||
<%= turbo_frame_tag dom_id(@element, :frame) do %>
|
||||
<div>
|
||||
<div class="d-flex">
|
||||
<h2 class="h3">
|
||||
<i class="bi bi-card-checklist">
|
||||
</i>
|
||||
<%= @element.title %>
|
||||
</h2>
|
||||
<%= link_to(tag.i(class: "bi bi-pencil"), @element, class: "btn btn-link text-warning") %>
|
||||
</div>
|
||||
<%= render "form", element: @element %>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<div class="action-row">
|
||||
<%= link_to t("scaffold.link_show", model: Element.model_name.human), @element %>
|
||||
|
|
|
|||
|
|
@ -1,8 +1,10 @@
|
|||
<h1><%= t("scaffold.pagetitle_new", model: Element.model_name.human) %></h1>
|
||||
|
||||
<%= turbo_frame_tag "new_element_frame" do %>
|
||||
<h2><i class="bi bi-plus"></i>Element hinzufügen</h2>
|
||||
<%= render "form", element: @element %>
|
||||
<div class="border border-info p-3">
|
||||
<h2><i class="bi bi-card-checklist me-2"></i>Neues Element</h2>
|
||||
<%= render "form", element: @element %>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<div class="action-row">
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
<nav class="navbar navbar-expand-lg bg-body-tertiary">
|
||||
<div class="container-fluid">
|
||||
<div class="container">
|
||||
<a class="navbar-brand" href="<%= root_path %>">A11yist</a>
|
||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
|
||||
<span class="navbar-toggler-icon"></span>
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@
|
|||
<%= render partial: "layouts/sidebar" %>
|
||||
<%= render partial: "layouts/navigation" %>
|
||||
<%= render partial: "layouts/flash" %>
|
||||
<main class="p-3">
|
||||
<main class="mt-3 container">
|
||||
<%= yield %>
|
||||
</main>
|
||||
</body>
|
||||
|
|
|
|||
|
|
@ -8,7 +8,8 @@
|
|||
<th><%= Report.human_attribute_name(:name) %></th>
|
||||
|
||||
<th><%= Report.human_attribute_name(:comment_html) %></th>
|
||||
|
||||
<th></th>
|
||||
<th></th>
|
||||
</thead>
|
||||
<tbody>
|
||||
<% @reports.each do |report| %>
|
||||
|
|
@ -18,7 +19,8 @@
|
|||
<td><%= link_to(report.name, url_for(report)) %></td>
|
||||
|
||||
<td><%= link_to(truncate(strip_tags(report.comment)), url_for(report)) if report.comment %></td>
|
||||
|
||||
<td><%= l(report.created_at, format: :short) %></td>
|
||||
<td><%= l(report.updated_at, format: :short) %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
|
|
|
|||
|
|
@ -1,11 +1,18 @@
|
|||
<div class="container">
|
||||
<h1><i class="bi bi-journal-text me-2"></i><%= @report.name %></h1>
|
||||
<p class="small">
|
||||
Erstellt am <%= l(@report.created_at, format: :short) %>,
|
||||
zuletzt bearbeitet am <%= l(@report.updated_at, format: :short) %>
|
||||
</p>
|
||||
|
||||
<%= @report.comment_html %>
|
||||
<% if @report.comment_html %>
|
||||
<div class="mt-2 mb-4 lead">
|
||||
<%= @report.comment_html %>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<div class="my-5">
|
||||
<div class="border-top pt-3">
|
||||
<%= turbo_frame_tag "new_element_frame" do %>
|
||||
<%= link_to "#{tag.i(class: "bi bi-plus-lg")} Element".html_safe, new_element_path(report_id: @report.id), class: "btn btn-primary" %>
|
||||
<%= link_to "#{tag.i(class: "bi bi-plus-lg")} Neues Element".html_safe, new_element_path(report_id: @report.id), class: "btn btn-primary" %>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
|
|
@ -17,8 +24,16 @@
|
|||
|
||||
|
||||
<div class="action-row">
|
||||
<%= link_to report_path(@report, format: :pdf), class: "btn btn-primary", target: "_blank" do %>
|
||||
<i class="bi bi-filetype-pdf"></i> PDF
|
||||
<% end %>
|
||||
<%= link_to report_path(@report, format: :docx), class: "btn btn-primary", target: "_blank" do %>
|
||||
<i class="bi bi-filetype-docx"></i> DOCX
|
||||
<% end %>
|
||||
<%= link_to report_path(@report, format: :xlsx), class: "btn btn-primary", target: "_blank" do %>
|
||||
<i class="bi bi-filetype-xlsx"></i> XLSX
|
||||
<% end %>
|
||||
<%= link_to t("scaffold.link_edit", model: @report.model_name.human), edit_report_path(@report) %>
|
||||
<%= link_to t("scaffold.link_index", model: @report.model_name.human(count: 2)), reports_path %>
|
||||
<%= button_to t("scaffold.link_destroy", model: @report.model_name.human), @report, method: :delete, class: "btn btn-outline-danger" %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
10
app/views/reports/show.xlsx.axlsx
Normal file
10
app/views/reports/show.xlsx.axlsx
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
wb = xlsx_package.workbook
|
||||
wb.add_worksheet(name: "Erfolgskriterien") do |sheet|
|
||||
sheet.add_row SuccessCriterion.column_names
|
||||
|
||||
@report.elements.each do |element|
|
||||
element.success_criteria.each do |sc|
|
||||
sheet.add_row sc.attributes.values
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
@ -1,18 +1,40 @@
|
|||
|
||||
<div id="<%= dom_id success_criterion %>" class="card mt-3">
|
||||
<div class="card-header">
|
||||
<h3><i class="bi bi-check2 me-2"></i><%= success_criterion.title %></h3>
|
||||
<%= link_to "cancel", success_criterion %>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<%= bootstrap_form_with(model: success_criterion) do |form| %>
|
||||
<%= form.text_field :title %>
|
||||
<%= form.rich_text_area :description_html %>
|
||||
<%= form.number_field :level %>
|
||||
<%= form.select :result, SuccessCriterion.results.keys, include_blank: true %>
|
||||
<%= form.rich_text_area :comment_html %>
|
||||
<%= form.submit %>
|
||||
<% end %>
|
||||
<%== render partial: "success_criteria/header", locals: { success_criterion: success_criterion } %>
|
||||
|
||||
<div class="collapse show" id="collapseSuccessCriterion_<%= success_criterion.id %>">
|
||||
<div class="card-body">
|
||||
<%= bootstrap_form_with(model: success_criterion) do |form| %>
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<div class="btn-group" role="group" aria-label="Resultat">
|
||||
<%= form.radio_button_without_bootstrap :result, :passed, class: "btn-check", autocomplete: "off" %>
|
||||
<label class="btn btn-outline-success" for="success_criterion_result_passed">
|
||||
Bestanden
|
||||
</label>
|
||||
<%= form.radio_button_without_bootstrap :result, :failed, class: "btn-check", autocomplete: "off" %>
|
||||
<label class="btn btn-outline-danger" for="success_criterion_result_failed">
|
||||
Durchgefallen
|
||||
</label>
|
||||
<%= form.radio_button_without_bootstrap :result, :not_applicable, class: "btn-check", autocomplete: "off" %>
|
||||
<label class="btn btn-outline-secondary" for="success_criterion_result_not_applicable">
|
||||
Nicht anwendbar
|
||||
</label>
|
||||
</div>
|
||||
<%# form.collection_select :result, SuccessCriterion.results.map{ |k, v| [k, t("activerecord.attributes.success_criterion.results/#{k}")] }, :first, :second, include_blank: true, hide_label: true %>
|
||||
<%# form.select :category, SuccessCriterion.categories.keys %>
|
||||
</div>
|
||||
<div class="col">
|
||||
<%= form.select :level, SuccessCriterion.levels.keys, hide_label: true %>
|
||||
</div>
|
||||
</div>
|
||||
<%= form.rich_text_area :comment_html %>
|
||||
<%= form.text_field :title %>
|
||||
<%= form.rich_text_area :description_html %>
|
||||
<%= form.submit class: "btn btn-warning" %>
|
||||
<%= link_to "Abbrechen", success_criterion, class: "btn btn-outline-secondary" %>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
<%# <%= link_to "edit", url_for([:edit, success_criterion]) %>
|
||||
</div>
|
||||
|
|
|
|||
37
app/views/success_criteria/_header.html.erb
Normal file
37
app/views/success_criteria/_header.html.erb
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
<% edit_mode = action_name == "edit" %>
|
||||
<div class="card-header d-flex">
|
||||
<h3
|
||||
class="h4"
|
||||
data-bs-toggle="collapse"
|
||||
href="#collapseSuccessCriterion_<%= success_criterion.id %>"
|
||||
role="button"
|
||||
aria-expanded="false"
|
||||
aria-controls="collapseSuccessCriterion_<%= success_criterion.id %>"
|
||||
style="cursor: pointer">
|
||||
<i class="bi <%= success_criterion_result_icon_classes(success_criterion) %>"></i>
|
||||
<%= success_criterion.title %>
|
||||
<span class="badge rounded-pill text-bg-secondary">
|
||||
<%= success_criterion.level %>
|
||||
</span>
|
||||
<% if success_criterion.comment_html.present? %>
|
||||
<i class="bi bi-chat"></i>
|
||||
<% end %>
|
||||
<% if false && action_name == "edit" %>
|
||||
<a href="#">
|
||||
<i class="bi bi-pencil text-warning"></i>
|
||||
<% end %>
|
||||
</h3>
|
||||
<%= link_to tag.i(class: "bi bi-#{edit_mode ? "pencil" : "pencil"}"), edit_mode ? success_criterion : [:edit, success_criterion], class: "btn btn-#{edit_mode ? "link text-warning" : "link text-secondary"}" %>
|
||||
<div class="flex-fill d-flex justify-content-end">
|
||||
<button class="btn btn-link text-body"
|
||||
data-controller="collapse-chevron-toggler"
|
||||
data-bs-toggle="collapse"
|
||||
href="#collapseSuccessCriterion_<%= success_criterion.id %>"
|
||||
role="button"
|
||||
aria-expanded="false"
|
||||
aria-controls="collapseSuccessCriterion_<%= success_criterion.id %>"
|
||||
>
|
||||
<i class="bi bi-chevron-down" data-collapse-chevron-toggler-target="icon"></i>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -1,19 +1,35 @@
|
|||
<% expanded = false unless defined?(expanded) %>
|
||||
<div id="<%= dom_id success_criterion %>" class="card mt-3">
|
||||
<div class="card-header">
|
||||
<h3><i class="bi bi-check2 me-2"></i><%= success_criterion.title %></h3>
|
||||
<%= link_to "edit", [:edit, success_criterion]%>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<%= success_criterion.description_html %>
|
||||
<p class="mt-3">
|
||||
<strong>Level</strong>: <%= success_criterion.level %>
|
||||
</p>
|
||||
<p>
|
||||
<strong>Resultat</strong>: <%= success_criterion.result %>
|
||||
</p>
|
||||
<% if success_criterion.comment_html.present? %>
|
||||
<h4 class="mt-3">Kommentar</h4>
|
||||
<%= success_criterion.comment_html %>
|
||||
<% end %>
|
||||
<%== render partial: "success_criteria/header", locals: {success_criterion: success_criterion } %>
|
||||
|
||||
<div class="collapse<%= " show" if expanded %>" id="collapseSuccessCriterion_<%= success_criterion.id %>">
|
||||
<div class="card-body">
|
||||
<%= bootstrap_form_with(model: success_criterion, data: { controller: "autosubmit" }) do |form| %>
|
||||
<div class="row mb-3">
|
||||
<div class="col">
|
||||
<div class="btn-group" role="group" aria-label="Resultat">
|
||||
<%= form.radio_button_without_bootstrap :result, :passed, class: "btn-check", autocomplete: "off", id: dom_id(success_criterion, :result_passed) %>
|
||||
<label class="btn btn-outline-success" for="<%= dom_id(success_criterion, :result_passed) %>">
|
||||
Bestanden
|
||||
</label>
|
||||
<%= form.radio_button_without_bootstrap :result, :failed, class: "btn-check", autocomplete: "off", id: dom_id(success_criterion, :result_failed) %>
|
||||
<label class="btn btn-outline-danger" for="<%= dom_id(success_criterion, :result_failed) %>">
|
||||
Durchgefallen
|
||||
</label>
|
||||
<%= form.radio_button_without_bootstrap :result, :not_applicable, class: "btn-check", autocomplete: "off", id: dom_id(success_criterion, :result_not_applicable) %>
|
||||
<label class="btn btn-outline-secondary" for="<%= dom_id(success_criterion, :result_not_applicable) %>">
|
||||
Nicht anwendbar
|
||||
</label>
|
||||
</div>
|
||||
<%# form.collection_select :result, SuccessCriterion.results.map{ |k, v| [k, t("activerecord.attributes.success_criterion.results/#{k}")] }, :first, :second, include_blank: true, hide_label: true %>
|
||||
<%# form.select :category, SuccessCriterion.categories.keys %>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
<%= success_criterion.description_html %>
|
||||
<% if success_criterion.comment_html.present? %>
|
||||
<div class="comment mt-3"><%= success_criterion.comment_html %></div>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
<h1><%= t("scaffold.pagetitle_show", model: @success_criterion.class.model_name.human) %></h1>
|
||||
|
||||
<%= turbo_frame_tag(dom_id(@success_criterion, :frame)) do %>
|
||||
<% render @success_criterion %>
|
||||
<% render partial: "success_criteria/success_criterion", locals: { success_criterion: @success_criterion, expanded: true } %>
|
||||
<% end %>
|
||||
|
||||
<div class="action-row">
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue