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

fix: subschemas aparecen como filtros #16290

This commit is contained in:
maki 2024-06-03 11:05:17 -03:00
parent b814ae5355
commit 60b539639f
2 changed files with 11 additions and 6 deletions

View file

@ -25,8 +25,7 @@
- @site.schema_organization.each do |key, _|
.custom-control.custom-checkbox
- schema = @site.layouts[key]
%input.custom-control-input.magenta{ type: 'checkbox', id: schema, name: "layout[]", class: "", value: schema.name, checked: @filter_params[:layout]&.include?(key.to_s) }
%label.custom-control-label.font-weight-normal{ for: schema }= schema.humanized_name
= render 'schemas/filter', site: @site, key: key, schema: schema, filter: @filter_params
%button.btn.btn-secondary.mt-3{ type: 'submit' }= t('posts.filters.submit')
= render 'layouts/details',
summary: t('posts.new'),

View file

@ -1,4 +1,10 @@
- if filter[:layout] == schema.name.to_s
= link_to t('.remove'), site_posts_path(site, **filter.merge(layout: nil)), class: 'btn btn-primary btn-sm m-0'
- else
= link_to t('.filter'), site_posts_path(site, **filter.merge(layout: schema.value)), class: 'btn btn-secondary btn-sm m-0'
%div
%input.custom-control-input.magenta{ type: 'checkbox', id: schema, name: "layout[]", class: "", value: schema.name, checked: @filter_params[:layout]&.include?(key.to_s) }
%label.custom-control-label.font-weight-normal{ for: schema }= schema.humanized_name
-# XXX: Solo un nivel de recursividad
- unless local_assigns[:parent_schema]
- schema.schemas.each do |s|
- next if s.hidden?
= render 'schemas/filter', schema: s, key: s.name, site: site, filter: filter