decidim-assemblies 0.23.6 → 0.24.0.rc1
Sign up to get free protection for your applications and to get access to all the features.
- 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/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/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/admin/assemblies_types/index.html.erb +1 -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 +11 -5
- 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 +9 -3
- data/config/locales/fi.yml +9 -3
- data/config/locales/fr-CA.yml +9 -3
- data/config/locales/fr.yml +9 -3
- data/config/locales/gl.yml +0 -57
- 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 +9 -3
- data/config/locales/no.yml +0 -4
- data/config/locales/pl.yml +16 -10
- data/config/locales/pt-BR.yml +0 -1
- data/config/locales/pt.yml +0 -4
- data/config/locales/ro-RO.yml +101 -135
- data/config/locales/ru.yml +1 -2
- 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 -7
- data/config/locales/tr-TR.yml +0 -4
- data/config/locales/uk.yml +1 -2
- 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/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
- data/lib/decidim/assemblies.rb +1 -0
- 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/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
@@ -1,8 +1,6 @@
|
|
1
1
|
sv:
|
2
2
|
activemodel:
|
3
3
|
attributes:
|
4
|
-
assemblies_setting:
|
5
|
-
enable_organization_chart: Aktivera organisationskarta
|
6
4
|
assembly:
|
7
5
|
area_id: Område
|
8
6
|
assembly_type: Typ av grupp
|
@@ -52,6 +50,7 @@ sv:
|
|
52
50
|
target: Vem deltar
|
53
51
|
title: Titel
|
54
52
|
twitter: Twitter
|
53
|
+
weight: Vikt
|
55
54
|
youtube: YouTube
|
56
55
|
assembly_member:
|
57
56
|
birthday: Födelsedag
|
@@ -62,7 +61,6 @@ sv:
|
|
62
61
|
full_name: Fullständigt namn
|
63
62
|
gender: Kön
|
64
63
|
position: Befattning
|
65
|
-
user_id: Användare
|
66
64
|
assembly_user_role:
|
67
65
|
email: E-post
|
68
66
|
name: Namn
|
@@ -249,7 +247,6 @@ sv:
|
|
249
247
|
update: "%{user_name} uppdaterade inställningarna för församlingarna"
|
250
248
|
assembly_type:
|
251
249
|
create: "%{user_name} skapade grupptypen %{resource_name}"
|
252
|
-
delete: "%{user_name} tog bort medlemmen %{resource_name} från grupptypen %{space_name}"
|
253
250
|
publish: "%{user_name} publicerade grupptypen %{resource_name}"
|
254
251
|
unpublish: "%{user_name} avpublicerade grupptypen %{resource_name}"
|
255
252
|
update: "%{user_name} uppdaterade grupptypen %{resource_name}"
|
@@ -386,7 +383,6 @@ sv:
|
|
386
383
|
comments_count: Kommentarer
|
387
384
|
debates_count: Debatter
|
388
385
|
endorsements_count: Instämmanden
|
389
|
-
headline: Aktivitet
|
390
386
|
meetings_count: Möten
|
391
387
|
orders_count: Stöd
|
392
388
|
pages_count: Sidor
|
@@ -443,8 +439,6 @@ sv:
|
|
443
439
|
home:
|
444
440
|
hero:
|
445
441
|
participate_title: Delta i plattformens dialoger
|
446
|
-
sub_hero:
|
447
|
-
register_title: Skapa ett konto på plattformen genom att logga in
|
448
442
|
participatory_processes:
|
449
443
|
pages:
|
450
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
@@ -307,11 +307,10 @@ uk:
|
|
307
307
|
target: Хто бере участь
|
308
308
|
statistics:
|
309
309
|
answers_count: Відповідей
|
310
|
-
assemblies_count:
|
310
|
+
assemblies_count: Зборів
|
311
311
|
comments_count: Коментарів
|
312
312
|
debates_count: Обговорень
|
313
313
|
endorsements_count: Проявів підтримки
|
314
|
-
headline: Діяльність
|
315
314
|
meetings_count: Зустрічей
|
316
315
|
orders_count: Голосів
|
317
316
|
pages_count: Сторінок
|
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
|
@@ -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,
|
@@ -10,31 +10,50 @@ module Decidim
|
|
10
10
|
# type - A GraphQL::BaseType to extend.
|
11
11
|
#
|
12
12
|
# Returns nothing.
|
13
|
-
def self.
|
14
|
-
type.field :
|
15
|
-
type !types[AssembliesTypeType]
|
16
|
-
description "Lists all assemblies types"
|
13
|
+
def self.included(type)
|
14
|
+
type.field :assemblies_types, [AssembliesTypeType], null: false, description: "Lists all assemblies types"
|
17
15
|
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
16
|
+
type.field :assemblies_type, AssembliesTypeType, null: true, description: "Finds an assemblies type group" do
|
17
|
+
argument :id, GraphQL::Types::ID, description: "The ID of the Assemblies type", required: true
|
18
|
+
end
|
19
|
+
type.field :assemblies,
|
20
|
+
[Decidim::Assemblies::AssemblyType],
|
21
|
+
null: true,
|
22
|
+
description: "Lists all assemblies" do
|
23
|
+
argument :filter, Decidim::ParticipatoryProcesses::ParticipatoryProcessInputFilter, "This argument let's you filter the results", required: false
|
24
|
+
argument :order, Decidim::ParticipatoryProcesses::ParticipatoryProcessInputSort, "This argument let's you order the results", required: false
|
23
25
|
end
|
24
26
|
|
25
|
-
type.field :
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
resolve lambda { |_obj, args, ctx|
|
31
|
-
Decidim::AssembliesType.find_by(
|
32
|
-
organization: ctx[:current_organization],
|
33
|
-
id: args[:id]
|
34
|
-
)
|
35
|
-
}
|
27
|
+
type.field :assembly,
|
28
|
+
Decidim::Assemblies::AssemblyType,
|
29
|
+
null: true,
|
30
|
+
description: "Finds a assembly" do
|
31
|
+
argument :id, GraphQL::Types::ID, "The ID of the participatory space", required: false
|
36
32
|
end
|
37
33
|
end
|
34
|
+
|
35
|
+
def assemblies_types(*)
|
36
|
+
Decidim::AssembliesType.where(
|
37
|
+
organization: context[:current_organization]
|
38
|
+
)
|
39
|
+
end
|
40
|
+
|
41
|
+
def assemblies_type(id:)
|
42
|
+
Decidim::AssembliesType.find_by(
|
43
|
+
organization: context[:current_organization],
|
44
|
+
id: id
|
45
|
+
)
|
46
|
+
end
|
47
|
+
|
48
|
+
def assemblies(filter: {}, order: {})
|
49
|
+
manifest = Decidim.participatory_space_manifests.select { |m| m.name == :assemblies }.first
|
50
|
+
Decidim::Core::ParticipatorySpaceListBase.new(manifest: manifest).call(object, { filter: filter, order: order }, context)
|
51
|
+
end
|
52
|
+
|
53
|
+
def assembly(id: nil)
|
54
|
+
manifest = Decidim.participatory_space_manifests.select { |m| m.name == :assemblies }.first
|
55
|
+
Decidim::Core::ParticipatorySpaceFinderBase.new(manifest: manifest).call(object, { id: id }, context)
|
56
|
+
end
|
38
57
|
end
|
39
58
|
end
|
40
59
|
end
|
@@ -5,7 +5,7 @@ require "decidim/dev"
|
|
5
5
|
|
6
6
|
FactoryBot.define do
|
7
7
|
sequence(:assembly_slug) do |n|
|
8
|
-
"#{Faker::Internet.slug(nil, "-")}-#{n}"
|
8
|
+
"#{Decidim::Faker::Internet.slug(words: nil, glue: "-")}-#{n}"
|
9
9
|
end
|
10
10
|
|
11
11
|
factory :assemblies_setting, class: "Decidim::AssembliesSetting" do
|
@@ -53,6 +53,7 @@ FactoryBot.define do
|
|
53
53
|
instagram_handler { "others" }
|
54
54
|
youtube_handler { "others" }
|
55
55
|
github_handler { "others" }
|
56
|
+
weight { 1 }
|
56
57
|
|
57
58
|
trait :with_type do
|
58
59
|
assembly_type { create :assemblies_type, organization: organization }
|
@@ -162,14 +163,14 @@ FactoryBot.define do
|
|
162
163
|
|
163
164
|
full_name { Faker::Name.name }
|
164
165
|
gender { Faker::Lorem.word }
|
165
|
-
birthday { Faker::Date.birthday(18, 65) }
|
166
|
+
birthday { Faker::Date.birthday(min_age: 18, max_age: 65) }
|
166
167
|
birthplace { Faker::Lorem.word }
|
167
168
|
position { Decidim::AssemblyMember::POSITIONS.first }
|
168
|
-
designation_date { Faker::Date.between(1.year.ago, 1.month.ago) }
|
169
|
+
designation_date { Faker::Date.between(from: 1.year.ago, to: 1.month.ago) }
|
169
170
|
designation_mode { Faker::Lorem.word }
|
170
171
|
|
171
172
|
trait :ceased do
|
172
|
-
ceased_date { Faker::Date.between(1.day.ago, 5.days.ago) }
|
173
|
+
ceased_date { Faker::Date.between(from: 1.day.ago, to: 5.days.ago) }
|
173
174
|
end
|
174
175
|
|
175
176
|
trait :with_user do
|