mirror of
https://0xacab.org/sutty/sutty
synced 2024-11-22 21: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:
parent
3779f4b241
commit
35722484e7
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