mirror of
https://0xacab.org/sutty/sutty
synced 2025-02-24 09:21:47 +00:00
Merge branch 'issue-12795' into panel.sutty.nl
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
This commit is contained in:
commit
8968165ce9
7 changed files with 75 additions and 1 deletions
|
@ -84,6 +84,7 @@ class ApplicationController < ActionController::Base
|
||||||
protected
|
protected
|
||||||
|
|
||||||
def configure_permitted_parameters
|
def configure_permitted_parameters
|
||||||
|
devise_parameter_sanitizer.permit(:sign_up, keys: Usuarie::CONSENT_FIELDS)
|
||||||
devise_parameter_sanitizer.permit(:account_update, keys: %i[lang])
|
devise_parameter_sanitizer.permit(:account_update, keys: %i[lang])
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -2,6 +2,8 @@
|
||||||
|
|
||||||
# Usuarie de la plataforma
|
# Usuarie de la plataforma
|
||||||
class Usuarie < ApplicationRecord
|
class Usuarie < ApplicationRecord
|
||||||
|
include Usuarie::Consent
|
||||||
|
|
||||||
devise :invitable, :database_authenticatable,
|
devise :invitable, :database_authenticatable,
|
||||||
:recoverable, :rememberable, :validatable,
|
:recoverable, :rememberable, :validatable,
|
||||||
:confirmable, :lockable, :registerable
|
:confirmable, :lockable, :registerable
|
||||||
|
|
6
app/views/bootstrap/_custom_checkbox.haml
Normal file
6
app/views/bootstrap/_custom_checkbox.haml
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
- help_id = "#{id}_help"
|
||||||
|
|
||||||
|
.custom-control.custom-checkbox
|
||||||
|
%input.custom-control-input{ id: id, type: 'checkbox', name: name, value: value, required: required }
|
||||||
|
%label.custom-control-label{ for: id, aria: { describedby: help_id } }= content
|
||||||
|
%small.form-text.text-muted{ id: help_id }= yield
|
|
@ -2,7 +2,7 @@
|
||||||
- 'black-bg'
|
- 'black-bg'
|
||||||
|
|
||||||
.row.align-items-center.justify-content-center.full-height
|
.row.align-items-center.justify-content-center.full-height
|
||||||
.col-md-5.align-self-center
|
.col-md-6.align-self-center
|
||||||
%h2= t('.sign_up')
|
%h2= t('.sign_up')
|
||||||
%p= t('.help')
|
%p= t('.help')
|
||||||
|
|
||||||
|
@ -39,6 +39,22 @@
|
||||||
min: @minimum_password_length,
|
min: @minimum_password_length,
|
||||||
aria: { describedby: 'minimum-password-length' },
|
aria: { describedby: 'minimum-password-length' },
|
||||||
placeholder: t("#{password}_confirmation")
|
placeholder: t("#{password}_confirmation")
|
||||||
|
|
||||||
|
- if params[:consent]
|
||||||
|
.form-group
|
||||||
|
- Usuarie::CONSENT_FIELDS.each do |field|
|
||||||
|
- required = t(".#{field}.required", default: '').present?
|
||||||
|
- id = "usuarie_#{field}"
|
||||||
|
- name = "usuarie[#{field}]"
|
||||||
|
- content = t(".#{field}.label")
|
||||||
|
- href = t(".#{field}.href", default: '')
|
||||||
|
- help_content = t(".#{field}.help")
|
||||||
|
= render 'bootstrap/custom_checkbox', id: id, name: name, content: content, required: required, value: "1" do
|
||||||
|
- if href.present?
|
||||||
|
= link_to help_content, href, target: '_blank', rel: 'noopener'
|
||||||
|
- else
|
||||||
|
= help_content
|
||||||
|
|
||||||
.actions
|
.actions
|
||||||
= f.submit t('.sign_up'),
|
= f.submit t('.sign_up'),
|
||||||
class: 'btn btn-lg btn-block'
|
class: 'btn btn-lg btn-block'
|
||||||
|
|
|
@ -104,6 +104,25 @@ en:
|
||||||
new:
|
new:
|
||||||
sign_up: Sign up
|
sign_up: Sign up
|
||||||
help: We only ask for an e-mail address and a password. The password is safely stored, no one else besides you knows it! You'll also receive an e-mail to confirm your account.
|
help: We only ask for an e-mail address and a password. The password is safely stored, no one else besides you knows it! You'll also receive an e-mail to confirm your account.
|
||||||
|
privacy_policy_accepted:
|
||||||
|
label: "I know about Sutty's privacy policy"
|
||||||
|
help: "Read privacy policy"
|
||||||
|
href: "https://sutty.nl/en/privacy-policy/"
|
||||||
|
required: true
|
||||||
|
terms_of_service_accepted:
|
||||||
|
label: "My sites won't promote hate towards minorities"
|
||||||
|
help: "Read terms of service"
|
||||||
|
href: "https://sutty.nl/en/terms-of-service/"
|
||||||
|
required: true
|
||||||
|
code_of_conduct_accepted:
|
||||||
|
label: "My sites are inclusive spaces"
|
||||||
|
help: "Read codes for sharing"
|
||||||
|
href: "https://sutty.nl/en/code-of-conduct/"
|
||||||
|
required: true
|
||||||
|
available_for_feedback_accepted:
|
||||||
|
label: "I'm available to provide feedback"
|
||||||
|
help: "We may contact you occasionaly"
|
||||||
|
required: false
|
||||||
signed_up: Welcome! You have signed up successfully.
|
signed_up: Welcome! You have signed up successfully.
|
||||||
signed_up_but_inactive: You have signed up successfully. However, we could not sign you in because your account is not yet activated.
|
signed_up_but_inactive: You have signed up successfully. However, we could not sign you in because your account is not yet activated.
|
||||||
signed_up_but_locked: You have signed up successfully. However, we could not sign you in because your account is locked.
|
signed_up_but_locked: You have signed up successfully. However, we could not sign you in because your account is locked.
|
||||||
|
|
|
@ -104,6 +104,24 @@ es:
|
||||||
new:
|
new:
|
||||||
sign_up: Registrarme
|
sign_up: Registrarme
|
||||||
help: Para registrarte solo pedimos una dirección de correo y una contraseña. La contraseña se almacena de forma segura, ¡nadie más que vos la sabe! Recibirás un correo de confirmación de cuenta.
|
help: Para registrarte solo pedimos una dirección de correo y una contraseña. La contraseña se almacena de forma segura, ¡nadie más que vos la sabe! Recibirás un correo de confirmación de cuenta.
|
||||||
|
privacy_policy_accepted:
|
||||||
|
label: "Conozco la política de privacidad de Sutty"
|
||||||
|
help: "Leer política de privacidad"
|
||||||
|
href: "https://sutty.nl/politica-de-privacidad/"
|
||||||
|
required: "true"
|
||||||
|
terms_of_service_accepted:
|
||||||
|
label: "Mis sitios no promueven el odio a minorías"
|
||||||
|
help: "Leer términos de servicio"
|
||||||
|
href: "https://sutty.nl/terminos-de-servicio/"
|
||||||
|
required: "true"
|
||||||
|
code_of_conduct_accepted:
|
||||||
|
label: "Mis sitios son espacios inclusivos"
|
||||||
|
help: "Leer códigos para compartir"
|
||||||
|
href: "https://sutty.nl/codigo-de-convivencia/"
|
||||||
|
required: "true"
|
||||||
|
available_for_feedback_accepted:
|
||||||
|
label: "Estoy disponible para ofrecer retroalimentación"
|
||||||
|
help: "Te contactaremos ocasionalmente"
|
||||||
signed_up: Bienvenide. Tu cuenta fue creada.
|
signed_up: Bienvenide. Tu cuenta fue creada.
|
||||||
signed_up_but_inactive: Tu cuenta ha sido creada correctamente. Sin embargo, no hemos podido iniciar la sesión porque tu cuenta aún no está activada.
|
signed_up_but_inactive: Tu cuenta ha sido creada correctamente. Sin embargo, no hemos podido iniciar la sesión porque tu cuenta aún no está activada.
|
||||||
signed_up_but_locked: Tu cuenta ha sido creada correctamente. Sin embargo, no hemos podido iniciar la sesión porque que tu cuenta está bloqueada.
|
signed_up_but_locked: Tu cuenta ha sido creada correctamente. Sin embargo, no hemos podido iniciar la sesión porque que tu cuenta está bloqueada.
|
||||||
|
|
12
db/migrate/20230328200129_add_consent_to_usuaries.rb
Normal file
12
db/migrate/20230328200129_add_consent_to_usuaries.rb
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
|
# Agrega consentimientos a les usuaries. No usamos un loop de
|
||||||
|
# Usuarie::CONSENT_FIELDS porque quizás agreguemos campos luego.
|
||||||
|
class AddConsentToUsuaries < ActiveRecord::Migration[6.1]
|
||||||
|
def change
|
||||||
|
add_column :usuaries, :privacy_policy_accepted_at, :datetime
|
||||||
|
add_column :usuaries, :terms_of_service_accepted_at, :datetime
|
||||||
|
add_column :usuaries, :code_of_conduct_accepted_at, :datetime
|
||||||
|
add_column :usuaries, :available_for_feedback_accepted_at, :datetime
|
||||||
|
end
|
||||||
|
end
|
Loading…
Reference in a new issue