wip: wcag structure
This commit is contained in:
parent
4c31dbbed0
commit
4dd445be57
48 changed files with 461 additions and 137 deletions
|
|
@ -7,6 +7,12 @@
|
|||
<%= link_to Checklist.model_name.human(count: Checklist.count), :checklists %>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<i class="bi bi-rulers"></i>
|
||||
<%= Guideline.count %>
|
||||
<%= link_to Guideline.model_name.human(count: Guideline.count), :guidelines %>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<i class="bi bi-check2"></i>
|
||||
<%= Check.count %>
|
||||
|
|
@ -27,4 +33,4 @@
|
|||
<li>
|
||||
<%= link_to "ZIP Backup herunterladen", admin_backup_url(format: :zip), class: " ", data: { turbo_prefetch: false, frame: "_top", turbo: false } %>
|
||||
</li>
|
||||
</ul>
|
||||
</ul>
|
||||
|
|
|
|||
|
|
@ -11,8 +11,8 @@ div id=dom_id(check)
|
|||
th = Check.human_attribute_name(:number)
|
||||
td = check.number
|
||||
tr
|
||||
th = Principle.model_name.human
|
||||
td = check.principle&.t_name
|
||||
th = Guideline.model_name.human
|
||||
td = check.guideline&.name_en
|
||||
tr
|
||||
th = Standard.model_name.human(count: check.standard_ids.size)
|
||||
td = check.standards.map(&:t_name).sort_by(&:downcase).join(", ")
|
||||
|
|
@ -80,4 +80,4 @@ div id=dom_id(check)
|
|||
ul
|
||||
- check.links.select{ _1.link_category == category }.map { |link| link_to link.text, link.url, target: :_blank }.each do |link|
|
||||
li = link
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
= bootstrap_form_with(model: check, remote: true, data: { controller: "unsaved-changes" }) do |form|
|
||||
h2 Details
|
||||
= multilang_form_field(form, :name)
|
||||
= form.text_field :number, required: false
|
||||
.row
|
||||
= form.collection_radio_buttons(:principle_id, Principle.all.sort_by(&:t_name), :id, :t_name) { |b| b.label(class: "col-md-2") { b.radio_button + b.text } }
|
||||
= form.collection_radio_buttons(:guideline_id, Guideline.all.sort_by(&:full_number), :id, :to_s) { |b| b.label(class: "col-md-2") { b.radio_button + b.text } }
|
||||
= form.text_field :number, required: false
|
||||
= form.collection_check_boxes :standard_ids, Standard.all.sort_by{ _1.t_name.downcase }, :id, :t_name, include_blank: true
|
||||
|
||||
h2 Einschränkung/Zugänglichkeit
|
||||
|
|
|
|||
|
|
@ -6,4 +6,5 @@
|
|||
- if element.persisted?
|
||||
= safe_display(element.screenshot) { tag.div(link_to(_1.filename.to_s, _1), class: "mb-3") }
|
||||
= form.submit class: "btn btn-primary"
|
||||
= link_to("Abbrechen", element.persisted? ? element : element.report, class: "btn btn-outline-secondary")
|
||||
- unless modal?
|
||||
= link_to("Abbrechen", element.persisted? ? element : element.report, class: "btn btn-outline-secondary")
|
||||
|
|
|
|||
|
|
@ -1,26 +1,3 @@
|
|||
/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)
|
||||
|
||||
h1.title id=dom_id(@report) = @report.name
|
||||
|
||||
h2 1 Einschätzung
|
||||
|
|
@ -42,18 +19,18 @@ h2 2 Protokoll
|
|||
- current_page_pos += 1
|
||||
- current_element_pos = 0
|
||||
h3 = "2.#{current_page_pos} #{page.path}"
|
||||
p
|
||||
strong URL
|
||||
= page.url
|
||||
- page.elements.select { |e| e.success_criteria.any? { _1.failed? } }.each do |element|
|
||||
- current_element_pos += 1
|
||||
- current_abs_element_pos += 1
|
||||
- current_sc_pos = 0
|
||||
h4 = "2.#{current_page_pos}.#{current_element_pos} #{element.title}"
|
||||
/h3 = "2.#{current_abs_element_pos} #{element.title}"
|
||||
p
|
||||
strong Pfad:
|
||||
span =< page.path
|
||||
= safe_display(element.screenshot) { image_tag(_1.representation(resize_to_fit: [250, 250]))}
|
||||
= element.description
|
||||
- element.success_criteria.select{ _1.failed? }.each do |sc|
|
||||
- element.success_criteria.select(&:failed?).each do |sc|
|
||||
- current_sc_pos += 1
|
||||
/h4
|
||||
= "2.#{current_abs_element_pos}.#{current_sc_pos} #{sc.title}"
|
||||
|
|
|
|||
7
app/views/guidelines/_form.html.erb
Normal file
7
app/views/guidelines/_form.html.erb
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
<%= bootstrap_form_with(model: guideline) do |form| %>
|
||||
<%= form.collection_select :principle_id, Principle.all.sort_by(&:id), :id, :t_name %>
|
||||
<%= form.number_field :number %>
|
||||
<%= form.text_field :name_de %>
|
||||
<%= form.rich_text_area :description_de %>
|
||||
<%= form.submit %>
|
||||
<% end %>
|
||||
15
app/views/guidelines/_guideline.html.erb
Normal file
15
app/views/guidelines/_guideline.html.erb
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
<div id="<%= dom_id guideline %>">
|
||||
<p>
|
||||
<strong>Principle:</strong>
|
||||
<%= guideline.principle.t_name %>
|
||||
</p>
|
||||
|
||||
<%= guideline.description_de %>
|
||||
<h2 class="mt-4">Richtlinien</h2>
|
||||
<% guideline.checks.each do |check| %>
|
||||
<section class="pt-3">
|
||||
<h3 class="fs-5"><%= link_to check %></h3>
|
||||
<%= check.t_criterion %>
|
||||
</section>
|
||||
<% end %>
|
||||
</div>
|
||||
2
app/views/guidelines/_guideline.json.jbuilder
Normal file
2
app/views/guidelines/_guideline.json.jbuilder
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
json.extract! guideline, :id, :principle_id, :number, :name_de, :created_at, :updated_at
|
||||
json.url guideline_url(guideline, format: :json)
|
||||
8
app/views/guidelines/edit.html.erb
Normal file
8
app/views/guidelines/edit.html.erb
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
<h1><%= t("scaffold.pagetitle_edit", model: Guideline.model_name.human) %></h1>
|
||||
|
||||
<%= render "form", guideline: @guideline %>
|
||||
|
||||
<div class="action-row">
|
||||
<%= link_to t("scaffold.link_show", model: Guideline.model_name.human), @guideline %>
|
||||
<%= link_to t("scaffold.link_index", model: Guideline.model_name.human(count: 2)), guidelines_path %>
|
||||
</div>
|
||||
28
app/views/guidelines/index.html.erb
Normal file
28
app/views/guidelines/index.html.erb
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
<h1><%= t("scaffold.pagetitle_index", model: Guideline.model_name.human(count: 2)) %></h1>
|
||||
|
||||
<table class="table table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
|
||||
<th><%= Guideline.human_attribute_name(:name_de) %></th>
|
||||
|
||||
<th><%= Guideline.human_attribute_name(:description_de) %></th>
|
||||
|
||||
</thead>
|
||||
<tbody>
|
||||
<% @guidelines.each do |guideline| %>
|
||||
<tr>
|
||||
|
||||
|
||||
|
||||
<td><%= link_to(guideline, url_for(guideline)) %></td>
|
||||
<td><%= link_to(guideline.description_de, url_for(guideline)) %></td>
|
||||
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<div class="action-row">
|
||||
<%= link_to t("scaffold.link_new", model: Guideline.model_name.human), new_guideline_path %>
|
||||
</div>
|
||||
1
app/views/guidelines/index.json.jbuilder
Normal file
1
app/views/guidelines/index.json.jbuilder
Normal file
|
|
@ -0,0 +1 @@
|
|||
json.array! @guidelines, partial: "guidelines/guideline", as: :guideline
|
||||
7
app/views/guidelines/new.html.erb
Normal file
7
app/views/guidelines/new.html.erb
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
<h1><%= t("scaffold.pagetitle_new", model: Guideline.model_name.human) %></h1>
|
||||
|
||||
<%= render "form", guideline: @guideline %>
|
||||
|
||||
<div class="action-row">
|
||||
<%= link_to t("scaffold.link_index", model: Guideline.model_name.human(count: 2)), guidelines_path %>
|
||||
</div>
|
||||
9
app/views/guidelines/show.html.erb
Normal file
9
app/views/guidelines/show.html.erb
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
<h1><%= @guideline %></h1>
|
||||
|
||||
<%= render @guideline %>
|
||||
|
||||
<div class="action-row">
|
||||
<%= link_to t("scaffold.link_edit", model: @guideline.model_name.human), edit_guideline_path(@guideline) %>
|
||||
<%= link_to t("scaffold.link_index", model: @guideline.model_name.human(count: 2)), guidelines_path %>
|
||||
<%= button_to t("scaffold.link_destroy", model: @guideline.model_name.human), @guideline, method: :delete, class: "btn btn-outline-danger" %>
|
||||
</div>
|
||||
1
app/views/guidelines/show.json.jbuilder
Normal file
1
app/views/guidelines/show.json.jbuilder
Normal file
|
|
@ -0,0 +1 @@
|
|||
json.partial! "guidelines/guideline", guideline: @guideline
|
||||
|
|
@ -19,6 +19,12 @@ h1 Dashboard
|
|||
li = link_to(r.name, r)
|
||||
|
||||
.col-md-6
|
||||
h2 Browser Erweiterungen
|
||||
p = link_to "Language Tools KI Korrektur", "https://languagetool.org/services#browsers"
|
||||
p = link_to "DeepL Firefox Extension", "https://www.deepl.com/en/firefox-extension"
|
||||
p = link_to "DeepL Chrome Extension", "https://www.deepl.com/en/chrome-extension"
|
||||
p = link_to "DeepL Edge Extension", "https://www.deepl.com/en/edge-extension"
|
||||
|
||||
h2 Hotkeys
|
||||
p Auf der Bericht-Ausfüllen Seite können folgende Shortcuts verwendet werden:
|
||||
dl
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
.toast class="#{alert ? "text-bg-danger" : "text-bg-info"}" role="alert" aria-live="assertive" aria-atomic="true" data={ controller: "toast" }
|
||||
.toast class="#{alert ? "text-bg-danger" : "text-bg-info"}" role="alert" aria-live="assertive" aria-atomic="true" data={ controller: "toast", ts: Time.now.to_f }
|
||||
.toast-header
|
||||
/img src="..." class="rounded me-2" alt="...">
|
||||
/strong.me-auto = heading
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
doctype html
|
||||
html data-bs-theme="#{cookies[:"modeTheme"] || "light"}" data-controller="set-theme"
|
||||
html lang=:de data-bs-theme="#{cookies[:"modeTheme"] || "light"}" data-controller="set-theme"
|
||||
head
|
||||
title a11ydive
|
||||
meta[name="viewport" content="width=device-width,initial-scale=1"]
|
||||
|
|
|
|||
|
|
@ -2,4 +2,5 @@
|
|||
= form.text_field :path
|
||||
= form.text_field :url
|
||||
= form.submit
|
||||
= link_to("Abbrechen", report_path(@page.report), class: "btn btn-outline-secondary")
|
||||
- unless modal?
|
||||
= link_to("Abbrechen", report_path(@page.report), class: "btn btn-outline-secondary")
|
||||
|
|
|
|||
|
|
@ -7,4 +7,5 @@
|
|||
= form.rich_text_area :test_comment
|
||||
= form.submit class: "btn btn-primary"
|
||||
- unless modal?
|
||||
p Not MODAL
|
||||
=< link_to "Abbrechen", success_criterion.persisted? ? success_criterion : success_criterion.element, class: "btn btn-outline-secondary"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue