5
0
Fork 0
mirror of https://0xacab.org/sutty/sutty synced 2024-11-16 19:36:22 +00:00

mostrar cuáles son los filtros actuales y poder removerlos

además, crear una sección de notas al pie con definiciones disponibles
para lectores de pantalla.  (no quiere decir que sean completas, `title`
solo funciona con usuaries de mouse)
This commit is contained in:
f 2021-05-07 17:32:54 -03:00
parent 051e40f64b
commit 754e8fbbcc
3 changed files with 18 additions and 0 deletions

View file

@ -60,6 +60,16 @@
- @site.locales.each do |locale| - @site.locales.each do |locale|
= link_to t("locales.#{locale}.name"), site_posts_path(@site, **@filter_params.merge(locale: locale)), = link_to t("locales.#{locale}.name"), site_posts_path(@site, **@filter_params.merge(locale: locale)),
class: "mr-2 mt-2 mb-2 #{locale == @locale ? 'active font-weight-bold' : ''}" class: "mr-2 mt-2 mb-2 #{locale == @locale ? 'active font-weight-bold' : ''}"
.pl-2-plus
- @filter_params.each do |param, value|
- if param == 'layout'
- value = @site.layouts[value.to_sym].humanized_name
= link_to site_posts_path(@site, **@filter_params.reject { |k, _| k == param }),
class: 'btn btn-secondary btn-sm',
title: t('posts.remove_filter_help', filter: value),
aria: { labelledby: "help-filter-#{param}" } do
= value
×
- if @posts.empty? - if @posts.empty?
%h2= t('posts.empty') %h2= t('posts.empty')
- else - else
@ -121,3 +131,9 @@
= link_to t('posts.edit'), edit_site_post_path(@site, post.path), class: 'btn btn-block' = link_to t('posts.edit'), edit_site_post_path(@site, post.path), class: 'btn btn-block'
- if @usuarie || policy(post).destroy? - if @usuarie || policy(post).destroy?
= link_to t('posts.destroy'), site_post_path(@site, post.path), class: 'btn btn-block', method: :delete, data: { confirm: t('posts.confirm_destroy') } = link_to t('posts.destroy'), site_post_path(@site, post.path), class: 'btn btn-block', method: :delete, data: { confirm: t('posts.confirm_destroy') }
#footnotes{ hidden: true }
- @filter_params.each do |param, value|
- if param == 'layout'
- value = @site.layouts[value.to_sym].humanized_name
%label{ id: "help-filter-#{param}" }= t('posts.remove_filter_help', filter: value)

View file

@ -451,6 +451,7 @@ en:
add: 'Add' add: 'Add'
filter: 'Filter' filter: 'Filter'
remove_filter: 'Back' remove_filter: 'Back'
remove_filter_help: 'Remove the filter: %{filter}'
categories: 'Everything' categories: 'Everything'
index: 'Posts' index: 'Posts'
edit: 'Edit' edit: 'Edit'

View file

@ -515,6 +515,7 @@ es:
add: 'Agregar' add: 'Agregar'
filter: 'Filtrar' filter: 'Filtrar'
remove_filter: 'Volver' remove_filter: 'Volver'
remove_filter_help: 'Quitar este filtro: %{filter}'
index: 'Artículos' index: 'Artículos'
edit: 'Editar' edit: 'Editar'
preview: preview: