5
0
Fork 0
mirror of https://0xacab.org/sutty/sutty synced 2024-11-19 00:26:21 +00:00

Merge branch 'issue-12795' into panel.sutty.nl
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful

This commit is contained in:
f 2023-03-28 18:20:08 -03:00
commit 8968165ce9
7 changed files with 75 additions and 1 deletions

View file

@ -84,6 +84,7 @@ class ApplicationController < ActionController::Base
protected
def configure_permitted_parameters
devise_parameter_sanitizer.permit(:sign_up, keys: Usuarie::CONSENT_FIELDS)
devise_parameter_sanitizer.permit(:account_update, keys: %i[lang])
end

View file

@ -2,6 +2,8 @@
# Usuarie de la plataforma
class Usuarie < ApplicationRecord
include Usuarie::Consent
devise :invitable, :database_authenticatable,
:recoverable, :rememberable, :validatable,
:confirmable, :lockable, :registerable

View 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

View file

@ -2,7 +2,7 @@
- 'black-bg'
.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')
%p= t('.help')
@ -39,6 +39,22 @@
min: @minimum_password_length,
aria: { describedby: 'minimum-password-length' },
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
= f.submit t('.sign_up'),
class: 'btn btn-lg btn-block'

View file

@ -104,6 +104,25 @@ en:
new:
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.
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_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.

View file

@ -104,6 +104,24 @@ es:
new:
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.
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_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.

View 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