5
0
Fork 0
mirror of https://0xacab.org/sutty/sutty synced 2024-11-25 23:56:22 +00:00

feat: poder establecer una lista de esquemas para invitades #17343

This commit is contained in:
f 2024-09-06 16:01:52 -03:00
parent cbe2f66a94
commit 78f757d429
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 # 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)

View file

@ -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