decidim-core 0.0.1 → 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Rakefile +1 -1
- data/app/assets/config/decidim_core_manifest.js +1 -0
- data/app/assets/javascripts/decidim.js.es6 +3 -2
- data/app/assets/javascripts/decidim/append_elements.js.es6 +8 -0
- data/app/assets/javascripts/decidim/filters.js.es6 +22 -0
- data/app/assets/javascripts/decidim/form_filter.component.js.es6 +176 -0
- data/app/assets/javascripts/decidim/form_filter.component.test.js +151 -0
- data/app/assets/javascripts/decidim/inline_svg.js.es6 +12 -0
- data/app/assets/javascripts/decidim/user_registrations.js.es6 +22 -0
- data/app/assets/stylesheets/decidim/_variables.scss +1 -1
- data/app/assets/stylesheets/decidim/modules/_comments.scss +3 -6
- data/app/assets/stylesheets/decidim/modules/_cookie-bar.scss +22 -0
- data/app/assets/stylesheets/decidim/modules/_layout.scss +9 -1
- data/app/assets/stylesheets/decidim/modules/_navbar.scss +8 -5
- data/app/assets/stylesheets/decidim/modules/_order-by.scss +0 -1
- data/app/assets/stylesheets/decidim/modules/_process-phase.scss +4 -0
- data/app/assets/stylesheets/decidim/modules/_timeline.scss +62 -80
- data/app/assets/stylesheets/decidim/modules/_typography.scss +20 -31
- data/app/assets/stylesheets/decidim/utils/_fontface.scss +4 -16
- data/app/assets/stylesheets/decidim/utils/_settings.scss +29 -26
- data/app/assets/stylesheets/decidim/utils/_variables.scss +22 -0
- data/app/commands/decidim/authorize_user.rb +17 -1
- data/app/commands/decidim/create_omniauth_registration.rb +92 -0
- data/app/commands/decidim/create_registration.rb +50 -0
- data/app/commands/decidim/invite_user.rb +50 -0
- data/app/commands/decidim/invite_user_again.rb +25 -0
- data/app/commands/decidim/remove_user_role.rb +26 -0
- data/app/controllers/concerns/decidim/feature_settings.rb +27 -0
- data/app/controllers/concerns/decidim/filter_resource.rb +71 -0
- data/app/controllers/concerns/decidim/form_factory.rb +21 -18
- data/app/controllers/concerns/decidim/needs_participatory_process.rb +2 -3
- data/app/controllers/decidim/devise/confirmations_controller.rb +2 -0
- data/app/controllers/decidim/devise/invitations_controller.rb +4 -0
- data/app/controllers/decidim/devise/omniauth_registrations_controller.rb +96 -0
- data/app/controllers/decidim/devise/passwords_controller.rb +2 -0
- data/app/controllers/decidim/devise/registrations_controller.rb +34 -0
- data/app/controllers/decidim/devise/sessions_controller.rb +1 -0
- data/app/controllers/decidim/pages_controller.rb +10 -2
- data/app/controllers/decidim/participatory_process_steps_controller.rb +16 -0
- data/app/controllers/decidim/participatory_processes_controller.rb +6 -11
- data/app/forms/decidim/form.rb +6 -6
- data/app/forms/decidim/invite_admin_form.rb +37 -0
- data/app/forms/decidim/omniauth_registration_form.rb +24 -0
- data/app/forms/decidim/registration_form.rb +41 -0
- data/app/helpers/decidim/filters_helper.rb +21 -0
- data/app/helpers/decidim/layout_helper.rb +17 -1
- data/app/helpers/decidim/omniauth_helper.rb +23 -0
- data/app/helpers/decidim/paginate_helper.rb +21 -0
- data/app/helpers/decidim/participatory_process_helper.rb +14 -0
- data/app/helpers/decidim/participatory_process_steps_helper.rb +17 -0
- data/app/mailers/decidim/decidim_devise_mailer.rb +2 -2
- data/app/models/decidim/feature.rb +40 -0
- data/app/models/decidim/identity.rb +12 -0
- data/app/models/decidim/organization.rb +3 -10
- data/app/models/decidim/user.rb +3 -1
- data/app/models/decidim/user_group.rb +18 -0
- data/app/models/decidim/user_group_membership.rb +9 -0
- data/app/services/decidim/authorization_handler.rb +13 -13
- data/app/services/decidim/resource_search.rb +52 -0
- data/app/uploaders/decidim/organization_logo_uploader.rb +1 -1
- data/app/views/decidim/authorizations/new.html.erb +3 -1
- data/app/views/decidim/devise/omniauth_registrations/new.html.erb +40 -0
- data/app/views/decidim/devise/registrations/new.html.erb +21 -1
- data/app/views/decidim/devise/sessions/new.html.erb +1 -0
- data/app/views/decidim/devise/shared/_links.html.erb +0 -8
- data/app/views/decidim/devise/shared/_omniauth_buttons.html.erb +21 -0
- data/app/views/decidim/participatory_process_steps/_participatory_process_step.html.erb +16 -0
- data/app/views/decidim/participatory_process_steps/_timeline.html.erb +7 -0
- data/app/views/decidim/participatory_process_steps/index.html.erb +12 -0
- data/app/views/decidim/participatory_processes/show.html.erb +5 -5
- data/app/views/decidim/shared/_login_modal.html.erb +30 -0
- data/app/views/devise/mailer/invite_admin.html.erb +17 -0
- data/app/views/devise/mailer/invite_admin.text.erb +15 -0
- data/app/views/devise/mailer/organization_admin_invitation_instructions.html.erb +1 -1
- data/app/views/devise/mailer/organization_admin_invitation_instructions.text.erb +1 -1
- data/app/views/layouts/decidim/_application.html.erb +1 -0
- data/app/views/layouts/decidim/_header.html.erb +1 -1
- data/app/views/layouts/decidim/_meta.html.erb +1 -0
- data/app/views/layouts/decidim/_process_header.html.erb +12 -1
- data/app/views/layouts/decidim/_process_header_steps.html.erb +1 -0
- data/app/views/layouts/decidim/_social_meta.html.erb +11 -0
- data/app/views/layouts/decidim/participatory_process.html.erb +4 -0
- data/app/views/pages/home.html.erb +29 -2
- data/config/i18n-tasks.yml +1 -0
- data/config/initializers/devise.rb +10 -1
- data/config/locales/ca.yml +45 -3
- data/config/locales/en.yml +45 -3
- data/config/locales/es.yml +45 -3
- data/config/routes.rb +9 -2
- data/config/secrets.yml +36 -0
- data/db/migrate/20170110133113_add_configuration_to_features.rb +7 -0
- data/db/migrate/20170110153807_add_handler_to_organization.rb +5 -0
- data/db/migrate/20170116110851_create_identities.rb +11 -0
- data/db/migrate/20170116135237_loosen_step_requirements.rb +6 -0
- data/db/migrate/20170117142904_add_uniqueness_field_to_authorizations.rb +7 -0
- data/db/migrate/20170119145359_create_user_groups.rb +11 -0
- data/db/migrate/20170119150255_create_user_group_memberships.rb +12 -0
- data/db/migrate/20170119150649_add_show_statistics_to_organization.rb +5 -0
- data/db/migrate/20170120120733_add_user_groups_verified.rb +5 -0
- data/db/seeds.rb +45 -79
- data/lib/decidim/core.rb +8 -0
- data/lib/decidim/core/engine.rb +8 -0
- data/lib/decidim/core/test/factories.rb +188 -0
- data/lib/decidim/core/version.rb +1 -1
- data/lib/decidim/devise_failure_app.rb +1 -0
- data/lib/decidim/feature_manifest.rb +27 -0
- data/lib/decidim/features/base_controller.rb +8 -3
- data/lib/decidim/features/settings_manifest.rb +94 -0
- data/lib/decidim/filter_form_builder.rb +56 -0
- data/lib/decidim/form_builder.rb +4 -7
- data/vendor/assets/javascripts/svg-injector.js +464 -0
- metadata +142 -26
- data/app/assets/stylesheets/decidim/modules/_owl-carousel.scss +0 -72
- data/app/assets/stylesheets/decidim/modules/_phase-nav.scss +0 -177
- data/app/assets/stylesheets/decidim/utils/_helpers.sass +0 -21
- data/app/assets/stylesheets/decidim/utils/_keyframes.sass +0 -13
- data/app/assets/stylesheets/decidim/utils/_mixins.sass +0 -33
data/config/locales/en.yml
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
---
|
|
2
2
|
en:
|
|
3
|
+
activemodel:
|
|
4
|
+
attributes:
|
|
5
|
+
user:
|
|
6
|
+
user_group_document_number: Organization document number
|
|
7
|
+
user_group_name: Organization name
|
|
8
|
+
user_group_phone: Organization phone
|
|
3
9
|
activerecord:
|
|
4
10
|
attributes:
|
|
5
11
|
decidim/user:
|
|
@@ -27,6 +33,8 @@ en:
|
|
|
27
33
|
title: My account
|
|
28
34
|
authorization_handlers:
|
|
29
35
|
decidim/dummy_authorization_handler: Example authorization
|
|
36
|
+
errors:
|
|
37
|
+
duplicate_authorization: A user is already authorized with the same data.
|
|
30
38
|
authorizations:
|
|
31
39
|
create:
|
|
32
40
|
error: There was an error creating the authorization.
|
|
@@ -47,11 +55,22 @@ en:
|
|
|
47
55
|
actions:
|
|
48
56
|
unauthorized: You are not authorized to perform this action
|
|
49
57
|
devise:
|
|
58
|
+
omniauth_registrations:
|
|
59
|
+
create:
|
|
60
|
+
email_already_exists: Another account is using the same email address
|
|
61
|
+
new:
|
|
62
|
+
complete_profile: Complete profile
|
|
63
|
+
sign_up: Complete your profile
|
|
64
|
+
subtitle: Please fill in the following form in order to complete the sign up
|
|
50
65
|
registrations:
|
|
51
66
|
new:
|
|
52
67
|
already_have_an_account?: Already have an account?
|
|
53
68
|
sign_in: Log in
|
|
54
69
|
sign_up: Sign up
|
|
70
|
+
sign_up_as:
|
|
71
|
+
legend: Sign up as
|
|
72
|
+
user: Individual
|
|
73
|
+
user_group: Organization/Collective
|
|
55
74
|
subtitle: Sign up to participate in discussions and support proposals.
|
|
56
75
|
terms: the terms and conditions of use
|
|
57
76
|
tos_agreement: By signing up you agree to %{link}.
|
|
@@ -60,30 +79,45 @@ en:
|
|
|
60
79
|
new:
|
|
61
80
|
are_you_new?: New to the platform?
|
|
62
81
|
register: Create an account
|
|
82
|
+
shared:
|
|
83
|
+
omniauth_buttons:
|
|
84
|
+
or: Or
|
|
63
85
|
menu:
|
|
64
86
|
home: Home
|
|
65
87
|
processes: Processes
|
|
88
|
+
participatory_process_steps:
|
|
89
|
+
index:
|
|
90
|
+
process_steps: Process steps
|
|
91
|
+
participatory_process_step:
|
|
92
|
+
info: Information
|
|
66
93
|
participatory_processes:
|
|
67
94
|
documents:
|
|
68
95
|
related_documents: Related documents
|
|
69
96
|
photos:
|
|
70
97
|
related_photos: Related photos
|
|
98
|
+
shared:
|
|
99
|
+
login_modal:
|
|
100
|
+
please_sign_in: Please sign in
|
|
101
|
+
sign_up: Sign up
|
|
71
102
|
devise:
|
|
72
103
|
mailer:
|
|
73
104
|
invitation_instructions:
|
|
74
105
|
accept: Accept invitation
|
|
75
106
|
accept_until: This invitation will be due in %{due_date}.
|
|
76
|
-
hello: Hello %{email}
|
|
107
|
+
hello: Hello %{email},
|
|
77
108
|
ignore: |-
|
|
78
109
|
If you don't want to accept the invitation, please ignore this email.<br />
|
|
79
110
|
Your account won't be created until you access the link above and set your password.
|
|
111
|
+
invited_you_as_admin: "%{invited_by} has invited you as an admin of %{application}, you can accept it through the link below."
|
|
80
112
|
someone_invited_you: Someone has invited you to %{application}, you can accept it through the link below.
|
|
113
|
+
invite_admin:
|
|
114
|
+
subject: You've been invited to manage %{organization}
|
|
81
115
|
organization_admin_invitation_instructions:
|
|
82
|
-
subject: You've been invited to
|
|
116
|
+
subject: You've been invited to manage %{organization}
|
|
83
117
|
password_change:
|
|
84
118
|
greeting: Hello %{recipient}!
|
|
85
119
|
message: We're contacting you to notify you that your password has been changed.
|
|
86
|
-
subject: Password
|
|
120
|
+
subject: Password changed
|
|
87
121
|
errors:
|
|
88
122
|
messages:
|
|
89
123
|
file_size_is_less_than_or_equal_to: file size must be less than or equal to %{count}
|
|
@@ -115,6 +149,10 @@ en:
|
|
|
115
149
|
active_step: 'Current step:'
|
|
116
150
|
more_info: More info
|
|
117
151
|
take_part: Take part
|
|
152
|
+
process_header:
|
|
153
|
+
process_menu_item: The process
|
|
154
|
+
process_header_steps:
|
|
155
|
+
view_steps: View steps
|
|
118
156
|
user_menu:
|
|
119
157
|
profile: My account
|
|
120
158
|
sign_out: Sign out
|
|
@@ -143,6 +181,10 @@ en:
|
|
|
143
181
|
proposals_explanation: Open space for citizen proposals about what kind of city we want to live in.
|
|
144
182
|
register: Register
|
|
145
183
|
see_all_processes: See all processes
|
|
184
|
+
stats:
|
|
185
|
+
headline: Current state of %{organization}
|
|
186
|
+
processes: Processes
|
|
187
|
+
users: Users
|
|
146
188
|
welcome: Welcome to %{organization}!
|
|
147
189
|
views:
|
|
148
190
|
pagination:
|
data/config/locales/es.yml
CHANGED
|
@@ -1,4 +1,10 @@
|
|
|
1
1
|
es:
|
|
2
|
+
activemodel:
|
|
3
|
+
attributes:
|
|
4
|
+
user:
|
|
5
|
+
user_group_document_number: Número de documento acreditativo
|
|
6
|
+
user_group_name: Nombre de la Organización
|
|
7
|
+
user_group_phone: Teléfono de la organización
|
|
2
8
|
activerecord:
|
|
3
9
|
attributes:
|
|
4
10
|
decidim/user:
|
|
@@ -26,6 +32,8 @@ es:
|
|
|
26
32
|
title: Mi cuenta
|
|
27
33
|
authorization_handlers:
|
|
28
34
|
decidim/dummy_authorization_handler: Autorización de ejemplo
|
|
35
|
+
errors:
|
|
36
|
+
duplicate_authorization: Un usuario ya está autorizado con los mismos datos.
|
|
29
37
|
authorizations:
|
|
30
38
|
create:
|
|
31
39
|
error: Se ha producido un error al crear la autorización.
|
|
@@ -46,11 +54,22 @@ es:
|
|
|
46
54
|
actions:
|
|
47
55
|
unauthorized: No tienes permiso para realizar esta acción.
|
|
48
56
|
devise:
|
|
57
|
+
omniauth_registrations:
|
|
58
|
+
create:
|
|
59
|
+
email_already_exists: Otra cuenta utiliza la misma dirección de correo electrónico
|
|
60
|
+
new:
|
|
61
|
+
complete_profile: Completar perfil
|
|
62
|
+
sign_up: Complete su perfil
|
|
63
|
+
subtitle: Por favor, rellene el siguiente formulario con el fin de completar la inscripción
|
|
49
64
|
registrations:
|
|
50
65
|
new:
|
|
51
66
|
already_have_an_account?: '¿Ya tienes una cuenta?'
|
|
52
67
|
sign_in: Entra
|
|
53
68
|
sign_up: Regístrate
|
|
69
|
+
sign_up_as:
|
|
70
|
+
legend: Inscribirse como
|
|
71
|
+
user: Individual
|
|
72
|
+
user_group: Organización/Colectivo
|
|
54
73
|
subtitle: Crea una cuenta para poder participar en los debates y apoyar las propuestas.
|
|
55
74
|
terms: los términos y condiciones de uso
|
|
56
75
|
tos_agreement: Al registrarte aceptas %{link}.
|
|
@@ -59,30 +78,45 @@ es:
|
|
|
59
78
|
new:
|
|
60
79
|
are_you_new?: '¿Eres nuevo en la plataforma?'
|
|
61
80
|
register: Créate una cuenta
|
|
81
|
+
shared:
|
|
82
|
+
omniauth_buttons:
|
|
83
|
+
or: O
|
|
62
84
|
menu:
|
|
63
85
|
home: Inicio
|
|
64
86
|
processes: Procesos
|
|
87
|
+
participatory_process_steps:
|
|
88
|
+
index:
|
|
89
|
+
process_steps: Las fases de proceso
|
|
90
|
+
participatory_process_step:
|
|
91
|
+
info: Información
|
|
65
92
|
participatory_processes:
|
|
66
93
|
documents:
|
|
67
94
|
related_documents: Documentos relacionados
|
|
68
95
|
photos:
|
|
69
96
|
related_photos: Fotos relacionadas
|
|
97
|
+
shared:
|
|
98
|
+
login_modal:
|
|
99
|
+
please_sign_in: Por favor, regístrese
|
|
100
|
+
sign_up: Regístrese
|
|
70
101
|
devise:
|
|
71
102
|
mailer:
|
|
72
103
|
invitation_instructions:
|
|
73
104
|
accept: Aceptar invitación
|
|
74
105
|
accept_until: Esta invitación caducará el día %{due_date}.
|
|
75
|
-
hello: Hola %{email}
|
|
106
|
+
hello: Hola %{email},
|
|
76
107
|
ignore: |-
|
|
77
108
|
Si no quieres aceptar la invitación ignora este correo.<br />
|
|
78
109
|
Tu cuenta no se creará hasta que accedas al enlance de abajo y escojas tu contraseña.
|
|
110
|
+
invited_you_as_admin: "%{invited_by} te ha invitado como administrador de %{application}, puedes aceptar a través del siguiente enlace."
|
|
79
111
|
someone_invited_you: Alguien te ha invitado a %{application}, puedes aceptar la invitación con el enlace a continuación.
|
|
112
|
+
invite_admin:
|
|
113
|
+
subject: Has sido invitado para gestionar %{organization}
|
|
80
114
|
organization_admin_invitation_instructions:
|
|
81
|
-
subject:
|
|
115
|
+
subject: Has sido invitado para gestionar %{organization}
|
|
82
116
|
password_change:
|
|
83
117
|
greeting: '¡Hola %{recipient}!'
|
|
84
118
|
message: Nos ponemos en contacto contigo para notificarte que tu contraseña ha sido cambiada correctamente.
|
|
85
|
-
subject: Contraseña
|
|
119
|
+
subject: Contraseña modificada
|
|
86
120
|
errors:
|
|
87
121
|
messages:
|
|
88
122
|
file_size_is_less_than_or_equal_to: el tamaño del archivo debe ser menor que o igual a %{count}
|
|
@@ -114,6 +148,10 @@ es:
|
|
|
114
148
|
active_step: 'Fase actual:'
|
|
115
149
|
more_info: Más información
|
|
116
150
|
take_part: Participa
|
|
151
|
+
process_header:
|
|
152
|
+
process_menu_item: El proceso
|
|
153
|
+
process_header_steps:
|
|
154
|
+
view_steps: Ver las fases
|
|
117
155
|
user_menu:
|
|
118
156
|
profile: Mi cuenta
|
|
119
157
|
sign_out: Sal
|
|
@@ -142,6 +180,10 @@ es:
|
|
|
142
180
|
proposals_explanation: Espacio abierto de propuestas de los ciudadanos sobre en qué tipo de ciudad queremos vivir.
|
|
143
181
|
register: Regístrate
|
|
144
182
|
see_all_processes: Ver todos los procesos
|
|
183
|
+
stats:
|
|
184
|
+
headline: Estado actual de %{organization}
|
|
185
|
+
processes: Procesos
|
|
186
|
+
users: Usuarios
|
|
145
187
|
welcome: Bienvenido/da %{organization}!
|
|
146
188
|
views:
|
|
147
189
|
pagination:
|
data/config/routes.rb
CHANGED
|
@@ -11,11 +11,18 @@ Decidim::Core::Engine.routes.draw do
|
|
|
11
11
|
sessions: "decidim/devise/sessions",
|
|
12
12
|
confirmations: "decidim/devise/confirmations",
|
|
13
13
|
registrations: "decidim/devise/registrations",
|
|
14
|
-
passwords: "decidim/devise/passwords"
|
|
14
|
+
passwords: "decidim/devise/passwords",
|
|
15
|
+
omniauth_callbacks: "decidim/devise/omniauth_registrations"
|
|
15
16
|
}
|
|
16
17
|
|
|
18
|
+
devise_scope :user do
|
|
19
|
+
post "omniauth_registrations" => "devise/omniauth_registrations#create"
|
|
20
|
+
end
|
|
21
|
+
|
|
17
22
|
resource :locale, only: [:create]
|
|
18
|
-
resources :participatory_processes, only: [:index, :show]
|
|
23
|
+
resources :participatory_processes, only: [:index, :show] do
|
|
24
|
+
resources :participatory_process_steps, only: [:index]
|
|
25
|
+
end
|
|
19
26
|
|
|
20
27
|
scope "/participatory_processes/:participatory_process_id/features/:feature_id" do
|
|
21
28
|
Decidim.feature_manifests.each do |manifest|
|
data/config/secrets.yml
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# Be sure to restart your server when you modify this file.
|
|
2
|
+
|
|
3
|
+
# Your secret key is used for verifying the integrity of signed cookies.
|
|
4
|
+
# If you change this key, all old signed cookies will become invalid!
|
|
5
|
+
|
|
6
|
+
# Make sure the secret is at least 30 characters and all random,
|
|
7
|
+
# no regular words or you'll be exposed to dictionary attacks.
|
|
8
|
+
# You can use `rails secret` to generate a secure secret key.
|
|
9
|
+
|
|
10
|
+
# Make sure the secrets in this file are kept private
|
|
11
|
+
# if you're sharing your code publicly.
|
|
12
|
+
|
|
13
|
+
default: &default
|
|
14
|
+
omniauth:
|
|
15
|
+
facebook:
|
|
16
|
+
enabled: true
|
|
17
|
+
app_id: <%= ENV["OMNIAUTH_FACEBOOK_APP_ID"] %>
|
|
18
|
+
app_secret: <%= ENV["OMNIAUTH_FACEBOOK_APP_SECRET"] %>
|
|
19
|
+
twitter:
|
|
20
|
+
enabled: true
|
|
21
|
+
api_key: <%= ENV["OMNIAUTH_TWITTER_API_KEY"] %>
|
|
22
|
+
api_secret: <%= ENV["OMNIAUTH_TWITTER_API_SECRET"] %>
|
|
23
|
+
|
|
24
|
+
development:
|
|
25
|
+
<<: *default
|
|
26
|
+
secret_key_base: 40d3a76fcae6d7298712dd2d403a3820cc37e0e82d56f5e26f7aba255a023c801d20e7e1472e1616da61308bcc74f4a2710a94b2382ca2aa21e4b0840767fd08
|
|
27
|
+
|
|
28
|
+
test:
|
|
29
|
+
<<: *default
|
|
30
|
+
secret_key_base: 0d21437a814053102ecc4c8905ec8eb990c86b65c8ecfdddbadfdb3c75fe0fd3ab88368896237b0984694f9a7bc747e9d92642e01caab31942abb4ce94b5ff1a
|
|
31
|
+
|
|
32
|
+
# Do not keep production secrets in the repository,
|
|
33
|
+
# instead read values from the environment.
|
|
34
|
+
production:
|
|
35
|
+
<<: *default
|
|
36
|
+
secret_key_base: <%= ENV["SECRET_KEY_BASE"] %>
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
class CreateIdentities < ActiveRecord::Migration[5.0]
|
|
2
|
+
def change
|
|
3
|
+
create_table :decidim_identities do |t|
|
|
4
|
+
t.string :provider, null: false
|
|
5
|
+
t.string :uid, null: false
|
|
6
|
+
t.references :decidim_user, null: false, index: true
|
|
7
|
+
end
|
|
8
|
+
|
|
9
|
+
add_index :decidim_identities, [:provider, :uid], unique: true
|
|
10
|
+
end
|
|
11
|
+
end
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
class CreateUserGroupMemberships < ActiveRecord::Migration[5.0]
|
|
2
|
+
def change
|
|
3
|
+
create_table :decidim_user_group_memberships do |t|
|
|
4
|
+
t.references :decidim_user, null: false, index: true
|
|
5
|
+
t.references :decidim_user_group, null: false, index: true
|
|
6
|
+
|
|
7
|
+
t.timestamps
|
|
8
|
+
end
|
|
9
|
+
|
|
10
|
+
add_index :decidim_user_group_memberships, [:decidim_user_id, :decidim_user_group_id], unique: true, name: "decidim_user_group_memberships_unique_user_and_group_ids"
|
|
11
|
+
end
|
|
12
|
+
end
|
data/db/seeds.rb
CHANGED
|
@@ -2,8 +2,9 @@
|
|
|
2
2
|
if !Rails.env.production? || ENV["SEED"]
|
|
3
3
|
require "decidim/faker/localized"
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
organization = Decidim::Organization.create!(
|
|
6
6
|
name: Faker::Company.name,
|
|
7
|
+
twitter_handler: Faker::Hipster.word,
|
|
7
8
|
host: ENV["DECIDIM_HOST"] || "localhost",
|
|
8
9
|
welcome_text: Decidim::Faker::Localized.sentence(5),
|
|
9
10
|
description: Decidim::Faker::Localized.wrapped("<p>", "</p>") do
|
|
@@ -14,12 +15,19 @@ if !Rails.env.production? || ENV["SEED"]
|
|
|
14
15
|
available_locales: Decidim.available_locales
|
|
15
16
|
)
|
|
16
17
|
|
|
18
|
+
3.times.each do |index|
|
|
19
|
+
Decidim::Scope.create!(
|
|
20
|
+
name: Faker::Address.unique.state,
|
|
21
|
+
organization: organization
|
|
22
|
+
)
|
|
23
|
+
end
|
|
24
|
+
|
|
17
25
|
Decidim::User.create!(
|
|
18
26
|
name: Faker::Name.name,
|
|
19
27
|
email: "admin@decidim.org",
|
|
20
28
|
password: "decidim123456",
|
|
21
29
|
password_confirmation: "decidim123456",
|
|
22
|
-
organization:
|
|
30
|
+
organization: organization,
|
|
23
31
|
confirmed_at: Time.current,
|
|
24
32
|
locale: I18n.default_locale,
|
|
25
33
|
roles: ["admin"],
|
|
@@ -33,87 +41,45 @@ if !Rails.env.production? || ENV["SEED"]
|
|
|
33
41
|
password_confirmation: "decidim123456",
|
|
34
42
|
confirmed_at: Time.current,
|
|
35
43
|
locale: I18n.default_locale,
|
|
36
|
-
organization:
|
|
44
|
+
organization: organization,
|
|
37
45
|
tos_agreement: true
|
|
38
46
|
)
|
|
39
47
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
Decidim::Faker::Localized.
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
Decidim::Faker::Localized.
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
title: Decidim::Faker::Localized.sentence(5),
|
|
60
|
-
slug: Faker::Internet.slug(nil, "-"),
|
|
61
|
-
subtitle: Decidim::Faker::Localized.sentence(2),
|
|
62
|
-
hashtag: "##{Faker::Lorem.word}",
|
|
63
|
-
short_description: Decidim::Faker::Localized.wrapped("<p>", "</p>") do
|
|
64
|
-
Decidim::Faker::Localized.sentence(3)
|
|
65
|
-
end,
|
|
66
|
-
description: Decidim::Faker::Localized.wrapped("<p>", "</p>") do
|
|
67
|
-
Decidim::Faker::Localized.paragraph(3)
|
|
68
|
-
end,
|
|
69
|
-
hero_image: File.new(File.join(File.dirname(__FILE__), "seeds", "city2.jpeg")),
|
|
70
|
-
banner_image: File.new(File.join(File.dirname(__FILE__), "seeds", "city3.jpeg")),
|
|
71
|
-
published_at: 1.week.ago,
|
|
72
|
-
organization: staging_organization
|
|
73
|
-
)
|
|
74
|
-
|
|
75
|
-
Decidim::ParticipatoryProcess.create!(
|
|
76
|
-
title: Decidim::Faker::Localized.sentence(5),
|
|
77
|
-
slug: Faker::Internet.slug(nil, "-"),
|
|
78
|
-
subtitle: Decidim::Faker::Localized.sentence(2),
|
|
79
|
-
hashtag: "##{Faker::Lorem.word}",
|
|
80
|
-
short_description: Decidim::Faker::Localized.wrapped("<p>", "</p>") do
|
|
81
|
-
Decidim::Faker::Localized.sentence(3)
|
|
82
|
-
end,
|
|
83
|
-
description: Decidim::Faker::Localized.wrapped("<p>", "</p>") do
|
|
84
|
-
Decidim::Faker::Localized.paragraph(3)
|
|
85
|
-
end,
|
|
86
|
-
hero_image: File.new(File.join(File.dirname(__FILE__), "seeds", "city3.jpeg")),
|
|
87
|
-
banner_image: File.new(File.join(File.dirname(__FILE__), "seeds", "city2.jpeg")),
|
|
88
|
-
organization: staging_organization
|
|
89
|
-
)
|
|
90
|
-
|
|
91
|
-
Decidim::ParticipatoryProcessStep.create!(
|
|
92
|
-
title: Decidim::Faker::Localized.sentence(5),
|
|
93
|
-
short_description: Decidim::Faker::Localized.wrapped("<p>", "</p>") do
|
|
94
|
-
Decidim::Faker::Localized.sentence(3)
|
|
95
|
-
end,
|
|
96
|
-
description: Decidim::Faker::Localized.wrapped("<p>", "</p>") do
|
|
97
|
-
Decidim::Faker::Localized.paragraph(3)
|
|
98
|
-
end,
|
|
99
|
-
active: true,
|
|
100
|
-
start_date: 1.month.ago.at_midnight,
|
|
101
|
-
end_date: 2.months.from_now.at_midnight,
|
|
102
|
-
participatory_process: participatory_process1
|
|
103
|
-
)
|
|
48
|
+
3.times do
|
|
49
|
+
Decidim::ParticipatoryProcess.create!(
|
|
50
|
+
title: Decidim::Faker::Localized.sentence(5),
|
|
51
|
+
slug: Faker::Internet.unique.slug(nil, "-"),
|
|
52
|
+
subtitle: Decidim::Faker::Localized.sentence(2),
|
|
53
|
+
hashtag: "##{Faker::Lorem.word}",
|
|
54
|
+
short_description: Decidim::Faker::Localized.wrapped("<p>", "</p>") do
|
|
55
|
+
Decidim::Faker::Localized.sentence(3)
|
|
56
|
+
end,
|
|
57
|
+
description: Decidim::Faker::Localized.wrapped("<p>", "</p>") do
|
|
58
|
+
Decidim::Faker::Localized.paragraph(3)
|
|
59
|
+
end,
|
|
60
|
+
hero_image: File.new(File.join(File.dirname(__FILE__), "seeds", "city.jpeg")),
|
|
61
|
+
banner_image: File.new(File.join(File.dirname(__FILE__), "seeds", "city2.jpeg")),
|
|
62
|
+
promoted: true,
|
|
63
|
+
published_at: 2.weeks.ago,
|
|
64
|
+
organization: organization
|
|
65
|
+
)
|
|
66
|
+
end
|
|
104
67
|
|
|
105
|
-
Decidim::
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
Decidim::Faker::Localized.
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
Decidim::Faker::Localized.
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
68
|
+
Decidim::ParticipatoryProcess.find_each do |process|
|
|
69
|
+
Decidim::ParticipatoryProcessStep.create!(
|
|
70
|
+
title: Decidim::Faker::Localized.sentence(5),
|
|
71
|
+
short_description: Decidim::Faker::Localized.wrapped("<p>", "</p>") do
|
|
72
|
+
Decidim::Faker::Localized.sentence(3)
|
|
73
|
+
end,
|
|
74
|
+
description: Decidim::Faker::Localized.wrapped("<p>", "</p>") do
|
|
75
|
+
Decidim::Faker::Localized.paragraph(3)
|
|
76
|
+
end,
|
|
77
|
+
active: true,
|
|
78
|
+
start_date: 1.month.ago.at_midnight,
|
|
79
|
+
end_date: 2.months.from_now.at_midnight,
|
|
80
|
+
participatory_process: process
|
|
81
|
+
)
|
|
82
|
+
end
|
|
117
83
|
|
|
118
84
|
Decidim::ParticipatoryProcess.find_each do |process|
|
|
119
85
|
Decidim::ParticipatoryProcessAttachment.create!(
|