decidim-participatory_processes 0.29.2 → 0.30.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/participatory_process_groups/process_filters_cell.rb +4 -5
- data/app/cells/decidim/participatory_processes/content_blocks/highlighted_processes_settings_form/show.erb +1 -1
- data/app/cells/decidim/participatory_processes/process_dropdown_metadata_cell.rb +7 -0
- data/app/cells/decidim/participatory_processes/process_filters/show.erb +0 -1
- data/app/cells/decidim/participatory_processes/process_filters_cell.rb +6 -32
- data/app/commands/decidim/participatory_processes/admin/copy_participatory_process.rb +2 -23
- data/app/commands/decidim/participatory_processes/admin/create_participatory_process.rb +3 -3
- data/app/commands/decidim/participatory_processes/admin/import_participatory_process.rb +0 -1
- data/app/commands/decidim/participatory_processes/admin/update_participatory_process.rb +3 -3
- data/app/controllers/decidim/participatory_processes/admin/component_share_tokens_controller.rb +18 -0
- data/app/controllers/decidim/participatory_processes/admin/participatory_process_share_tokens_controller.rb +16 -0
- data/app/controllers/decidim/participatory_processes/admin/participatory_processes_controller.rb +15 -3
- data/app/controllers/decidim/participatory_processes/participatory_processes_controller.rb +2 -4
- data/app/controllers/decidim/participatory_processes/participatory_space_private_users_controller.rb +27 -0
- data/app/forms/decidim/participatory_processes/admin/participatory_process_copy_form.rb +0 -1
- data/app/forms/decidim/participatory_processes/admin/participatory_process_form.rb +3 -33
- data/app/forms/decidim/participatory_processes/admin/participatory_process_import_form.rb +0 -1
- data/app/helpers/decidim/participatory_processes/participatory_process_helper.rb +28 -20
- data/app/jobs/decidim/participatory_processes/change_active_step_job.rb +1 -1
- data/app/models/decidim/participatory_process.rb +19 -3
- data/app/permissions/decidim/participatory_processes/permissions.rb +15 -14
- data/app/presenters/decidim/participatory_processes/admin_log/participatory_process_presenter.rb +1 -1
- data/app/queries/decidim/participatory_processes/metrics/participatory_process_followers_metric_measure.rb +2 -2
- data/app/queries/decidim/participatory_processes/metrics/participatory_processes_metric_manage.rb +2 -2
- data/app/serializers/decidim/participatory_processes/open_data_participatory_process_serializer.rb +47 -0
- data/app/serializers/decidim/participatory_processes/participatory_process_importer.rb +1 -43
- data/app/serializers/decidim/participatory_processes/participatory_process_serializer.rb +17 -126
- data/app/views/decidim/participatory_processes/admin/participatory_process_copies/_form.html.erb +0 -4
- data/app/views/decidim/participatory_processes/admin/participatory_process_imports/_form.html.erb +0 -3
- data/app/views/decidim/participatory_processes/admin/participatory_processes/_form.html.erb +25 -60
- data/app/views/decidim/participatory_processes/admin/participatory_processes/_process_row.html.erb +83 -0
- data/app/views/decidim/participatory_processes/admin/participatory_processes/_processes_thead.html.erb +19 -0
- data/app/views/decidim/participatory_processes/admin/participatory_processes/index.html.erb +16 -84
- data/app/views/decidim/participatory_processes/admin/participatory_processes/manage_trash.html.erb +20 -0
- data/app/views/decidim/participatory_processes/participatory_process_groups/show.html.erb +3 -1
- data/app/views/decidim/participatory_processes/participatory_processes/index.html.erb +3 -1
- data/app/views/decidim/participatory_processes/participatory_processes/show.html.erb +6 -6
- data/app/views/decidim/participatory_processes/participatory_space_private_users/index.html.erb +22 -0
- data/config/assets.rb +1 -2
- data/config/locales/ar.yml +2 -17
- data/config/locales/bg.yml +0 -36
- data/config/locales/bs-BA.yml +0 -9
- data/config/locales/ca.yml +61 -36
- data/config/locales/cs.yml +61 -36
- data/config/locales/de.yml +60 -35
- data/config/locales/el.yml +0 -36
- data/config/locales/en.yml +61 -36
- data/config/locales/es-MX.yml +60 -35
- data/config/locales/es-PY.yml +60 -35
- data/config/locales/es.yml +60 -35
- data/config/locales/eu.yml +60 -35
- data/config/locales/fi-plain.yml +61 -36
- data/config/locales/fi.yml +61 -36
- data/config/locales/fr-CA.yml +24 -35
- data/config/locales/fr.yml +24 -35
- data/config/locales/ga-IE.yml +0 -14
- data/config/locales/gl.yml +0 -18
- data/config/locales/hu.yml +0 -36
- data/config/locales/id-ID.yml +0 -17
- data/config/locales/is-IS.yml +0 -13
- data/config/locales/it.yml +0 -21
- data/config/locales/ja.yml +61 -36
- data/config/locales/lb.yml +0 -20
- data/config/locales/lt.yml +0 -36
- data/config/locales/lv.yml +0 -20
- data/config/locales/nl.yml +0 -21
- data/config/locales/no.yml +0 -36
- data/config/locales/pl.yml +0 -36
- data/config/locales/pt-BR.yml +0 -33
- data/config/locales/pt.yml +0 -21
- data/config/locales/ro-RO.yml +1 -36
- data/config/locales/ru.yml +0 -14
- data/config/locales/sk.yml +0 -20
- data/config/locales/sr-CS.yml +0 -9
- data/config/locales/sv.yml +53 -36
- data/config/locales/tr-TR.yml +0 -21
- data/config/locales/uk.yml +0 -14
- data/config/locales/zh-CN.yml +0 -20
- data/config/locales/zh-TW.yml +0 -36
- data/db/migrate/20210310120750_add_followable_counter_cache_to_participatory_processes.rb +1 -1
- data/db/migrate/20240822161355_add_deleted_at_to_decidim_participatory_processes.rb +8 -0
- data/db/migrate/20241108141423_remove_column_show_metrics_from_participatory_processes.rb +7 -0
- data/db/migrate/20241108141514_remove_column_banner_image_from_participatory_processes.rb +7 -0
- data/db/migrate/20241108141605_remove_column_show_statistics_from_participatory_processes.rb +7 -0
- data/decidim-participatory_processes.gemspec +1 -1
- data/lib/decidim/api/participatory_process_group_type.rb +3 -3
- data/lib/decidim/api/participatory_process_step_type.rb +7 -9
- data/lib/decidim/api/participatory_process_type.rb +18 -23
- data/lib/decidim/api/participatory_process_type_type.rb +3 -3
- data/lib/decidim/participatory_processes/admin_engine.rb +85 -59
- data/lib/decidim/participatory_processes/content_blocks/registry_manager.rb +11 -0
- data/lib/decidim/participatory_processes/engine.rb +7 -0
- data/lib/decidim/participatory_processes/menu.rb +9 -17
- data/lib/decidim/participatory_processes/participatory_space.rb +5 -2
- data/lib/decidim/participatory_processes/seeds.rb +8 -16
- data/lib/decidim/participatory_processes/test/factories.rb +14 -14
- data/lib/decidim/participatory_processes/version.rb +1 -1
- metadata +24 -25
- data/app/cells/decidim/participatory_processes/process_filters/type_filter.erb +0 -17
- data/app/commands/decidim/participatory_processes/admin/create_participatory_process_type.rb +0 -17
- data/app/commands/decidim/participatory_processes/admin/update_participatory_process_type.rb +0 -13
- data/app/controllers/decidim/participatory_processes/admin/categories_controller.rb +0 -13
- data/app/controllers/decidim/participatory_processes/admin/participatory_process_types_controller.rb +0 -117
- data/app/forms/decidim/participatory_processes/admin/participatory_process_type_form.rb +0 -20
- data/app/helpers/decidim/participatory_processes/admin/participatory_process_helper.rb +0 -24
- data/app/packs/entrypoints/decidim_participatory_processes_admin.js +0 -1
- data/app/packs/src/decidim/participatory_processes/admin/participatory_processes.js +0 -18
- data/app/views/decidim/participatory_processes/admin/participatory_process_types/_form.html.erb +0 -9
- data/app/views/decidim/participatory_processes/admin/participatory_process_types/edit.html.erb +0 -18
- data/app/views/decidim/participatory_processes/admin/participatory_process_types/index.html.erb +0 -58
- data/app/views/decidim/participatory_processes/admin/participatory_process_types/new.html.erb +0 -18
data/config/locales/zh-TW.yml
CHANGED
@@ -23,16 +23,12 @@ zh-TW:
|
|
23
23
|
local_area: 組織區域
|
24
24
|
meta_scope: 元數據範圍
|
25
25
|
participatory_process_group_id: 程序群組
|
26
|
-
participatory_process_type_id: 處理類型
|
27
26
|
participatory_scope: 決定了什麼
|
28
27
|
participatory_structure: 如何決定
|
29
28
|
private_space: 私有程序
|
30
29
|
promoted: 推廣
|
31
30
|
published_at: 發佈於
|
32
31
|
related_process_ids: 相關程序
|
33
|
-
scope_id: 範圍
|
34
|
-
scope_type_max_depth_id: 範圍篩選深度
|
35
|
-
scopes_enabled: 啟用範圍
|
36
32
|
short_description: 簡短說明
|
37
33
|
slug: URL網址
|
38
34
|
start_date: 開始日期
|
@@ -61,8 +57,6 @@ zh-TW:
|
|
61
57
|
short_description: 簡短說明
|
62
58
|
start_date: 開始日期
|
63
59
|
title: 標題
|
64
|
-
participatory_process_type:
|
65
|
-
title: 標題
|
66
60
|
participatory_process_user_role:
|
67
61
|
email: 電子郵件
|
68
62
|
name: 名稱
|
@@ -98,7 +92,6 @@ zh-TW:
|
|
98
92
|
new_process: 新的程序
|
99
93
|
new_process_group: 新的程序群組
|
100
94
|
new_process_step: 新階段
|
101
|
-
new_process_type: 新的處理類型
|
102
95
|
new_process_user_role: 新程序管理員
|
103
96
|
preview: 預覽
|
104
97
|
publish: 發布
|
@@ -109,16 +102,13 @@ zh-TW:
|
|
109
102
|
participatory_process_groups_submenu:
|
110
103
|
info: 資訊
|
111
104
|
landing_page: 登陸頁面
|
112
|
-
participatory_process_types: 處理類型
|
113
105
|
participatory_processes: 程序
|
114
106
|
participatory_processes_submenu:
|
115
107
|
attachment_collections: 資料夾
|
116
108
|
attachment_files: 檔案
|
117
109
|
attachments: 附件
|
118
|
-
categories: 類別
|
119
110
|
components: 组件
|
120
111
|
moderations: 版主
|
121
|
-
private_users: 私人參與者
|
122
112
|
process_admins: 程序管理員
|
123
113
|
steps: 分類
|
124
114
|
models:
|
@@ -139,11 +129,6 @@ zh-TW:
|
|
139
129
|
start_date: 開始日期
|
140
130
|
title: 標題
|
141
131
|
name: 參與式過程階段
|
142
|
-
participatory_process_type:
|
143
|
-
fields:
|
144
|
-
created_at: 建立於
|
145
|
-
title: 標題
|
146
|
-
name: 處理類型
|
147
132
|
participatory_process_user_role:
|
148
133
|
fields:
|
149
134
|
email: 電子郵件
|
@@ -166,7 +151,6 @@ zh-TW:
|
|
166
151
|
title: 重複的參與性流程
|
167
152
|
participatory_process_groups:
|
168
153
|
destroy:
|
169
|
-
error: 刪除參與性流程群組時發生錯誤。
|
170
154
|
success: 參與式流程組成功刪除。
|
171
155
|
edit:
|
172
156
|
title: 編輯程序群組
|
@@ -219,21 +203,6 @@ zh-TW:
|
|
219
203
|
update:
|
220
204
|
error: 更新參與程序階段時出現問題。
|
221
205
|
success: 參與式階段成功更新。
|
222
|
-
participatory_process_types:
|
223
|
-
create:
|
224
|
-
error: 新增程序類型時發生錯誤
|
225
|
-
success: 程序類型已成功創建
|
226
|
-
destroy:
|
227
|
-
success: 程序類型已成功刪除。
|
228
|
-
edit:
|
229
|
-
title: 編輯程序類型
|
230
|
-
update: 更新
|
231
|
-
new:
|
232
|
-
create: 建立
|
233
|
-
title: 新的處理類型
|
234
|
-
update:
|
235
|
-
error: 更新這個程序類型時發生錯誤
|
236
|
-
success: 程序類型成功更新。
|
237
206
|
participatory_process_user_roles:
|
238
207
|
create:
|
239
208
|
error: 新增參與者至此參與式過程時發生問題。
|
@@ -385,14 +354,9 @@ zh-TW:
|
|
385
354
|
form:
|
386
355
|
announcement_help: 您在此處輸入的文字將顯示至使用者的正下方程序信息
|
387
356
|
duration: 持續時間
|
388
|
-
filters: 過濾器
|
389
357
|
images: 圖片
|
390
358
|
metadata: 元數據
|
391
|
-
other: 其他
|
392
359
|
related_processes: 相關程序
|
393
|
-
scope_type_max_depth_help: 限制範圍過濾器深度;過濾器將會從一般範圍到所選範圍層級進行顯示。
|
394
|
-
select_an_area: 選擇一個地區
|
395
|
-
select_participatory_process_type: 選擇一個程序類型
|
396
360
|
select_process_group: 選擇一個程序群組
|
397
361
|
title: 基本資訊
|
398
362
|
content_blocks:
|
@@ -7,7 +7,7 @@ class AddFollowableCounterCacheToParticipatoryProcesses < ActiveRecord::Migratio
|
|
7
7
|
reversible do |dir|
|
8
8
|
dir.up do
|
9
9
|
Decidim::ParticipatoryProcess.reset_column_information
|
10
|
-
Decidim::ParticipatoryProcess.find_each do |record|
|
10
|
+
Decidim::ParticipatoryProcess.unscoped.find_each do |record|
|
11
11
|
record.class.reset_counters(record.id, :follows)
|
12
12
|
end
|
13
13
|
end
|
@@ -0,0 +1,8 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
class AddDeletedAtToDecidimParticipatoryProcesses < ActiveRecord::Migration[7.0]
|
4
|
+
def change
|
5
|
+
add_column :decidim_participatory_processes, :deleted_at, :datetime
|
6
|
+
add_index :decidim_participatory_processes, :deleted_at
|
7
|
+
end
|
8
|
+
end
|
@@ -17,7 +17,7 @@ Gem::Specification.new do |s|
|
|
17
17
|
"homepage_uri" => "https://decidim.org",
|
18
18
|
"source_code_uri" => "https://github.com/decidim/decidim"
|
19
19
|
}
|
20
|
-
s.required_ruby_version = "~> 3.
|
20
|
+
s.required_ruby_version = "~> 3.3.0"
|
21
21
|
|
22
22
|
s.name = "decidim-participatory_processes"
|
23
23
|
s.summary = "Decidim participatory processes module"
|
@@ -6,12 +6,12 @@ module Decidim
|
|
6
6
|
class ParticipatoryProcessGroupType < Decidim::Api::Types::BaseObject
|
7
7
|
description "A participatory process group"
|
8
8
|
|
9
|
-
field :id, GraphQL::Types::ID, "ID of this participatory process group", null: false
|
10
|
-
field :title, Decidim::Core::TranslatedFieldType, "The title of this participatory process group", null: true
|
11
9
|
field :description, Decidim::Core::TranslatedFieldType, "The description of this participatory process group", null: true
|
10
|
+
field :hero_image, GraphQL::Types::String, "The hero image for this participatory process group", null: true
|
11
|
+
field :id, GraphQL::Types::ID, "ID of this participatory process group", null: false
|
12
12
|
field :participatory_processes, [Decidim::ParticipatoryProcesses::ParticipatoryProcessType, { null: true }],
|
13
13
|
description: "Lists all the participatory processes belonging to this group", null: false
|
14
|
-
field :
|
14
|
+
field :title, Decidim::Core::TranslatedFieldType, "The title of this participatory process group", null: true
|
15
15
|
|
16
16
|
def hero_image
|
17
17
|
object.attached_uploader(:hero_image).url
|
@@ -6,18 +6,16 @@ module Decidim
|
|
6
6
|
class ParticipatoryProcessStepType < Decidim::Api::Types::BaseObject
|
7
7
|
description "A participatory process step"
|
8
8
|
|
9
|
-
field :
|
10
|
-
|
11
|
-
field :participatory_process, ParticipatoryProcessType, description: "The participatory process in which this step belongs to.", null: false
|
12
|
-
|
13
|
-
field :title, Decidim::Core::TranslatedFieldType, "The title of this step", null: false
|
14
|
-
field :description, Decidim::Core::TranslatedFieldType, "The description of this step", null: true
|
15
|
-
field :start_date, Decidim::Core::DateTimeType, "This step's start date", null: true
|
16
|
-
field :end_date, Decidim::Core::DateTimeType, "This step's end date", null: true
|
9
|
+
field :active, GraphQL::Types::Boolean, "If this step is the active one", null: true
|
17
10
|
field :call_to_action_path, GraphQL::Types::String, "A call to action URL for this step", method: :cta_path, null: true
|
18
11
|
field :call_to_action_text, Decidim::Core::TranslatedFieldType, "The call to action text for this step", method: :cta_text, null: true
|
19
|
-
field :
|
12
|
+
field :description, Decidim::Core::TranslatedFieldType, "The description of this step", null: true
|
13
|
+
field :end_date, Decidim::Core::DateTimeType, "This step's end date", null: true
|
14
|
+
field :id, GraphQL::Types::ID, "The unique ID of this step.", null: false
|
15
|
+
field :participatory_process, ParticipatoryProcessType, description: "The participatory process in which this step belongs to.", null: false
|
20
16
|
field :position, GraphQL::Types::Int, "Ordering position among all the steps", null: true
|
17
|
+
field :start_date, Decidim::Core::DateTimeType, "This step's start date", null: true
|
18
|
+
field :title, Decidim::Core::TranslatedFieldType, "The title of this step", null: false
|
21
19
|
end
|
22
20
|
end
|
23
21
|
end
|
@@ -6,42 +6,37 @@ module Decidim
|
|
6
6
|
class ParticipatoryProcessType < Decidim::Api::Types::BaseObject
|
7
7
|
implements Decidim::Core::ParticipatorySpaceInterface
|
8
8
|
implements Decidim::Core::ParticipatorySpaceResourceableInterface
|
9
|
-
implements Decidim::Core::
|
9
|
+
implements Decidim::Core::TaxonomizableInterface
|
10
|
+
implements Decidim::Core::TimestampsInterface
|
10
11
|
implements Decidim::Core::AttachableInterface
|
11
12
|
implements Decidim::Core::CategoriesContainerInterface
|
12
13
|
|
13
14
|
description "A participatory process"
|
14
15
|
|
15
|
-
field :
|
16
|
-
field :slug, GraphQL::Types::String, null: false
|
17
|
-
field :hashtag, GraphQL::Types::String, "The hashtag for this participatory process", null: true
|
18
|
-
field :created_at, Decidim::Core::DateTimeType, "The time this page was created", null: false
|
19
|
-
field :updated_at, Decidim::Core::DateTimeType, "The time this page was updated", null: false
|
20
|
-
field :published_at, Decidim::Core::DateTimeType, "The time this page was published", null: false
|
21
|
-
field :subtitle, Decidim::Core::TranslatedFieldType, "The subtitle of this participatory process.", null: true
|
16
|
+
field :announcement, Decidim::Core::TranslatedFieldType, "Highlighted announcement for this participatory process.", null: true
|
22
17
|
field :description, Decidim::Core::TranslatedFieldType, "The description of this participatory process.", null: true
|
23
|
-
field :
|
24
|
-
field :start_date, Decidim::Core::DateType, "This participatory process' start date.", null: true
|
18
|
+
field :developer_group, Decidim::Core::TranslatedFieldType, "The promoter group of this participatory process.", null: true
|
25
19
|
field :end_date, Decidim::Core::DateType, "This participatory process' end date.", null: true
|
26
|
-
|
20
|
+
field :hashtag, GraphQL::Types::String, "The hashtag for this participatory process", null: true
|
27
21
|
field :hero_image, GraphQL::Types::String, "The hero image for this participatory process", null: true
|
28
|
-
field :
|
29
|
-
field :developer_group, Decidim::Core::TranslatedFieldType, "The promoter group of this participatory process.", null: true
|
30
|
-
field :meta_scope, Decidim::Core::TranslatedFieldType, "The scope metadata of this participatory process.", null: true
|
22
|
+
field :id, GraphQL::Types::ID, "The internal ID for this participatory process", null: false
|
31
23
|
field :local_area, Decidim::Core::TranslatedFieldType, "The organization area of this participatory process.", null: true
|
32
|
-
field :
|
24
|
+
field :meta_scope, Decidim::Core::TranslatedFieldType, "The scope metadata of this participatory process.", null: true
|
25
|
+
field :participatory_process_group, Decidim::ParticipatoryProcesses::ParticipatoryProcessGroupType,
|
26
|
+
null: true,
|
27
|
+
description: "The participatory process group in which this process belong to"
|
33
28
|
field :participatory_scope, Decidim::Core::TranslatedFieldType, "What is decided on this participatory process.", null: true
|
34
29
|
field :participatory_structure, Decidim::Core::TranslatedFieldType, "How it is decided on this participatory process.", null: true
|
35
|
-
field :
|
36
|
-
|
37
|
-
field :announcement, Decidim::Core::TranslatedFieldType, "Highlighted announcement for this participatory process.", null: true
|
38
|
-
|
30
|
+
field :promoted, GraphQL::Types::Boolean, "If this participatory process is promoted (therefore in the homepage)", null: true
|
31
|
+
field :published_at, Decidim::Core::DateTimeType, "The time this page was published", null: false
|
39
32
|
field :reference, GraphQL::Types::String, "Reference prefix for this participatory process", null: true
|
33
|
+
field :scopes_enabled, GraphQL::Types::Boolean, "If this participatory process has scopes enabled", null: true
|
34
|
+
field :short_description, Decidim::Core::TranslatedFieldType, "The short description of this participatory process.", null: true
|
35
|
+
field :slug, GraphQL::Types::String, "The slug of the Participatory Process", null: false
|
36
|
+
field :start_date, Decidim::Core::DateType, "This participatory process' start date.", null: true
|
40
37
|
field :steps, [Decidim::ParticipatoryProcesses::ParticipatoryProcessStepType, { null: true }], "All the steps of this process.", null: false
|
41
|
-
|
42
|
-
field :
|
43
|
-
null: true,
|
44
|
-
description: "The participatory process group in which this process belong to"
|
38
|
+
field :subtitle, Decidim::Core::TranslatedFieldType, "The subtitle of this participatory process.", null: true
|
39
|
+
field :target, Decidim::Core::TranslatedFieldType, "Who participates in this participatory process.", null: true
|
45
40
|
|
46
41
|
def hero_image
|
47
42
|
object.attached_uploader(:hero_image).url
|
@@ -4,14 +4,14 @@ module Decidim
|
|
4
4
|
module ParticipatoryProcesses
|
5
5
|
# This type represents a ParticipatoryProcessType.
|
6
6
|
class ParticipatoryProcessTypeType < Decidim::Api::Types::BaseObject
|
7
|
+
implements Decidim::Core::TimestampsInterface
|
8
|
+
|
7
9
|
description "A participatory process type"
|
8
10
|
|
9
11
|
field :id, GraphQL::Types::ID, "Unique ID of this participatory process type", null: false
|
10
|
-
field :title, Decidim::Core::TranslatedFieldType, "The title of this participatory process type", null: true
|
11
|
-
field :created_at, Decidim::Core::DateTimeType, "The time this participatory process type was created", null: false
|
12
|
-
field :updated_at, Decidim::Core::DateTimeType, "The time this participatory process type was updated", null: false
|
13
12
|
field :processes, [Decidim::ParticipatoryProcesses::ParticipatoryProcessType, { null: true }],
|
14
13
|
description: "Lists all the participatory processes belonging to this type", null: false
|
14
|
+
field :title, Decidim::Core::TranslatedFieldType, "The title of this participatory process type", null: true
|
15
15
|
end
|
16
16
|
end
|
17
17
|
end
|
@@ -16,89 +16,115 @@ module Decidim
|
|
16
16
|
paths["lib/tasks"] = nil
|
17
17
|
|
18
18
|
routes do
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
end
|
24
|
-
resources :participatory_process_types
|
25
|
-
resources :participatory_processes, param: :slug, except: [:show, :destroy] do
|
26
|
-
resource :publish, controller: "participatory_process_publications", only: [:create, :destroy]
|
27
|
-
resources :copies, controller: "participatory_process_copies", only: [:new, :create]
|
28
|
-
|
29
|
-
resources :steps, controller: "participatory_process_steps" do
|
30
|
-
resource :activate, controller: "participatory_process_step_activations", only: [:create, :destroy]
|
31
|
-
collection do
|
32
|
-
post :ordering, to: "participatory_process_step_ordering#create"
|
19
|
+
constraints(->(request) { Decidim::Admin::OrganizationDashboardConstraint.new(request).matches? }) do
|
20
|
+
resources :participatory_process_groups do
|
21
|
+
resource :landing_page, only: [:edit, :update], controller: "participatory_process_group_landing_page" do
|
22
|
+
resources :content_blocks, only: [:edit, :update, :destroy, :create], controller: "participatory_process_group_landing_page_content_blocks"
|
33
23
|
end
|
34
24
|
end
|
35
|
-
resources :
|
25
|
+
resources :participatory_processes, param: :slug, except: [:show, :destroy] do
|
26
|
+
resource :publish, controller: "participatory_process_publications", only: [:create, :destroy]
|
27
|
+
resources :copies, controller: "participatory_process_copies", only: [:new, :create]
|
28
|
+
|
36
29
|
member do
|
37
|
-
|
30
|
+
patch :soft_delete
|
31
|
+
patch :restore
|
38
32
|
end
|
39
|
-
end
|
40
|
-
resources :attachment_collections, controller: "participatory_process_attachment_collections", except: [:show]
|
41
|
-
resources :attachments, controller: "participatory_process_attachments", except: [:show]
|
42
|
-
|
43
|
-
resource :export, controller: "participatory_process_exports", only: :create
|
44
33
|
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
34
|
+
resources :steps, controller: "participatory_process_steps" do
|
35
|
+
resource :activate, controller: "participatory_process_step_activations", only: [:create, :destroy]
|
36
|
+
collection do
|
37
|
+
post :ordering, to: "participatory_process_step_ordering#create"
|
38
|
+
end
|
39
|
+
end
|
40
|
+
resources :user_roles, controller: "participatory_process_user_roles" do
|
41
|
+
member do
|
42
|
+
post :resend_invitation, to: "participatory_process_user_roles#resend_invitation"
|
43
|
+
end
|
44
|
+
end
|
45
|
+
resources :attachment_collections, controller: "participatory_process_attachment_collections", except: [:show]
|
46
|
+
resources :attachments, controller: "participatory_process_attachments", except: [:show]
|
52
47
|
|
53
|
-
|
54
|
-
resources :categories, except: [:show]
|
48
|
+
resource :export, controller: "participatory_process_exports", only: :create
|
55
49
|
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
put :publish
|
60
|
-
put :unpublish
|
61
|
-
get :share
|
50
|
+
collection do
|
51
|
+
get :manage_trash, to: "participatory_processes#manage_trash"
|
52
|
+
resources :imports, controller: "participatory_process_imports", only: [:new, :create]
|
62
53
|
end
|
63
|
-
|
64
|
-
|
65
|
-
get :example, on: :collection
|
54
|
+
resource :landing_page, only: [:edit, :update], controller: "participatory_process_landing_page" do
|
55
|
+
resources :content_blocks, only: [:edit, :update, :destroy, :create], controller: "participatory_process_landing_page_content_blocks"
|
66
56
|
end
|
67
|
-
resources :reminders, only: [:new, :create]
|
68
57
|
end
|
69
58
|
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
59
|
+
scope "/participatory_processes/:participatory_process_slug" do
|
60
|
+
resources :components do
|
61
|
+
collection do
|
62
|
+
put :reorder
|
63
|
+
end
|
64
|
+
resource :permissions, controller: "component_permissions"
|
65
|
+
member do
|
66
|
+
put :publish
|
67
|
+
put :unpublish
|
68
|
+
get :share
|
69
|
+
patch :soft_delete
|
70
|
+
patch :restore
|
71
|
+
end
|
72
|
+
collection do
|
73
|
+
get :manage_trash, to: "components#manage_trash"
|
74
|
+
put :hide
|
75
|
+
end
|
76
|
+
resources :component_share_tokens, except: [:show], path: "share_tokens", as: "share_tokens"
|
77
|
+
resources :exports, only: :create
|
78
|
+
resources :imports, only: [:new, :create] do
|
79
|
+
get :example, on: :collection
|
80
|
+
end
|
81
|
+
resources :reminders, only: [:new, :create]
|
75
82
|
end
|
76
|
-
resources :reports, controller: "moderations/reports", only: [:index, :show]
|
77
|
-
end
|
78
83
|
|
79
|
-
|
80
|
-
|
81
|
-
|
84
|
+
resources :moderations do
|
85
|
+
member do
|
86
|
+
put :unreport
|
87
|
+
put :hide
|
88
|
+
put :unhide
|
89
|
+
end
|
90
|
+
patch :bulk_action, on: :collection
|
91
|
+
resources :reports, controller: "moderations/reports", only: [:index, :show]
|
82
92
|
end
|
83
|
-
|
84
|
-
|
85
|
-
|
93
|
+
|
94
|
+
resources :participatory_space_private_users, controller: "participatory_space_private_users" do
|
95
|
+
member do
|
96
|
+
post :resend_invitation, to: "participatory_space_private_users#resend_invitation"
|
97
|
+
end
|
98
|
+
collection do
|
99
|
+
resource :participatory_space_private_users_csv_imports, only: [:new, :create], path: "csv_import" do
|
100
|
+
delete :destroy_all
|
101
|
+
end
|
102
|
+
post :publish_all
|
103
|
+
post :unpublish_all
|
86
104
|
end
|
87
105
|
end
|
106
|
+
|
107
|
+
resources :participatory_process_share_tokens, except: [:show], path: "share_tokens"
|
88
108
|
end
|
89
|
-
end
|
90
109
|
|
91
|
-
|
92
|
-
|
93
|
-
|
110
|
+
scope "/participatory_processes/:participatory_process_slug/components/:component_id/manage" do
|
111
|
+
Decidim.component_manifests.each do |manifest|
|
112
|
+
next unless manifest.admin_engine
|
94
113
|
|
95
|
-
|
96
|
-
|
114
|
+
constraints CurrentComponent.new(manifest) do
|
115
|
+
mount manifest.admin_engine, at: "/", as: "decidim_admin_participatory_process_#{manifest.name}"
|
116
|
+
end
|
97
117
|
end
|
98
118
|
end
|
99
119
|
end
|
100
120
|
end
|
101
121
|
|
122
|
+
initializer "decidim_participatory_processes_admin.mount_routes" do
|
123
|
+
Decidim::Core::Engine.routes do
|
124
|
+
mount Decidim::ParticipatoryProcesses::AdminEngine, at: "/admin", as: "decidim_admin_participatory_processes"
|
125
|
+
end
|
126
|
+
end
|
127
|
+
|
102
128
|
initializer "decidim_participatory_processes_admin.menu" do
|
103
129
|
Decidim::ParticipatoryProcesses::Menu.register_admin_menu_modules!
|
104
130
|
Decidim::ParticipatoryProcesses::Menu.register_admin_participatory_processes_menu!
|
@@ -166,6 +166,7 @@ module Decidim
|
|
166
166
|
end
|
167
167
|
end
|
168
168
|
|
169
|
+
register_highlighted_debates
|
169
170
|
register_highlighted_meetings
|
170
171
|
register_highlighted_posts
|
171
172
|
register_highlighted_proposals
|
@@ -173,6 +174,16 @@ module Decidim
|
|
173
174
|
register_related_assemblies
|
174
175
|
end
|
175
176
|
|
177
|
+
def self.register_highlighted_debates
|
178
|
+
return unless Decidim.module_installed?(:debates)
|
179
|
+
|
180
|
+
Decidim.content_blocks.register(:participatory_process_homepage, :highlighted_debates) do |content_block|
|
181
|
+
content_block.cell = "decidim/debates/content_blocks/highlighted_debates"
|
182
|
+
content_block.public_name_key = "decidim.debates.content_blocks.highlighted_debates.name"
|
183
|
+
content_block.component_manifest_name = "debates"
|
184
|
+
end
|
185
|
+
end
|
186
|
+
|
176
187
|
def self.register_highlighted_meetings
|
177
188
|
return unless Decidim.module_installed?(:meetings)
|
178
189
|
|
@@ -33,6 +33,7 @@ module Decidim
|
|
33
33
|
resources :participatory_process_groups, only: :show, path: "processes_groups"
|
34
34
|
resources :participatory_processes, only: [:index, :show], param: :slug, path: "processes" do
|
35
35
|
get "all-metrics", on: :member
|
36
|
+
resources :participatory_space_private_users, only: :index, path: "members"
|
36
37
|
end
|
37
38
|
|
38
39
|
scope "/processes/:participatory_process_slug/f/:component_id" do
|
@@ -46,6 +47,12 @@ module Decidim
|
|
46
47
|
end
|
47
48
|
end
|
48
49
|
|
50
|
+
initializer "decidim_participatory_processes.mount_routes" do
|
51
|
+
Decidim::Core::Engine.routes do
|
52
|
+
mount Decidim::ParticipatoryProcesses::Engine, at: "/", as: "decidim_participatory_processes"
|
53
|
+
end
|
54
|
+
end
|
55
|
+
|
49
56
|
initializer "decidim_participatory_processes.register_icons" do
|
50
57
|
Decidim.icons.register(name: "Decidim::ParticipatoryProcess", icon: "treasure-map-line", description: "Participatory Process", category: "activity",
|
51
58
|
engine: :participatory_process)
|
@@ -44,8 +44,7 @@ module Decidim
|
|
44
44
|
icon_name: "treasure-map-line",
|
45
45
|
position: 2,
|
46
46
|
active: is_active_link?(decidim_admin_participatory_processes.participatory_processes_path, :inclusive) ||
|
47
|
-
is_active_link?(decidim_admin_participatory_processes.participatory_process_groups_path, :inclusive)
|
48
|
-
is_active_link?(decidim_admin_participatory_processes.participatory_process_types_path),
|
47
|
+
is_active_link?(decidim_admin_participatory_processes.participatory_process_groups_path, :inclusive),
|
49
48
|
if: allowed_to?(:enter, :space_area, space_name: :processes) || allowed_to?(:enter, :space_area, space_name: :process_groups)
|
50
49
|
end
|
51
50
|
end
|
@@ -100,6 +99,7 @@ module Decidim
|
|
100
99
|
active: is_active_link?(manage_component_path(component)) ||
|
101
100
|
is_active_link?(decidim_admin_participatory_processes.edit_component_path(current_participatory_space, component)) ||
|
102
101
|
is_active_link?(decidim_admin_participatory_processes.edit_component_permissions_path(current_participatory_space, component)) ||
|
102
|
+
is_active_link?(decidim_admin_participatory_processes.component_share_tokens_path(current_participatory_space, component)) ||
|
103
103
|
participatory_space_active_link?(component),
|
104
104
|
if: component.manifest.admin_engine && user_role_config.component_is_accessible?(component.manifest_name)
|
105
105
|
end
|
@@ -138,13 +138,6 @@ module Decidim
|
|
138
138
|
if: allowed_to?(:read, :component),
|
139
139
|
submenu: { target_menu: :admin_participatory_process_components_menu }
|
140
140
|
|
141
|
-
menu.add_item :categories,
|
142
|
-
I18n.t("categories", scope: "decidim.admin.menu.participatory_processes_submenu"),
|
143
|
-
decidim_admin_participatory_processes.categories_path(current_participatory_space),
|
144
|
-
active: is_active_link?(decidim_admin_participatory_processes.categories_path(current_participatory_space)),
|
145
|
-
icon_name: "price-tag-3-line",
|
146
|
-
if: allowed_to?(:read, :category)
|
147
|
-
|
148
141
|
menu.add_item :attachments,
|
149
142
|
I18n.t("attachments", scope: "decidim.admin.menu.participatory_processes_submenu"),
|
150
143
|
decidim_admin_participatory_processes.participatory_process_attachments_path(current_participatory_space),
|
@@ -173,6 +166,13 @@ module Decidim
|
|
173
166
|
active: is_active_link?(decidim_admin_participatory_processes.moderations_path(current_participatory_space)),
|
174
167
|
icon_name: "flag-line",
|
175
168
|
if: allowed_to?(:read, :moderation, current_participatory_space:)
|
169
|
+
|
170
|
+
menu.add_item :participatory_process_share_tokens,
|
171
|
+
I18n.t("menu.share_tokens", scope: "decidim.admin"),
|
172
|
+
decidim_admin_participatory_processes.participatory_process_share_tokens_path(current_participatory_space),
|
173
|
+
active: is_active_link?(decidim_admin_participatory_processes.participatory_process_share_tokens_path(current_participatory_space)),
|
174
|
+
icon_name: "share-line",
|
175
|
+
if: allowed_to?(:read, :share_tokens, current_participatory_space:)
|
176
176
|
end
|
177
177
|
end
|
178
178
|
|
@@ -212,14 +212,6 @@ module Decidim
|
|
212
212
|
icon_name: "upload-line",
|
213
213
|
if: allowed_to?(:import, :process),
|
214
214
|
active: is_active_link?(decidim_admin_participatory_processes.new_import_path)
|
215
|
-
|
216
|
-
menu.add_item :participatory_process_types,
|
217
|
-
I18n.t("menu.participatory_process_types", scope: "decidim.admin"),
|
218
|
-
decidim_admin_participatory_processes.participatory_process_types_path,
|
219
|
-
position: 3,
|
220
|
-
icon_name: "price-tag-3-line",
|
221
|
-
if: allowed_to?(:manage, :participatory_process_type),
|
222
|
-
active: is_active_link?(decidim_admin_participatory_processes.participatory_process_types_path)
|
223
215
|
end
|
224
216
|
end
|
225
217
|
end
|
@@ -45,11 +45,14 @@ Decidim.register_participatory_space(:participatory_processes) do |participatory
|
|
45
45
|
end
|
46
46
|
|
47
47
|
participatory_space.exports :participatory_processes do |export|
|
48
|
-
export.collection do
|
49
|
-
Decidim::ParticipatoryProcess.
|
48
|
+
export.collection do
|
49
|
+
Decidim::ParticipatoryProcess.public_spaces
|
50
50
|
end
|
51
51
|
|
52
|
+
export.include_in_open_data = true
|
53
|
+
|
52
54
|
export.serializer Decidim::ParticipatoryProcesses::ParticipatoryProcessSerializer
|
55
|
+
export.open_data_serializer Decidim::ParticipatoryProcesses::OpenDataParticipatoryProcessSerializer
|
53
56
|
end
|
54
57
|
|
55
58
|
participatory_space.register_on_destroy_account do |user|
|
@@ -18,13 +18,17 @@ module Decidim
|
|
18
18
|
Decidim::ContentBlocksCreator.new(process_group).create_default!
|
19
19
|
end
|
20
20
|
|
21
|
-
|
21
|
+
taxonomy = create_taxonomy!(name: "Process Types", parent: nil)
|
22
22
|
2.times do
|
23
|
-
|
23
|
+
create_taxonomy!(name: ::Faker::Lorem.word, parent: taxonomy)
|
24
24
|
end
|
25
|
+
# filters for processes only
|
26
|
+
create_taxonomy_filter!(root_taxonomy: taxonomy,
|
27
|
+
taxonomies: taxonomy.all_children,
|
28
|
+
participatory_space_manifests: [:participatory_processes])
|
25
29
|
|
26
30
|
2.times do |_n|
|
27
|
-
process = create_process!(process_group: process_groups.sample
|
31
|
+
process = create_process!(process_group: process_groups.sample)
|
28
32
|
|
29
33
|
create_follow!(Decidim::User.where(organization:, admin: true).first, process)
|
30
34
|
create_follow!(Decidim::User.where(organization:, admin: false).first, process)
|
@@ -37,10 +41,6 @@ module Decidim
|
|
37
41
|
|
38
42
|
create_attachments!(attached_to: process)
|
39
43
|
|
40
|
-
2.times do
|
41
|
-
create_category!(participatory_space: process)
|
42
|
-
end
|
43
|
-
|
44
44
|
seed_components_manifests!(participatory_space: process)
|
45
45
|
end
|
46
46
|
end
|
@@ -74,14 +74,7 @@ module Decidim
|
|
74
74
|
)
|
75
75
|
end
|
76
76
|
|
77
|
-
def
|
78
|
-
Decidim::ParticipatoryProcessType.create!(
|
79
|
-
title: Decidim::Faker::Localized.word,
|
80
|
-
organization:
|
81
|
-
)
|
82
|
-
end
|
83
|
-
|
84
|
-
def create_process!(process_group: nil, process_type: nil)
|
77
|
+
def create_process!(process_group: nil)
|
85
78
|
n = rand(2)
|
86
79
|
params = {
|
87
80
|
title: Decidim::Faker::Localized.sentence(word_count: 5),
|
@@ -107,7 +100,6 @@ module Decidim
|
|
107
100
|
start_date: Date.current,
|
108
101
|
end_date: 2.months.from_now,
|
109
102
|
participatory_process_group: process_group,
|
110
|
-
participatory_process_type: process_type,
|
111
103
|
scope: n.positive? ? nil : Decidim::Scope.all.sample
|
112
104
|
}
|
113
105
|
|