From fbe2d9b1a96a97e81a331cc4fb2615c02a2df772 Mon Sep 17 00:00:00 2001 From: f Date: Mon, 4 Mar 2024 13:12:22 -0300 Subject: [PATCH] feat: agregar contenido sin desplegable #13586 --- app/assets/stylesheets/application.scss | 30 ++++++++++++++++++++----- app/views/layouts/_details.haml | 15 +++++++++++++ app/views/posts/index.haml | 19 +++++++++------- app/views/schemas/_row.haml | 9 +++----- 4 files changed, 53 insertions(+), 20 deletions(-) diff --git a/app/assets/stylesheets/application.scss b/app/assets/stylesheets/application.scss index e1e56b8a..195cb662 100644 --- a/app/assets/stylesheets/application.scss +++ b/app/assets/stylesheets/application.scss @@ -561,11 +561,19 @@ $bezier: cubic-bezier(0.75, 0, 0.25, 1); // details styles .details { - summary { + & > summary { list-style: none; - cursor: default; - position: relative; + cursor: pointer; + + .hide-when-open { + display: inline; + } + + .show-when-open { + display: none; + } } +<<<<<<< HEAD summary::after { content: '▶'; font-size: 1.8rem; @@ -575,16 +583,26 @@ $bezier: cubic-bezier(0.75, 0, 0.25, 1); transform: rotate(180deg); } +======= + +>>>>>>> 61101723 (feat: poder cambiar el nivel de summary) &[open] { & > summary { - &::after { - transform: rotate(90deg); - } + .hide-when-open { + display: none; + } + + .show-when-open { + display: inline; + } } } +<<<<<<< HEAD } hr { border-bottom: 1px solid #dee2e6; +======= +>>>>>>> 61101723 (feat: poder cambiar el nivel de summary) } diff --git a/app/views/layouts/_details.haml b/app/views/layouts/_details.haml index 306986bf..94203400 100644 --- a/app/views/layouts/_details.haml +++ b/app/views/layouts/_details.haml @@ -1,6 +1,21 @@ -# Detail Cola de Moderación +<<<<<<< HEAD %details.details.py-2 %summary %h3.py-2= summary +======= + @param :id [String] El ID opcional sirve para mantener el historial de + cuál estaba abierto y recuperarlo al cargar la página + @param :summary [String] El resumen + @param :summary_class [String] Clases para el summary + +- local_assigns[:summary_class] ||= 'h3' + +%details.details.py-2{ id: local_assigns[:id], data: { controller: 'details', action: 'toggle->details#store' } } + %summary.d-flex.flex-row.align-items-center.justify-content-between{ class: local_assigns[:summary_class] } + %span= summary + %span.hide-when-open ▶ + %span.show-when-open ▼ +>>>>>>> 61101723 (feat: poder cambiar el nivel de summary) = yield diff --git a/app/views/posts/index.haml b/app/views/posts/index.haml index 9eaf2f1f..ba0ede1f 100644 --- a/app/views/posts/index.haml +++ b/app/views/posts/index.haml @@ -17,14 +17,17 @@ %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 - - @site.schema_organization.each do |schema, _| - - schema = @site.layouts[schema] - - next if schema.hidden? - = render 'schemas/row', site: @site, schema: schema, filter: @filter_params + .caja + .d-flex.border.border-magenta.p-2.justify-content-between.align-items-center.w-100 + %h3.magenta.font-weight-bold.m-0= t('posts.new') + %p.h1.magenta.font-weight-bold.m-0= '+' + %table.table-sm.mb-3.w-100 + %tbody + - @site.schema_organization.each do |schema, _| + - schema = @site.layouts[schema] + - next if schema.hidden? + = render 'schemas/row', site: @site, schema: schema, filter: @filter_params + - if policy(@site_stat).index? = link_to t('stats.index.title'), site_stats_path(@site), class: 'btn btn-secondary' diff --git a/app/views/schemas/_row.haml b/app/views/schemas/_row.haml index 1d1fca87..9b727f97 100644 --- a/app/views/schemas/_row.haml +++ b/app/views/schemas/_row.haml @@ -1,12 +1,9 @@ -%tr - %th.w-100{ scope: 'row' } +%tr.border-left.border-right.border-bottom.border-magenta + %th.font-weight-normal.w-100{ scope: 'row' } - if local_assigns[:parent_schema] %span.text-muted — = schema.humanized_name - %td.px-0.text-nowrap - = render 'schemas/add', **local_assigns - = render 'schemas/filter', **local_assigns - + -# XXX: Solo un nivel de recursividad - unless local_assigns[:parent_schema] - schema.schemas.each do |s|