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

Merge branch 'rails' of 0xacab.org:sutty/sutty into issue-15066

This commit is contained in:
f 2024-05-27 19:30:47 -03:00
commit adacac50cc
No known key found for this signature in database
4 changed files with 38 additions and 32 deletions

View file

@ -289,6 +289,8 @@ class Site < ApplicationRecord
# #
# @return [Hash] { post: Layout } # @return [Hash] { post: Layout }
def layouts def layouts
return {} if data['layouts'].blank?
# Crea un Struct dinámico cuyas llaves son los nombres de todos los # Crea un Struct dinámico cuyas llaves son los nombres de todos los
# layouts. Si pasamos un layout que no existe, obtenemos un # layouts. Si pasamos un layout que no existe, obtenemos un
# NoMethodError # NoMethodError

View file

@ -36,8 +36,7 @@ class SiteUsuariePolicy
end end
def accept_invitation? def accept_invitation?
su = site_usuarie !!site_usuarie.usuarie.rol_for_site(site_usuarie.site)&.temporal
(usuarie? || invitade?) && su.usuarie.rol_for_site(su.site).temporal
end end
def reject_invitation? def reject_invitation?

View file

@ -10,4 +10,6 @@
-# XXX: Solo un nivel de recursividad -# XXX: Solo un nivel de recursividad
- unless local_assigns[:parent_schema] - unless local_assigns[:parent_schema]
- schema.schemas.each do |s| - schema.schemas.each do |s|
- next if s.hidden?
= render 'schemas/row', schema: s, site: site, filter: filter, parent_schema: schema = render 'schemas/row', schema: s, site: site, filter: filter, parent_schema: schema

View file

@ -15,15 +15,18 @@
%tbody %tbody
- @sites.each do |site| - @sites.each do |site|
- next unless site.jekyll? - next unless site.jekyll?
%tr %tr
%td %td
%h2 %h2
- if policy(site).show? - if policy(site).show?
= link_to site.title, site_posts_path(site, locale: site.default_locale) = link_to site.title,
site_posts_path(site,
locale: site.default_locale)
- else - else
= site.title = site.title
%p.lead= site.description %p.lead= site.description
%br .d-flex.flex-row
= link_to t('.visit'), site.url, class: 'btn btn-secondary' = link_to t('.visit'), site.url, class: 'btn btn-secondary'
- if current_usuarie.rol_for_site(site).temporal? - if current_usuarie.rol_for_site(site).temporal?
= render 'components/btn_base', = render 'components/btn_base',