mirror of
https://0xacab.org/sutty/sutty
synced 2024-11-29 02:26:21 +00:00
Merge branch 'issue-17343' into production.panel.sutty.nl
This commit is contained in:
commit
8e8e2116f7
2 changed files with 7 additions and 3 deletions
|
@ -13,11 +13,15 @@ class Site
|
||||||
# Por defecto, si el sitio no lo soporta, se obtienen los layouts
|
# Por defecto, si el sitio no lo soporta, se obtienen los layouts
|
||||||
# ordenados alfabéticamente por traducción.
|
# ordenados alfabéticamente por traducción.
|
||||||
#
|
#
|
||||||
|
# @param [Usuarie,nil]
|
||||||
# @return [Hash]
|
# @return [Hash]
|
||||||
def schema_organization
|
def schema_organization(usuarie = nil)
|
||||||
@schema_organization ||=
|
@schema_organization ||=
|
||||||
begin
|
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&.symbolize_keys!
|
||||||
schema_organization&.transform_values! do |ary|
|
schema_organization&.transform_values! do |ary|
|
||||||
ary.map(&:to_sym)
|
ary.map(&:to_sym)
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
%h3= t('posts.new')
|
%h3= t('posts.new')
|
||||||
%table.table.table-sm.mb-3
|
%table.table.table-sm.mb-3
|
||||||
%tbody
|
%tbody
|
||||||
- @site.schema_organization.each do |schema, _|
|
- @site.schema_organization(current_usuarie).each do |schema, _|
|
||||||
- schema = @site.layouts[schema]
|
- schema = @site.layouts[schema]
|
||||||
- next if schema.hidden?
|
- next if schema.hidden?
|
||||||
= render 'schemas/row', site: @site, schema: schema, filter: @filter_params
|
= render 'schemas/row', site: @site, schema: schema, filter: @filter_params
|
||||||
|
|
Loading…
Reference in a new issue