5
0
Fork 0
mirror of https://0xacab.org/sutty/sutty synced 2024-11-23 02:46:22 +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 end
def add_code_of_conduct def add_code_of_conduct
return unless site.layout?(:code_of_conduct) || site.layout?(:page)
# TODO: soportar más códigos de conducta # TODO: soportar más códigos de conducta
coc = CodeOfConduct.first coc = CodeOfConduct.first
with_all_locales do |locale| with_all_locales do |locale|
params = ActionController::Parameters.new( params = ActionController::Parameters.new(
post: { post: {
layout: 'code_of_conduct', layout: site.layout?(:code_of_conduct) ? 'code_of_conduct' : 'page',
lang: locale.to_s, lang: locale.to_s,
title: coc.title, title: coc.title,
description: coc.description description: coc.description