A lot :)
This commit is contained in:
parent
aad67af0d1
commit
63fc206c27
153 changed files with 2043 additions and 646 deletions
|
|
@ -1,22 +0,0 @@
|
|||
<div id="<%= dom_id check %>">
|
||||
<p>
|
||||
<strong><%= Check.human_attribute_name(:position) %>:</strong>
|
||||
<%= check.position %>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<strong><%= Check.human_attribute_name(:name) %>:</strong>
|
||||
<%= check.name %>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<strong><%= Check.human_attribute_name(:success_criterion_html) %>:</strong>
|
||||
<%= check.success_criterion_html %>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<strong><%= Check.human_attribute_name(:level) %>:</strong>
|
||||
<%= check.level %>
|
||||
</p>
|
||||
|
||||
</div>
|
||||
68
app/views/checks/_check.html.slim
Normal file
68
app/views/checks/_check.html.slim
Normal file
|
|
@ -0,0 +1,68 @@
|
|||
div id=dom_id(check)
|
||||
table.table
|
||||
tbody
|
||||
tr
|
||||
th = Check.human_attribute_name(:id)
|
||||
td = check.id
|
||||
tr
|
||||
th = Principle.model_name.human
|
||||
td = check.principle&.t_name
|
||||
tr
|
||||
th = Check.human_attribute_name(:number)
|
||||
td = check.number
|
||||
tr
|
||||
th = Check.human_attribute_name(:name)
|
||||
td = check.t_name
|
||||
tr
|
||||
th = Standard.model_name.human(count: check.standard_ids.size)
|
||||
td = check.standards.map(&:t_name).join(", ")
|
||||
tr
|
||||
th = Check.human_attribute_name(:target_disabilities)
|
||||
td = check.display_target_disabilities
|
||||
tr
|
||||
th = Check.human_attribute_name(:applicabilities)
|
||||
td = check.display_applicabilities
|
||||
tr
|
||||
th = Check.human_attribute_name(:external_number)
|
||||
td = check.external_number
|
||||
tr
|
||||
th = Check.human_attribute_name(:conformity_level)
|
||||
td = check.conformity_level
|
||||
tr
|
||||
th = Check.human_attribute_name(:conformity_notice_de)
|
||||
td = check.conformity_notice_de
|
||||
tr
|
||||
th = Check.human_attribute_name(:conformity_notice_en)
|
||||
td = check.conformity_notice_en
|
||||
tr
|
||||
th = Check.human_attribute_name(:priority)
|
||||
td = check.priority
|
||||
tr
|
||||
th = Check.human_attribute_name(:quick_criterion_de)
|
||||
td = check.quick_criterion_de
|
||||
tr
|
||||
th = Check.human_attribute_name(:quick_criterion_en)
|
||||
td = check.quick_criterion_en
|
||||
tr
|
||||
th = Check.human_attribute_name(:quick_fail_de)
|
||||
td = check.quick_fail_de
|
||||
tr
|
||||
th = Check.human_attribute_name(:quick_fail_en)
|
||||
td = check.quick_fail_en
|
||||
tr
|
||||
th = Check.human_attribute_name(:quick_fix_de)
|
||||
td = check.quick_fix_de
|
||||
tr
|
||||
th = Check.human_attribute_name(:quick_fix_en)
|
||||
td = check.quick_fix_en
|
||||
tr
|
||||
th = Link.model_name.human(count: check.links.size)
|
||||
td
|
||||
.row
|
||||
.col
|
||||
- check.links.map(&:link_category).uniq.each do |category|
|
||||
span = category.name
|
||||
ul
|
||||
- check.links.select{ _1.link_category == category }.map { |link| link_to link.text, link.url, target: :_blank }.each do |link|
|
||||
li = link
|
||||
|
||||
|
|
@ -1,2 +1,4 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
json.extract! check, :id, :position, :name, :success_criterion_html, :level, :created_at, :updated_at
|
||||
json.url check_url(check, format: :json)
|
||||
|
|
|
|||
|
|
@ -1,7 +0,0 @@
|
|||
<%= bootstrap_form_with(model: check, remote: true) do |form| %>
|
||||
<%= form.text_field :position %>
|
||||
<%= form.text_field :name %>
|
||||
<%= form.rich_text_area :success_criterion_html %>
|
||||
<%= form.select :level, Check.levels.keys, add_blank: !form.object.level.present? %>
|
||||
<%= form.submit %>
|
||||
<% end %>
|
||||
53
app/views/checks/_form.html.slim
Normal file
53
app/views/checks/_form.html.slim
Normal file
|
|
@ -0,0 +1,53 @@
|
|||
= bootstrap_form_with(model: check, remote: true) do |form|
|
||||
h2 Details
|
||||
= form.collection_select :principle_id, Principle.all.sort_by(&:t_name), :id, :t_name
|
||||
= form.text_field :number
|
||||
= multilang_form_field(form, :name)
|
||||
= form.collection_check_boxes :standard_ids, Standard.all.sort_by(&:t_name), :id, :t_name, include_blank: true
|
||||
h2 Zugänglichkeit
|
||||
.row
|
||||
.col-md-3
|
||||
= form.check_box :visual, label: t("disability.visual").capitalize
|
||||
.col-md-3
|
||||
= form.check_box :auditory, label: t("disability.auditory").capitalize
|
||||
.col-md-3
|
||||
= form.check_box :physical, label: t("disability.physical").capitalize
|
||||
.col-md-3
|
||||
= form.check_box :cognitive, label: t("disability.cognitive").capitalize
|
||||
h2 Anwendbarkeit
|
||||
.row
|
||||
.col-md-6
|
||||
= form.check_box :applicable_to_web, label: t("applicability.applicable_to_web").capitalize
|
||||
.col-md-6
|
||||
= form.check_box :applicable_to_app, label: t("applicability.applicable_to_app").capitalize
|
||||
h2 Richtlinie
|
||||
= form.text_field :external_number
|
||||
= form.select :conformity_level, Check.conformity_levels.keys, include_blank: true
|
||||
= multilang_form_field(form, :conformity_notice, as: :rich_text_area)
|
||||
|
||||
= form.select :priority, Check.priorities.keys.map{ [t("priority.#{_1}"), _1] }, include_blank: true
|
||||
h2 Quick Infos
|
||||
= multilang_form_field(form, :quick_criterion, as: :rich_text_area)
|
||||
= multilang_form_field(form, :quick_fail, as: :rich_text_area)
|
||||
= multilang_form_field(form, :quick_fix, as: :rich_text_area)
|
||||
|
||||
h2 Regular-Kriterium
|
||||
= multilang_form_field(form, :criterion, as: :rich_text_area)
|
||||
= multilang_form_field(form, :criterion_details, as: :rich_text_area)
|
||||
= multilang_form_field(form, :example, as: :rich_text_area)
|
||||
= multilang_form_field(form, :exemption_details, as: :rich_text_area)
|
||||
= multilang_form_field(form, :standard_text, as: :rich_text_area)
|
||||
|
||||
h2 Intern
|
||||
= form.rich_text_area :test_instructions
|
||||
= multilang_form_field(form, :powerpoint_text, as: :rich_text_area)
|
||||
= form.rich_text_area :comment
|
||||
|
||||
h2 Links
|
||||
- LinkCategory.all.sort_by(&:t_name).each do |c|
|
||||
h3 = c.t_name
|
||||
= form.collection_check_boxes(:link_ids, c.links.sort_by(&:t_text), :id, :to_s, hide_label: true)
|
||||
/ = form.collection_check_boxes :link_ids, Link.all.sort_by(&:text), :id, :to_s
|
||||
|
||||
/ = form.rich_text_area :success_criterion_de
|
||||
= form.submit
|
||||
|
|
@ -15,18 +15,24 @@
|
|||
<table class="table table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th><%= Check.human_attribute_name(:id) %></th>
|
||||
<th><%= Check.human_attribute_name(:level) %></th>
|
||||
<th><%= Check.human_attribute_name(:number) %></th>
|
||||
<th><%= Check.human_attribute_name(:name) %></th>
|
||||
<th><%= Check.human_attribute_name(:success_criterion_html) %></th>
|
||||
<th><%= Check.human_attribute_name(:standards) %></th>
|
||||
<th><%= t("checks.target_disabilities") %></th>
|
||||
<th><%= t("checks.applicability") %></th>
|
||||
<th><%= Check.human_attribute_name(:external_number) %></th>
|
||||
<th><%= Check.human_attribute_name(:conformity_level) %></th>
|
||||
</thead>
|
||||
<tbody>
|
||||
<% @checks.each do |check| %>
|
||||
<tr>
|
||||
<td><%= check.id %></td>
|
||||
<td><%= check.level %></td>
|
||||
<td><%= link_to(check.name, url_for(check)) %></td>
|
||||
<td><%= link_to(truncate(strip_tags(check.success_criterion_html.to_s)), url_for(check)) %></td>
|
||||
<td><%= check.number %></td>
|
||||
<td><%= check.t_name %></td>
|
||||
<td><%= check.standards.map(&:t_name).join(", ") %></td>
|
||||
<td><%= check.display_target_disabilities %></td>
|
||||
<td><%= check.t_name %></td>
|
||||
<td><%= check.t_name %></td>
|
||||
<td><%= link_to(check.t_name, url_for(check)) %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
51
app/views/checks/index.html.slim
Normal file
51
app/views/checks/index.html.slim
Normal file
|
|
@ -0,0 +1,51 @@
|
|||
h1
|
||||
= t("scaffold.pagetitle_index", model: Check.model_name.human(count: 2))
|
||||
= bootstrap_form_with(url: checks_path(page: params[:page]), method: :get, scope: :filter) do |form|
|
||||
= form.hidden_field :page, value: params[:page] if params[:page]
|
||||
.row
|
||||
.col-md-3
|
||||
= form.text_field(:s, placeholder: "suchen...", hide_label: true, value: filter_params[:s])
|
||||
.col
|
||||
= form.submit name: "", value: "Suchen"
|
||||
= link_to "Filter löschen", checks_path, class: "btn btn-outline-secondary ms-3" if filter_params[:s]
|
||||
table.table.table-striped
|
||||
thead
|
||||
tr
|
||||
th ID
|
||||
th
|
||||
= Check.human_attribute_name(:number)
|
||||
th
|
||||
= Check.human_attribute_name(:name)
|
||||
th
|
||||
= Check.human_attribute_name(:standard_ids)
|
||||
th
|
||||
= Check.human_attribute_name(:target_disability)
|
||||
th
|
||||
= Check.human_attribute_name(:applicability)
|
||||
th
|
||||
= Check.human_attribute_name(:external_number)
|
||||
th
|
||||
= Check.human_attribute_name(:conformity_level)
|
||||
tbody
|
||||
- @checks.each do |check|
|
||||
tr
|
||||
td = link_to check.id, check
|
||||
td
|
||||
= link_to(check.number, check)
|
||||
td
|
||||
= link_to check.t_name&.truncate(64), check
|
||||
td
|
||||
= link_to check.standards.map(&:t_name).join(", "), check
|
||||
td
|
||||
= link_to check.display_target_disabilities, check
|
||||
td
|
||||
= link_to check.display_applicabilities, check
|
||||
td
|
||||
= link_to check.external_number, check
|
||||
td
|
||||
= link_to check.conformity_level, check
|
||||
.my-3
|
||||
== pagy_info(@pagy)
|
||||
== pagy_bootstrap_nav(@pagy)
|
||||
.action-row
|
||||
= link_to t("scaffold.link_new", model: Check.model_name.human), new_check_path
|
||||
|
|
@ -1 +1,3 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
json.array! @checks, partial: "checks/check", as: :check
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
<h1><%= t("scaffold.pagetitle_show", model: @check.class.model_name.human) %></h1>
|
||||
<h1><%= @check.t_name %></h1>
|
||||
|
||||
<%= render @check %>
|
||||
|
||||
|
|
|
|||
|
|
@ -1 +1,3 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
json.partial! "checks/check", check: @check
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue