decidim-participatory_processes 0.23.3 → 0.23.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/commands/decidim/participatory_processes/admin/create_participatory_process_admin.rb +7 -75
- data/config/locales/fi-plain.yml +1 -1
- data/config/locales/fi.yml +1 -1
- data/config/locales/nl.yml +1 -1
- data/config/locales/pl.yml +16 -13
- data/config/locales/ru.yml +1 -1
- data/config/locales/uk.yml +1 -1
- data/lib/decidim/participatory_processes/version.rb +1 -1
- metadata +8 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3ca3f945c8a279707ad27923267cbad6b791bbc2bb8d553cf3ae0e8d64fe3405
|
4
|
+
data.tar.gz: b4d5a1b8566a352b7dcb396c0a1c80e410bb9e5a681801fa04dfb2b39c1d87b1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 44ac537887ddd11b9d645b8d12633c3c8d7e9726fa3a46b14ba03467745ddaa5491268cbf70a9bc0a5069a3b9a8e02c0b71d4ddf9ec89cc69cc410045a7594a2
|
7
|
+
data.tar.gz: fad92e532d67076ef6d6512f89173ef1751b353051f9409fa326b1b6adca93dd4d424274cff9c867908e59a31bb5b649435988a0b406e29a96b648932e9b4ced
|
data/app/commands/decidim/participatory_processes/admin/create_participatory_process_admin.rb
CHANGED
@@ -6,6 +6,8 @@ module Decidim
|
|
6
6
|
# A command with all the business logic when creating a new participatory
|
7
7
|
# process admin in the system.
|
8
8
|
class CreateParticipatoryProcessAdmin < NotifyRoleAssignedToParticipatoryProcess
|
9
|
+
include ::Decidim::Admin::CreateParticipatorySpaceAdminUserActions
|
10
|
+
|
9
11
|
# Public: Initializes the command.
|
10
12
|
#
|
11
13
|
# form - A form object with the params.
|
@@ -15,33 +17,12 @@ module Decidim
|
|
15
17
|
def initialize(form, current_user, participatory_process)
|
16
18
|
@form = form
|
17
19
|
@current_user = current_user
|
18
|
-
@
|
19
|
-
end
|
20
|
-
|
21
|
-
# Executes the command. Broadcasts these events:
|
22
|
-
#
|
23
|
-
# - :ok when everything is valid.
|
24
|
-
# - :invalid if the form wasn't valid and we couldn't proceed.
|
25
|
-
#
|
26
|
-
# Returns nothing.
|
27
|
-
def call
|
28
|
-
return broadcast(:invalid) if form.invalid?
|
29
|
-
|
30
|
-
ActiveRecord::Base.transaction do
|
31
|
-
@user = existing_user || new_user
|
32
|
-
existing_role || create_role
|
33
|
-
add_admin_as_follower
|
34
|
-
end
|
35
|
-
|
36
|
-
broadcast(:ok)
|
37
|
-
rescue ActiveRecord::RecordInvalid
|
38
|
-
form.errors.add(:email, :taken)
|
39
|
-
broadcast(:invalid)
|
20
|
+
@participatory_space = participatory_process
|
40
21
|
end
|
41
22
|
|
42
23
|
private
|
43
24
|
|
44
|
-
attr_reader :form, :
|
25
|
+
attr_reader :form, :participatory_space, :current_user, :user
|
45
26
|
|
46
27
|
def create_role
|
47
28
|
extra_info = {
|
@@ -52,7 +33,7 @@ module Decidim
|
|
52
33
|
role_params = {
|
53
34
|
role: form.role.to_sym,
|
54
35
|
user: user,
|
55
|
-
participatory_process:
|
36
|
+
participatory_process: participatory_space
|
56
37
|
}
|
57
38
|
|
58
39
|
Decidim.traceability.create!(
|
@@ -65,60 +46,11 @@ module Decidim
|
|
65
46
|
end
|
66
47
|
|
67
48
|
def existing_role
|
68
|
-
Decidim::ParticipatoryProcessUserRole.
|
49
|
+
Decidim::ParticipatoryProcessUserRole.exists?(
|
69
50
|
role: form.role.to_sym,
|
70
51
|
user: user,
|
71
|
-
participatory_process:
|
72
|
-
)
|
73
|
-
end
|
74
|
-
|
75
|
-
def existing_user
|
76
|
-
return @existing_user if defined?(@existing_user)
|
77
|
-
|
78
|
-
@existing_user = User.find_by(
|
79
|
-
email: form.email,
|
80
|
-
organization: participatory_process.organization
|
52
|
+
participatory_process: participatory_space
|
81
53
|
)
|
82
|
-
|
83
|
-
InviteUserAgain.call(@existing_user, invitation_instructions) if @existing_user && !@existing_user.invitation_accepted?
|
84
|
-
|
85
|
-
@existing_user
|
86
|
-
end
|
87
|
-
|
88
|
-
def new_user
|
89
|
-
@new_user ||= InviteUser.call(user_form) do
|
90
|
-
on(:ok) do |user|
|
91
|
-
return user
|
92
|
-
end
|
93
|
-
end
|
94
|
-
end
|
95
|
-
|
96
|
-
def user_form
|
97
|
-
OpenStruct.new(name: form.name,
|
98
|
-
email: form.email.downcase,
|
99
|
-
organization: participatory_process.organization,
|
100
|
-
admin: false,
|
101
|
-
invited_by: current_user,
|
102
|
-
invitation_instructions: invitation_instructions)
|
103
|
-
end
|
104
|
-
|
105
|
-
def invitation_instructions
|
106
|
-
return "invite_admin" if form.role == "admin"
|
107
|
-
|
108
|
-
"invite_collaborator"
|
109
|
-
end
|
110
|
-
|
111
|
-
def add_admin_as_follower
|
112
|
-
return if user.follows?(participatory_process)
|
113
|
-
|
114
|
-
form = Decidim::FollowForm
|
115
|
-
.from_params(followable_gid: participatory_process.to_signed_global_id.to_s)
|
116
|
-
.with_context(
|
117
|
-
current_organization: participatory_process.organization,
|
118
|
-
current_user: user
|
119
|
-
)
|
120
|
-
|
121
|
-
Decidim::CreateFollow.new(form, user).call
|
122
54
|
end
|
123
55
|
end
|
124
56
|
end
|
data/config/locales/fi-plain.yml
CHANGED
data/config/locales/fi.yml
CHANGED
data/config/locales/nl.yml
CHANGED
data/config/locales/pl.yml
CHANGED
@@ -16,10 +16,10 @@ pl:
|
|
16
16
|
hashtag: Hashtag
|
17
17
|
hero_image: Obraz główny
|
18
18
|
local_area: Obszar organizacji
|
19
|
-
meta_scope: Zakres
|
19
|
+
meta_scope: Zakres
|
20
20
|
participatory_process_group_id: Grupa procesów
|
21
21
|
participatory_scope: Zaproponowano
|
22
|
-
participatory_structure: Jak
|
22
|
+
participatory_structure: Jak wziąć udział
|
23
23
|
promoted: Promowany
|
24
24
|
published_at: Opublikowano
|
25
25
|
related_process_ids: Powiązane procesy
|
@@ -32,7 +32,7 @@ pl:
|
|
32
32
|
slug: URL slug
|
33
33
|
start_date: Data rozpoczęcia
|
34
34
|
subtitle: Podtytuł
|
35
|
-
target: Kto
|
35
|
+
target: Kto może wziąć udział
|
36
36
|
title: Tytuł
|
37
37
|
participatory_process_group:
|
38
38
|
description: Opis
|
@@ -110,7 +110,7 @@ pl:
|
|
110
110
|
info: Informacje
|
111
111
|
moderations: Moderacje
|
112
112
|
private_users: Użytkownicy prywatni
|
113
|
-
process_admins:
|
113
|
+
process_admins: Administratorzy procesu
|
114
114
|
steps: Etapy
|
115
115
|
models:
|
116
116
|
participatory_process:
|
@@ -216,7 +216,7 @@ pl:
|
|
216
216
|
title: Aktualizuj administratora procesu partycypacyjnego
|
217
217
|
update: Aktualizuj
|
218
218
|
index:
|
219
|
-
process_admins_title: Administratorzy procesu
|
219
|
+
process_admins_title: Administratorzy procesu
|
220
220
|
new:
|
221
221
|
create: Utwórz
|
222
222
|
title: Nowy administrator procesu partycypacyjnego
|
@@ -312,7 +312,7 @@ pl:
|
|
312
312
|
one: 1 proces dla %{group}
|
313
313
|
few: "%{count} procesy dla %{group}"
|
314
314
|
many: "%{count} procesów dla %{group}"
|
315
|
-
other: "%{count}
|
315
|
+
other: "%{count} procesy dla %{group}"
|
316
316
|
title: Uczestniczące grupy procesów
|
317
317
|
participatory_process_steps:
|
318
318
|
index:
|
@@ -323,16 +323,19 @@ pl:
|
|
323
323
|
content_blocks:
|
324
324
|
highlighted_processes:
|
325
325
|
max_results: Maksymalna ilość elementów do pokazania
|
326
|
+
new_import:
|
327
|
+
accepted_types:
|
328
|
+
json: JSON
|
326
329
|
participatory_process_copies:
|
327
330
|
form:
|
328
|
-
slug_help: 'URL slugi służą do generowania adresów URL kierujących do tego procesu. Można
|
331
|
+
slug_help: 'URL slugi służą do generowania adresów URL kierujących bezpośrednio do tego procesu. Należy wpisać tylko to, co ma znaleźć się na końcu po znaku „/”, a nie pełen adres. Można użyć liter, cyfr i myślników. Musi zaczynać się od litery. Przykład: %{url}'
|
329
332
|
participatory_process_imports:
|
330
333
|
form:
|
331
334
|
document_legend: Dodaj dokument
|
332
|
-
slug_help: 'URL slugi służą do generowania adresów URL kierujących do tego procesu. Można
|
335
|
+
slug_help: 'URL slugi służą do generowania adresów URL kierujących bezpośrednio do tego procesu. Należy wpisać tylko to, co ma znaleźć się na końcu po znaku „/”, a nie pełen adres. Można użyć liter, cyfr i myślników. Musi zaczynać się od litery. Przykład: %{url}'
|
333
336
|
participatory_process_steps:
|
334
337
|
form:
|
335
|
-
cta_path_help: '
|
338
|
+
cta_path_help: 'Wpisz tutaj tylko to, co ma znaleźć się na końcu po znaku „/”, a nie pełny adres URL. Można użyć liter, cyfr i myślników. Musi zaczynać się od litery. Jeśli nie zostanie ustawione, przycisk nie będzie wyświetlany. Przykład: %{url}'
|
336
339
|
cta_text_help: Jeśli nie zostanie ustawione, przycisk nie będzie wyświetlany.
|
337
340
|
participatory_processes:
|
338
341
|
form:
|
@@ -346,7 +349,7 @@ pl:
|
|
346
349
|
scope_type_max_depth_help: Ogranicz głębokość filtra zakresu; Filtr pokaże typy zakresu od ogólnego do wybranego.
|
347
350
|
select_an_area: Wybierz kategorię
|
348
351
|
select_process_group: Wybierz grupę procesów
|
349
|
-
slug_help: 'URL slugi służą do generowania adresów URL kierujących do tego procesu. Można
|
352
|
+
slug_help: 'URL slugi służą do generowania adresów URL kierujących bezpośrednio do tego procesu. Należy wpisać tylko to, co ma znaleźć się na końcu po znaku „/”, a nie pełen adres. Można użyć liter, cyfr i myślników. Musi zaczynać się od litery. Przykład: %{url}'
|
350
353
|
title: Informacje ogólne
|
351
354
|
visbility: Widoczność
|
352
355
|
content_blocks:
|
@@ -404,18 +407,18 @@ pl:
|
|
404
407
|
index:
|
405
408
|
loading: Ładowanie wyników...
|
406
409
|
show:
|
407
|
-
area:
|
410
|
+
area: Kategoria
|
408
411
|
dates: Daty
|
409
412
|
developer_group: Grupa inicjatorów
|
410
413
|
end_date: Data zakończenia
|
411
414
|
local_area: Obszar Organizacji
|
412
415
|
participatory_scope: Co zostało postanowione
|
413
|
-
participatory_structure: Jak
|
416
|
+
participatory_structure: Jak wziąć udział
|
414
417
|
private_space: To jest prywatny proces
|
415
418
|
related_processes: Powiązane procesy
|
416
419
|
scope: Zakres
|
417
420
|
start_date: Data rozpoczęcia
|
418
|
-
target: Kto
|
421
|
+
target: Kto może wziąć udział
|
419
422
|
unspecified: Nieokreślony
|
420
423
|
statistics:
|
421
424
|
answers_count: Odpowiedzi
|
data/config/locales/ru.yml
CHANGED
data/config/locales/uk.yml
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: decidim-participatory_processes
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.23.
|
4
|
+
version: 0.23.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Josep Jaume Rey Peroy
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2021-
|
13
|
+
date: 2021-03-10 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: decidim-core
|
@@ -18,42 +18,42 @@ dependencies:
|
|
18
18
|
requirements:
|
19
19
|
- - '='
|
20
20
|
- !ruby/object:Gem::Version
|
21
|
-
version: 0.23.
|
21
|
+
version: 0.23.4
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
24
|
version_requirements: !ruby/object:Gem::Requirement
|
25
25
|
requirements:
|
26
26
|
- - '='
|
27
27
|
- !ruby/object:Gem::Version
|
28
|
-
version: 0.23.
|
28
|
+
version: 0.23.4
|
29
29
|
- !ruby/object:Gem::Dependency
|
30
30
|
name: decidim-admin
|
31
31
|
requirement: !ruby/object:Gem::Requirement
|
32
32
|
requirements:
|
33
33
|
- - '='
|
34
34
|
- !ruby/object:Gem::Version
|
35
|
-
version: 0.23.
|
35
|
+
version: 0.23.4
|
36
36
|
type: :development
|
37
37
|
prerelease: false
|
38
38
|
version_requirements: !ruby/object:Gem::Requirement
|
39
39
|
requirements:
|
40
40
|
- - '='
|
41
41
|
- !ruby/object:Gem::Version
|
42
|
-
version: 0.23.
|
42
|
+
version: 0.23.4
|
43
43
|
- !ruby/object:Gem::Dependency
|
44
44
|
name: decidim-dev
|
45
45
|
requirement: !ruby/object:Gem::Requirement
|
46
46
|
requirements:
|
47
47
|
- - '='
|
48
48
|
- !ruby/object:Gem::Version
|
49
|
-
version: 0.23.
|
49
|
+
version: 0.23.4
|
50
50
|
type: :development
|
51
51
|
prerelease: false
|
52
52
|
version_requirements: !ruby/object:Gem::Requirement
|
53
53
|
requirements:
|
54
54
|
- - '='
|
55
55
|
- !ruby/object:Gem::Version
|
56
|
-
version: 0.23.
|
56
|
+
version: 0.23.4
|
57
57
|
description: Participatory processes component for decidim.
|
58
58
|
email:
|
59
59
|
- josepjaume@gmail.com
|