Requested gui improvements
This commit is contained in:
parent
98a5f96989
commit
d1a4eeea30
16 changed files with 152 additions and 98 deletions
|
|
@ -1,3 +1,6 @@
|
||||||
|
$tertiary: $gray-300;
|
||||||
|
$tertiary-dark: $gray-700;
|
||||||
|
|
||||||
.action-row {
|
.action-row {
|
||||||
@extend .d-flex;
|
@extend .d-flex;
|
||||||
@extend .p-2;
|
@extend .p-2;
|
||||||
|
|
@ -155,17 +158,7 @@ details.tree {
|
||||||
}
|
}
|
||||||
|
|
||||||
>summary.active {
|
>summary.active {
|
||||||
border-left: solid 8px $primary;
|
background-color: $tertiary;
|
||||||
|
|
||||||
.content {
|
|
||||||
padding-right: 16px;
|
|
||||||
border-right: solid 8px $primary;
|
|
||||||
}
|
|
||||||
|
|
||||||
// border: solid 1px $primary;
|
|
||||||
// background-color: $gray-800;
|
|
||||||
padding-left: 8px;
|
|
||||||
// padding-top: 8px;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
>summary::before {
|
>summary::before {
|
||||||
|
|
@ -197,7 +190,7 @@ details.tree {
|
||||||
}
|
}
|
||||||
|
|
||||||
li:has(a.active) {
|
li:has(a.active) {
|
||||||
border-left: solid 2px $primary;
|
border-left: solid 2px $tertiary;
|
||||||
padding-left: 36px;
|
padding-left: 36px;
|
||||||
// background-color: $gray-900;
|
// background-color: $gray-900;
|
||||||
}
|
}
|
||||||
|
|
@ -205,9 +198,19 @@ details.tree {
|
||||||
}
|
}
|
||||||
|
|
||||||
@include color-mode(dark) {
|
@include color-mode(dark) {
|
||||||
details.tree summary::before {
|
details.tree {
|
||||||
|
summary::before {
|
||||||
@include details-icon(to-rgb(map-get($theme-colors, "light")));
|
@include details-icon(to-rgb(map-get($theme-colors, "light")));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
summary.active {
|
||||||
|
background-color: $tertiary-dark;
|
||||||
|
}
|
||||||
|
|
||||||
|
ul li:has(a.active) {
|
||||||
|
border-left: solid 2px $tertiary-dark;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
details.tree[open]>summary::before {
|
details.tree[open]>summary::before {
|
||||||
|
|
@ -233,39 +236,68 @@ details.tree[open]>summary::before {
|
||||||
}
|
}
|
||||||
|
|
||||||
.sc-level {
|
.sc-level {
|
||||||
font-size: 0.5rem;
|
// font-size: 0.5rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
details.success_criterion {
|
details.success_criterion {
|
||||||
|
|
||||||
summary:hover {
|
summary:hover {
|
||||||
background-color: $secondary;
|
background-color: $tertiary;
|
||||||
|
|
||||||
|
|
||||||
// border-right: solid 4px $primary;
|
// border-right: solid 4px $primary;
|
||||||
}
|
}
|
||||||
|
|
||||||
// padding-left: 22px;
|
// padding-left: 22px;
|
||||||
.result-icon {
|
.result-icon {
|
||||||
width: 3rem;
|
width: 3rem;
|
||||||
margin-right: 1rem;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
>.content {
|
>.content {
|
||||||
padding-left: 4rem;
|
padding-left: 1rem;
|
||||||
padding-right: 1rem;
|
padding-right: 1rem;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// details.success_criterion::details-content {
|
|
||||||
// padding-left: 4rem;
|
@include color-mode(dark) {
|
||||||
// }
|
details.success_criterion {
|
||||||
|
summary:hover {
|
||||||
|
background-color: $tertiary-dark;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
details.success_criterion[open] {
|
details.success_criterion[open] {
|
||||||
// padding-left: 8px;
|
// padding-left: 8px;
|
||||||
border-right: solid 16px $primary;
|
border: solid 1px $tertiary;
|
||||||
margin-bottom: 2rem;
|
margin-bottom: 2rem;
|
||||||
padding-bottom: 1rem;
|
padding-bottom: 1rem;
|
||||||
border-bottom: solid 1px $secondary;
|
|
||||||
|
summary {
|
||||||
|
background-color: $tertiary;
|
||||||
|
}
|
||||||
|
|
||||||
|
summary:hover {
|
||||||
|
background-color: shade-color($tertiary, 30%);
|
||||||
|
// border-right: solid 4px $primary;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@include color-mode(dark) {
|
||||||
|
details.success_criterion[open] {
|
||||||
|
// padding-left: 8px;
|
||||||
|
border: solid 1px $tertiary-dark;
|
||||||
|
|
||||||
|
summary {
|
||||||
|
background-color: $tertiary-dark;
|
||||||
|
}
|
||||||
|
|
||||||
|
summary:hover {
|
||||||
|
background-color: shade-color($tertiary-dark, 30%);
|
||||||
|
// border-right: solid 4px $primary;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
details.success_criterion.passed {
|
details.success_criterion.passed {
|
||||||
|
|
|
||||||
|
|
@ -10,6 +10,7 @@ class ReportsController < ApplicationController
|
||||||
|
|
||||||
# GET /reports/1
|
# GET /reports/1
|
||||||
def show
|
def show
|
||||||
|
@page_nav_mode = params[:pnm] == "c" ? :comment : :nav_tree
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.html do
|
format.html do
|
||||||
@current_page = page_param && @report.pages.find(page_param) || @report.pages.first
|
@current_page = page_param && @report.pages.find(page_param) || @report.pages.first
|
||||||
|
|
|
||||||
|
|
@ -39,6 +39,10 @@ module SuccessCriteriaHelper
|
||||||
end
|
end
|
||||||
link_to tag.i(class: "bi bi-pencil"),
|
link_to tag.i(class: "bi bi-pencil"),
|
||||||
path,
|
path,
|
||||||
class: "btn btn-#{edit_mode ? 'link text-warning' : 'link text-secondary'}"
|
class: "btn btn-#{edit_mode ? 'link text-warning' : 'link text-body'}"
|
||||||
|
end
|
||||||
|
|
||||||
|
def success_criterion_badge(content, extra_classes: "")
|
||||||
|
tag.span(content, class: "badge #{extra_classes}")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
9
app/views/elements/_page_nav_row.html.slim
Normal file
9
app/views/elements/_page_nav_row.html.slim
Normal file
|
|
@ -0,0 +1,9 @@
|
||||||
|
li
|
||||||
|
- if current_page
|
||||||
|
=< link_to("##{dom_id(element)}", data: { "turbo": false }) do
|
||||||
|
i.bi.bi-boxes.me-1
|
||||||
|
=< "#{element.number} #{element.title}"
|
||||||
|
- else
|
||||||
|
=< link_to(report_path(element.report, page_id: element.page.id, anchor: dom_id(element)), data: { "turbo": false }) do
|
||||||
|
i.bi.bi-boxes.me-1
|
||||||
|
=< "#{element.number} #{element.title}"
|
||||||
|
|
@ -1,5 +1,3 @@
|
||||||
= turbo_stream.update "new_element_frame", partial: "pages/new_element_button", locals: { page: @element.page }
|
= turbo_stream.update "new_element_frame", partial: "pages/new_element_button", locals: { page: @element.page }
|
||||||
= turbo_stream.append "element_list", @element
|
= turbo_stream.append "element_list", @element
|
||||||
= turbo_stream.append dom_id(@element.page, :page_nav_elements) do
|
= turbo_stream.append dom_id(@element.page, :page_nav_elements), partial: "elements/page_nav_row", locals: { element: @element, current_page: true }
|
||||||
i.bi.bi-boxes.me-1
|
|
||||||
= link_to("#{@element.number} #{@element.title}", "##{dom_id(@element)}", data: { "turbo": false })
|
|
||||||
|
|
@ -1,9 +1,7 @@
|
||||||
<h1><%= t("scaffold.pagetitle_new", model: Element.model_name.human) %></h1>
|
<h1><%= t("scaffold.pagetitle_new", model: Element.model_name.human) %></h1>
|
||||||
|
|
||||||
<%= turbo_frame_tag "new_element_frame" do %>
|
<%= turbo_frame_tag "new_element_frame" do %>
|
||||||
<div class="border border-info p-3">
|
|
||||||
<%= render "form", element: @element %>
|
<%= render "form", element: @element %>
|
||||||
</div>
|
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
<div class="action-row">
|
<div class="action-row">
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,3 @@
|
||||||
.mt-5
|
= bootstrap_form_with(model: page, class: "mt-3") do |form|
|
||||||
= bootstrap_form_with(model: page) do |form|
|
|
||||||
= form.text_area :notes, rows: [(page.notes&.count("\n") || 0) + 1, 10].max, placeholder: "Hier kannst du Notizen speichern. \n\nJeder Pfad hat seine eigenen Notizen.", hide_label: true
|
= form.text_area :notes, rows: [(page.notes&.count("\n") || 0) + 1, 10].max, placeholder: "Hier kannst du Notizen speichern. \n\nJeder Pfad hat seine eigenen Notizen.", hide_label: true
|
||||||
= form.submit "Speichern"
|
= form.submit "Speichern"
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
<div id="<%= dom_id page %>" class="mb-3"data-bs-scrollspy-target="#<%= dom_id(page.report, :page_nav) %>" data-controller="bs-scrollspy">
|
<div id="<%= dom_id page %>" class="mb-3"data-bs-scrollspy-target="#<%= dom_id(page.report, :page_nav_spy) %>" data-controller="bs-scrollspy">
|
||||||
<h2>
|
<h2>
|
||||||
<i class="bi bi-file-earmark-check"></i>
|
<i class="bi bi-file-earmark-check"></i>
|
||||||
<%= page.position %> <%= page.path %></h2>
|
<%= page.position %> <%= page.path %></h2>
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,7 @@
|
||||||
<h1><%= t("scaffold.pagetitle_new", model: Page.model_name.human) %></h1>
|
<h1><%= t("scaffold.pagetitle_new", model: Page.model_name.human) %></h1>
|
||||||
|
|
||||||
<%= turbo_frame_tag "new_page_frame" do %>
|
<%= turbo_frame_tag "new_page_frame" do %>
|
||||||
<div class="border border-info p-3">
|
|
||||||
<%= render "form", page: @page %>
|
<%= render "form", page: @page %>
|
||||||
</div>
|
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
<div class="action-row">
|
<div class="action-row">
|
||||||
|
|
|
||||||
|
|
@ -3,9 +3,6 @@ h1
|
||||||
|
|
||||||
= render @page
|
= render @page
|
||||||
|
|
||||||
= turbo_frame_tag(dom_id(@page, :notes)) do
|
|
||||||
= render partial: "pages/notes", locals: { page: @page }
|
|
||||||
|
|
||||||
.action-row
|
.action-row
|
||||||
= link_to t("scaffold.link_edit", model: @page.model_name.human), edit_page_path(@page)
|
= 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)
|
= link_to t("scaffold.link_index", model: @page.model_name.human(count: 2)), report_pages_path(@page.report)
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,12 @@
|
||||||
div id=dom_id(report, :page_nav)
|
div id=dom_id(report, :page_nav)
|
||||||
|
ul.nav.nav-underline
|
||||||
|
li.nav-item
|
||||||
|
= link_to("Baum", url_for(pnm: :n), class: "nav-link #{@page_nav_mode == :nav_tree ? "active david" : nil}")
|
||||||
|
li.nav-item
|
||||||
|
= link_to("Notizen", url_for(pnm: :c), class: "nav-link #{@page_nav_mode == :comment ? "active" : nil}")
|
||||||
|
- if @page_nav_mode == :nav_tree
|
||||||
- if report.pages.any?
|
- if report.pages.any?
|
||||||
details.switch open=true
|
nav.mt-3 id=dom_id(report, :page_nav_spy)
|
||||||
summary.justify-content-end
|
|
||||||
span Pfade
|
|
||||||
nav
|
|
||||||
ul
|
ul
|
||||||
- report.pages.each do |page|
|
- report.pages.each do |page|
|
||||||
- is_current = current_page == page
|
- is_current = current_page == page
|
||||||
|
|
@ -18,7 +21,8 @@ div id=dom_id(report, :page_nav)
|
||||||
=< link_to("#{page.position} #{page.path}", report_path(report, page_id: page.id), data: { "turbo-frame": :_top })
|
=< link_to("#{page.position} #{page.path}", report_path(report, page_id: page.id), data: { "turbo-frame": :_top })
|
||||||
ul id=dom_id(page, :page_nav_elements)
|
ul id=dom_id(page, :page_nav_elements)
|
||||||
- page.elements.each do |element|
|
- page.elements.each do |element|
|
||||||
li
|
= render partial: "elements/page_nav_row", locals: { element: element, current_page: current_page == element.page }
|
||||||
|
/li
|
||||||
- if current_page == page
|
- if current_page == page
|
||||||
=< link_to("##{dom_id(element)}", data: { "turbo": false }) do
|
=< link_to("##{dom_id(element)}", data: { "turbo": false }) do
|
||||||
i.bi.bi-boxes.me-1
|
i.bi.bi-boxes.me-1
|
||||||
|
|
@ -29,3 +33,6 @@ div id=dom_id(report, :page_nav)
|
||||||
=< "#{element.number} #{element.title}"
|
=< "#{element.number} #{element.title}"
|
||||||
= turbo_frame_tag "new_page_frame" do
|
= turbo_frame_tag "new_page_frame" do
|
||||||
= render partial: "reports/new_page_button", locals: { report: report }
|
= render partial: "reports/new_page_button", locals: { report: report }
|
||||||
|
- else
|
||||||
|
= turbo_frame_tag(dom_id(current_page, :notes)) do
|
||||||
|
= render partial: "pages/notes", locals: { page: current_page }
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,7 @@ h1
|
||||||
.col-lg-4.col-md-6.col-sm-12
|
.col-lg-4.col-md-6.col-sm-12
|
||||||
.page_nav.sticky-top
|
.page_nav.sticky-top
|
||||||
= render partial: "reports/page_nav", locals: { report: @report, current_page: @current_page }
|
= render partial: "reports/page_nav", locals: { report: @report, current_page: @current_page }
|
||||||
- if @current_page
|
- if @current_page && false
|
||||||
= turbo_frame_tag(dom_id(@current_page, :notes)) do
|
= turbo_frame_tag(dom_id(@current_page, :notes)) do
|
||||||
= render partial: "pages/notes", locals: { page: @current_page }
|
= render partial: "pages/notes", locals: { page: @current_page }
|
||||||
.col-lg-8.col-md-6.col-sm-12
|
.col-lg-8.col-md-6.col-sm-12
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,8 @@
|
||||||
.row
|
.row
|
||||||
.col
|
.col
|
||||||
= bootstrap_form_with(model: success_criterion, data: { controller: "autosubmit" }) do |form|
|
= bootstrap_form_with(model: success_criterion, data: { controller: "autosubmit" }) do |form|
|
||||||
span.float-end
|
.position-relative
|
||||||
|
.position-absolute.top-0.end-0.fw-bold
|
||||||
= success_criterion_edit_button(success_criterion, false)
|
= success_criterion_edit_button(success_criterion, false)
|
||||||
.my-3.btn-group[role="group" aria-label="Resultat"]
|
.my-3.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)
|
= form.radio_button_without_bootstrap :result, :passed, class: "btn-check", autocomplete: "off", id: dom_id(success_criterion, :result_passed)
|
||||||
|
|
@ -15,33 +16,36 @@
|
||||||
/= form.radio_button_without_bootstrap :result, nil, class: "btn-check", autocomplete: "off", id: dom_id(success_criterion, :result_not_applicable)
|
/= form.radio_button_without_bootstrap :result, nil, class: "btn-check", autocomplete: "off", id: dom_id(success_criterion, :result_not_applicable)
|
||||||
/label.btn.btn-outline-secondary for=dom_id(success_criterion, :nil) Reset
|
/label.btn.btn-outline-secondary for=dom_id(success_criterion, :nil) Reset
|
||||||
.row
|
.row
|
||||||
|
.col
|
||||||
|
- if success_criterion.test_comment?
|
||||||
|
.comment = success_criterion.test_comment
|
||||||
|
- else
|
||||||
|
= bootstrap_form_with(model: success_criterion) do |form|
|
||||||
|
= form.rich_text_area :test_comment, placeholder: "Test Kommentar", hide_label: true
|
||||||
|
= form.submit "Kommentar speichern", class: "btn btn-secondary float-end"
|
||||||
|
|
||||||
|
.row.mb-4
|
||||||
.col-md-4.col-lg-3
|
.col-md-4.col-lg-3
|
||||||
'WCAG/ID
|
.text-end.fw-bold WCAG/ID
|
||||||
.col-md-8.col-lg-9
|
.col-md-8.col-lg-9
|
||||||
= link_to("#{success_criterion.check.external_number}/#{success_criterion.check.id}", success_criterion.check, data: { turbo_frame: "_top"}, target: :_blank)
|
= link_to("#{success_criterion.check.external_number}/#{success_criterion.check.id}", success_criterion.check, data: { turbo_frame: "_top"}, target: :_blank)
|
||||||
.row
|
.row.mb-4
|
||||||
.col-md-4.col-lg-3
|
.col-md-4.col-lg-3
|
||||||
= SuccessCriterion.human_attribute_name(:quick_criterion)
|
.text-end.fw-bold = SuccessCriterion.human_attribute_name(:quick_criterion)
|
||||||
.col-md-8.col-lg-9
|
.col-md-8.col-lg-9
|
||||||
= success_criterion.quick_criterion
|
= success_criterion.quick_criterion
|
||||||
.row
|
.row.mb-4
|
||||||
.col-md-4.col-lg-3
|
.col-md-4.col-lg-3
|
||||||
= SuccessCriterion.human_attribute_name(:quick_fail)
|
.text-end.fw-bold = SuccessCriterion.human_attribute_name(:quick_fail)
|
||||||
.col-md-8.col-lg-9
|
.col-md-8.col-lg-9
|
||||||
= success_criterion.quick_fail
|
= success_criterion.quick_fail
|
||||||
.row
|
.row.mb-4
|
||||||
.col-md-4.col-lg-3
|
.col-md-4.col-lg-3
|
||||||
= SuccessCriterion.human_attribute_name(:quick_fix)
|
.text-end.fw-bold = SuccessCriterion.human_attribute_name(:quick_fix)
|
||||||
.col-md-8.col-lg-9
|
.col-md-8.col-lg-9
|
||||||
= success_criterion.quick_fix
|
= success_criterion.quick_fix
|
||||||
- safe_display(success_criterion.check.test_instructions) do |i|
|
|
||||||
.row
|
.row
|
||||||
.col-md-4.col-lg-3
|
.col-md-4.col-lg-3
|
||||||
= SuccessCriterion.human_attribute_name(:test_instructions)
|
.text-end.fw-bold = SuccessCriterion.human_attribute_name(:test_instructions)
|
||||||
.col-md-8.col-lg-9
|
.col-md-8.col-lg-9
|
||||||
= i
|
= success_criterion.check.test_instructions
|
||||||
.row
|
|
||||||
.col
|
|
||||||
= bootstrap_form_with(model: success_criterion) do |form|
|
|
||||||
= form.rich_text_area :test_comment
|
|
||||||
= form.submit :speichern
|
|
||||||
|
|
|
||||||
|
|
@ -1,16 +1,22 @@
|
||||||
- edit_mode = action_name == "edit"
|
- edit_mode = action_name == "edit"
|
||||||
summary.d-flex.align-items-start id=dom_id(success_criterion, :header)
|
summary.d-flex.align-items-start id=dom_id(success_criterion, :header)
|
||||||
.content.d-flex.align-items-center
|
.content.d-flex.align-items-center
|
||||||
.result-icon.d-flex.justify-content-center class=[success_criterion_result_color_classes(success_criterion)]
|
.result-icon.d-flex.justify-content-center.mt-1 class=[success_criterion_result_color_classes(success_criterion)]
|
||||||
span.h1.bi class=[success_criterion_result_icon_classes(success_criterion)]
|
span.h1.bi class=[success_criterion_result_icon_classes(success_criterion)]
|
||||||
h4
|
h4.mt-2
|
||||||
= success_criterion.page.position
|
= success_criterion.page.position
|
||||||
| .
|
| .
|
||||||
= success_criterion.element.position
|
= success_criterion.element.position
|
||||||
| .
|
| .
|
||||||
= success_criterion.position
|
= success_criterion.position
|
||||||
|
span.me-2
|
||||||
=< success_criterion.title
|
=< success_criterion.title
|
||||||
.small.badge.rounded-pill.ms-2.mt-2.sc-level class="sc-level-#{success_criterion.level.to_s.downcase}"
|
|
||||||
= success_criterion.level
|
|
||||||
- if success_criterion.test_comment.present?
|
- if success_criterion.test_comment.present?
|
||||||
i.bi.bi-chat.ms-2
|
== tag.i(class: "bi bi-chat-fill me-2")
|
||||||
|
|
||||||
|
= success_criterion_badge(success_criterion.check.external_number, extra_classes: "text-bg-info me-1")
|
||||||
|
|
||||||
|
= success_criterion_badge(success_criterion.level, extra_classes: "sc-level sc-level-#{success_criterion.level.to_s.downcase} me-1")
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -15,6 +15,7 @@ de-CH:
|
||||||
quick_fail: Quick Fail
|
quick_fail: Quick Fail
|
||||||
quick_fix: Quick Fix
|
quick_fix: Quick Fix
|
||||||
title: Titel
|
title: Titel
|
||||||
|
test_instructions: Testanleitung
|
||||||
check:
|
check:
|
||||||
id: ID
|
id: ID
|
||||||
number: Nummer
|
number: Nummer
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,7 @@ module ActiveSupport
|
||||||
class TestCase
|
class TestCase
|
||||||
include ActionText::SystemTestHelper
|
include ActionText::SystemTestHelper
|
||||||
# Run tests in parallel with specified workers
|
# Run tests in parallel with specified workers
|
||||||
# parallelize(workers: :number_of_processors)
|
parallelize(workers: :number_of_processors)
|
||||||
|
|
||||||
# Setup all fixtures in test/fixtures/*.yml for all tests in alphabetical order.
|
# Setup all fixtures in test/fixtures/*.yml for all tests in alphabetical order.
|
||||||
fixtures :all
|
fixtures :all
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue