decidim-assemblies 0.23.3 → 0.24.0.rc1
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/app/cells/decidim/assemblies/assembly_m_cell.rb +2 -0
- data/app/cells/decidim/assemblies/statistic/show.erb +9 -0
- data/app/cells/decidim/assemblies/statistic_cell.rb +20 -0
- data/app/cells/decidim/assemblies/statistics/show.erb +17 -0
- data/app/cells/decidim/assemblies/statistics_cell.rb +18 -0
- data/app/commands/decidim/assemblies/admin/create_assembly.rb +1 -0
- data/app/commands/decidim/assemblies/admin/create_assembly_admin.rb +12 -72
- data/app/commands/decidim/assemblies/admin/update_assembly.rb +2 -1
- data/app/controllers/decidim/assemblies/admin/imports_controller.rb +14 -0
- data/app/controllers/decidim/assemblies/admin/moderations/reports_controller.rb +14 -0
- data/app/controllers/decidim/assemblies/assemblies_controller.rb +1 -1
- data/app/events/decidim/role_assigned_to_assembly_event.rb +1 -1
- data/app/forms/decidim/assemblies/admin/assembly_form.rb +1 -0
- data/app/helpers/decidim/assemblies/admin/assemblies_admin_menu_helper.rb +15 -0
- data/app/models/decidim/assembly.rb +3 -3
- data/app/presenters/decidim/assemblies/assembly_stats_presenter.rb +35 -25
- data/app/queries/decidim/assemblies/organization_assemblies.rb +1 -1
- data/app/queries/decidim/assemblies/organization_published_assemblies.rb +1 -1
- data/app/serializers/decidim/assemblies/assembly_serializer.rb +1 -0
- data/app/views/decidim/assemblies/admin/assemblies/_form.html.erb +4 -0
- data/app/views/decidim/assemblies/admin/assemblies/index.html.erb +11 -1
- data/app/views/decidim/assemblies/assemblies/show.html.erb +1 -1
- data/app/views/layouts/decidim/admin/assemblies.html.erb +2 -20
- data/app/views/layouts/decidim/admin/assembly.html.erb +2 -1
- data/config/locales/ar.yml +0 -1
- data/config/locales/ca.yml +1 -4
- data/config/locales/cs.yml +9 -3
- data/config/locales/de.yml +9 -3
- data/config/locales/el.yml +0 -4
- data/config/locales/en.yml +9 -3
- data/config/locales/es-MX.yml +0 -4
- data/config/locales/es-PY.yml +0 -4
- data/config/locales/es.yml +0 -4
- data/config/locales/eu.yml +0 -1
- data/config/locales/fi-plain.yml +8 -2
- data/config/locales/fi.yml +8 -2
- data/config/locales/fr-CA.yml +9 -3
- data/config/locales/fr.yml +9 -3
- data/config/locales/gl.yml +0 -1
- data/config/locales/hu.yml +0 -4
- data/config/locales/id-ID.yml +0 -1
- data/config/locales/is-IS.yml +0 -1
- data/config/locales/it.yml +0 -4
- data/config/locales/ja.yml +0 -4
- data/config/locales/lv.yml +0 -4
- data/config/locales/nl.yml +12 -3
- data/config/locales/no.yml +0 -4
- data/config/locales/pl.yml +15 -3
- data/config/locales/pt-BR.yml +0 -1
- data/config/locales/pt.yml +0 -4
- data/config/locales/ro-RO.yml +14 -4
- data/config/locales/ru.yml +0 -1
- data/config/locales/sk.yml +0 -3
- data/config/locales/sl.yml +0 -1
- data/config/locales/sr-CS.yml +0 -3
- data/config/locales/sv.yml +1 -4
- data/config/locales/tr-TR.yml +0 -4
- data/config/locales/uk.yml +0 -1
- data/config/locales/zh-CN.yml +0 -4
- data/db/migrate/20210204152393_add_weight_field_to_assembly.rb +7 -0
- data/lib/decidim/api/assemblies_type_type.rb +16 -0
- data/lib/decidim/api/assembly_member_type.rb +28 -0
- data/lib/decidim/api/assembly_type.rb +64 -0
- data/lib/decidim/assemblies.rb +1 -0
- data/lib/decidim/assemblies/admin_engine.rb +31 -1
- data/lib/decidim/assemblies/api.rb +9 -0
- data/lib/decidim/assemblies/engine.rb +3 -5
- data/lib/decidim/assemblies/participatory_space.rb +38 -38
- data/lib/decidim/assemblies/query_extensions.rb +39 -20
- data/lib/decidim/assemblies/test/factories.rb +5 -4
- data/lib/decidim/assemblies/version.rb +1 -1
- metadata +24 -16
- data/app/types/decidim/assemblies/assemblies_type_type.rb +0 -17
- data/app/types/decidim/assemblies/assembly_member_type.rb +0 -29
- data/app/types/decidim/assemblies/assembly_type.rb +0 -67
- data/app/views/decidim/assemblies/assemblies/_statistics.html.erb +0 -10
data/config/locales/ro-RO.yml
CHANGED
@@ -34,6 +34,15 @@ ro:
|
|
34
34
|
meta_scope: Sferă metadate
|
35
35
|
parent_id: Asociere părinte
|
36
36
|
participatory_processes_ids: Procese participative conexe
|
37
|
+
title: Titlu
|
38
|
+
twitter: Twitter
|
39
|
+
youtube: YouTube
|
40
|
+
assembly_member:
|
41
|
+
birthday: Data nașterii
|
42
|
+
ceased_date: Data încetării
|
43
|
+
gender: Sexul
|
44
|
+
assembly_user_role:
|
45
|
+
email: E-mail
|
37
46
|
errors:
|
38
47
|
models:
|
39
48
|
assembly:
|
@@ -211,7 +220,6 @@ ro:
|
|
211
220
|
update: "%{user_name} a actualizat setările de asamblare"
|
212
221
|
assembly_type:
|
213
222
|
create: "%{user_name} a creat %{resource_name} tip de asamblare"
|
214
|
-
delete: "%{user_name} a eliminat membrul %{resource_name} din tipul de adunare %{space_name}"
|
215
223
|
publish: "%{user_name} a publicat %{resource_name} tip de asamblare"
|
216
224
|
unpublish: "%{user_name} nu a publicat %{resource_name} tip de asamblare"
|
217
225
|
update: "%{user_name} a actualizat tipul de asamblare %{resource_name}"
|
@@ -270,6 +278,9 @@ ro:
|
|
270
278
|
content_blocks:
|
271
279
|
highlighted_assemblies:
|
272
280
|
max_results: Cantitatea maximă de elemente de afișat
|
281
|
+
new_import:
|
282
|
+
accepted_types:
|
283
|
+
json: JSON
|
273
284
|
assembly_members:
|
274
285
|
index:
|
275
286
|
members: Membri
|
@@ -345,11 +356,12 @@ ro:
|
|
345
356
|
comments_count: Comentarii
|
346
357
|
debates_count: Dezbateri
|
347
358
|
endorsements_count: Susținători
|
348
|
-
headline: Activitate
|
349
359
|
meetings_count: Întâlniri
|
350
360
|
orders_count: Suportă
|
351
361
|
pages_count: Pagini
|
362
|
+
participants_count: Participanţi
|
352
363
|
posts_count: Mesaje
|
364
|
+
processes_count: Procese
|
353
365
|
projects_count: Proiecte
|
354
366
|
proposals_count: Propuneri
|
355
367
|
results_count: Rezultate
|
@@ -402,8 +414,6 @@ ro:
|
|
402
414
|
home:
|
403
415
|
hero:
|
404
416
|
participate_title: Participă la procesele platformei
|
405
|
-
sub_hero:
|
406
|
-
register_title: Înregistrează-te pentru a crea un cont pe platformă
|
407
417
|
participatory_processes:
|
408
418
|
pages:
|
409
419
|
home:
|
data/config/locales/ru.yml
CHANGED
data/config/locales/sk.yml
CHANGED
@@ -129,7 +129,6 @@ sk:
|
|
129
129
|
admin_log:
|
130
130
|
assembly_type:
|
131
131
|
create: "%{user_name} vytvoril %{resource_name} nový typ zhromaždenia"
|
132
|
-
delete: "%{user_name} odstránil %{resource_name} používateľa z typu zhromaždenia %{space_name}"
|
133
132
|
publish: "%{user_name} vytvoril nový typ zhromaždenia %{resource_name}"
|
134
133
|
unpublish: "%{user_name} zrušil publikovanie typu zhromaždenia %{resource_name}"
|
135
134
|
update: "%{user_name} aktualizoval typ zhromaždenia %{resource_name}"
|
@@ -163,8 +162,6 @@ sk:
|
|
163
162
|
home:
|
164
163
|
hero:
|
165
164
|
participate_title: Podieľajte sa na procesoch platformy
|
166
|
-
sub_hero:
|
167
|
-
register_title: Vytvorte si účet na platforme
|
168
165
|
participatory_processes:
|
169
166
|
pages:
|
170
167
|
home:
|
data/config/locales/sl.yml
CHANGED
data/config/locales/sr-CS.yml
CHANGED
@@ -25,7 +25,6 @@ sr:
|
|
25
25
|
admin_log:
|
26
26
|
assembly_type:
|
27
27
|
create: "%{user_name} je stvorio tip veća %{resource_name}"
|
28
|
-
delete: "%{user_name} je uklonio člana %{resource_name} iz tipa veća %{space_name}"
|
29
28
|
publish: "%{user_name} je objavio tip veća %{resource_name}"
|
30
29
|
unpublish: "%{user_name} je odustao od objavljivanja tipa veća %{resource_name}"
|
31
30
|
update: "%{user_name} je ažurirao tip veća %{resource_name}"
|
@@ -64,8 +63,6 @@ sr:
|
|
64
63
|
home:
|
65
64
|
hero:
|
66
65
|
participate_title: Učestvujte u procesima platforme
|
67
|
-
sub_hero:
|
68
|
-
register_title: Registrujte se na platformu
|
69
66
|
participatory_processes:
|
70
67
|
pages:
|
71
68
|
home:
|
data/config/locales/sv.yml
CHANGED
@@ -50,6 +50,7 @@ sv:
|
|
50
50
|
target: Vem deltar
|
51
51
|
title: Titel
|
52
52
|
twitter: Twitter
|
53
|
+
weight: Vikt
|
53
54
|
youtube: YouTube
|
54
55
|
assembly_member:
|
55
56
|
birthday: Födelsedag
|
@@ -246,7 +247,6 @@ sv:
|
|
246
247
|
update: "%{user_name} uppdaterade inställningarna för församlingarna"
|
247
248
|
assembly_type:
|
248
249
|
create: "%{user_name} skapade grupptypen %{resource_name}"
|
249
|
-
delete: "%{user_name} tog bort medlemmen %{resource_name} från grupptypen %{space_name}"
|
250
250
|
publish: "%{user_name} publicerade grupptypen %{resource_name}"
|
251
251
|
unpublish: "%{user_name} avpublicerade grupptypen %{resource_name}"
|
252
252
|
update: "%{user_name} uppdaterade grupptypen %{resource_name}"
|
@@ -383,7 +383,6 @@ sv:
|
|
383
383
|
comments_count: Kommentarer
|
384
384
|
debates_count: Debatter
|
385
385
|
endorsements_count: Instämmanden
|
386
|
-
headline: Aktivitet
|
387
386
|
meetings_count: Möten
|
388
387
|
orders_count: Stöd
|
389
388
|
pages_count: Sidor
|
@@ -440,8 +439,6 @@ sv:
|
|
440
439
|
home:
|
441
440
|
hero:
|
442
441
|
participate_title: Delta i plattformens dialoger
|
443
|
-
sub_hero:
|
444
|
-
register_title: Skapa ett konto på plattformen genom att logga in
|
445
442
|
participatory_processes:
|
446
443
|
pages:
|
447
444
|
home:
|
data/config/locales/tr-TR.yml
CHANGED
@@ -249,7 +249,6 @@ tr:
|
|
249
249
|
update: "%{user_name}, kurul ayarlarını güncelledi"
|
250
250
|
assembly_type:
|
251
251
|
create: "%{user_name},%{resource_name} kurul türünü oluşturdu"
|
252
|
-
delete: "%{user_name},%{resource_name} üyesini %{space_name} kurul türünden kaldırdı"
|
253
252
|
publish: "%{user_name}, %{resource_name} kurul türünü yayınladı"
|
254
253
|
unpublish: "%{user_name}, %{resource_name} kurul türünü yayından kaldırdı"
|
255
254
|
update: "%{user_name}, %{resource_name} kurul türünü güncelledi"
|
@@ -386,7 +385,6 @@ tr:
|
|
386
385
|
comments_count: Yorumlar
|
387
386
|
debates_count: Tartışmalar
|
388
387
|
endorsements_count: Onaylar
|
389
|
-
headline: Aktivite
|
390
388
|
meetings_count: Toplantılar
|
391
389
|
orders_count: Destekler
|
392
390
|
pages_count: Sayfalar
|
@@ -443,8 +441,6 @@ tr:
|
|
443
441
|
home:
|
444
442
|
hero:
|
445
443
|
participate_title: Platformun süreçlerine katılın
|
446
|
-
sub_hero:
|
447
|
-
register_title: Platformda bir hesap oluşturmak için kaydolun
|
448
444
|
participatory_processes:
|
449
445
|
pages:
|
450
446
|
home:
|
data/config/locales/uk.yml
CHANGED
data/config/locales/zh-CN.yml
CHANGED
@@ -243,7 +243,6 @@ zh-CN:
|
|
243
243
|
update: "%{user_name} 更新了程序集设置"
|
244
244
|
assembly_type:
|
245
245
|
create: "%{user_name} 创建了 %{resource_name} 组装类型"
|
246
|
-
delete: "%{user_name} 将 %{resource_name} 成员从 %{space_name} 组装类型中移除"
|
247
246
|
publish: "%{user_name} 发布了 %{resource_name} 组装类型"
|
248
247
|
unpublish: "%{user_name} 未发布的 %{resource_name} 组装类型"
|
249
248
|
update: "%{user_name} 更新了 %{resource_name} 装配体类型"
|
@@ -377,7 +376,6 @@ zh-CN:
|
|
377
376
|
comments_count: 评论
|
378
377
|
debates_count: 辩论
|
379
378
|
endorsements_count: 授权
|
380
|
-
headline: 活动
|
381
379
|
meetings_count: 会议
|
382
380
|
orders_count: 支持
|
383
381
|
pages_count: 页 次
|
@@ -434,8 +432,6 @@ zh-CN:
|
|
434
432
|
home:
|
435
433
|
hero:
|
436
434
|
participate_title: 参与平台进程
|
437
|
-
sub_hero:
|
438
|
-
register_title: 注册在平台上创建帐户
|
439
435
|
participatory_processes:
|
440
436
|
pages:
|
441
437
|
home:
|
@@ -0,0 +1,16 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Decidim
|
4
|
+
module Assemblies
|
5
|
+
# This type represents an AssembliesType.
|
6
|
+
class AssembliesTypeType < Decidim::Api::Types::BaseObject
|
7
|
+
description "An assemblies type"
|
8
|
+
|
9
|
+
field :id, GraphQL::Types::ID, "The assemblies type's unique ID", null: false
|
10
|
+
field :title, Decidim::Core::TranslatedFieldType, "The title of this assemblies type.", null: false
|
11
|
+
field :created_at, Decidim::Core::DateTimeType, "The time this assemblies type was created", null: false
|
12
|
+
field :updated_at, Decidim::Core::DateTimeType, "The time this assemblies type was updated", null: false
|
13
|
+
field :assemblies, [Decidim::Assemblies::AssemblyType, { null: true }], "Assemblies with this assemblies type", null: false
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,28 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Decidim
|
4
|
+
module Assemblies
|
5
|
+
# This type represents a assembly.
|
6
|
+
class AssemblyMemberType < Decidim::Api::Types::BaseObject
|
7
|
+
description "An assembly member"
|
8
|
+
|
9
|
+
field :id, GraphQL::Types::ID, "Internal ID of the member", null: false
|
10
|
+
field :full_name, GraphQL::Types::String, "Full name of the member", null: true
|
11
|
+
field :position, GraphQL::Types::String, "Position of the member in the assembly", null: true
|
12
|
+
|
13
|
+
field :user, Decidim::Core::UserType, "The corresponding decidim user", null: true
|
14
|
+
|
15
|
+
field :created_at, Decidim::Core::DateTimeType, "The time this member was created", null: true
|
16
|
+
field :updated_at, Decidim::Core::DateTimeType, "The time this member was updated", null: true
|
17
|
+
|
18
|
+
field :weight, GraphQL::Types::Int, "Order of appearance in which it should be represented", null: true
|
19
|
+
field :gender, GraphQL::Types::String, "Gender of the member", null: true
|
20
|
+
# field :birthday, Decidim::Core::DateType, "Birthday date of the member" # non-public currently
|
21
|
+
field :birthplace, GraphQL::Types::String, "Birthplace of the member", null: true
|
22
|
+
field :designation_date, Decidim::Core::DateType, "Date of designation of the member", null: true
|
23
|
+
# field :designationMode, types.String, "Mode in which the member was designated", property: :designation_mode # non-public currently
|
24
|
+
field :position_other, GraphQL::Types::String, "Custom position name", null: true
|
25
|
+
field :ceased_date, Decidim::Core::DateType, "Date of cease for the member", null: true
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
@@ -0,0 +1,64 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Decidim
|
4
|
+
module Assemblies
|
5
|
+
# This type represents a assembly.
|
6
|
+
class AssemblyType < Decidim::Api::Types::BaseObject
|
7
|
+
implements Decidim::Core::ParticipatorySpaceInterface
|
8
|
+
implements Decidim::Core::AttachableInterface
|
9
|
+
implements Decidim::Core::ParticipatorySpaceResourceableInterface
|
10
|
+
|
11
|
+
description "An assembly"
|
12
|
+
|
13
|
+
field :id, ID, "The internal ID for this assembly", null: false
|
14
|
+
field :subtitle, Decidim::Core::TranslatedFieldType, "The subtitle of this assembly", null: true
|
15
|
+
field :short_description, Decidim::Core::TranslatedFieldType, "The sort description of this assembly", null: true
|
16
|
+
field :description, Decidim::Core::TranslatedFieldType, "The description of this assembly", null: true
|
17
|
+
field :slug, String, "The slug of this assembly", null: false
|
18
|
+
field :hashtag, String, "The hashtag for this assembly", null: true
|
19
|
+
field :created_at, Decidim::Core::DateTimeType, "The time this assembly was created", null: false
|
20
|
+
field :updated_at, Decidim::Core::DateTimeType, "The time this assembly was updated", null: false
|
21
|
+
field :published_at, Decidim::Core::DateTimeType, "The time this assembly was published", null: false
|
22
|
+
field :reference, String, "Reference for this assembly", null: false
|
23
|
+
field :categories, [Decidim::Core::CategoryType, { null: true }], "Categories for this assembly", null: false
|
24
|
+
|
25
|
+
field :hero_image, String, "The hero image for this assembly", null: true
|
26
|
+
field :banner_image, String, "The banner image for this assembly", null: true
|
27
|
+
field :promoted, Boolean, "If this assembly is promoted (therefore in the homepage)", null: true
|
28
|
+
field :developer_group, Decidim::Core::TranslatedFieldType, "The promoter group of this assembly", null: true
|
29
|
+
field :meta_scope, Decidim::Core::TranslatedFieldType, "The scope metadata of this assembly", null: true
|
30
|
+
field :local_area, Decidim::Core::TranslatedFieldType, "The organization area of this assembly", null: true
|
31
|
+
field :target, Decidim::Core::TranslatedFieldType, "Who participates in this assembly", null: true
|
32
|
+
field :participatory_scope, Decidim::Core::TranslatedFieldType, "What is decided on this assembly", null: true
|
33
|
+
field :participatory_structure, Decidim::Core::TranslatedFieldType, "How it is decided on this assembly", null: true
|
34
|
+
field :show_statistics, Boolean, "If this assembly should show statistics", null: true
|
35
|
+
field :scopes_enabled, Boolean, "If this assembly has scopes enabled", null: true
|
36
|
+
field :private_space, Boolean, "If this assembly is a private space", null: true
|
37
|
+
field :area, Decidim::Core::AreaApiType, "Area of this assembly", null: true
|
38
|
+
field :parent, Decidim::Assemblies::AssemblyType, "The parent assembly of this assembly", null: true
|
39
|
+
field :parents_path, String, "Assembly hierarchy representation", null: true
|
40
|
+
field :children_count, Integer, "Number of children assemblies", null: true
|
41
|
+
field :purpose_of_action, Decidim::Core::TranslatedFieldType, "Purpose of action", null: true
|
42
|
+
field :composition, Decidim::Core::TranslatedFieldType, "Composition of this assembly", null: true
|
43
|
+
field :assembly_type, Decidim::Assemblies::AssembliesTypeType, "Type of the assembly", null: true
|
44
|
+
field :creation_date, Decidim::Core::DateType, "Creation date of this assembly", null: true
|
45
|
+
field :created_by, String, "The creator of this assembly", null: true
|
46
|
+
field :created_by_other, Decidim::Core::TranslatedFieldType, "Custom creator", null: true
|
47
|
+
field :duration, Decidim::Core::DateType, "Duration of this assembly", null: true
|
48
|
+
field :included_at, Decidim::Core::DateType, "Included at", null: true
|
49
|
+
field :closing_date, Decidim::Core::DateType, "Closing date of the assembly", null: true
|
50
|
+
field :closing_date_reason, Decidim::Core::TranslatedFieldType, "Closing date reason of this assembly", null: true
|
51
|
+
field :internal_organisation, Decidim::Core::TranslatedFieldType, "Internal organisation of this assembly", null: true
|
52
|
+
field :is_transparent, Boolean, "If this assembly is transparent", null: true
|
53
|
+
field :special_features, Decidim::Core::TranslatedFieldType, "Special features of this assembly", null: true
|
54
|
+
field :twitter_handler, String, "Twitter handler", null: true
|
55
|
+
field :instagram_handler, String, "Instagram handler", null: true
|
56
|
+
field :facebook_handler, String, "Facebook handler", null: true
|
57
|
+
field :youtube_handler, String, "Youtube handler", null: true
|
58
|
+
field :github_handler, String, "Github handler", null: true
|
59
|
+
|
60
|
+
field :members, [Decidim::Assemblies::AssemblyMemberType, { null: true }], "Members of this assembly", null: false
|
61
|
+
field :children, [Decidim::Assemblies::AssemblyType, { null: true }], "Childrens of this assembly", null: false
|
62
|
+
end
|
63
|
+
end
|
64
|
+
end
|
data/lib/decidim/assemblies.rb
CHANGED
@@ -50,6 +50,7 @@ module Decidim
|
|
50
50
|
get :share
|
51
51
|
end
|
52
52
|
resources :exports, only: :create
|
53
|
+
resources :imports, only: [:new, :create]
|
53
54
|
end
|
54
55
|
|
55
56
|
resources :moderations do
|
@@ -58,6 +59,7 @@ module Decidim
|
|
58
59
|
put :hide
|
59
60
|
put :unhide
|
60
61
|
end
|
62
|
+
resources :reports, controller: "moderations/reports", only: [:index, :show]
|
61
63
|
end
|
62
64
|
|
63
65
|
resources :participatory_space_private_users, controller: "participatory_space_private_users" do
|
@@ -81,6 +83,12 @@ module Decidim
|
|
81
83
|
end
|
82
84
|
end
|
83
85
|
|
86
|
+
initializer "decidim_assemblies.action_controller" do |_app|
|
87
|
+
ActiveSupport.on_load :action_controller do
|
88
|
+
helper Decidim::Assemblies::Admin::AssembliesAdminMenuHelper if respond_to?(:helper)
|
89
|
+
end
|
90
|
+
end
|
91
|
+
|
84
92
|
initializer "decidim_assemblies.admin_assets" do |app|
|
85
93
|
app.config.assets.precompile += %w(admin/decidim_assemblies_manifest.js)
|
86
94
|
end
|
@@ -90,11 +98,33 @@ module Decidim
|
|
90
98
|
menu.item I18n.t("menu.assemblies", scope: "decidim.admin"),
|
91
99
|
decidim_admin_assemblies.assemblies_path,
|
92
100
|
icon_name: "dial",
|
93
|
-
position:
|
101
|
+
position: 2.2,
|
94
102
|
active: :inclusive,
|
95
103
|
if: allowed_to?(:enter, :space_area, space_name: :assemblies)
|
96
104
|
end
|
97
105
|
end
|
106
|
+
|
107
|
+
initializer "decidim_assemblies.admin_assemblies_menu" do
|
108
|
+
Decidim.menu :admin_assemblies_menu do |menu|
|
109
|
+
menu.item I18n.t("menu.assemblies", scope: "decidim.admin"),
|
110
|
+
decidim_admin_assemblies.assemblies_path,
|
111
|
+
position: 1.0,
|
112
|
+
active: is_active_link?(decidim_admin_assemblies.assemblies_path),
|
113
|
+
if: allowed_to?(:read, :assembly_list)
|
114
|
+
|
115
|
+
menu.item I18n.t("menu.assemblies_types", scope: "decidim.admin"),
|
116
|
+
decidim_admin_assemblies.assemblies_types_path,
|
117
|
+
active: is_active_link?(decidim_admin_assemblies.assemblies_types_path),
|
118
|
+
position: 1.1,
|
119
|
+
if: allowed_to?(:manage, :assemblies_type)
|
120
|
+
|
121
|
+
menu.item I18n.t("menu.assemblies_settings", scope: "decidim.admin"),
|
122
|
+
decidim_admin_assemblies.edit_assemblies_settings_path,
|
123
|
+
active: is_active_link?(decidim_admin_assemblies.edit_assemblies_settings_path),
|
124
|
+
position: 1.3,
|
125
|
+
if: allowed_to?(:read, :assemblies_setting)
|
126
|
+
end
|
127
|
+
end
|
98
128
|
end
|
99
129
|
end
|
100
130
|
end
|
@@ -0,0 +1,9 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Decidim
|
4
|
+
module Assemblies
|
5
|
+
autoload :AssemblyType, "decidim/api/assembly_type"
|
6
|
+
autoload :AssemblyMemberType, "decidim/api/assembly_member_type"
|
7
|
+
autoload :AssembliesTypeType, "decidim/api/assemblies_type_type"
|
8
|
+
end
|
9
|
+
end
|
@@ -58,8 +58,8 @@ module Decidim
|
|
58
58
|
Decidim.menu :menu do |menu|
|
59
59
|
menu.item I18n.t("menu.assemblies", scope: "decidim"),
|
60
60
|
decidim_assemblies.assemblies_path,
|
61
|
-
position: 2.
|
62
|
-
if:
|
61
|
+
position: 2.2,
|
62
|
+
if: OrganizationPublishedAssemblies.new(current_organization, current_user).any?,
|
63
63
|
active: :inclusive
|
64
64
|
end
|
65
65
|
end
|
@@ -111,9 +111,7 @@ module Decidim
|
|
111
111
|
end
|
112
112
|
|
113
113
|
initializer "decidim_assemblies.query_extensions" do
|
114
|
-
Decidim::Api::QueryType.
|
115
|
-
QueryExtensions.define(self)
|
116
|
-
end
|
114
|
+
Decidim::Api::QueryType.include Decidim::Assemblies::QueryExtensions
|
117
115
|
end
|
118
116
|
end
|
119
117
|
end
|
@@ -55,15 +55,15 @@ Decidim.register_participatory_space(:assemblies) do |participatory_space|
|
|
55
55
|
|
56
56
|
2.times do |n|
|
57
57
|
params = {
|
58
|
-
title: Decidim::Faker::Localized.sentence(5),
|
59
|
-
slug: Faker::Internet.unique.slug(nil, "-"),
|
60
|
-
subtitle: Decidim::Faker::Localized.sentence(2),
|
58
|
+
title: Decidim::Faker::Localized.sentence(word_count: 5),
|
59
|
+
slug: Decidim::Faker::Internet.unique.slug(words: nil, glue: "-"),
|
60
|
+
subtitle: Decidim::Faker::Localized.sentence(word_count: 2),
|
61
61
|
hashtag: "##{Faker::Lorem.word}",
|
62
62
|
short_description: Decidim::Faker::Localized.wrapped("<p>", "</p>") do
|
63
|
-
Decidim::Faker::Localized.sentence(3)
|
63
|
+
Decidim::Faker::Localized.sentence(word_count: 3)
|
64
64
|
end,
|
65
65
|
description: Decidim::Faker::Localized.wrapped("<p>", "</p>") do
|
66
|
-
Decidim::Faker::Localized.paragraph(3)
|
66
|
+
Decidim::Faker::Localized.paragraph(sentence_count: 3)
|
67
67
|
end,
|
68
68
|
organization: organization,
|
69
69
|
hero_image: File.new(File.join(seeds_root, "city.jpeg")), # Keep after organization
|
@@ -71,17 +71,17 @@ Decidim.register_participatory_space(:assemblies) do |participatory_space|
|
|
71
71
|
promoted: true,
|
72
72
|
published_at: 2.weeks.ago,
|
73
73
|
meta_scope: Decidim::Faker::Localized.word,
|
74
|
-
developer_group: Decidim::Faker::Localized.sentence(1),
|
75
|
-
local_area: Decidim::Faker::Localized.sentence(2),
|
76
|
-
target: Decidim::Faker::Localized.sentence(3),
|
77
|
-
participatory_scope: Decidim::Faker::Localized.sentence(1),
|
78
|
-
participatory_structure: Decidim::Faker::Localized.sentence(2),
|
74
|
+
developer_group: Decidim::Faker::Localized.sentence(word_count: 1),
|
75
|
+
local_area: Decidim::Faker::Localized.sentence(word_count: 2),
|
76
|
+
target: Decidim::Faker::Localized.sentence(word_count: 3),
|
77
|
+
participatory_scope: Decidim::Faker::Localized.sentence(word_count: 1),
|
78
|
+
participatory_structure: Decidim::Faker::Localized.sentence(word_count: 2),
|
79
79
|
scope: n.positive? ? Decidim::Scope.reorder(Arel.sql("RANDOM()")).first : nil,
|
80
80
|
purpose_of_action: Decidim::Faker::Localized.wrapped("<p>", "</p>") do
|
81
|
-
Decidim::Faker::Localized.paragraph(3)
|
81
|
+
Decidim::Faker::Localized.paragraph(sentence_count: 3)
|
82
82
|
end,
|
83
83
|
composition: Decidim::Faker::Localized.wrapped("<p>", "</p>") do
|
84
|
-
Decidim::Faker::Localized.paragraph(3)
|
84
|
+
Decidim::Faker::Localized.paragraph(sentence_count: 3)
|
85
85
|
end,
|
86
86
|
assembly_type: Decidim::AssembliesType.create!(organization: organization, title: Decidim::Faker::Localized.word),
|
87
87
|
creation_date: 1.day.from_now,
|
@@ -90,13 +90,13 @@ Decidim.register_participatory_space(:assemblies) do |participatory_space|
|
|
90
90
|
duration: 2.days.from_now,
|
91
91
|
included_at: 5.days.from_now,
|
92
92
|
closing_date: 5.days.from_now,
|
93
|
-
closing_date_reason: Decidim::Faker::Localized.sentence(3),
|
93
|
+
closing_date_reason: Decidim::Faker::Localized.sentence(word_count: 3),
|
94
94
|
internal_organisation: Decidim::Faker::Localized.wrapped("<p>", "</p>") do
|
95
|
-
Decidim::Faker::Localized.paragraph(3)
|
95
|
+
Decidim::Faker::Localized.paragraph(sentence_count: 3)
|
96
96
|
end,
|
97
97
|
is_transparent: true,
|
98
98
|
special_features: Decidim::Faker::Localized.wrapped("<p>", "</p>") do
|
99
|
-
Decidim::Faker::Localized.paragraph(3)
|
99
|
+
Decidim::Faker::Localized.paragraph(sentence_count: 3)
|
100
100
|
end,
|
101
101
|
twitter_handler: Faker::Lorem.word,
|
102
102
|
facebook_handler: Faker::Lorem.word,
|
@@ -138,15 +138,15 @@ Decidim.register_participatory_space(:assemblies) do |participatory_space|
|
|
138
138
|
end
|
139
139
|
|
140
140
|
child = Decidim::Assembly.create!(
|
141
|
-
title: Decidim::Faker::Localized.sentence(5),
|
142
|
-
slug: Faker::Internet.unique.slug(nil, "-"),
|
143
|
-
subtitle: Decidim::Faker::Localized.sentence(2),
|
141
|
+
title: Decidim::Faker::Localized.sentence(word_count: 5),
|
142
|
+
slug: Decidim::Faker::Internet.unique.slug(words: nil, glue: "-"),
|
143
|
+
subtitle: Decidim::Faker::Localized.sentence(word_count: 2),
|
144
144
|
hashtag: "##{Faker::Lorem.word}",
|
145
145
|
short_description: Decidim::Faker::Localized.wrapped("<p>", "</p>") do
|
146
|
-
Decidim::Faker::Localized.sentence(3)
|
146
|
+
Decidim::Faker::Localized.sentence(word_count: 3)
|
147
147
|
end,
|
148
148
|
description: Decidim::Faker::Localized.wrapped("<p>", "</p>") do
|
149
|
-
Decidim::Faker::Localized.paragraph(3)
|
149
|
+
Decidim::Faker::Localized.paragraph(sentence_count: 3)
|
150
150
|
end,
|
151
151
|
organization: organization,
|
152
152
|
hero_image: File.new(File.join(seeds_root, "city.jpeg")), # Keep after organization
|
@@ -154,11 +154,11 @@ Decidim.register_participatory_space(:assemblies) do |participatory_space|
|
|
154
154
|
promoted: true,
|
155
155
|
published_at: 2.weeks.ago,
|
156
156
|
meta_scope: Decidim::Faker::Localized.word,
|
157
|
-
developer_group: Decidim::Faker::Localized.sentence(1),
|
158
|
-
local_area: Decidim::Faker::Localized.sentence(2),
|
159
|
-
target: Decidim::Faker::Localized.sentence(3),
|
160
|
-
participatory_scope: Decidim::Faker::Localized.sentence(1),
|
161
|
-
participatory_structure: Decidim::Faker::Localized.sentence(2),
|
157
|
+
developer_group: Decidim::Faker::Localized.sentence(word_count: 1),
|
158
|
+
local_area: Decidim::Faker::Localized.sentence(word_count: 2),
|
159
|
+
target: Decidim::Faker::Localized.sentence(word_count: 3),
|
160
|
+
participatory_scope: Decidim::Faker::Localized.sentence(word_count: 1),
|
161
|
+
participatory_structure: Decidim::Faker::Localized.sentence(word_count: 2),
|
162
162
|
scope: n.positive? ? Decidim::Scope.reorder(Arel.sql("RANDOM()")).first : nil,
|
163
163
|
parent: assembly
|
164
164
|
)
|
@@ -167,37 +167,37 @@ Decidim.register_participatory_space(:assemblies) do |participatory_space|
|
|
167
167
|
current_assembly.add_to_index_as_search_resource
|
168
168
|
attachment_collection = Decidim::AttachmentCollection.create!(
|
169
169
|
name: Decidim::Faker::Localized.word,
|
170
|
-
description: Decidim::Faker::Localized.sentence(5),
|
170
|
+
description: Decidim::Faker::Localized.sentence(word_count: 5),
|
171
171
|
collection_for: current_assembly
|
172
172
|
)
|
173
173
|
|
174
174
|
Decidim::Attachment.create!(
|
175
|
-
title: Decidim::Faker::Localized.sentence(2),
|
176
|
-
description: Decidim::Faker::Localized.sentence(5),
|
175
|
+
title: Decidim::Faker::Localized.sentence(word_count: 2),
|
176
|
+
description: Decidim::Faker::Localized.sentence(word_count: 5),
|
177
177
|
attachment_collection: attachment_collection,
|
178
178
|
attached_to: current_assembly,
|
179
179
|
file: File.new(File.join(seeds_root, "Exampledocument.pdf")) # Keep after attached_to
|
180
180
|
)
|
181
181
|
|
182
182
|
Decidim::Attachment.create!(
|
183
|
-
title: Decidim::Faker::Localized.sentence(2),
|
184
|
-
description: Decidim::Faker::Localized.sentence(5),
|
183
|
+
title: Decidim::Faker::Localized.sentence(word_count: 2),
|
184
|
+
description: Decidim::Faker::Localized.sentence(word_count: 5),
|
185
185
|
attached_to: current_assembly,
|
186
186
|
file: File.new(File.join(seeds_root, "city.jpeg")) # Keep after attached_to
|
187
187
|
)
|
188
188
|
|
189
189
|
Decidim::Attachment.create!(
|
190
|
-
title: Decidim::Faker::Localized.sentence(2),
|
191
|
-
description: Decidim::Faker::Localized.sentence(5),
|
190
|
+
title: Decidim::Faker::Localized.sentence(word_count: 2),
|
191
|
+
description: Decidim::Faker::Localized.sentence(word_count: 5),
|
192
192
|
attached_to: current_assembly,
|
193
193
|
file: File.new(File.join(seeds_root, "Exampledocument.pdf")) # Keep after attached_to
|
194
194
|
)
|
195
195
|
|
196
196
|
2.times do
|
197
197
|
Decidim::Category.create!(
|
198
|
-
name: Decidim::Faker::Localized.sentence(5),
|
198
|
+
name: Decidim::Faker::Localized.sentence(word_count: 5),
|
199
199
|
description: Decidim::Faker::Localized.wrapped("<p>", "</p>") do
|
200
|
-
Decidim::Faker::Localized.paragraph(3)
|
200
|
+
Decidim::Faker::Localized.paragraph(sentence_count: 3)
|
201
201
|
end,
|
202
202
|
participatory_space: current_assembly
|
203
203
|
)
|
@@ -207,9 +207,9 @@ Decidim.register_participatory_space(:assemblies) do |participatory_space|
|
|
207
207
|
Decidim::AssemblyMember.create!(
|
208
208
|
full_name: Faker::Name.name,
|
209
209
|
gender: Faker::Lorem.word,
|
210
|
-
birthday: Faker::Date.birthday(18, 65),
|
210
|
+
birthday: Faker::Date.birthday(min_age: 18, max_age: 65),
|
211
211
|
birthplace: Faker::Demographic.demonym,
|
212
|
-
designation_date: Faker::Date.between(1.year.ago, 1.month.ago),
|
212
|
+
designation_date: Faker::Date.between(from: 1.year.ago, to: 1.month.ago),
|
213
213
|
designation_mode: Faker::Lorem.word,
|
214
214
|
position: position,
|
215
215
|
position_other: position == "other" ? Faker::Job.position : nil,
|
@@ -220,9 +220,9 @@ Decidim.register_participatory_space(:assemblies) do |participatory_space|
|
|
220
220
|
Decidim::AssemblyMember.create!(
|
221
221
|
user: current_assembly.organization.users.first,
|
222
222
|
gender: Faker::Lorem.word,
|
223
|
-
birthday: Faker::Date.birthday(18, 65),
|
223
|
+
birthday: Faker::Date.birthday(min_age: 18, max_age: 65),
|
224
224
|
birthplace: Faker::Demographic.demonym,
|
225
|
-
designation_date: Faker::Date.between(1.year.ago, 1.month.ago),
|
225
|
+
designation_date: Faker::Date.between(from: 1.year.ago, to: 1.month.ago),
|
226
226
|
designation_mode: Faker::Lorem.word,
|
227
227
|
position: "other",
|
228
228
|
position_other: Faker::Job.position,
|