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

Merge branch 'issue-17343' into production.panel.sutty.nl

This commit is contained in:
f 2024-09-06 16:03:04 -03:00
commit 8e8e2116f7
No known key found for this signature in database
2 changed files with 7 additions and 3 deletions

View file

@ -13,11 +13,15 @@ class Site
# Por defecto, si el sitio no lo soporta, se obtienen los layouts
# ordenados alfabéticamente por traducción.
#
# @param [Usuarie,nil]
# @return [Hash]
def schema_organization
def schema_organization(usuarie = nil)
@schema_organization ||=
begin
schema_organization = data.dig('schema', 'organization')
# XXX: retrocompatibilidad
key = (usuarie.blank? || usuarie?(usuarie)) ? 'organization' : 'organization_guest'
schema_organization = data.dig('schema', key)
schema_organization ||= data.dig('schema', 'organization')
schema_organization&.symbolize_keys!
schema_organization&.transform_values! do |ary|
ary.map(&:to_sym)

View file

@ -16,7 +16,7 @@
%h3= t('posts.new')
%table.table.table-sm.mb-3
%tbody
- @site.schema_organization.each do |schema, _|
- @site.schema_organization(current_usuarie).each do |schema, _|
- schema = @site.layouts[schema]
- next if schema.hidden?
= render 'schemas/row', site: @site, schema: schema, filter: @filter_params