First step of online html export
This commit is contained in:
parent
d2165a484c
commit
5e0539d7c6
7 changed files with 264 additions and 16 deletions
55
app/views/exports/show.html.slim
Normal file
55
app/views/exports/show.html.slim
Normal file
|
|
@ -0,0 +1,55 @@
|
|||
h1 id=dom_id(@report) = @report.name
|
||||
|
||||
h2#toc Inhaltsverzeichnis
|
||||
nav
|
||||
= link_to(@report.name, "##{dom_id(@report)}")
|
||||
ul
|
||||
li = link_to("Inhaltsverzeichnis", "#toc")
|
||||
li
|
||||
= link_to('Testbericht')
|
||||
ul
|
||||
- @report.pages.select { |p| p.elements.any? { |e| e.success_criteria.any?(&:failed?) } }.each do |page|
|
||||
li
|
||||
= link_to("#{page.position} #{page.path}", "##{dom_id(page)}")
|
||||
ul
|
||||
- page.elements.select { |e| e.success_criteria.any?(&:failed?) }.each do |element|
|
||||
li
|
||||
= link_to("#{element.number} #{element.title}")
|
||||
ul
|
||||
- element.success_criteria.select(&:failed?).each do |sc|
|
||||
li = link_to("#{sc.number} #{sc.title}", "##{dom_id(sc)}")
|
||||
li
|
||||
= link_to("Anhang")
|
||||
ul
|
||||
- @failed_success_criteria.group_by(&:check).each do |check, scs|
|
||||
li = link_to(check.display_label)
|
||||
|
||||
|
||||
h2 Testbericht
|
||||
- @report.pages.select { |p| p.elements.any? { |e| e.success_criteria.any? { _1.failed? } } }.each do |page|
|
||||
h3 = "#{page.position} #{page.path}"
|
||||
- page.elements { |e| e.success_criteria.any? { _1.failed? } }.each do |element|
|
||||
h4 = "#{element.number} #{element.title}"
|
||||
- element.success_criteria.select{ _1.failed? }.each do |sc|
|
||||
h5 = "#{sc.number} #{sc.title}"
|
||||
- if sc.test_comment?
|
||||
p = sc.test_comment
|
||||
dl
|
||||
dt Kriterium
|
||||
dd = sc.quick_criterion
|
||||
dt Fail
|
||||
dd = sc.quick_fail
|
||||
dt Fix
|
||||
dd = sc.quick_fix
|
||||
dt WCAG
|
||||
dd = link_to(sc.check.external_number, sc.check.external_url)
|
||||
|
||||
h2 Anhang
|
||||
|
||||
h3 Liste der zu beachtenden WCAG Regeln
|
||||
|
||||
- @failed_success_criteria.group_by(&:check).each do |check, scs|
|
||||
h4 = check.display_label
|
||||
= check.criterion_de
|
||||
strong Erfolgskriterien
|
||||
p = scs.map(&:number).join(", ")
|
||||
12
app/views/layouts/exports.html.slim
Normal file
12
app/views/layouts/exports.html.slim
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
doctype html
|
||||
html data-bs-theme="light" data-controller="set-theme"
|
||||
head
|
||||
title a11ydive Export
|
||||
meta[name="viewport" content="width=device-width,initial-scale=1"]
|
||||
= csrf_meta_tags
|
||||
= csp_meta_tag
|
||||
= stylesheet_link_tag "exports", "data-turbo-track": "reload"
|
||||
= javascript_include_tag "application", "data-turbo-track": "reload", type: "module"
|
||||
body
|
||||
main#main-content
|
||||
= yield
|
||||
|
|
@ -37,22 +37,25 @@ h1
|
|||
- 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
|
||||
= link_to(report_export_path(@report), 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
|
||||
| Online HTML
|
||||
/ = 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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue