5
0
Fork 0
mirror of https://0xacab.org/sutty/sutty synced 2024-10-06 19:06:56 +00:00

fix: solo crear el código de conducta si la plantilla lo soporta

como fallback usamos page
This commit is contained in:
f 2023-03-22 19:06:57 -03:00
parent 3779f4b241
commit 35722484e7

View file

@ -143,13 +143,15 @@ SiteService = Struct.new(:site, :usuarie, :params, keyword_init: true) do
end
def add_code_of_conduct
return unless site.layout?(:code_of_conduct) || site.layout?(:page)
# TODO: soportar más códigos de conducta
coc = CodeOfConduct.first
with_all_locales do |locale|
params = ActionController::Parameters.new(
post: {
layout: 'code_of_conduct',
layout: site.layout?(:code_of_conduct) ? 'code_of_conduct' : 'page',
lang: locale.to_s,
title: coc.title,
description: coc.description