decidim-participatory_processes 0.23.3 → 0.24.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (155) hide show
  1. checksums.yaml +4 -4
  2. data/app/cells/decidim/participatory_process_groups/content_block_cell.rb +17 -0
  3. data/app/cells/decidim/participatory_process_groups/content_blocks/highlighted_participatory_processes/filters.erb +22 -0
  4. data/app/cells/decidim/participatory_process_groups/content_blocks/highlighted_participatory_processes/filters_small_view.erb +18 -0
  5. data/app/cells/decidim/participatory_process_groups/content_blocks/highlighted_participatory_processes/participatory_space_filters.erb +6 -0
  6. data/app/cells/decidim/participatory_process_groups/content_blocks/highlighted_participatory_processes/show.erb +7 -0
  7. data/app/cells/decidim/participatory_process_groups/content_blocks/highlighted_participatory_processes/title_filter_order.erb +8 -0
  8. data/app/cells/decidim/participatory_process_groups/content_blocks/highlighted_participatory_processes_cell.rb +65 -0
  9. data/app/cells/decidim/participatory_process_groups/content_blocks/html/show.erb +3 -0
  10. data/app/cells/decidim/participatory_process_groups/content_blocks/html_cell.rb +13 -0
  11. data/app/cells/decidim/participatory_process_groups/content_blocks/metadata/show.erb +28 -0
  12. data/app/cells/decidim/participatory_process_groups/content_blocks/metadata_cell.rb +15 -0
  13. data/app/cells/decidim/participatory_process_groups/content_blocks/stats/show.erb +13 -0
  14. data/app/cells/decidim/participatory_process_groups/content_blocks/stats_cell.rb +17 -0
  15. data/app/cells/decidim/participatory_process_groups/content_blocks/title/show.erb +43 -0
  16. data/app/cells/decidim/participatory_process_groups/content_blocks/title_cell.rb +56 -0
  17. data/app/cells/decidim/participatory_process_groups/process_filters_cell.rb +78 -0
  18. data/app/cells/decidim/participatory_processes/content_blocks/highlighted_processes/show.erb +2 -16
  19. data/app/cells/decidim/participatory_processes/content_blocks/highlighted_processes/single_process.erb +32 -28
  20. data/app/cells/decidim/participatory_processes/content_blocks/highlighted_processes_cell.rb +33 -10
  21. data/app/cells/decidim/participatory_processes/filtered_participatory_processes/show.erb +3 -0
  22. data/app/cells/decidim/participatory_processes/filtered_participatory_processes_cell.rb +56 -0
  23. data/app/cells/decidim/participatory_processes/process_cell.rb +6 -1
  24. data/app/cells/decidim/participatory_processes/process_filters_cell.rb +1 -1
  25. data/app/cells/decidim/participatory_processes/process_group_cell.rb +6 -1
  26. data/app/cells/decidim/participatory_processes/process_group_m_cell.rb +3 -1
  27. data/app/cells/decidim/participatory_processes/process_group_s/image.erb +1 -0
  28. data/app/cells/decidim/participatory_processes/process_group_s/show.erb +8 -0
  29. data/app/cells/decidim/participatory_processes/process_group_s_cell.rb +23 -0
  30. data/app/cells/decidim/participatory_processes/process_s/image.erb +1 -0
  31. data/app/cells/decidim/participatory_processes/process_s/show.erb +14 -0
  32. data/app/cells/decidim/participatory_processes/process_s_cell.rb +35 -0
  33. data/app/cells/decidim/participatory_processes/statistic/show.erb +3 -3
  34. data/app/cells/decidim/participatory_processes/statistics/show.erb +1 -1
  35. data/app/commands/decidim/participatory_processes/admin/create_participatory_process.rb +1 -0
  36. data/app/commands/decidim/participatory_processes/admin/create_participatory_process_admin.rb +7 -75
  37. data/app/commands/decidim/participatory_processes/admin/create_participatory_process_group.rb +11 -2
  38. data/app/commands/decidim/participatory_processes/admin/update_participatory_process.rb +1 -0
  39. data/app/commands/decidim/participatory_processes/admin/update_participatory_process_group.rb +11 -2
  40. data/app/commands/decidim/participatory_processes/admin/update_participatory_process_step.rb +1 -0
  41. data/app/controllers/decidim/participatory_processes/admin/imports_controller.rb +14 -0
  42. data/app/controllers/decidim/participatory_processes/admin/moderations/reports_controller.rb +18 -0
  43. data/app/controllers/decidim/participatory_processes/admin/participatory_process_group_landing_page_content_blocks_controller.rb +48 -0
  44. data/app/controllers/decidim/participatory_processes/admin/participatory_process_group_landing_page_controller.rb +53 -0
  45. data/app/controllers/decidim/participatory_processes/admin/participatory_process_groups_controller.rb +3 -1
  46. data/app/controllers/decidim/participatory_processes/participatory_process_groups_controller.rb +1 -2
  47. data/app/controllers/decidim/participatory_processes/participatory_processes_controller.rb +14 -1
  48. data/app/events/decidim/participatory_process_role_assigned_event.rb +1 -1
  49. data/app/forms/decidim/participatory_processes/admin/participatory_process_form.rb +3 -0
  50. data/app/forms/decidim/participatory_processes/admin/participatory_process_group_form.rb +34 -2
  51. data/app/forms/decidim/participatory_processes/admin/participatory_process_step_form.rb +1 -1
  52. data/app/helpers/decidim/participatory_processes/admin/participatory_processes_menu_helper.rb +23 -0
  53. data/app/helpers/decidim/participatory_processes/admin/process_groups_for_select_helper.rb +1 -1
  54. data/app/helpers/decidim/participatory_processes/application_helper.rb +0 -12
  55. data/app/helpers/decidim/participatory_processes/participatory_process_helper.rb +35 -0
  56. data/app/models/decidim/participatory_process.rb +2 -2
  57. data/app/models/decidim/participatory_process_group.rb +9 -1
  58. data/app/presenters/decidim/participatory_processes/admin_log/participatory_process_group_presenter.rb +10 -2
  59. data/app/presenters/decidim/participatory_processes/participatory_process_group_stats_presenter.rb +67 -0
  60. data/app/presenters/decidim/participatory_processes/participatory_process_presenter.rb +4 -3
  61. data/app/presenters/decidim/participatory_processes/participatory_process_stats_presenter.rb +3 -3
  62. data/app/queries/decidim/participatory_processes/group_participatory_processes.rb +16 -0
  63. data/app/queries/decidim/participatory_processes/group_published_participatory_processes.rb +21 -0
  64. data/app/queries/decidim/participatory_processes/organization_participatory_processes.rb +1 -1
  65. data/app/queries/decidim/participatory_processes/organization_published_participatory_processes.rb +1 -1
  66. data/app/queries/decidim/participatory_processes/promoted_participatory_process_groups.rb +12 -0
  67. data/app/queries/decidim/participatory_processes/stats_followers_count.rb +18 -4
  68. data/app/queries/decidim/participatory_processes/stats_participants_count.rb +18 -4
  69. data/app/queries/decidim/participatory_processes/visible_participatory_process_groups.rb +6 -2
  70. data/app/serializers/decidim/participatory_processes/participatory_process_importer.rb +1 -1
  71. data/app/serializers/decidim/participatory_processes/participatory_process_serializer.rb +1 -1
  72. data/app/services/decidim/participatory_processes/participatory_process_search.rb +2 -1
  73. data/app/views/decidim/participatory_processes/admin/participatory_process_copies/new.html.erb +2 -0
  74. data/app/views/decidim/participatory_processes/admin/participatory_process_groups/_form.html.erb +68 -13
  75. data/app/views/decidim/participatory_processes/admin/participatory_process_groups/edit.html.erb +7 -14
  76. data/app/views/decidim/participatory_processes/admin/participatory_process_groups/index.html.erb +12 -3
  77. data/app/views/decidim/participatory_processes/admin/participatory_process_groups/new.html.erb +2 -8
  78. data/app/views/decidim/participatory_processes/admin/participatory_process_groups/show.html.erb +10 -2
  79. data/app/views/decidim/participatory_processes/admin/participatory_process_steps/edit.html.erb +1 -0
  80. data/app/views/decidim/participatory_processes/admin/participatory_process_steps/index.html.erb +6 -0
  81. data/app/views/decidim/participatory_processes/admin/participatory_process_user_roles/edit.html.erb +2 -0
  82. data/app/views/decidim/participatory_processes/admin/participatory_process_user_roles/index.html.erb +8 -0
  83. data/app/views/decidim/participatory_processes/admin/participatory_process_user_roles/new.html.erb +2 -0
  84. data/app/views/decidim/participatory_processes/admin/participatory_processes/_form.html.erb +4 -0
  85. data/app/views/decidim/participatory_processes/admin/participatory_processes/index.html.erb +14 -3
  86. data/app/views/decidim/participatory_processes/admin/participatory_processes/new.html.erb +2 -0
  87. data/app/views/decidim/participatory_processes/admin/shared/_secondary_nav.html.erb +2 -16
  88. data/app/views/decidim/participatory_processes/participatory_process_groups/show.html.erb +18 -8
  89. data/app/views/decidim/participatory_processes/participatory_process_groups/show.js.erb +12 -0
  90. data/app/views/decidim/participatory_processes/participatory_processes/_participatory_process_group.html.erb +4 -0
  91. data/app/views/decidim/participatory_processes/participatory_processes/_promoted_process_group.html.erb +31 -0
  92. data/app/views/decidim/participatory_processes/participatory_processes/index.html.erb +4 -2
  93. data/app/views/decidim/participatory_processes/participatory_processes/show.html.erb +4 -4
  94. data/app/views/layouts/decidim/admin/participatory_process.html.erb +8 -1
  95. data/app/views/layouts/decidim/admin/participatory_process_group.html.erb +17 -0
  96. data/config/locales/ar.yml +3 -10
  97. data/config/locales/ca.yml +52 -5
  98. data/config/locales/cs.yml +56 -9
  99. data/config/locales/de.yml +52 -5
  100. data/config/locales/el.yml +3 -6
  101. data/config/locales/en.yml +52 -5
  102. data/config/locales/es-MX.yml +52 -5
  103. data/config/locales/es-PY.yml +52 -5
  104. data/config/locales/es.yml +52 -5
  105. data/config/locales/eu.yml +3 -6
  106. data/config/locales/fi-plain.yml +53 -6
  107. data/config/locales/fi.yml +53 -6
  108. data/config/locales/fr-CA.yml +52 -5
  109. data/config/locales/fr.yml +52 -5
  110. data/config/locales/gl.yml +84 -5
  111. data/config/locales/hu.yml +3 -6
  112. data/config/locales/id-ID.yml +3 -5
  113. data/config/locales/is-IS.yml +3 -3
  114. data/config/locales/it.yml +8 -6
  115. data/config/locales/ja.yml +3 -5
  116. data/config/locales/lv.yml +3 -7
  117. data/config/locales/nl.yml +50 -6
  118. data/config/locales/no.yml +3 -6
  119. data/config/locales/pl.yml +63 -13
  120. data/config/locales/pt-BR.yml +3 -6
  121. data/config/locales/pt.yml +3 -6
  122. data/config/locales/ro-RO.yml +74 -25
  123. data/config/locales/ru.yml +4 -9
  124. data/config/locales/sk.yml +3 -8
  125. data/config/locales/sr-CS.yml +4 -0
  126. data/config/locales/sv.yml +33 -5
  127. data/config/locales/tr-TR.yml +51 -5
  128. data/config/locales/uk.yml +4 -9
  129. data/config/locales/zh-CN.yml +3 -5
  130. data/db/migrate/20170220110740_remove_steps_short_description.rb +1 -1
  131. data/db/migrate/20201007215105_add_hashtag_to_participatory_process_groups.rb +7 -0
  132. data/db/migrate/20201008154315_add_metadata_columns_to_participatory_process_groups.rb +13 -0
  133. data/db/migrate/20201013105520_rename_name_column_to_title_in_decidim_participatory_process_groups.rb +39 -0
  134. data/db/migrate/20201030133444_add_promoted_flag_to_decidim_participatory_process_groups.rb +7 -0
  135. data/db/migrate/20210204154593_add_weight_field_to_participatory_processes.rb +7 -0
  136. data/db/migrate/20210310120750_add_followable_counter_cache_to_participatory_processes.rb +16 -0
  137. data/lib/decidim/api/participatory_process_group_type.rb +17 -0
  138. data/{app/types/decidim/participatory_processes → lib/decidim/api}/participatory_process_input_filter.rb +0 -0
  139. data/{app/types/decidim/participatory_processes → lib/decidim/api}/participatory_process_input_sort.rb +2 -2
  140. data/lib/decidim/api/participatory_process_step_type.rb +23 -0
  141. data/lib/decidim/api/participatory_process_type.rb +50 -0
  142. data/lib/decidim/participatory_processes.rb +2 -6
  143. data/lib/decidim/participatory_processes/admin_engine.rb +49 -1
  144. data/lib/decidim/participatory_processes/api.rb +11 -0
  145. data/lib/decidim/participatory_processes/engine.rb +90 -8
  146. data/lib/decidim/participatory_processes/participatory_space.rb +47 -24
  147. data/lib/decidim/participatory_processes/query_extensions.rb +18 -20
  148. data/lib/decidim/participatory_processes/test/factories.rb +15 -2
  149. data/lib/decidim/participatory_processes/version.rb +1 -1
  150. metadata +59 -17
  151. data/app/functions/decidim/participatory_processes/participatory_process_finder.rb +0 -10
  152. data/app/functions/decidim/participatory_processes/participatory_process_list.rb +0 -11
  153. data/app/types/decidim/participatory_processes/participatory_process_group_type.rb +0 -20
  154. data/app/types/decidim/participatory_processes/participatory_process_step_type.rb +0 -28
  155. data/app/types/decidim/participatory_processes/participatory_process_type.rb +0 -54
@@ -36,9 +36,17 @@ tr:
36
36
  title: Başlık
37
37
  participatory_process_group:
38
38
  description: Açıklama
39
+ developer_group: Tanıtım grubu
40
+ group_url: Web sitesi
41
+ hashtag: Etiket
39
42
  hero_image: görüntü
40
- name: isim
43
+ local_area: Organizasyon alanı
44
+ meta_scope: Kapsam meta verileri
41
45
  participatory_process_ids: İlgili süreçler
46
+ participatory_scope: Karar nedir
47
+ participatory_structure: Nasıl karar verilir
48
+ target: Katılanlar
49
+ title: Başlık
42
50
  participatory_process_step:
43
51
  cta_path: Eylem yolunu çağır
44
52
  cta_text: Harekete Geçirici Mesaj metni
@@ -94,6 +102,9 @@ tr:
94
102
  unpublish: Yayından Kaldır
95
103
  menu:
96
104
  participatory_process_groups: Süreç grupları
105
+ participatory_process_groups_submenu:
106
+ info: Bilgi
107
+ landing_page: Açılış sayfası
97
108
  participatory_processes: Süreçler
98
109
  participatory_processes_submenu:
99
110
  attachment_collections: Klasörler
@@ -117,7 +128,7 @@ tr:
117
128
  name: Katılımcı süreç
118
129
  participatory_process_group:
119
130
  fields:
120
- name: isim
131
+ title: Başlık
121
132
  name: İşlem grubu
122
133
  participatory_process_step:
123
134
  fields:
@@ -145,6 +156,13 @@ tr:
145
156
  copy: kopya
146
157
  select: Çoğaltmak istediğiniz verileri seçin
147
158
  title: Yinelenen katılımcı süreç
159
+ participatory_process_group_landing_page:
160
+ edit:
161
+ active_content_blocks: Aktif içerik blokları
162
+ inactive_content_blocks: Aktif olmayan içerik blokları
163
+ participatory_process_group_landing_page_content_blocks:
164
+ edit:
165
+ update: Güncelle
148
166
  participatory_process_groups:
149
167
  destroy:
150
168
  error: Katılımcı süreç grubu yok edilirken bir hata oluştu.
@@ -301,10 +319,30 @@ tr:
301
319
  show:
302
320
  related_assemblies: İlgili kurullar
303
321
  participatory_process_groups:
322
+ content_blocks:
323
+ html_1:
324
+ name: İlk HTML bloğu
325
+ html_2:
326
+ name: İkinci HTML bloğu
327
+ html_3:
328
+ name: Üçüncü HTML bloğu
329
+ metadata:
330
+ developer_group: Tarafından teşvik
331
+ name: Meta veri
332
+ participatory_scope: Karar nedir
333
+ participatory_structure: Nasıl karar verilir
334
+ target: Katılanlar
335
+ participatory_processes:
336
+ name: Katılımcı süreçleri
337
+ stats:
338
+ name: Aktivite
339
+ title:
340
+ meta_scope: Kapsam
341
+ name: Başlık, açıklama ve etiket
342
+ participatory_processes:
343
+ one: 1 süreç
344
+ other: "%{count} süreç"
304
345
  show:
305
- group_participatory_processes:
306
- one: '%{group}için 1 süreç'
307
- other: "%{count} için işlemler %{group}"
308
346
  title: Katılımcı süreç grupları
309
347
  participatory_process_steps:
310
348
  index:
@@ -321,6 +359,11 @@ tr:
321
359
  participatory_process_copies:
322
360
  form:
323
361
  slug_help: 'URL sümükleri, bu işleme işaret eden URL''leri oluşturmak için kullanılır. Sadece harfleri, sayıları ve kısa çizgileri kabul eder ve bir harfle başlamalıdır. Örnek: %{url}'
362
+ participatory_process_groups:
363
+ form:
364
+ metadata: Meta veri
365
+ title: Genel bilgi
366
+ visibility: Görünürlük
324
367
  participatory_process_imports:
325
368
  form:
326
369
  document_legend: Doküman Ekle
@@ -392,6 +435,7 @@ tr:
392
435
  loading: Sonuçlar yükleniyor ...
393
436
  show:
394
437
  area: alan
438
+ belongs_to_group: Bu süreç,
395
439
  dates: Tarihler
396
440
  developer_group: Tanıtım grubu
397
441
  end_date: Bitiş tarihi
@@ -449,6 +493,8 @@ tr:
449
493
  more_info_about: '%{resource_name} süreci hakkında daha fazla bilgi'
450
494
  take_part: Yer almak
451
495
  take_part_in: '%{resource_name} sürecine katılın'
496
+ promoted_process_group:
497
+ more_info: Daha fazla bilgi
452
498
  process_header_steps:
453
499
  step: '%{total}adımdan %{current}'
454
500
  view_steps: Adımları göster
@@ -33,7 +33,6 @@ uk:
33
33
  participatory_process_group:
34
34
  description: Опис
35
35
  hero_image: Зображення
36
- name: Ім'я
37
36
  participatory_process_ids: Супутні рухи
38
37
  participatory_process_step:
39
38
  description: Опис
@@ -106,8 +105,6 @@ uk:
106
105
  title: Назва
107
106
  name: Рух співучасті
108
107
  participatory_process_group:
109
- fields:
110
- name: Ім'я
111
108
  name: Сукупність рухів
112
109
  participatory_process_step:
113
110
  fields:
@@ -257,12 +254,10 @@ uk:
257
254
  menu:
258
255
  processes: Рухи
259
256
  participatory_process_groups:
257
+ content_blocks:
258
+ stats:
259
+ name: Діяльність
260
260
  show:
261
- group_participatory_processes:
262
- one: 1 рух у %{group}
263
- few: "%{count} рухи у %{group}"
264
- many: "%{count} рухів у %{group}"
265
- other: "%{count} рухів у %{group}"
266
261
  title: Сукупності рухів співучасті
267
262
  participatory_process_steps:
268
263
  index:
@@ -349,7 +344,7 @@ uk:
349
344
  orders_count: Голосів
350
345
  pages_count: Сторінок
351
346
  participants_count: Учасників
352
- processes_count: Рухів
347
+ processes_count: Рухи
353
348
  projects_count: Проектів
354
349
  proposals_count: Пропозицій
355
350
  results_count: Підсумків
@@ -37,7 +37,6 @@ zh-CN:
37
37
  participatory_process_group:
38
38
  description: 描述
39
39
  hero_image: 图片
40
- name: 名称
41
40
  participatory_process_ids: 相关进程
42
41
  participatory_process_step:
43
42
  cta_path: 调用行动路径
@@ -113,8 +112,6 @@ zh-CN:
113
112
  title: 标题
114
113
  name: 参与性进程
115
114
  participatory_process_group:
116
- fields:
117
- name: 名称
118
115
  name: 流程组
119
116
  participatory_process_step:
120
117
  fields:
@@ -298,9 +295,10 @@ zh-CN:
298
295
  show:
299
296
  related_assemblies: 相关的会议
300
297
  participatory_process_groups:
298
+ content_blocks:
299
+ stats:
300
+ name: 统计
301
301
  show:
302
- group_participatory_processes:
303
- other: "%{count} 的 %{group} 进程"
304
302
  title: 参与性进程组
305
303
  participatory_process_steps:
306
304
  index:
@@ -19,7 +19,7 @@ class RemoveStepsShortDescription < ActiveRecord::Migration[5.0]
19
19
 
20
20
  def new_description_for(step)
21
21
  desc = {}
22
- step.description.each_key do |locale|
22
+ step.description.keys.each do |locale|
23
23
  desc[locale] = step.short_description[locale] + step.description[locale]
24
24
  end
25
25
  desc
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+
3
+ class AddHashtagToParticipatoryProcessGroups < ActiveRecord::Migration[5.2]
4
+ def change
5
+ add_column :decidim_participatory_process_groups, :hashtag, :string
6
+ end
7
+ end
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ class AddMetadataColumnsToParticipatoryProcessGroups < ActiveRecord::Migration[5.2]
4
+ def change
5
+ add_column :decidim_participatory_process_groups, :group_url, :string
6
+ add_column :decidim_participatory_process_groups, :developer_group, :jsonb
7
+ add_column :decidim_participatory_process_groups, :local_area, :jsonb
8
+ add_column :decidim_participatory_process_groups, :meta_scope, :jsonb
9
+ add_column :decidim_participatory_process_groups, :target, :jsonb
10
+ add_column :decidim_participatory_process_groups, :participatory_scope, :jsonb
11
+ add_column :decidim_participatory_process_groups, :participatory_structure, :jsonb
12
+ end
13
+ end
@@ -0,0 +1,39 @@
1
+ # frozen_string_literal: true
2
+
3
+ class RenameNameColumnToTitleInDecidimParticipatoryProcessGroups < ActiveRecord::Migration[5.2]
4
+ def up
5
+ rename_column :decidim_participatory_process_groups, :name, :title
6
+ PaperTrail::Version.where(item_type: "Decidim::ParticipatoryProcessGroup").each do |version|
7
+ # rubocop:disable Rails/SkipsModelValidations
8
+ version.update_attribute(:object_changes, version.object_changes.gsub(/^name:/, "title:")) if version.object_changes.present?
9
+ # rubocop:enable Rails/SkipsModelValidations
10
+
11
+ next unless version.object.present? && version.object.has_key?("name")
12
+
13
+ object = version.object
14
+ object["title"] = object.delete("name")
15
+
16
+ # rubocop:disable Rails/SkipsModelValidations
17
+ version.update_attribute(:object, object)
18
+ # rubocop:enable Rails/SkipsModelValidations
19
+ end
20
+ end
21
+
22
+ def down
23
+ PaperTrail::Version.where(item_type: "Decidim::ParticipatoryProcessGroup").each do |version|
24
+ # rubocop:disable Rails/SkipsModelValidations
25
+ version.update_attribute(:object_changes, version.object_changes.gsub(/^title:/, "name:")) if version.object_changes.present?
26
+ # rubocop:enable Rails/SkipsModelValidations
27
+
28
+ next unless version.object.present? && version.object.has_key?("title")
29
+
30
+ object = version.object
31
+ object["name"] = object.delete("title")
32
+
33
+ # rubocop:disable Rails/SkipsModelValidations
34
+ version.update_attribute(:object, object)
35
+ # rubocop:enable Rails/SkipsModelValidations
36
+ end
37
+ rename_column :decidim_participatory_process_groups, :title, :name
38
+ end
39
+ end
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+
3
+ class AddPromotedFlagToDecidimParticipatoryProcessGroups < ActiveRecord::Migration[5.2]
4
+ def change
5
+ add_column :decidim_participatory_process_groups, :promoted, :boolean, default: false, index: true
6
+ end
7
+ end
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+
3
+ class AddWeightFieldToParticipatoryProcesses < ActiveRecord::Migration[5.2]
4
+ def change
5
+ add_column :decidim_participatory_processes, :weight, :integer, null: false, default: true
6
+ end
7
+ end
@@ -0,0 +1,16 @@
1
+ # frozen_string_literal: true
2
+
3
+ class AddFollowableCounterCacheToParticipatoryProcesses < ActiveRecord::Migration[5.2]
4
+ def change
5
+ add_column :decidim_participatory_processes, :follows_count, :integer, null: false, default: 0, index: true
6
+
7
+ reversible do |dir|
8
+ dir.up do
9
+ Decidim::ParticipatoryProcess.reset_column_information
10
+ Decidim::ParticipatoryProcess.find_each do |record|
11
+ record.class.reset_counters(record.id, :follows)
12
+ end
13
+ end
14
+ end
15
+ end
16
+ end
@@ -0,0 +1,17 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Decidim
4
+ module ParticipatoryProcesses
5
+ # This type represents a ParticipatoryProcess.
6
+ class ParticipatoryProcessGroupType < Decidim::Api::Types::BaseObject
7
+ description "A participatory process group"
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
+ field :description, Decidim::Core::TranslatedFieldType, "The description of this participatory process group", null: true
12
+ field :participatory_processes, [Decidim::ParticipatoryProcesses::ParticipatoryProcessType, { null: true }],
13
+ description: "Lists all the participatory processes belonging to this group", null: false
14
+ field :hero_image, GraphQL::Types::String, "The hero image for this participatory process group", null: true
15
+ end
16
+ end
17
+ end
@@ -8,8 +8,8 @@ module Decidim
8
8
  graphql_name "ParticipatoryProcessSort"
9
9
  description "A type used for sorting participatory processess"
10
10
 
11
- argument :id, String, "Sort by ID, valid values are ASC or DESC", required: false
12
- argument :start_date, String, "Sort by participatory process starting date, valid values are ASC or DESC", required: false
11
+ argument :id, GraphQL::Types::String, "Sort by ID, valid values are ASC or DESC", required: false
12
+ argument :start_date, GraphQL::Types::String, "Sort by participatory process starting date, valid values are ASC or DESC", required: false
13
13
  end
14
14
  end
15
15
  end
@@ -0,0 +1,23 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Decidim
4
+ module ParticipatoryProcesses
5
+ # This type represents a step on a participatory process.
6
+ class ParticipatoryProcessStepType < Decidim::Api::Types::BaseObject
7
+ description "A participatory process step"
8
+
9
+ field :id, GraphQL::Types::ID, "The unique ID of this step.", null: false
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::DateType, "This step's start date", null: true
16
+ field :end_date, Decidim::Core::DateType, "This step's end date", null: true
17
+ field :call_to_action_path, GraphQL::Types::String, "A call to action URL for this step", method: :cta_path, null: true
18
+ field :call_to_action_text, Decidim::Core::TranslatedFieldType, "The call to action text for this step", method: :cta_text, null: true
19
+ field :active, GraphQL::Types::Boolean, "If this step is the active one", null: true
20
+ field :position, GraphQL::Types::Int, "Ordering position among all the steps", null: true
21
+ end
22
+ end
23
+ end
@@ -0,0 +1,50 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Decidim
4
+ module ParticipatoryProcesses
5
+ # This type represents a ParticipatoryProcess.
6
+ class ParticipatoryProcessType < Decidim::Api::Types::BaseObject
7
+ implements Decidim::Core::ParticipatorySpaceInterface
8
+ implements Decidim::Core::ParticipatorySpaceResourceableInterface
9
+ implements Decidim::Core::ScopableInterface
10
+ implements Decidim::Core::AttachableInterface
11
+
12
+ description "A participatory process"
13
+
14
+ field :id, GraphQL::Types::ID, "The internal ID for this participatory process", null: false
15
+ field :slug, GraphQL::Types::String, null: false
16
+ field :hashtag, GraphQL::Types::String, "The hashtag for this participatory process", null: true
17
+ field :created_at, Decidim::Core::DateTimeType, "The time this page was created", null: false
18
+ field :updated_at, Decidim::Core::DateTimeType, "The time this page was updated", null: false
19
+ field :published_at, Decidim::Core::DateTimeType, "The time this page was published", null: false
20
+ field :subtitle, Decidim::Core::TranslatedFieldType, "The subtitle of this participatory process.", null: true
21
+ field :description, Decidim::Core::TranslatedFieldType, "The description of this participatory process.", null: true
22
+ field :short_description, Decidim::Core::TranslatedFieldType, "The short description of this participatory process.", null: true
23
+ field :start_date, Decidim::Core::DateType, "This participatory process' start date.", null: true
24
+ field :end_date, Decidim::Core::DateType, "This participatory process' end date.", null: true
25
+
26
+ field :banner_image, GraphQL::Types::String, "The banner image for this participatory process", null: true
27
+ field :hero_image, GraphQL::Types::String, "The hero image for this participatory process", null: true
28
+ field :promoted, GraphQL::Types::Boolean, "If this participatory process is promoted (therefore in the homepage)", null: true
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
31
+ field :local_area, Decidim::Core::TranslatedFieldType, "The organization area of this participatory process.", null: true
32
+ field :target, Decidim::Core::TranslatedFieldType, "Who participates in this participatory process.", null: true
33
+ field :participatory_scope, Decidim::Core::TranslatedFieldType, "What is decided on this participatory process.", null: true
34
+ field :participatory_structure, Decidim::Core::TranslatedFieldType, "How it is decided on this participatory process.", null: true
35
+ field :show_metrics, GraphQL::Types::Boolean, "If this participatory process should show metrics", null: true
36
+ field :show_statistics, GraphQL::Types::Boolean, "If this participatory process should show statistics", null: true
37
+ field :scopes_enabled, GraphQL::Types::Boolean, "If this participatory process has scopes enabled", null: true
38
+
39
+ field :announcement, Decidim::Core::TranslatedFieldType, "Highlighted announcement for this participatory process.", null: true
40
+
41
+ field :reference, GraphQL::Types::String, "Reference prefix for this participatory process", null: true
42
+ field :steps, [Decidim::ParticipatoryProcesses::ParticipatoryProcessStepType, { null: true }], "All the steps of this process.", null: false
43
+ field :categories, [Decidim::Core::CategoryType, { null: true }], "Categories for this participatory process", null: false
44
+
45
+ field :participatory_process_group, Decidim::ParticipatoryProcesses::ParticipatoryProcessGroupType,
46
+ null: true,
47
+ description: "The participatory process group in which this process belong to"
48
+ end
49
+ end
50
+ end
@@ -1,16 +1,12 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require "decidim/participatory_processes/admin"
4
+ require "decidim/participatory_processes/api"
4
5
  require "decidim/participatory_processes/engine"
5
6
  require "decidim/participatory_processes/admin_engine"
6
7
  require "decidim/participatory_processes/participatory_space"
7
8
 
8
9
  module Decidim
9
10
  # Base module for the participatory processes engine.
10
- module ParticipatoryProcesses
11
- # Public: Stores an instance of ViewHooks
12
- def self.view_hooks
13
- @view_hooks ||= ViewHooks.new
14
- end
15
- end
11
+ module ParticipatoryProcesses; end
16
12
  end
@@ -15,7 +15,11 @@ module Decidim
15
15
  paths["lib/tasks"] = nil
16
16
 
17
17
  routes do
18
- resources :participatory_process_groups
18
+ resources :participatory_process_groups do
19
+ resource :landing_page, only: [:edit, :update], controller: "participatory_process_group_landing_page" do
20
+ resources :content_blocks, only: [:edit, :update], controller: "participatory_process_group_landing_page_content_blocks"
21
+ end
22
+ end
19
23
  resources :participatory_processes, param: :slug, except: [:show, :destroy] do
20
24
  resource :publish, controller: "participatory_process_publications", only: [:create, :destroy]
21
25
  resources :copies, controller: "participatory_process_copies", only: [:new, :create]
@@ -52,6 +56,7 @@ module Decidim
52
56
  get :share
53
57
  end
54
58
  resources :exports, only: :create
59
+ resources :imports, only: [:new, :create]
55
60
  end
56
61
 
57
62
  resources :moderations do
@@ -60,7 +65,9 @@ module Decidim
60
65
  put :hide
61
66
  put :unhide
62
67
  end
68
+ resources :reports, controller: "moderations/reports", only: [:index, :show]
63
69
  end
70
+
64
71
  resources :participatory_space_private_users, controller: "participatory_space_private_users" do
65
72
  member do
66
73
  post :resend_invitation, to: "participatory_space_private_users#resend_invitation"
@@ -86,6 +93,12 @@ module Decidim
86
93
  app.config.assets.precompile += %w(admin/decidim_participatory_processes_manifest.js)
87
94
  end
88
95
 
96
+ initializer "decidim_participatory_processes.action_controller" do |_app|
97
+ ActiveSupport.on_load :action_controller do
98
+ helper Decidim::ParticipatoryProcesses::Admin::ParticipatoryProcessesMenuHelper if respond_to?(:helper)
99
+ end
100
+ end
101
+
89
102
  initializer "decidim_participatory_processes.admin_menu" do
90
103
  Decidim.menu :admin_menu do |menu|
91
104
  menu.item I18n.t("menu.participatory_processes", scope: "decidim.admin"),
@@ -97,6 +110,41 @@ module Decidim
97
110
  if: allowed_to?(:enter, :space_area, space_name: :processes) || allowed_to?(:enter, :space_area, space_name: :process_groups)
98
111
  end
99
112
  end
113
+
114
+ initializer "decidim_participatory_processes.admin_participatory_processes_menu" do
115
+ Decidim.menu :admin_participatory_processes_menu do |menu|
116
+ menu.item I18n.t("menu.participatory_processes", scope: "decidim.admin"),
117
+ decidim_admin_participatory_processes.participatory_processes_path,
118
+ position: 1,
119
+ if: allowed_to?(:enter, :space_area, space_name: :processes),
120
+ active: is_active_link?(decidim_admin_participatory_processes.participatory_processes_path)
121
+
122
+ menu.item I18n.t("menu.participatory_process_groups", scope: "decidim.admin"),
123
+ decidim_admin_participatory_processes.participatory_process_groups_path,
124
+ position: 2,
125
+ if: allowed_to?(:enter, :space_area, space_name: :process_groups),
126
+ active: is_active_link?(decidim_admin_participatory_processes.participatory_process_groups_path)
127
+ end
128
+ end
129
+ initializer "decidim_participatory_processes.admin_process_group_menu" do
130
+ Decidim.menu :admin_participatory_process_menu do |menu|
131
+ end
132
+ end
133
+
134
+ initializer "decidim_participatory_processes.admin_process_group_menu" do
135
+ Decidim.menu :admin_participatory_process_group_menu do |menu|
136
+ menu.item I18n.t("info", scope: "decidim.admin.menu.participatory_process_groups_submenu"),
137
+ decidim_admin_participatory_processes.edit_participatory_process_group_path(participatory_process_group),
138
+ position: 1,
139
+ if: allowed_to?(:update, :process_group, process_group: participatory_process_group),
140
+ active: is_active_link?(decidim_admin_participatory_processes.edit_participatory_process_group_path(participatory_process_group))
141
+ menu.item I18n.t("landing_page", scope: "decidim.admin.menu.participatory_process_groups_submenu"),
142
+ decidim_admin_participatory_processes.edit_participatory_process_group_landing_page_path(participatory_process_group),
143
+ position: 2,
144
+ if: allowed_to?(:update, :process_group, process_group: participatory_process_group),
145
+ active: is_active_link?(decidim_admin_participatory_processes.participatory_process_group_landing_page_path(participatory_process_group))
146
+ end
147
+ end
100
148
  end
101
149
  end
102
150
  end