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
@@ -1,10 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Decidim
4
- module ParticipatoryProcesses
5
- # Adds slug finder for participatory_processes
6
- class ParticipatoryProcessFinder < Decidim::Core::ParticipatorySpaceFinder
7
- argument :slug, types.String, "The slug of the participatory process"
8
- end
9
- end
10
- end
@@ -1,11 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Decidim
4
- module ParticipatoryProcesses
5
- # Adds some filter values for participatory_processes
6
- class ParticipatoryProcessList < Decidim::Core::ParticipatorySpaceListBase
7
- argument :filter, ParticipatoryProcessInputFilter, "This argument let's you filter the results"
8
- argument :order, ParticipatoryProcessInputSort, "This argument let's you order the results"
9
- end
10
- end
11
- end
@@ -1,20 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Decidim
4
- module ParticipatoryProcesses
5
- # This type represents a ParticipatoryProcess.
6
- ParticipatoryProcessGroupType = GraphQL::ObjectType.define do
7
- name "ParticipatoryProcessGroup"
8
- description "A participatory process group"
9
-
10
- field :id, !types.ID, "ID of this participatory process group"
11
- field :name, Decidim::Core::TranslatedFieldType, "The name of this participatory process group"
12
- field :description, Decidim::Core::TranslatedFieldType, "The description of this participatory process group", property: :description
13
- field :participatoryProcesses, !types[ParticipatoryProcessType] do
14
- description "Lists all the participatory processes belonging to this group"
15
- property :participatory_processes
16
- end
17
- field :heroImage, types.String, "The hero image for this participatory process group", property: :hero_image
18
- end
19
- end
20
- end
@@ -1,28 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Decidim
4
- module ParticipatoryProcesses
5
- # This type represents a step on a participatory process.
6
- ParticipatoryProcessStepType = GraphQL::ObjectType.define do
7
- name "ParticipatoryProcessStep"
8
- description "A participatory process step"
9
-
10
- field :id, !types.ID, "The unique ID of this step."
11
-
12
- field :participatoryProcess do
13
- type !ParticipatoryProcessType
14
- description "The participatory process in which this step belongs to."
15
- property :participatory_process
16
- end
17
-
18
- field :title, !Decidim::Core::TranslatedFieldType, "The title of this step"
19
- field :description, Decidim::Core::TranslatedFieldType, "The description of this step"
20
- field :startDate, Decidim::Core::DateType, "This step's start date", property: :start_date
21
- field :endDate, Decidim::Core::DateType, "This step's end date", property: :end_date
22
- field :callToActionPath, types.String, "A call to action URL for this step", property: :cta_path
23
- field :callToActionText, Decidim::Core::TranslatedFieldType, "The call to action text for this step", property: :cta_text
24
- field :active, types.Boolean, "If this step is the active one"
25
- field :position, types.Int, "Ordering position among all the steps"
26
- end
27
- end
28
- end
@@ -1,54 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Decidim
4
- module ParticipatoryProcesses
5
- # This type represents a ParticipatoryProcess.
6
- ParticipatoryProcessType = GraphQL::ObjectType.define do
7
- interfaces [
8
- -> { Decidim::Core::ParticipatorySpaceInterface },
9
- -> { Decidim::Core::ParticipatorySpaceResourceableInterface },
10
- -> { Decidim::Core::ScopableInterface },
11
- -> { Decidim::Core::AttachableInterface }
12
- ]
13
-
14
- name "ParticipatoryProcess"
15
- description "A participatory process"
16
-
17
- field :id, !types.ID, "The internal ID for this participatory process"
18
- field :slug, !types.String
19
- field :hashtag, types.String, "The hashtag for this participatory process"
20
- field :createdAt, !Decidim::Core::DateTimeType, "The time this page was created", property: :created_at
21
- field :updatedAt, !Decidim::Core::DateTimeType, "The time this page was updated", property: :updated_at
22
- field :publishedAt, !Decidim::Core::DateTimeType, "The time this page was published", property: :published_at
23
- field :subtitle, Decidim::Core::TranslatedFieldType, "The subtitle of this participatory process."
24
- field :description, Decidim::Core::TranslatedFieldType, "The description of this participatory process.", property: :description
25
- field :shortDescription, Decidim::Core::TranslatedFieldType, "The short description of this participatory process.", property: :short_description
26
- field :startDate, Decidim::Core::DateType, "This participatory process' start date.", property: :start_date
27
- field :endDate, Decidim::Core::DateType, "This participatory process' end date.", property: :end_date
28
-
29
- field :bannerImage, types.String, "The banner image for this participatory process", property: :banner_image
30
- field :heroImage, types.String, "The hero image for this participatory process", property: :hero_image
31
- field :promoted, types.Boolean, "If this participatory process is promoted (therefore in the homepage)"
32
- field :developerGroup, Decidim::Core::TranslatedFieldType, "The promoter group of this participatory process.", property: :developer_group
33
- field :metaScope, Decidim::Core::TranslatedFieldType, "The scope metadata of this participatory process.", property: :meta_scope
34
- field :localArea, Decidim::Core::TranslatedFieldType, "The organization area of this participatory process.", property: :local_area
35
- field :target, Decidim::Core::TranslatedFieldType, "Who participates in this participatory process."
36
- field :participatoryScope, Decidim::Core::TranslatedFieldType, "What is decided on this participatory process.", property: :participatory_scope
37
- field :participatoryStructure, Decidim::Core::TranslatedFieldType, "How it is decided on this participatory process.", property: :participatory_structure
38
- field :showMetrics, types.Boolean, "If this participatory process should show metrics", property: :show_metrics
39
- field :showStatistics, types.Boolean, "If this participatory process should show statistics", property: :show_statistics
40
- field :scopesEnabled, types.Boolean, "If this participatory process has scopes enabled", property: :scopes_enabled
41
-
42
- field :announcement, Decidim::Core::TranslatedFieldType, "Highlighted announcement for this participatory process."
43
-
44
- field :reference, types.String, "Reference prefix for this participatory process"
45
- field :steps, !types[ParticipatoryProcessStepType], "All the steps of this process."
46
- field :categories, !types[Decidim::Core::CategoryType], "Categories for this participatory process"
47
-
48
- field :participatoryProcessGroup, ParticipatoryProcessGroupType do
49
- description "The participatory process group in which this process belong to"
50
- property :participatory_process_group
51
- end
52
- end
53
- end
54
- end