mirror of
https://0xacab.org/sutty/sutty
synced 2024-11-17 04:16: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:
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
|
||||
|
||||
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,
|
||||
|
|
Loading…
Reference in a new issue