From 9225ae7ce8a24e2df8a0d69d9fecf200934ce57b Mon Sep 17 00:00:00 2001 From: f Date: Thu, 24 Dec 2020 12:35:58 -0300 Subject: [PATCH] =?UTF-8?q?seleccionar=20art=C3=ADculos=20con=20el=20estil?= =?UTF-8?q?o=20de=20sutty?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/posts/index.haml | 11 +++++++++-- config/locales/en.yml | 1 + config/locales/es.yml | 1 + 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/app/views/posts/index.haml b/app/views/posts/index.haml index 83f8f7a..728be34 100644 --- a/app/views/posts/index.haml +++ b/app/views/posts/index.haml @@ -57,7 +57,7 @@ %caption.sr-only= t('posts.caption') %thead %tr - %th.border-0.background-white.position-sticky{ style: 'top: 0', colspan: '4' } + %th.border-0.background-white.position-sticky{ style: 'top: 0; z-index: 2', colspan: '4' } = submit_tag t('posts.reorder.submit'), class: 'btn' %button.btn{ data: { action: 'reorder#unselect' } } = t('posts.reorder.unselect') @@ -72,10 +72,17 @@ -# TODO: Solo les usuaries cachean porque tenemos que separar les botones por permisos. + + TODO: Verificar qué pasa cuando se gestiona el sitio en + distintos idiomas a la vez - cache_if @usuarie, post do + - checkbox_id = "checkbox-#{post.uuid.value}" %tr{ id: post.uuid.value, data: { target: 'reorder.row' } } %td - %input{ type: 'checkbox', autocomplete: 'off', data: { action: 'reorder#select' } } + .custom-control.custom-checkbox + %input.custom-control-input{ id: checkbox_id, type: 'checkbox', autocomplete: 'off', data: { action: 'reorder#select' } } + %label.custom-control-label{ for: checkbox_id } + %span.sr-only= t('posts.reorder.select') -# Orden más alto es mayor prioridad = hidden_field 'post[reorder]', post.uuid.value, value: @posts.length - i, diff --git a/config/locales/en.yml b/config/locales/en.yml index 9d485d9..57f514f 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -475,6 +475,7 @@ en: destroy: Remove image reorder: submit: 'Save order' + select: 'Select this post' unselect: 'Deselected all' top: 'Send to top' bottom: 'Send to bottom' diff --git a/config/locales/es.yml b/config/locales/es.yml index 129231a..77a4fd7 100644 --- a/config/locales/es.yml +++ b/config/locales/es.yml @@ -488,6 +488,7 @@ es: destroy: 'Eliminar imagen' reorder: submit: 'Guardar orden' + select: 'Seleccionar este artículo' unselect: 'Deseleccionar todos' top: 'Enviar al principio' bottom: 'Enviar al final'