start of iteration 2
This commit is contained in:
parent
9fb87a74ce
commit
729ed13521
75 changed files with 705 additions and 170 deletions
|
|
@ -1,4 +1,4 @@
|
|||
<h1><i class="bi bi-card-checklist me-2"></i><%= "#{@checklist.name}" %></h1>
|
||||
<h1><i class="bi bi-boxes me-2"></i><%= "#{@checklist.name}" %></h1>
|
||||
|
||||
<div class="row">
|
||||
<div class="col col-12 col-lg-8">
|
||||
|
|
|
|||
|
|
@ -1,13 +1,10 @@
|
|||
<div id="<%= dom_id element %>" class="mt-4 border-top pt-3">
|
||||
<div id="<%= dom_id element %>" class="<%= "mt-5" unless element == element.page.elements.first %>">
|
||||
<%= turbo_frame_tag dom_id(element, :frame) do %>
|
||||
<div class="d-flex">
|
||||
<h2 class="h4">
|
||||
<i class="bi bi-card-checklist">
|
||||
<i class="bi bi-boxes">
|
||||
</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">
|
||||
|
|
@ -16,17 +13,23 @@
|
|||
</div>
|
||||
<div class="">
|
||||
|
||||
<%= element.description_html %>
|
||||
<%= element.description %>
|
||||
</div>
|
||||
|
||||
<% end %>
|
||||
|
||||
<% element.success_criteria.each do |sc| %>
|
||||
<%= turbo_frame_tag(dom_id(sc, :frame)) do %>
|
||||
<div id="<%= dom_id(element, :success_criteria_list) %>">
|
||||
<% element.success_criteria.each do |sc| %>
|
||||
<%= render sc %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% if element.success_criteria.none? %>
|
||||
<p><i>Es sind (noch) keine Erfolgskriterien definiert.</i></p>
|
||||
<% end %>
|
||||
<% if element.success_criteria.none? %>
|
||||
<p><i>Es sind (noch) keine Erfolgskriterien definiert.</i></p>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<div class="pt-3">
|
||||
<%= turbo_frame_tag dom_id(element, "new_success_criterion_frame") do %>
|
||||
<%= render partial: "elements/new_success_criterion_button", locals: { element: element } %>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -1,15 +1,7 @@
|
|||
<%= bootstrap_form_with(model: element, data: element.persisted? || { turbo_frame: "_top" }) do |form| %>
|
||||
<%= form.hidden_field :report_id %>
|
||||
<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>
|
||||
<%= bootstrap_form_with(model: element.persisted? ? element : [:page, element], data: element.persisted? || { turbo_frame: "_top" }) do |form| %>
|
||||
<%= form.hidden_field :page_id %>
|
||||
<%= form.text_field :title %>
|
||||
<%= form.rich_text_area :description_html %>
|
||||
<%= form.rich_text_area :description %>
|
||||
<%= form.submit class: "btn btn-warning" %>
|
||||
<%= link_to("Abbrechen", element.report, class: "btn btn-outline-secondary") %>
|
||||
<%= link_to("Abbrechen", element.persisted? ? element : element.report, class: "btn btn-outline-secondary") %>
|
||||
<% end %>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,3 @@
|
|||
<%= link_to "#{tag.i(class: "bi bi-plus-lg")} Neue Checkliste".html_safe, new_from_checklist_element_success_criteria_path(element), class: "btn btn-primary" %>
|
||||
|
||||
<%= link_to "#{tag.i(class: "bi bi-plus-lg")} Neues Erfolgskriterium".html_safe, new_element_success_criterion_path(element), class: "btn btn-primary" %>
|
||||
|
|
@ -1,2 +1,2 @@
|
|||
<%= turbo_stream.update "new_element_frame", partial: "reports/new_element_button", locals: { report: @element.report } %>
|
||||
<%= turbo_stream.update "new_element_frame", partial: "pages/new_element_button", locals: { page: @element.page } %>
|
||||
<%= turbo_stream.append "element_list", @element %>
|
||||
|
|
@ -4,13 +4,9 @@
|
|||
<div>
|
||||
<div class="d-flex">
|
||||
<h2 class="h3">
|
||||
<i class="bi bi-card-checklist">
|
||||
<i class="bi bi-boxes">
|
||||
</i>
|
||||
<%= @element.title %>
|
||||
<div class="badge text-bg-secondary">
|
||||
<%= @element.path %>
|
||||
</div>
|
||||
</h2>
|
||||
<%= link_to(tag.i(class: "bi bi-pencil"), @element, class: "btn btn-link text-warning") %>
|
||||
</div>
|
||||
<%= render "form", element: @element %>
|
||||
|
|
@ -19,5 +15,5 @@
|
|||
|
||||
<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 %>
|
||||
<%= link_to t("scaffold.link_index", model: Element.model_name.human(count: 2)), page_elements_path(@element.page) %>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -2,11 +2,10 @@
|
|||
|
||||
<%= turbo_frame_tag "new_element_frame" do %>
|
||||
<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">
|
||||
<%= link_to t("scaffold.link_index", model: Element.model_name.human(count: 2)), elements_path %>
|
||||
<%= link_to t("scaffold.link_index", model: Element.model_name.human(count: 2)), page_elements_path %>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -4,6 +4,6 @@
|
|||
|
||||
<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 %>
|
||||
<%= link_to t("scaffold.link_index", model: @element.model_name.human(count: 2)), page_elements_path(@element.page) %>
|
||||
<%= button_to t("scaffold.link_destroy", model: @element.model_name.human), @element, method: :delete, class: "btn btn-outline-danger" %>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -17,10 +17,13 @@
|
|||
<div class="row">
|
||||
<%= render partial: "layouts/sidebar" %>
|
||||
<main class="col ps-md-2 pt-2 <%= "border-start" if sidebar? %>">
|
||||
<div class="container">
|
||||
<div class="container-fluid">
|
||||
<%= render partial: "layouts/flash" %>
|
||||
<% if false && sidebar? %>
|
||||
<a href="#" data-bs-target="#sidebar" data-bs-toggle="collapse" class="p-1 text-decoration-none"><i class="bi bi-list bi-lg py-2 p-1"></i> Menu</a>
|
||||
<a href="#" data-bs-target="#sidebar" data-bs-toggle="collapse" class="p-1 text-decoration-none">
|
||||
<i class="bi bi-list bi-lg py-2 p-1"></i>
|
||||
Menu
|
||||
</a>
|
||||
<% end %>
|
||||
|
||||
<div id="main-content" data-controller="rich-text-link-targets">
|
||||
|
|
|
|||
6
app/views/pages/_form.html.erb
Normal file
6
app/views/pages/_form.html.erb
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
<%= bootstrap_form_with(model: [:report, page], data: { turbo: false }) do |form| %>
|
||||
<%= form.text_field :path %>
|
||||
<%= form.text_field :url %>
|
||||
<%# <%= form.rich_text_area :comment %>
|
||||
<%= form.submit %>
|
||||
<% end %>
|
||||
1
app/views/pages/_new_element_button.html.erb
Normal file
1
app/views/pages/_new_element_button.html.erb
Normal file
|
|
@ -0,0 +1 @@
|
|||
<%= link_to "#{tag.i(class: "bi bi-plus-lg")} Neues Element".html_safe, new_page_element_path(page_id: page.id), class: "btn btn-primary" %>
|
||||
13
app/views/pages/_page.html.erb
Normal file
13
app/views/pages/_page.html.erb
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
<div id="<%= dom_id page %>">
|
||||
<div id="element_list">
|
||||
<% page.elements.each do |element| %>
|
||||
<%= render element %>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<div class="pt-3">
|
||||
<%= turbo_frame_tag "new_element_frame" do %>
|
||||
<%= render partial: "pages/new_element_button", locals: { page: page } %>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
2
app/views/pages/_page.json.jbuilder
Normal file
2
app/views/pages/_page.json.jbuilder
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
json.extract! page, :id, :position, :path, :url, :report_id, :created_at, :updated_at
|
||||
json.url page_url(page, format: :json)
|
||||
8
app/views/pages/edit.html.erb
Normal file
8
app/views/pages/edit.html.erb
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
<h1><%= t("scaffold.pagetitle_edit", model: Page.model_name.human) %></h1>
|
||||
|
||||
<%= render "form", page: @page %>
|
||||
|
||||
<div class="action-row">
|
||||
<%= link_to t("scaffold.link_show", model: Page.model_name.human), @page %>
|
||||
<%= link_to t("scaffold.link_index", model: Page.model_name.human(count: 2)), report_pages_path(@page.report) %>
|
||||
</div>
|
||||
37
app/views/pages/index.html.erb
Normal file
37
app/views/pages/index.html.erb
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
<h1><%= t("scaffold.pagetitle_index", model: Page.model_name.human(count: 2)) %></h1>
|
||||
|
||||
<table class="table table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th><%= Page.human_attribute_name(:id) %></th>
|
||||
|
||||
<th><%= Page.human_attribute_name(:position) %></th>
|
||||
|
||||
<th><%= Page.human_attribute_name(:path) %></th>
|
||||
|
||||
<th><%= Page.human_attribute_name(:url) %></th>
|
||||
|
||||
<th><%= Page.human_attribute_name(:report_id) %></th>
|
||||
|
||||
</thead>
|
||||
<tbody>
|
||||
<% @pages.each do |page| %>
|
||||
<tr>
|
||||
<td><%= link_to(page.id, url_for(page)) %></td>
|
||||
|
||||
<td><%= link_to(page.position, url_for(page)) %></td>
|
||||
|
||||
<td><%= link_to(page.path, url_for(page)) %></td>
|
||||
|
||||
<td><%= link_to(page.url, url_for(page)) %></td>
|
||||
|
||||
<td><%= link_to(page.report_id, url_for(page)) %></td>
|
||||
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<div class="action-row">
|
||||
<%= link_to t("scaffold.link_new", model: Page.model_name.human), new_report_page_path(@report) %>
|
||||
</div>
|
||||
1
app/views/pages/index.json.jbuilder
Normal file
1
app/views/pages/index.json.jbuilder
Normal file
|
|
@ -0,0 +1 @@
|
|||
json.array! @pages, partial: "pages/page", as: :page
|
||||
12
app/views/pages/new.html.erb
Normal file
12
app/views/pages/new.html.erb
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
<h1><%= t("scaffold.pagetitle_new", model: Page.model_name.human) %></h1>
|
||||
|
||||
<%= turbo_frame_tag "new_page_frame" do %>
|
||||
<div class="border border-info p-3">
|
||||
<%= render "form", page: @page %>
|
||||
<%= link_to "Abbrechen", report_path(@page.report) %>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<div class="action-row">
|
||||
<%= link_to t("scaffold.link_index", model: Page.model_name.human(count: 2)), report_pages_path(@page.report) %>
|
||||
</div>
|
||||
9
app/views/pages/show.html.erb
Normal file
9
app/views/pages/show.html.erb
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
<h1><%= t("scaffold.pagetitle_show", model: @page.class.model_name.human) %></h1>
|
||||
|
||||
<%= render @page %>
|
||||
|
||||
<div class="action-row">
|
||||
<%= link_to t("scaffold.link_edit", model: @page.model_name.human), edit_page_path(@page) %>
|
||||
<%= link_to t("scaffold.link_index", model: @page.model_name.human(count: 2)), report_pages_path(@page.report) %>
|
||||
<%= button_to t("scaffold.link_destroy", model: @page.model_name.human), @page, method: :delete, class: "btn btn-outline-danger" %>
|
||||
</div>
|
||||
1
app/views/pages/show.json.jbuilder
Normal file
1
app/views/pages/show.json.jbuilder
Normal file
|
|
@ -0,0 +1 @@
|
|||
json.partial! "pages/page", page: @page
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
<%= bootstrap_form_with(model: report) do |form| %>
|
||||
<%= form.text_field :name %>
|
||||
<%= form.rich_text_area :comment_html %>
|
||||
<%= form.rich_text_area :comment %>
|
||||
<%= form.submit %>
|
||||
<% end %>
|
||||
|
|
|
|||
|
|
@ -1 +0,0 @@
|
|||
<%= link_to "#{tag.i(class: "bi bi-plus-lg")} Neues Element".html_safe, new_element_path(report_id: report.id), class: "btn btn-primary" %>
|
||||
1
app/views/reports/_new_page_button.html.erb
Normal file
1
app/views/reports/_new_page_button.html.erb
Normal file
|
|
@ -0,0 +1 @@
|
|||
<%= link_to "#{tag.i(class: "bi bi-plus-lg")} Neuer Pfad".html_safe, new_report_page_path(report), class: "btn btn-primary" %>
|
||||
|
|
@ -6,7 +6,7 @@
|
|||
|
||||
<p>
|
||||
<strong>Comment:</strong>
|
||||
<%= report.comment_html %>
|
||||
<%= report.comment %>
|
||||
</p>
|
||||
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
json.extract! report, :id, :name, :comment_html, :created_at, :updated_at
|
||||
json.extract! report, :id, :name, :comment, :created_at, :updated_at
|
||||
json.url report_url(report, format: :json)
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@
|
|||
|
||||
<th><%= Report.human_attribute_name(:name) %></th>
|
||||
|
||||
<th><%= Report.human_attribute_name(:comment_html) %></th>
|
||||
<th><%= Report.human_attribute_name(:comment) %></th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
</thead>
|
||||
|
|
@ -18,7 +18,7 @@
|
|||
|
||||
<td><%= link_to(report.name, url_for(report)) %></td>
|
||||
|
||||
<td><%= link_to(truncate(report.comment_html.to_plain_text), url_for(report)) if report.comment_html %></td>
|
||||
<td><%= link_to(truncate(report.comment.to_plain_text), url_for(report)) if report.comment %></td>
|
||||
<td><%= l(report.created_at, format: :short) %></td>
|
||||
<td><%= l(report.updated_at, format: :short) %></td>
|
||||
</tr>
|
||||
|
|
|
|||
|
|
@ -4,22 +4,22 @@
|
|||
zuletzt bearbeitet am <%= l(@report.updated_at, format: :short) %>
|
||||
</p>
|
||||
|
||||
<% if @report.comment_html %>
|
||||
<% if @report.comment %>
|
||||
<div class="mt-2 mb-4 lead">
|
||||
<%= @report.comment_html %>
|
||||
<%= @report.comment %>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<div class="border-top pt-3">
|
||||
<%= turbo_frame_tag "new_element_frame" do %>
|
||||
<%= render partial: "reports/new_element_button", locals: { report: @report } %>
|
||||
<%= turbo_frame_tag "new_page_frame" do %>
|
||||
<%= render partial: "reports/new_page_button", locals: { report: @report } %>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<div id="element_list">
|
||||
<% @report.elements.each do |element| %>
|
||||
<%= turbo_frame_tag dom_id(element, :frame) do %>
|
||||
<%= render element %>
|
||||
<div id="page_list">
|
||||
<% @report.pages.each do |page| %>
|
||||
<%= turbo_frame_tag dom_id(page, :frame) do %>
|
||||
<%= render page %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</div>
|
||||
47
app/views/reports/show.html.slim
Normal file
47
app/views/reports/show.html.slim
Normal file
|
|
@ -0,0 +1,47 @@
|
|||
h1
|
||||
i.bi.bi-journal-text.me-2
|
||||
= @report.name
|
||||
p.small
|
||||
| Erstellt am
|
||||
= l(@report.created_at, format: :short)
|
||||
| , zuletzt bearbeitet am
|
||||
= l(@report.updated_at, format: :short)
|
||||
- if @report.comment
|
||||
.mt-2.mb-4.lead
|
||||
= @report.comment
|
||||
= turbo_frame_tag "nav" do
|
||||
.row
|
||||
.col-lg-3.col-md-6.col-sm-12
|
||||
nav.nav.nav-pills.flex-column.mb-3#page_list
|
||||
- @report.pages.each do |page|
|
||||
= link_to(page.path, report_path(@report, page_id: page.id), class: "nav-link#{@current_page&.id == page.id ? " active" : nil }")
|
||||
= turbo_frame_tag "new_page_frame" do
|
||||
= render partial: "reports/new_page_button", locals: { report: @report }
|
||||
.col-lg-9.col-md-6.col-sm-12
|
||||
- if @current_page
|
||||
= render @current_page
|
||||
- else
|
||||
'Gehen Sie weiter, hier gibt es nichts zu sehen.
|
||||
.action-row
|
||||
= link_to report_path(@report, format: :pdf), class: "btn btn-secondary", target: "_blank" do
|
||||
i.bi.bi-filetype-pdf
|
||||
| PDF
|
||||
= link_to report_path(@report, format: :docx), class: "btn btn-secondary", target: "_blank" do
|
||||
i.bi.bi-filetype-docx
|
||||
| DOCX
|
||||
= link_to report_path(@report, format: :xlsx), class: "btn btn-secondary", target: "_blank" do
|
||||
i.bi.bi-filetype-xlsx
|
||||
| XLSX
|
||||
= link_to report_path(@report, format: :rtf), class: "btn btn-secondary", target: "_blank" do
|
||||
i.bi.bi-file-richtext
|
||||
| RTF
|
||||
= link_to report_path(@report, format: :xml), class: "btn btn-secondary", target: "_blank" do
|
||||
i.bi.bi-filetype-html
|
||||
| HTML
|
||||
= link_to report_path(@report, format: :odt), class: "btn btn-secondary", target: "_blank" do
|
||||
i.bi.bi-file-richtext
|
||||
| ODT
|
||||
.action-row
|
||||
= 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"
|
||||
|
|
@ -8,9 +8,9 @@
|
|||
zuletzt bearbeitet am <%= l(@report.updated_at, format: :short) %>
|
||||
</small>
|
||||
|
||||
<% if @report.comment_html %>
|
||||
<% if @report.comment %>
|
||||
<div>
|
||||
<%= @report.comment_html %>
|
||||
<%= @report.comment %>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
|
|
|
|||
|
|
@ -4,13 +4,13 @@
|
|||
zuletzt bearbeitet am <%= l(@report.updated_at, format: :short) %>
|
||||
</p>
|
||||
|
||||
<% if @report.comment_html %>
|
||||
<% if @report.comment %>
|
||||
<div class="mt-2 mb-4 lead">
|
||||
<%= @report.comment_html %>
|
||||
<%= @report.comment %>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<div class="border-top pt-3">
|
||||
<div class="pt-3">
|
||||
<%= turbo_frame_tag "new_element_frame" do %>
|
||||
<%= render partial: "reports/new_element_button", locals: { report: @report } %>
|
||||
<% end %>
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
<div class="collapse show" id="collapseSuccessCriterion_<%= success_criterion.id %>">
|
||||
<div class="card-body">
|
||||
<%= bootstrap_form_with(model: success_criterion) do |form| %>
|
||||
<%= bootstrap_form_with(model: success_criterion.persisted? ? success_criterion : [:element, success_criterion]) do |form| %>
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<div class="btn-group" role="group" aria-label="Resultat">
|
||||
|
|
@ -28,11 +28,13 @@
|
|||
<%= 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.rich_text_area :quick_criterion %>
|
||||
<%= form.rich_text_area :quick_fail %>
|
||||
<%= form.rich_text_area :quick_fix %>
|
||||
<%= form.rich_text_area :test_comment %>
|
||||
<%= form.submit class: "btn btn-warning" %>
|
||||
<%= link_to "Abbrechen", success_criterion, class: "btn btn-outline-secondary" %>
|
||||
<%= link_to "Abbrechen", success_criterion.persisted? ? success_criterion : success_criterion.element, class: "btn btn-outline-secondary" %>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@
|
|||
<span class="badge rounded-pill text-bg-secondary">
|
||||
<%= success_criterion.level %>
|
||||
</span>
|
||||
<% if success_criterion.comment_html.present? %>
|
||||
<% if success_criterion.test_comment.present? %>
|
||||
<i class="bi bi-chat"></i>
|
||||
<% end %>
|
||||
<% if false && action_name == "edit" %>
|
||||
|
|
|
|||
|
|
@ -1,35 +1,39 @@
|
|||
<% expanded = false unless defined?(expanded) %>
|
||||
<div id="<%= dom_id success_criterion %>" class="card mt-3">
|
||||
<%== 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>
|
||||
<%= turbo_frame_tag(dom_id(success_criterion, :frame)) do %>
|
||||
<% expanded = false unless defined?(expanded) %>
|
||||
<div id="<%= dom_id success_criterion %>" class="card mt-3">
|
||||
<%== 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>
|
||||
<%# 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 %>
|
||||
<% end %>
|
||||
<%= success_criterion.quick_criterion %>
|
||||
<%= success_criterion.quick_fail %>
|
||||
<%= success_criterion.quick_fix %>
|
||||
<% if success_criterion.test_comment.present? %>
|
||||
<div class="comment mt-3"><%= success_criterion.test_comment %></div>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
json.extract! success_criterion, :id, :element_id, :title, :description_html, :level, :result, :comment_html,
|
||||
json.extract! success_criterion, :id, :element_id, :title, :description_html, :level, :result, :comment,
|
||||
:created_at, :updated_at
|
||||
json.url success_criterion_url(success_criterion, format: :json)
|
||||
|
|
|
|||
2
app/views/success_criteria/create.turbo_stream.erb
Normal file
2
app/views/success_criteria/create.turbo_stream.erb
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
<%= turbo_stream.update dom_id(@success_criterion.element, "new_success_criterion_frame"), partial: "elements/new_success_criterion_button", locals: { element: @success_criterion.element } %>
|
||||
<%= turbo_stream.append dom_id(@success_criterion.element, "success_criteria_list"), @success_criterion %>
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
<%= turbo_stream.update dom_id(@success_criteria.first.element, "new_success_criterion_frame"), partial: "elements/new_success_criterion_button", locals: { element: @success_criteria.first.element } %>
|
||||
|
||||
<% @success_criteria.each do |success_criterion| %>
|
||||
<%= turbo_stream.append dom_id(success_criterion.element, "success_criteria_list"), success_criterion %>
|
||||
<% end %>
|
||||
|
|
@ -6,5 +6,5 @@
|
|||
|
||||
<div class="action-row">
|
||||
<%= link_to t("scaffold.link_show", model: SuccessCriterion.model_name.human), @success_criterion %>
|
||||
<%= link_to t("scaffold.link_index", model: SuccessCriterion.model_name.human(count: 2)), success_criteria_path %>
|
||||
<%= link_to t("scaffold.link_index", model: SuccessCriterion.model_name.human(count: 2)), element_success_criteria_path(@success_criterion.element) %>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -9,13 +9,11 @@
|
|||
|
||||
<th><%= SuccessCriterion.human_attribute_name(:title) %></th>
|
||||
|
||||
<th><%= SuccessCriterion.human_attribute_name(:description_html) %></th>
|
||||
|
||||
<th><%= SuccessCriterion.human_attribute_name(:level) %></th>
|
||||
|
||||
<th><%= SuccessCriterion.human_attribute_name(:result) %></th>
|
||||
|
||||
<th><%= SuccessCriterion.human_attribute_name(:comment_html) %></th>
|
||||
<th><%= SuccessCriterion.human_attribute_name(:test_comment) %></th>
|
||||
|
||||
</thead>
|
||||
<tbody>
|
||||
|
|
@ -27,13 +25,11 @@
|
|||
|
||||
<td><%= link_to(success_criterion.title, url_for(success_criterion)) %></td>
|
||||
|
||||
<td><%= link_to(truncate(success_criterion.description_html.to_plain_text), url_for(success_criterion)) %></td>
|
||||
|
||||
<td><%= link_to(success_criterion.level, url_for(success_criterion)) %></td>
|
||||
|
||||
<td><%= link_to(success_criterion.result, url_for(success_criterion)) %></td>
|
||||
|
||||
<td><%= link_to(truncate(success_criterion.comment_html.to_plain_text), url_for(success_criterion)) %></td>
|
||||
<td><%= link_to(truncate(success_criterion.test_comment.to_plain_text), url_for(success_criterion)) %></td>
|
||||
|
||||
</tr>
|
||||
<% end %>
|
||||
|
|
@ -41,5 +37,5 @@
|
|||
</table>
|
||||
|
||||
<div class="action-row">
|
||||
<%= link_to t("scaffold.link_new", model: SuccessCriterion.model_name.human), new_success_criterion_path %>
|
||||
<%= link_to t("scaffold.link_new", model: SuccessCriterion.model_name.human), new_element_success_criterion_path(@element) %>
|
||||
</div>
|
||||
|
|
@ -1,7 +0,0 @@
|
|||
<h1><%= t("scaffold.pagetitle_new", model: SuccessCriterion.model_name.human) %></h1>
|
||||
|
||||
<%= render "form", success_criterion: @success_criterion %>
|
||||
|
||||
<div class="action-row">
|
||||
<%= link_to t("scaffold.link_index", model: SuccessCriterion.model_name.human(count: 2)), success_criteria_path %>
|
||||
</div>
|
||||
21
app/views/success_criteria/new.html.erb.old
Normal file
21
app/views/success_criteria/new.html.erb.old
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
<h1><%= t("scaffold.pagetitle_new", model: SuccessCriterion.model_name.human) %></h1>
|
||||
|
||||
<%= turbo_frame_tag dom_id(@success_criterion.element, "new_success_criterion_frame") do %>
|
||||
<div id="<%= dom_id @success_criterion %>" class="card mt-3">
|
||||
<%== render partial: "success_criteria/header", locals: { success_criterion: @success_criterion.tap { _1.title = "Neu" } } %>
|
||||
|
||||
<div class="collapse show" id="collapseSuccessCriterion_<%= @success_criterion.id %>">
|
||||
<div class="card-body">
|
||||
<%= bootstrap_form_with(model: @success_criterion.persisted? ? @success_criterion : [:element, @success_criterion]) do |form| %>
|
||||
<%= form.collection_select :check_id, Check.all.order(:external_number), :id, :display_label %>
|
||||
<%= form.submit class: "btn btn-warning" %>
|
||||
<%= link_to "Abbrechen", @success_criterion.persisted? ? @success_criterion : @success_criterion.element, class: "btn btn-outline-secondary" %>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
<%# <%= link_to "edit", url_for([:edit, success_criterion]) %>
|
||||
</div>
|
||||
<% end %>
|
||||
<div class="action-row">
|
||||
<%= link_to t("scaffold.link_index", model: SuccessCriterion.model_name.human(count: 2)), element_success_criteria_path(@element) %>
|
||||
</div>
|
||||
11
app/views/success_criteria/new.html.slim
Normal file
11
app/views/success_criteria/new.html.slim
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
h1
|
||||
= t("scaffold.pagetitle_new", model: SuccessCriterion.model_name.human)
|
||||
= turbo_frame_tag dom_id(@success_criterion.element, "new_success_criterion_frame") do
|
||||
.border.border-info.p-3
|
||||
= bootstrap_form_with(model: @success_criterion.persisted? ? @success_criterion : [:element, @success_criterion]) do |form|
|
||||
= form.collection_select :check_id, Check.all.order(:external_number), :id, :display_label
|
||||
= form.submit class: "btn btn-warning"
|
||||
= link_to "Abbrechen", @success_criterion.persisted? ? @success_criterion : @success_criterion.element, class: "btn btn-outline-secondary"
|
||||
|
||||
.action-row
|
||||
= link_to t("scaffold.link_index", model: SuccessCriterion.model_name.human(count: 2)), element_success_criteria_path(@element)
|
||||
8
app/views/success_criteria/new_from_checklist.html.slim
Normal file
8
app/views/success_criteria/new_from_checklist.html.slim
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
|
||||
|
||||
= turbo_frame_tag dom_id(@success_criterion.element, :new_success_criterion_frame) do
|
||||
.border.border-info.p-3
|
||||
= bootstrap_form_with(url: create_from_checklist_element_success_criteria_path(@success_criterion.element), name: :new_from_checklist) do |form|
|
||||
= form.collection_select :checklist_id, Checklist.all.order(:name), :id, :name
|
||||
= form.submit class: "btn btn-warning"
|
||||
= link_to "Abbrechen", @success_criterion.persisted? ? @success_criterion : @success_criterion.element, class: "btn btn-outline-secondary"
|
||||
|
|
@ -1,11 +1,9 @@
|
|||
<h1><%= t("scaffold.pagetitle_show", model: @success_criterion.class.model_name.human) %></h1>
|
||||
|
||||
<%= turbo_frame_tag(dom_id(@success_criterion, :frame)) do %>
|
||||
<% render partial: "success_criteria/success_criterion", locals: { success_criterion: @success_criterion, expanded: true } %>
|
||||
<% end %>
|
||||
<%= render partial: "success_criteria/success_criterion", locals: { success_criterion: @success_criterion, expanded: true } %>
|
||||
|
||||
<div class="action-row">
|
||||
<%= link_to t("scaffold.link_edit", model: @success_criterion.model_name.human), edit_success_criterion_path(@success_criterion) %>
|
||||
<%= link_to t("scaffold.link_index", model: @success_criterion.model_name.human(count: 2)), success_criteria_path %>
|
||||
<%= link_to t("scaffold.link_index", model: @success_criterion.model_name.human(count: 2)), element_success_criteria_path(@success_criterion.element) %>
|
||||
<%= button_to t("scaffold.link_destroy", model: @success_criterion.model_name.human), @success_criterion, method: :delete, class: "btn btn-outline-danger" %>
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue