diff --git a/app/models/site.rb b/app/models/site.rb index fdb87659..9cc42cd0 100644 --- a/app/models/site.rb +++ b/app/models/site.rb @@ -234,6 +234,8 @@ class Site < ApplicationRecord # # @return [Hash] { post: Layout } def layouts + return {} if data['layouts'].blank? + # Crea un Struct dinĂ¡mico cuyas llaves son los nombres de todos los # layouts. Si pasamos un layout que no existe, obtenemos un # NoMethodError diff --git a/app/views/schemas/_row.haml b/app/views/schemas/_row.haml index edea4f2f..e5ff1409 100644 --- a/app/views/schemas/_row.haml +++ b/app/views/schemas/_row.haml @@ -8,4 +8,6 @@ -# XXX: Solo un nivel de recursividad - unless local_assigns[:parent_schema] - schema.schemas.each do |s| + - next if s.hidden? = render 'schemas/row', schema: s, site: site, filter: filter, parent_schema: schema + diff --git a/app/views/sites/index.haml b/app/views/sites/index.haml index 6419a138..2cdfb727 100644 --- a/app/views/sites/index.haml +++ b/app/views/sites/index.haml @@ -4,7 +4,7 @@ %p.lead= t('.help') - if policy(Site).new? = link_to t('sites.new.title'), new_site_path, - class: 'btn btn-secondary' + class: 'btn btn-secondary' %section.col - if @sites.empty? @@ -19,36 +19,37 @@ %td %h2 - 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 = site.title %p.lead= site.description - %br .d-flex.flex-row = link_to t('.visit'), site.url, class: 'btn btn-secondary' - if current_usuarie.rol_for_site(site).temporal? = render 'components/btn_base', - text: t('sites.invitations.accept'), - path: site_usuaries_accept_invitation_path(site), - title: t('help.sites.invitations.accept'), - class: 'btn-secondary' + text: t('sites.invitations.accept'), + path: site_usuaries_accept_invitation_path(site), + title: t('help.sites.invitations.accept'), + class: 'btn-secondary' = render 'components/btn_base', - text: t('sites.invitations.reject'), - path: site_usuaries_reject_invitation_path(site), - title: t('help.sites.invitations.reject'), - class: 'btn-secondary' + text: t('sites.invitations.reject'), + path: site_usuaries_reject_invitation_path(site), + title: t('help.sites.invitations.reject'), + class: 'btn-secondary' - else - if policy(site).show? = render 'layouts/btn_with_tooltip', - tooltip: t('help.sites.edit_posts'), - type: 'success', - link: site_path(site), - text: t('sites.posts') + tooltip: t('help.sites.edit_posts'), + type: 'success', + link: site_path(site), + text: t('sites.posts') = render 'sites/build', site: site = render 'sites/moderation_queue', site: site - if policy(SiteUsuarie.new(site, current_usuarie)).index? = render 'layouts/btn_with_tooltip', - tooltip: t('usuaries.index.help.self'), - text: t('usuaries.index.title'), - type: 'info', - link: site_usuaries_path(site) + tooltip: t('usuaries.index.help.self'), + text: t('usuaries.index.title'), + type: 'info', + link: site_usuaries_path(site) diff --git a/db/migrate/20240227134845_create_fediblocks.rb b/db/migrate/20240227134845_create_fediblocks.rb index 03f65f7c..1a61ccba 100644 --- a/db/migrate/20240227134845_create_fediblocks.rb +++ b/db/migrate/20240227134845_create_fediblocks.rb @@ -12,7 +12,7 @@ class CreateFediblocks < ActiveRecord::Migration[6.1] t.string :url, null: false t.string :download_url, null: false t.string :format, null: false - t.jsonb :instances, default: [] + t.jsonb :hostnames, default: [] end YAML.safe_load(File.read('db/seeds/activity_pub/fediblocks.yml')).each do |fediblock| diff --git a/db/migrate/20240228171335_rename_fediblock_instances_to_hostnames.rb b/db/migrate/20240228171335_rename_fediblock_instances_to_hostnames.rb deleted file mode 100644 index bad343f2..00000000 --- a/db/migrate/20240228171335_rename_fediblock_instances_to_hostnames.rb +++ /dev/null @@ -1,9 +0,0 @@ -# frozen_string_literal: true - -# Cambia el nombre de la columna para que podamos obtener todas las -# instancias de un fediblock -class RenameFediblockInstancesToHostnames < ActiveRecord::Migration[6.1] - def change - rename_column :activity_pub_fediblocks, :instances, :hostnames - end -end diff --git a/db/seeds/activity_pub/fediblocks.yml b/db/seeds/activity_pub/fediblocks.yml index c977f9bf..35fe38cd 100644 --- a/db/seeds/activity_pub/fediblocks.yml +++ b/db/seeds/activity_pub/fediblocks.yml @@ -6,7 +6,7 @@ id: "9046789a-5de8-4b16-beed-796060f8f3cc" - title: "Oliphant Tier 0" url: "https://writer.oliphant.social/oliphant/the-oliphant-social-blocklist" - download_url: "https://codeberg.org/oliphant/blocklists/raw/branch/main/blocklists/mastodon/tier0.csv" + download_url: "https://codeberg.org/oliphant/blocklists/raw/branch/main/blocklists/mastodon/seirdy-tier0.csv" format: "mastodon" id: "fc1efcb8-7e68-4a76-ae9e-0c447752b12b" - title: "The Bad Space (90%)"