From bd6b0f9696afa7483b2779d8f4ba00e3671ade61 Mon Sep 17 00:00:00 2001 From: f Date: Tue, 18 Feb 2020 15:15:02 -0300 Subject: [PATCH] habilitar/deshabilitar colaboraciones anonimas --- app/assets/stylesheets/application.scss | 7 +++++-- app/controllers/sites_controller.rb | 1 + app/views/sites/_form.haml | 8 ++++++++ config/locales/en.yml | 4 ++++ config/locales/es.yml | 4 ++++ 5 files changed, 22 insertions(+), 2 deletions(-) diff --git a/app/assets/stylesheets/application.scss b/app/assets/stylesheets/application.scss index f6db8fef..f10d81a8 100644 --- a/app/assets/stylesheets/application.scss +++ b/app/assets/stylesheets/application.scss @@ -1,13 +1,16 @@ //= require_tree . -@import "bootstrap"; - $black: black; $white: white; $grey: grey; $cyan: #13fefe; $magenta: #f206f9; +// Redefinir variables de Bootstrap +$primary: $magenta; + +@import "bootstrap"; + :root { --foreground: #{$black}; --background: #{$white}; diff --git a/app/controllers/sites_controller.rb b/app/controllers/sites_controller.rb index 598c7755..031cec6d 100644 --- a/app/controllers/sites_controller.rb +++ b/app/controllers/sites_controller.rb @@ -113,6 +113,7 @@ class SitesController < ApplicationController def site_params params.require(:site) .permit(:name, :design_id, :licencia_id, :description, :title, + :colaboracion_anonima, deploys_attributes: %i[type id _destroy]) end end diff --git a/app/views/sites/_form.haml b/app/views/sites/_form.haml index 18814dca..f0dc1189 100644 --- a/app/views/sites/_form.haml +++ b/app/views/sites/_form.haml @@ -92,6 +92,14 @@ = deploy.hidden_field :type - else + .form-group + %h2= t('.colaboracion_anonima.title') + %p.lead= t('.colaboracion_anonima.help') + + .custom-control.custom-switch + = f.check_box :colaboracion_anonima, class: 'custom-control-input' + = f.label :colaboracion_anonima, class: 'custom-control-label' + .form-group %h2= t('.deploys.title') %p.lead= t('.help.deploys') diff --git a/config/locales/en.yml b/config/locales/en.yml index a6a63709..aeb636b9 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -76,6 +76,7 @@ en: name: 'Name' title: 'Title' description: 'Description' + colaboracion_anonima: Enable anonymous collaboration errors: models: site: @@ -319,6 +320,9 @@ en: title: 'Privacy policy and code of conduct' deploys: title: 'Where do you want your site to be hosted?' + colaboracion_anonima: + title: 'Accept anonymous collaboration' + help: 'By allowing anonymous collaboration, you enable visitors to send articles without a Sutty account. Nothing is published without your consent, so make sure to check drafts regularly. This feature can expose you to attacks and violence, so we recommend you enable it with care.' fetch: title: 'Upgrade the site' help: diff --git a/config/locales/es.yml b/config/locales/es.yml index 832d8fa3..4b0c489f 100644 --- a/config/locales/es.yml +++ b/config/locales/es.yml @@ -79,6 +79,7 @@ es: name: 'Nombre' title: 'Título' description: 'Descripción' + colaboracion_anonima: Habilitar colaboración anónima errors: models: site: @@ -327,6 +328,9 @@ es: title: Políticas de privacidad y código de convivencia deploys: title: '¿Dónde querés alojar tu sitio?' + colaboracion_anonima: + title: 'Aceptar colaboraciones anónimas' + help: 'Al permitir colaboraciones anónimas, habilitamos a les visitantes del sitio a enviar contenido sin necesidad de una cuenta en Sutty. Nada se publica sin tu consentimiento, así que revisa los borradores regularmente. Esto también te puede exponer a ataques y violencias, por lo que es una característica que recomendamos usar con cuidado.' fetch: title: 'Actualizar el sitio' help: