improve checks index
This commit is contained in:
parent
a0e2c7cacb
commit
69693d0a37
2 changed files with 9 additions and 4 deletions
|
|
@ -7,7 +7,7 @@ class ChecksController < ApplicationController
|
||||||
|
|
||||||
# GET /checks or /checks.json
|
# GET /checks or /checks.json
|
||||||
def index
|
def index
|
||||||
@pagy, @checks = pagy(Check.filter_by(filter_params).order(:conformity_level))
|
@pagy, @checks = pagy(Check.filter_by(filter_params).order(:external_number))
|
||||||
end
|
end
|
||||||
|
|
||||||
# GET /checks/1 or /checks/1.json
|
# GET /checks/1 or /checks/1.json
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,8 @@ h1
|
||||||
|
|
||||||
.card.mb-3
|
.card.mb-3
|
||||||
.card-header.d-flex data-bs-toggle="collapse" href="#filter-form" role="button" aria-expanded="#{filter_params.present?}" aria-controler="filter-form"
|
.card-header.d-flex data-bs-toggle="collapse" href="#filter-form" role="button" aria-expanded="#{filter_params.present?}" aria-controler="filter-form"
|
||||||
' Filter
|
span.bi.bi-funnel
|
||||||
|
strong.ms-2 Filter
|
||||||
.card-body.collapse id="filter-form" class="#{"show" if filter_params.present?}"
|
.card-body.collapse id="filter-form" class="#{"show" if filter_params.present?}"
|
||||||
= bootstrap_form_with(url: checks_path, method: :get, scope: :filter) do |form|
|
= bootstrap_form_with(url: checks_path, method: :get, scope: :filter) do |form|
|
||||||
= form.hidden_field :page, value: params[:page] if params[:page]
|
= form.hidden_field :page, value: params[:page] if params[:page]
|
||||||
|
|
@ -40,15 +41,18 @@ h1
|
||||||
.col
|
.col
|
||||||
= form.submit name: "", value: "Filtern"
|
= form.submit name: "", value: "Filtern"
|
||||||
= link_to "Filter löschen", checks_path, class: "btn btn-outline-secondary ms-3", data: { turbo_prefetch: false } if filter_params.keys.any?
|
= link_to "Filter löschen", checks_path, class: "btn btn-outline-secondary ms-3", data: { turbo_prefetch: false } if filter_params.keys.any?
|
||||||
|
|
||||||
table.table.table-striped
|
table.table.table-striped
|
||||||
thead
|
thead
|
||||||
tr
|
tr
|
||||||
|
th
|
||||||
|
= Check.human_attribute_name(:external_number)
|
||||||
th
|
th
|
||||||
= Check.human_attribute_name(:name)
|
= Check.human_attribute_name(:name)
|
||||||
th
|
th
|
||||||
= Check.human_attribute_name(:standard_ids)
|
= Check.human_attribute_name(:standard_ids)
|
||||||
th
|
th
|
||||||
= Check.human_attribute_name(:target_disabilities)
|
= Check.human_attribute_name(:target_disabilities).truncate(10)
|
||||||
th
|
th
|
||||||
= Check.human_attribute_name(:applicability)
|
= Check.human_attribute_name(:applicability)
|
||||||
th
|
th
|
||||||
|
|
@ -56,8 +60,9 @@ table.table.table-striped
|
||||||
tbody
|
tbody
|
||||||
- @checks.each do |check|
|
- @checks.each do |check|
|
||||||
tr
|
tr
|
||||||
|
td = check.external_number
|
||||||
td
|
td
|
||||||
= link_to check.display_label&.truncate(64), check
|
= link_to check.t_name, check
|
||||||
td
|
td
|
||||||
= link_to check.standards.map(&:t_name).join(", "), check
|
= link_to check.standards.map(&:t_name).join(", "), check
|
||||||
td
|
td
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue