mirror of
https://0xacab.org/sutty/sutty
synced 2024-11-17 04:26:21 +00:00
fix: solo crear el código de conducta si la plantilla lo soporta
como fallback usamos page
This commit is contained in:
parent
ddd2bc07ff
commit
3f3ef00410
1 changed files with 3 additions and 1 deletions
|
@ -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,
|
||||||
|
|
Loading…
Reference in a new issue