From 0dc6e5e6652ff1637e907230aad8dc9458a09cb5 Mon Sep 17 00:00:00 2001 From: maki Date: Fri, 1 Mar 2024 16:07:56 -0300 Subject: [PATCH] feat: contenido del details de filtros #13586 --- app/assets/stylesheets/application.scss | 7 ++++--- app/views/posts/index.haml | 23 +++++++++++++---------- app/views/sites/_header.haml | 9 +++++++++ config/locales/en.yml | 3 +++ config/locales/es.yml | 3 +++ 5 files changed, 32 insertions(+), 13 deletions(-) diff --git a/app/assets/stylesheets/application.scss b/app/assets/stylesheets/application.scss index 240e61a5..e1e56b8a 100644 --- a/app/assets/stylesheets/application.scss +++ b/app/assets/stylesheets/application.scss @@ -570,9 +570,10 @@ $bezier: cubic-bezier(0.75, 0, 0.25, 1); content: '▶'; font-size: 1.8rem; position: absolute; - left: 97%; - bottom: 3%; + right: 0%; + top: 0%; transform: rotate(180deg); + } &[open] { & > summary { @@ -586,4 +587,4 @@ $bezier: cubic-bezier(0.75, 0, 0.25, 1); hr { border-bottom: 1px solid #dee2e6; -} \ No newline at end of file +} diff --git a/app/views/posts/index.haml b/app/views/posts/index.haml index bb97d8d5..9eaf2f1f 100644 --- a/app/views/posts/index.haml +++ b/app/views/posts/index.haml @@ -6,6 +6,18 @@ = render 'sites/build', site: @site, class: 'btn-block' + = render 'layouts/details', summary: t('posts.filters.title') do + .border.border-magenta.p-1 + %legend.font-weight-bold.m-0.h6= 'Tipo de contenido' + .custom-control.custom-checkbox + + - @site.schema_organization.each do |schema, _| + .row.no-gutters + - schema = @site.layouts[schema] + %input.custom-control-input.magenta{ type: 'checkbox', id: schema, name: "layouts", class: "" } + %label.custom-control-label.font-weight-normal{ for: schema }= schema.humanized_name + %button.btn.btn-secondary.mt-3{ type: 'submit' }= t('.filters.submit') + %h3= t('posts.new') %table.table.table-sm.mb-3 %tbody @@ -45,16 +57,7 @@ - @site.locales.each do |locale| = link_to @site.data.dig(locale.to_s, 'locale') || locale, site_posts_path(@site, **@filter_params.merge(locale: locale)), 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? %h2= t('posts.empty') - else diff --git a/app/views/sites/_header.haml b/app/views/sites/_header.haml index 57bea259..f1afbe65 100644 --- a/app/views/sites/_header.haml +++ b/app/views/sites/_header.haml @@ -13,3 +13,12 @@ %span.input-group-text.background-white.magenta.border.border-magenta.border-top.border-left-0.border-right.border-bottom %i.fa.fa-fw.fa-search %input.sr-only{ type: 'submit' } + - @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 + × diff --git a/config/locales/en.yml b/config/locales/en.yml index 1b4f2d86..38cc3aa0 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -640,6 +640,9 @@ en: next: Next page empty: "There are no results for those search parameters." caption: Post list + filters: + title: Filters + submit: Submit attribute_ro: file: download: Download file diff --git a/config/locales/es.yml b/config/locales/es.yml index e277f76b..5e8bba9d 100644 --- a/config/locales/es.yml +++ b/config/locales/es.yml @@ -651,6 +651,9 @@ es: next: Página siguiente empty: No hay artículos con estos parámetros de búsqueda. caption: Lista de artículos + filters: + title: Filtros + submit: Aplicar attribute_ro: file: download: Descargar archivo