decidim-decidim_awesome 0.10.3 → 0.11.1

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of decidim-decidim_awesome might be problematic. Click here for more details.

Files changed (232) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +14 -5
  3. data/README.md +65 -67
  4. data/app/cells/concerns/decidim/decidim_awesome/global_menu_cell_override.rb +20 -0
  5. data/app/cells/concerns/decidim/decidim_awesome/proposal_l_cell_override.rb +44 -0
  6. data/app/cells/decidim/decidim_awesome/content_blocks/map/show.erb +5 -12
  7. data/app/cells/decidim/decidim_awesome/voting/proposal_metadata_cell.rb +54 -0
  8. data/app/cells/decidim/decidim_awesome/voting/voting_cards_proposal/modal.erb +18 -0
  9. data/app/cells/decidim/decidim_awesome/voting/voting_cards_proposal/show.erb +37 -32
  10. data/app/cells/decidim/decidim_awesome/voting/voting_cards_proposal_cell.rb +9 -4
  11. data/app/commands/concerns/decidim/decidim_awesome/admin/needs_constraint_helpers.rb +1 -1
  12. data/app/commands/concerns/decidim/decidim_awesome/proposals/create_proposal_override.rb +2 -2
  13. data/app/commands/concerns/decidim/decidim_awesome/proposals/update_proposal_override.rb +2 -2
  14. data/app/commands/decidim/decidim_awesome/admin/create_constraint.rb +1 -1
  15. data/app/commands/decidim/decidim_awesome/admin/destroy_custom_redirect.rb +1 -1
  16. data/app/commands/decidim/decidim_awesome/admin/destroy_menu_hack.rb +1 -1
  17. data/app/commands/decidim/decidim_awesome/admin/rename_scope_label.rb +1 -1
  18. data/app/commands/decidim/decidim_awesome/admin/update_constraint.rb +1 -1
  19. data/app/commands/decidim/decidim_awesome/admin/update_custom_redirect.rb +2 -2
  20. data/app/commands/decidim/decidim_awesome/command.rb +1 -7
  21. data/app/controllers/concerns/decidim/decidim_awesome/admin/maintenance_context.rb +1 -1
  22. data/app/controllers/concerns/decidim/decidim_awesome/admin_accountability/admin/filterable_helper.rb +3 -4
  23. data/app/controllers/concerns/decidim/decidim_awesome/content_security_policy.rb +34 -0
  24. data/app/controllers/concerns/decidim/decidim_awesome/not_found_redirect.rb +1 -1
  25. data/app/controllers/concerns/decidim/decidim_awesome/proposals/orderable_override.rb +22 -9
  26. data/app/controllers/concerns/decidim/decidim_awesome/proposals/proposal_votes_controller_override.rb +3 -3
  27. data/app/controllers/decidim/decidim_awesome/admin/admin_accountability_controller.rb +7 -7
  28. data/app/controllers/decidim/decidim_awesome/admin/checks_controller.rb +7 -7
  29. data/app/controllers/decidim/decidim_awesome/admin/config_controller.rb +8 -10
  30. data/app/controllers/decidim/decidim_awesome/admin/constraints_controller.rb +20 -19
  31. data/app/controllers/decidim/decidim_awesome/admin/custom_redirects_controller.rb +6 -8
  32. data/app/controllers/decidim/decidim_awesome/admin/maintenance_controller.rb +2 -2
  33. data/app/controllers/decidim/decidim_awesome/admin/menu_hacks_controller.rb +6 -8
  34. data/app/controllers/decidim/decidim_awesome/admin/proposal_custom_fields_controller.rb +2 -2
  35. data/app/controllers/decidim/decidim_awesome/admin/scoped_admins_controller.rb +2 -2
  36. data/app/controllers/decidim/decidim_awesome/admin/scoped_styles_controller.rb +2 -2
  37. data/app/controllers/decidim/decidim_awesome/blank_component_controller.rb +8 -3
  38. data/app/controllers/decidim/decidim_awesome/editor_images_controller.rb +3 -3
  39. data/app/controllers/decidim/decidim_awesome/iframe_component/iframe_controller.rb +11 -5
  40. data/app/forms/concerns/decidim/decidim_awesome/proposals/proposal_wizard_create_step_form_override.rb +1 -1
  41. data/app/forms/decidim/decidim_awesome/admin/config_form.rb +13 -25
  42. data/app/forms/decidim/decidim_awesome/admin/custom_redirect_form.rb +2 -2
  43. data/app/forms/decidim/decidim_awesome/admin/intergram_form.rb +4 -0
  44. data/app/forms/decidim/decidim_awesome/admin/menu_form.rb +4 -4
  45. data/app/helpers/concerns/decidim/decidim_awesome/amendments_helper_override.rb +8 -1
  46. data/app/helpers/concerns/decidim/decidim_awesome/breadcrumb_helper_override.rb +23 -0
  47. data/app/helpers/concerns/decidim/decidim_awesome/proposals/application_helper_override.rb +23 -39
  48. data/app/helpers/decidim/decidim_awesome/admin/config_constraints_helpers.rb +2 -2
  49. data/app/helpers/decidim/decidim_awesome/map_helper.rb +8 -27
  50. data/app/jobs/decidim/decidim_awesome/migrate_legacy_images_job.rb +5 -4
  51. data/app/middleware/decidim/decidim_awesome/current_config.rb +3 -5
  52. data/app/models/concerns/decidim/decidim_awesome/has_proposal_extra_fields.rb +1 -1
  53. data/app/models/decidim/decidim_awesome/awesome_config.rb +1 -1
  54. data/app/models/decidim/decidim_awesome/paper_trail_version.rb +4 -8
  55. data/app/models/decidim/decidim_awesome/proposal_extra_field.rb +1 -1
  56. data/app/models/decidim/decidim_awesome/vote_weight.rb +2 -2
  57. data/app/overrides/decidim/proposals/proposals/{show → _proposal_aside}/limit_amendments_modal.html.erb.deface +1 -1
  58. data/app/overrides/decidim/proposals/proposals/_vote_button/replace_vote_button.html.erb.deface +1 -1
  59. data/app/overrides/layouts/decidim/_decidim_javascript/add_awesome_tags.html.erb.deface +6 -0
  60. data/app/overrides/layouts/decidim/_head/add_awesome_tags.html.erb.deface +4 -11
  61. data/app/overrides/layouts/decidim/admin/_header/{replace_scripts.html.erb.deface → add_awesome_tags.html.erb.deface} +4 -4
  62. data/app/packs/entrypoints/decidim_admin_decidim_awesome.js +1 -2
  63. data/app/packs/entrypoints/decidim_admin_decidim_awesome_global.js +4 -0
  64. data/app/packs/entrypoints/decidim_admin_decidim_awesome_global.scss +1 -0
  65. data/app/packs/entrypoints/decidim_decidim_awesome.js +2 -2
  66. data/app/packs/entrypoints/decidim_editor.js +14 -0
  67. data/app/packs/src/decidim/decidim_awesome/admin/auto_edit.js +95 -70
  68. data/app/packs/src/decidim/decidim_awesome/admin/check_redirections.js +46 -41
  69. data/app/packs/src/decidim/decidim_awesome/admin/codemirror.js +3 -3
  70. data/app/packs/src/decidim/decidim_awesome/admin/constraint_form_events.js +115 -0
  71. data/app/packs/src/decidim/decidim_awesome/admin/custom_fields_builder.js +4 -1
  72. data/app/packs/src/decidim/decidim_awesome/admin/form_exit_warn.js +22 -11
  73. data/app/packs/src/decidim/decidim_awesome/admin/proposal_sortings.js +26 -8
  74. data/app/packs/src/decidim/decidim_awesome/admin/user_picker.js +34 -21
  75. data/app/packs/src/decidim/decidim_awesome/amendments/show_modal_on_limits.js +20 -22
  76. data/app/packs/src/decidim/decidim_awesome/awesome_admin.js +5 -16
  77. data/app/packs/src/decidim/decidim_awesome/awesome_admin_global.js +1 -0
  78. data/app/packs/src/decidim/decidim_awesome/awesome_application.js +0 -15
  79. data/app/packs/src/decidim/decidim_awesome/awesome_map/api/fetcher.js +33 -11
  80. data/app/packs/src/decidim/decidim_awesome/awesome_map/api/meetings_fetcher.js +9 -12
  81. data/app/packs/src/decidim/decidim_awesome/awesome_map/api/proposals_fetcher.js +28 -0
  82. data/app/packs/src/decidim/decidim_awesome/awesome_map/awesome_map.js +3 -4
  83. data/app/packs/src/decidim/decidim_awesome/awesome_map/controllers/controller.js +12 -12
  84. data/app/packs/src/decidim/decidim_awesome/awesome_map/controllers/meetings_controller.js +11 -7
  85. data/app/packs/src/decidim/decidim_awesome/awesome_map/controllers/proposals_controller.js +6 -13
  86. data/app/packs/src/decidim/decidim_awesome/awesome_map/controls_ui.js +51 -20
  87. data/app/packs/src/decidim/decidim_awesome/awesome_map/load_map.js +27 -18
  88. data/app/packs/src/decidim/decidim_awesome/editor/index.js +94 -0
  89. data/app/packs/src/decidim/decidim_awesome/forms/autosave.js +28 -23
  90. data/app/packs/src/decidim/decidim_awesome/forms/custom_fields_renderer.js +9 -14
  91. data/app/packs/src/decidim/decidim_awesome/forms/rich_text_plugin.js +27 -32
  92. data/app/packs/src/decidim/decidim_awesome/proposals/images.js +16 -10
  93. data/app/packs/src/decidim/decidim_awesome/voting/voting_cards.js +47 -38
  94. data/app/packs/stylesheets/decidim/decidim_awesome/admin/auto_edits.scss +11 -12
  95. data/app/packs/stylesheets/decidim/decidim_awesome/admin/check_redirections.scss +15 -0
  96. data/app/packs/stylesheets/decidim/decidim_awesome/admin/codemirror.scss +19 -12
  97. data/app/packs/stylesheets/decidim/decidim_awesome/admin/constraints.scss +8 -32
  98. data/app/packs/stylesheets/decidim/decidim_awesome/admin/custom_fields.scss +28 -78
  99. data/app/packs/stylesheets/decidim/decidim_awesome/admin/custom_styles.scss +48 -0
  100. data/app/packs/stylesheets/decidim/decidim_awesome/admin/intergram_fixes.scss +11 -0
  101. data/app/packs/stylesheets/decidim/decidim_awesome/admin/user_picker.scss +15 -24
  102. data/app/packs/stylesheets/decidim/decidim_awesome/amendments/modal.scss +5 -0
  103. data/app/packs/stylesheets/decidim/decidim_awesome/awesome_admin.scss +9 -47
  104. data/app/packs/stylesheets/decidim/decidim_awesome/awesome_admin_global.scss +3 -12
  105. data/app/packs/stylesheets/decidim/decidim_awesome/awesome_application.scss +3 -19
  106. data/app/packs/stylesheets/decidim/decidim_awesome/awesome_iframe/iframe.scss +1 -1
  107. data/app/packs/stylesheets/decidim/decidim_awesome/awesome_map/map.scss +27 -21
  108. data/app/packs/stylesheets/decidim/decidim_awesome/forms/autosave.scss +6 -6
  109. data/app/packs/stylesheets/decidim/decidim_awesome/forms/custom_fields.scss +32 -101
  110. data/app/packs/stylesheets/decidim/decidim_awesome/shared/spinner.scss +5 -26
  111. data/app/packs/stylesheets/decidim/decidim_awesome/voting/voting_cards.scss +34 -52
  112. data/app/permissions/decidim/decidim_awesome/permissions.rb +3 -4
  113. data/app/presenters/concerns/decidim/decidim_awesome/breadcrumb_root_menu_item_presenter_override.rb +23 -0
  114. data/app/presenters/concerns/decidim/decidim_awesome/menu_item_presenter_override.rb +10 -2
  115. data/app/presenters/concerns/decidim/decidim_awesome/menu_presenter_override.rb +8 -0
  116. data/app/presenters/decidim/decidim_awesome/participatory_space_role_presenter.rb +1 -1
  117. data/app/presenters/decidim/decidim_awesome/private_data_presenter.rb +11 -11
  118. data/app/presenters/decidim/decidim_awesome/user_entity_presenter.rb +1 -1
  119. data/app/queries/decidim/decidim_awesome/private_data_finder.rb +1 -1
  120. data/app/serializers/decidim/decidim_awesome/proposals/private_proposal_serializer.rb +0 -8
  121. data/app/views/decidim/decidim_awesome/admin/admin_accountability/index.html.erb +23 -17
  122. data/app/views/decidim/decidim_awesome/admin/checks/index.html.erb +1 -3
  123. data/app/views/decidim/decidim_awesome/admin/config/_autoedit_box_label.html.erb +3 -3
  124. data/app/views/decidim/decidim_awesome/admin/config/_constraints.html.erb +20 -21
  125. data/app/views/decidim/decidim_awesome/admin/config/_form_admins.html.erb +6 -5
  126. data/app/views/decidim/decidim_awesome/admin/config/_form_editors.html.erb +2 -2
  127. data/app/views/decidim/decidim_awesome/admin/config/_form_livechat.html.erb +39 -23
  128. data/app/views/decidim/decidim_awesome/admin/config/_form_proposal_custom_fields.html.erb +4 -6
  129. data/app/views/decidim/decidim_awesome/admin/config/_form_proposals.html.erb +64 -76
  130. data/app/views/decidim/decidim_awesome/admin/config/_form_styles.html.erb +15 -11
  131. data/app/views/decidim/decidim_awesome/admin/config/_form_surveys.html.erb +8 -6
  132. data/app/views/decidim/decidim_awesome/admin/config/show.html.erb +22 -12
  133. data/app/views/decidim/decidim_awesome/admin/constraints/_form.html.erb +1 -49
  134. data/app/views/decidim/decidim_awesome/admin/constraints/new.html.erb +14 -9
  135. data/app/views/decidim/decidim_awesome/admin/constraints/show.html.erb +14 -9
  136. data/app/views/decidim/decidim_awesome/admin/custom_redirects/_form.html.erb +20 -5
  137. data/app/views/decidim/decidim_awesome/admin/custom_redirects/edit.html.erb +5 -5
  138. data/app/views/decidim/decidim_awesome/admin/custom_redirects/index.html.erb +15 -15
  139. data/app/views/decidim/decidim_awesome/admin/custom_redirects/new.html.erb +5 -5
  140. data/app/views/decidim/decidim_awesome/admin/maintenance/_private_data.html.erb +4 -4
  141. data/app/views/decidim/decidim_awesome/admin/menu_hacks/_form.html.erb +6 -6
  142. data/app/views/decidim/decidim_awesome/admin/menu_hacks/edit.html.erb +21 -12
  143. data/app/views/decidim/decidim_awesome/admin/menu_hacks/index.html.erb +16 -18
  144. data/app/views/decidim/decidim_awesome/admin/menu_hacks/new.html.erb +21 -12
  145. data/app/views/decidim/decidim_awesome/admin/shared/_filters_with_date.html.erb +14 -18
  146. data/app/views/decidim/decidim_awesome/amendments/_modal.html.erb +18 -11
  147. data/app/views/decidim/decidim_awesome/custom_fields/_form_render.html.erb +3 -5
  148. data/app/views/decidim/decidim_awesome/iframe_component/iframe/show.html.erb +7 -12
  149. data/app/views/decidim/decidim_awesome/map_component/map/_map_template.html.erb +53 -37
  150. data/app/views/decidim/decidim_awesome/map_component/map/show.html.erb +14 -5
  151. data/app/views/decidim/decidim_awesome/voting/voting_cards/_show_vote_button.html.erb +0 -3
  152. data/app/views/layouts/decidim/decidim_awesome/_awesome_config.html.erb +9 -7
  153. data/app/views/layouts/decidim/decidim_awesome/_intergram_widget.html.erb +9 -6
  154. data/app/views/layouts/decidim/decidim_awesome/admin/_base.html.erb +3 -12
  155. data/config/assets.rb +3 -33
  156. data/config/i18n-tasks.yml +1 -0
  157. data/config/locales/ca.yml +17 -94
  158. data/config/locales/cs.yml +15 -93
  159. data/config/locales/de.yml +15 -91
  160. data/config/locales/en.yml +24 -28
  161. data/config/locales/es.yml +18 -96
  162. data/config/locales/eu.yml +8 -18
  163. data/config/locales/fr.yml +15 -94
  164. data/config/locales/hu.yml +4 -18
  165. data/config/locales/it.yml +9 -26
  166. data/config/locales/ja.yml +16 -93
  167. data/config/locales/lt.yml +2 -4
  168. data/config/locales/nl.yml +8 -18
  169. data/config/locales/pt-BR.yml +11 -25
  170. data/config/locales/ro-RO.yml +2 -14
  171. data/config/locales/sv.yml +10 -21
  172. data/config/rubocop/disabled.yml +11 -0
  173. data/config/rubocop/faker.yml +480 -0
  174. data/config/rubocop/rails.yml +88 -0
  175. data/config/rubocop/rspec.yml +65 -0
  176. data/config/rubocop/ruby.yml +1210 -0
  177. data/db/migrate/20240306175331_rename_editor_images_awesome_config.rb +18 -0
  178. data/db/migrate/20240729164227_add_decidim_awesome_proposal_private_fields_date.rb +1 -1
  179. data/db/seeds.rb +3 -3
  180. data/lib/decidim/decidim_awesome/admin_engine.rb +4 -1
  181. data/lib/decidim/decidim_awesome/api/types/translated_custom_fields_type.rb +2 -3
  182. data/lib/decidim/decidim_awesome/awesome.rb +42 -28
  183. data/lib/decidim/decidim_awesome/awesome_helpers.rb +1 -1
  184. data/lib/decidim/decidim_awesome/checksums.yml +39 -60
  185. data/lib/decidim/decidim_awesome/config.rb +1 -1
  186. data/lib/decidim/decidim_awesome/custom_fields.rb +5 -5
  187. data/lib/decidim/decidim_awesome/engine.rb +24 -6
  188. data/lib/decidim/decidim_awesome/iframe_component/component.rb +1 -2
  189. data/lib/decidim/decidim_awesome/lock.rb +2 -2
  190. data/lib/decidim/decidim_awesome/map_component/component.rb +1 -1
  191. data/lib/decidim/decidim_awesome/menu.rb +33 -14
  192. data/lib/decidim/decidim_awesome/menu_hacker.rb +4 -8
  193. data/lib/decidim/decidim_awesome/system_checker.rb +2 -4
  194. data/lib/decidim/decidim_awesome/test/factories.rb +10 -10
  195. data/lib/decidim/decidim_awesome/test/initializer.rb +3 -11
  196. data/lib/decidim/decidim_awesome/test/layouts/decidim/_head.html.erb +2 -2
  197. data/lib/decidim/decidim_awesome/test/layouts/decidim/admin/_header.html.erb +2 -2
  198. data/lib/decidim/decidim_awesome/test/shared_examples/box_label_editor_examples.rb +18 -18
  199. data/lib/decidim/decidim_awesome/test/shared_examples/config_examples.rb +3 -3
  200. data/lib/decidim/decidim_awesome/test/shared_examples/custom_fields_examples.rb +11 -11
  201. data/lib/decidim/decidim_awesome/test/shared_examples/custom_redirects_contexts.rb +7 -7
  202. data/lib/decidim/decidim_awesome/test/shared_examples/editor_examples.rb +26 -66
  203. data/lib/decidim/decidim_awesome/test/shared_examples/menu_hack_contexts.rb +10 -9
  204. data/lib/decidim/decidim_awesome/test/shared_examples/scoped_admins_examples.rb +30 -20
  205. data/lib/decidim/decidim_awesome/test/shared_examples/summary_examples.rb +19 -10
  206. data/lib/decidim/decidim_awesome/version.rb +2 -2
  207. data/lib/decidim/decidim_awesome/voting_manifest.rb +5 -10
  208. data/lib/decidim/decidim_awesome.rb +1 -2
  209. data/lib/tasks/decidim_awesome_active_storage_migrations_tasks.rake +1 -1
  210. data/lib/tasks/decidim_awesome_upgrade_tasks.rake +4 -0
  211. data/package.json +19 -28
  212. metadata +40 -56
  213. data/app/cells/concerns/decidim/decidim_awesome/proposal_m_cell_override.rb +0 -18
  214. data/app/cells/decidim/decidim_awesome/voting/voting_cards_counter/show.erb +0 -15
  215. data/app/cells/decidim/decidim_awesome/voting/voting_cards_counter/vote_button.erb +0 -15
  216. data/app/cells/decidim/decidim_awesome/voting/voting_cards_counter_cell.rb +0 -21
  217. data/app/cells/decidim/decidim_awesome/voting/voting_cards_proposal_modal/show.erb +0 -16
  218. data/app/cells/decidim/decidim_awesome/voting/voting_cards_proposal_modal_cell.rb +0 -20
  219. data/app/cells/decidim/proposals/proposal_m/footer.erb +0 -13
  220. data/app/overrides/layouts/decidim/_head/add_awesome_legacy_scripts.rb +0 -14
  221. data/app/overrides/layouts/decidim/admin/_header/replace_styles.html.erb.deface +0 -3
  222. data/app/packs/entrypoints/decidim_admin_decidim_awesome_custom_fields.js +0 -2
  223. data/app/packs/entrypoints/decidim_decidim_awesome_admin_form_exit_warn.js +0 -1
  224. data/app/packs/src/decidim/decidim_awesome/admin/constraints.js +0 -55
  225. data/app/packs/src/decidim/decidim_awesome/editors/editor.js +0 -213
  226. data/app/packs/stylesheets/decidim/decidim_awesome/editors/markdown_editor.scss +0 -19
  227. data/app/packs/stylesheets/decidim/decidim_awesome/editors/quill_editor.scss +0 -58
  228. data/app/packs/stylesheets/vendor/select2-foundation-theme.scss +0 -348
  229. data/app/serializers/concerns/decidim/decidim_awesome/proposal_serializer_override.rb +0 -65
  230. data/app/views/decidim/decidim_awesome/admin/config/_modal.html.erb +0 -11
  231. data/app/views/decidim/decidim_awesome/voting/voting_cards/_proposal_m_cell_footer.erb +0 -15
  232. /data/app/packs/src/decidim/decidim_awesome/{editors/tabs_focus.js → admin/tabs_change.js} +0 -0
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2cf1da76fd4803091a1a436c61708acfffe4ce1766227e0dcdef5a03d43adb00
4
- data.tar.gz: f6dbf35fc450c203eea9db332372c26432fb171d9a057fbdc44bd1725d319963
3
+ metadata.gz: 107f5d454725a66c2a3a7658d9c841616a4556f634a6615c5f124ad2815c94b2
4
+ data.tar.gz: cc18503da6d79d49787f40a6a6da9fe659d64c05183c599a30800a25a874c5b9
5
5
  SHA512:
6
- metadata.gz: '01794da0b71c3719eab36c0c7a7107bd4873fa08bc78d78d61723cc6b238ad68eaed5bd281729c652e50c1afa0acdc0af2a47cbd1f2a0dea4fa7d40856dd5f5e'
7
- data.tar.gz: 519112bb3fd8422b23c2fb36330e80ee18a2b5d3dc08f2c27bddf5c4e2be53e619cfc056a101fe8c37e7a903a160c4e57c0d9023c8919457d9cceaa94cfa1559
6
+ metadata.gz: 7da76c3a55fac5f16814946e9de813e7e30f2f56523a62143b20ad52bf16863abfd5da3a79ac44c7a0aedffc4e9ddec232bed2732153474ac586cecac0acb302
7
+ data.tar.gz: d5c566fe5297b253b6004ad23007fc22d7a47c5aa9a0a310de319799c2fdfced27cf1b0c0861e8c9341d041eeb556571c0d65b8ae16d56fcb6b16eafe30a7d54
data/CHANGELOG.md CHANGED
@@ -1,11 +1,11 @@
1
1
  CHANGELOG
2
2
  =========
3
3
 
4
- v0.10.3
4
+ v0.11.1
5
5
  ------
6
6
 
7
7
  Compatibility:
8
- - Decidim v0.27.4
8
+ - Decidim v0.28.x
9
9
 
10
10
  Features:
11
11
  - Added Private Custom Fields feature
@@ -13,8 +13,17 @@ Features:
13
13
  - Added GraphQL types for custom fields in the API
14
14
  - Adds parsed information about custom fields in the Proposals export
15
15
  - Adds parsed information bout private custom fields when admins exports private data
16
- - Adds a maintenance menu with tools to remove old private
17
- - SQL vulnerability fix for admin accountability
16
+ - Adds a maintenance menu with tools to remove old private data
17
+
18
+ v0.11
19
+ ------
20
+
21
+ Compatibility:
22
+ - Decidim v0.28.x
23
+
24
+ Features:
25
+ - Redesign to version 0.28
26
+ - Removed markdown editor
18
27
 
19
28
  v0.10.2
20
29
  ------
@@ -71,7 +80,7 @@ Compatibility:
71
80
 
72
81
  Features:
73
82
  - Fixes for the menu hacker
74
-
83
+
75
84
  v0.9.1
76
85
  ------
77
86
 
data/README.md CHANGED
@@ -1,16 +1,14 @@
1
1
  # Decidim::DecidimAwesome
2
2
 
3
- [![[CI] Tests 0.27](https://github.com/decidim-ice/decidim-module-decidim_awesome/actions/workflows/tests.yml/badge.svg)](https://github.com/decidim-ice/decidim-module-decidim_awesome/actions/workflows/tests.yml)
4
- [![[CI] Tests 0.26](https://github.com/decidim-ice/decidim-module-decidim_awesome/actions/workflows/tests-legacy.yml/badge.svg)](https://github.com/decidim-ice/decidim-module-decidim_awesome/actions/workflows/tests-legacy.yml)
3
+ [![[CI] Tests 0.28](https://github.com/decidim-ice/decidim-module-decidim_awesome/actions/workflows/tests.yml/badge.svg)](https://github.com/decidim-ice/decidim-module-decidim_awesome/actions/workflows/tests.yml)
5
4
  [![[CI] Lint](https://github.com/decidim-ice/decidim-module-decidim_awesome/actions/workflows/lint.yml/badge.svg)](https://github.com/decidim-ice/decidim-module-decidim_awesome/actions/workflows/lint.yml)
6
- [![[CI] Precompile](https://github.com/decidim-ice/decidim-module-decidim_awesome/actions/workflows/precompile.yml/badge.svg)](https://github.com/decidim-ice/decidim-module-decidim_awesome/actions/workflows/precompile.yml)
7
5
  [![Maintainability](https://api.codeclimate.com/v1/badges/2dada53525dd5a944089/maintainability)](https://codeclimate.com/github/decidim-ice/decidim-module-decidim_awesome/maintainability)
8
6
  [![Test Coverage](https://codecov.io/gh/decidim-ice/decidim-module-decidim_awesome/branch/main/graph/badge.svg?token=TFBMCLLZJG)](https://codecov.io/gh/decidim-ice/decidim-module-decidim_awesome)
9
7
 
10
- Usability and UX tweaks for Decidim.
8
+ **Usability and UX tweaks for Decidim.**
11
9
 
12
10
  This plugin allows the administrators to expand the possibilities of Decidim beyond some existing limitations.
13
- All tweaks are provided in a optional fashion with granular permissions that let the administrator to choose exactly where to apply those mods. Some tweaks can be applied to any assembly, other in an specific participatory process or even in type of component only.
11
+ All tweaks are provided in a optional fashion with granular permissions that let the administrator to choose exactly where to apply those mods. Some tweaks can be applied to an assembly, other in an specific participatory process or even in a type of component only (for instance, only in proposals).
14
12
 
15
13
  **DISCLAIMER: This module is heavily tested and widely used, however we do not accept any responsibility for breaking anything. Feedback is appreciated though.**
16
14
 
@@ -31,13 +29,13 @@ Each hack can be scoped to one or more specific participatory spaces or componen
31
29
 
32
30
  ### Tweaks:
33
31
 
34
- #### 1. Image support for the Quill editor
32
+ #### 1. Image support for the RichText editor
35
33
 
36
34
  Modifies the WYSIWYG editor in Decidim by adding the possibility to insert images. When uploading images, Drag & Drop is supported. Images will be uploaded to the server and inserted as external resources (it doesn't use base64 in-line encoding).
37
35
 
38
36
  This feature allows you use images in newsletters as well.
39
37
 
40
- ![Images in Quill Editor](examples/quill-images.png)
38
+ ![Images in RichText Editor](examples/quill-images.png)
41
39
 
42
40
  #### 2. Auto-save for surveys and forms
43
41
 
@@ -47,27 +45,23 @@ It works purely in the client side by using LocalStorage capabilities of the bro
47
45
 
48
46
  Saving the form removes the stored data.
49
47
 
50
- ![Auto save in forms](examples/auto-save.png)
48
+ ![Auto save in forms](examples/auto-save.gif)
51
49
 
52
50
  #### 3. Images in proposals
53
51
 
54
- Event if you haven't activated the WYSIWYG editor (Quill) in public views (eg: proposals use a simple textarea if rich text editor has not been activated for users). You can allow users to upload images in them by drag & drop over the text area.
52
+ Event if you haven't activated the WYSIWYG editor (RichText) in public views (eg: proposals use a simple textarea if rich text editor has not been activated for users). You can allow users to upload images in them by drag & drop over the text area.
55
53
 
56
54
  ![Proposal images](examples/proposal-images.png)
57
55
 
58
- #### 4. Markdown editor for proposals
59
-
60
- Allows to use markdown when creating proposals instead of a bare textarea.
61
-
62
- #### 5. Admin scope configuration
56
+ #### 4. Restrict scope for tweaks
63
57
 
64
58
  All tweaks can be configured and scoped to a specific participatory space, a type of participatory space, a type of component or a specific component.
65
59
 
66
- Many scopes can be defined for every tweak.
60
+ Many scopes can be defined for every tweak. If a tweak is not scoped, it will be applied globally.
67
61
 
68
- ![Admin tweaks for editors](examples/admin-editors.png)
62
+ ![Tweak scopes](examples/tweak-scopes.png)
69
63
 
70
- #### 6. Awesome map component
64
+ #### 5. Awesome map component
71
65
 
72
66
  This is a component you can add in any participatory space. It retrieves all the geolocated content in that participatory space (meetings or proposals) and displays it in a big map.
73
67
 
@@ -75,25 +69,25 @@ It also provides a simple search by category, each category is assigned to a dif
75
69
 
76
70
  ![Awesome map](examples/awesome-map.png)
77
71
 
78
- #### 7. Fullscreen Iframe component
72
+ #### 6. Fullscreen Iframe component
79
73
 
80
74
  Another simple component that can be used to embed and Iframe with any external content in it that fills all the viewport.
81
75
 
82
76
  ![Fullscreen iframe](examples/fullscreen-iframe.png)
83
77
 
84
- #### 8. Live support chat
78
+ #### 7. Live support chat
85
79
 
86
- With this feature you can have a support chat in Decidim. It is linked to a [Telegram](https://telegram.org/) group or a single user chat using the [[IntergramBot](https://web.telegram.org/#/im?p=@IntergramBot). Just invite the bot to a group or chat with it directly, grab your ID, put it on the Awesome settings and have fun!. For more info or for hosting your own version of the bot check the [Intergram project](https://github.com/idoco/intergram).
80
+ With this feature you can have a support chat in Decidim. It is linked to a [Telegram](https://telegram.org/) group or a single user chat using the [IntergramBot](https://web.telegram.org/#/im?p=@IntergramBot). Just invite the bot to a group or chat with it directly, grab your ID, put it on the Awesome settings and have fun!. For more info or for hosting your own version of the bot check the [Intergram project](https://github.com/idoco/intergram).
87
81
 
88
82
  ![Intergram screenshot](examples/intergram.png)
89
83
 
90
- #### 9. Custom CSS applied only according scoped restrictions
84
+ #### 8. Custom CSS applied only according scoped restrictions
91
85
 
92
86
  With this feature you can create directly in the admin a CSS snipped that is only applied globally, in a particular assembly or even a single proposal!
93
87
 
94
88
  ![CSS screenshot](examples/custom_styles.png)
95
89
 
96
- #### 10. Change the main menu of Decidim entirely!
90
+ #### 9. Change the main menu of Decidim entirely!
97
91
 
98
92
  Feel free to hide, modify or add items in the Decidim's main menu. You can also change the order, establish some conditions (like showing only for logged users) or open in a new window.
99
93
 
@@ -102,7 +96,7 @@ Feel free to hide, modify or add items in the Decidim's main menu. You can also
102
96
  ![Menu hacks screenshot](examples/menu-3.png)
103
97
  ![Menu hacks screenshot](examples/menu-4.png)
104
98
 
105
- #### 11. Assign admins to specific scopes and prevent them modify anything else
99
+ #### 10. Assign admins to specific scopes and prevent them modify anything else
106
100
 
107
101
  Convert any user on the platform (that is not currently an admin) to a limited subset of participatory spaces or event components. Just add users to a box and scope them to some constraints. These users will see the "Edit" button in everywhere they have permissions. Any access to non allowed zones will redirect the user to the admin index page.
108
102
 
@@ -110,7 +104,7 @@ Convert any user on the platform (that is not currently an admin) to a limited s
110
104
  ![Scoped admins unauthorized](examples/scoped_admins_unauthorized.png)
111
105
  ![Scoped admins configuration](examples/scoped_admins_config.png)
112
106
 
113
- #### 12. Custom fields for proposals
107
+ #### 11. Custom fields for proposals
114
108
 
115
109
  Now admins can substitute the body of a proposal with a set of form fields.
116
110
  Edition is make with a Drag & Drop interface in the admin and can (and should) be scoped to apply only to certain proposal components.
@@ -137,7 +131,9 @@ Decidim::DecidimAwesome.configure do |config|
137
131
  end
138
132
  ```
139
133
 
140
- ##### 12.1. GraphQL types for custom fields
134
+ ##### 11.1. GraphQL types for custom fields
135
+
136
+ #### 11.1. GraphQL types for custom fields
141
137
 
142
138
  Custom fields are displayed in the GaphQL API according to their definition in a formatted array of objects in the attribute `bodyFields`.
143
139
 
@@ -179,14 +175,14 @@ A query to extract this information could look like this (see that the original
179
175
  You can then use this custom type in your GraphQL queries and mutations to handle the custom fields in proposals.
180
176
 
181
177
 
182
- ##### 12.2. Private Custom fields
178
+ ##### 11.2. Private Custom fields
183
179
 
184
180
  Similar to the custom fields feature, but only admins can see the content of the fields. This is useful for adding metadata to proposals that should not be visible to the public (such as contact data).
185
181
  Data is stored encrypted in the database.
186
182
 
187
183
  ![Private Custom fields screenshot](examples/private_custom_fields.png)
188
184
 
189
- #### 13. Custom Redirections (or URL shortener feature)
185
+ #### 12. Custom Redirections (or URL shortener feature)
190
186
 
191
187
  Admins can create custom paths that redirect to other places. Destinations can be internal absolute paths or external sites.
192
188
  There's also possible to choose to sanitize (ie: remove) any query string or to maintain it (so you can decide to use).
@@ -206,7 +202,7 @@ Using a link with a query string (ie: `/take-me-somewhere?locale=es`) that will
206
202
 
207
203
  ![Custom redirections screenshot](examples/custom-redirections.png)
208
204
 
209
- #### 14. Custom validation rules for title and body in proposals
205
+ #### 13. Custom validation rules for title and body in proposals
210
206
 
211
207
  Configure as you wish how the fields "title" and "body" are validated in proposals creation.
212
208
 
@@ -219,7 +215,7 @@ Rules available:
219
215
 
220
216
  ![Custom validations](examples/custom_validations.png)
221
217
 
222
- #### 15. Admin accountability
218
+ #### 14. Admin accountability
223
219
 
224
220
  This feature allows you to list all the users that are, or have been at any point in time, admins, valuators, user managers or any other role in Decidim. Including global admin roles or private admins of a particular participatory space.
225
221
 
@@ -227,7 +223,7 @@ Results can be filtered by role and by time range and also exported as CSV or ot
227
223
 
228
224
  ![Admin accountability](examples/admin_accountability.png)
229
225
 
230
- #### 16. Additional proposal sortings
226
+ #### 15. Additional proposal sortings
231
227
 
232
228
  ![Proposal sorting](examples/proposal_sorting.png)
233
229
  ![Proposal sorting admin](examples/proposal_sorting-admin.png)
@@ -256,7 +252,7 @@ Decidim::DecidimAwesome.configure do |config|
256
252
  end
257
253
  ```
258
254
 
259
- #### 17. Weighted voting
255
+ #### 16. Weighted voting
260
256
 
261
257
  This feature allows you to configure a proposals component to use a weighted voting system. This means that each vote can have a different weight and the result of the vote is calculated as the sum of all the weights.
262
258
 
@@ -279,7 +275,7 @@ if Decidim::DecidimAwesome.enabled?(:weighted_proposal_voting)
279
275
  voting.show_vote_button_view = "decidim/decidim_awesome/voting/no_admins_vote/show_vote_button"
280
276
  voting.show_votes_count_view = "decidim/decidim_awesome/voting/no_admins_vote/show_votes_count"
281
277
  # voting.show_votes_count_view = "" # hide votes count if needed
282
- voting.proposal_m_cell_footer = "decidim/decidim_awesome/voting/no_admins_vote/proposal_m_cell_footer"
278
+ voting.proposal_metadata_cell = "decidim/decidim_awesome/voting/proposal_metadata"
283
279
  # define a weight validator (optional, by default all weights are valid)
284
280
  voting.weight_validator do |weight, context|
285
281
  # don't allow admins to vote
@@ -305,11 +301,11 @@ A manifest must define a vote button view for the main proposal view, a vote cou
305
301
 
306
302
  All views are optional, if set to `nil` they will use the original ones. If set to an empty string `""` they will be hidden.
307
303
 
308
- The `weight_validator` is a Proc that receives the weight value and the context with the current user and the proposal and returns true or false if the weight is valid or not.
304
+ The `weight_validator` is a `Proc` that receives the weight value and the context with the current user and the proposal and returns true or false if the weight is valid or not.
309
305
 
310
306
  **Notes for view `show_vote_button_view`**
311
307
 
312
- When building a new view for the vote button ([see the original](https://github.com/decidim/decidim/blob/release/0.27-stable/decidim-proposals/app/views/decidim/proposals/proposals/_vote_button.html.erb)) is important to take into account the following situations:
308
+ When building a new view for the vote button ([see the original](https://github.com/decidim/decidim/blob/release/0.28-stable/decidim-proposals/app/views/decidim/proposals/proposals/_vote_button.html.erb)) is important to take into account the following situations:
313
309
 
314
310
  - If there's a `current_user` logged in
315
311
  - If votes are blocked `if current_settings.votes_blocked?`
@@ -317,7 +313,7 @@ When building a new view for the vote button ([see the original](https://github.
317
313
  - If maximum votes have already reached `if proposal.maximum_votes_reached?`
318
314
  - If the proposal can accumulate supports beyond maximum `if proposal.can_accumulate_supports_beyond_threshold`
319
315
  - If the current component allows the user to participate `if current_component.participatory_space.can_participate?(current_user)`
320
- - Note that the [original view](https://github.com/decidim/decidim/blob/release/0.27-stable/decidim-proposals/app/views/decidim/proposals/proposals/_vote_button.html.erb) is overridden only inside the tag `<div id="proposal-<%= proposal.id %>-vote-button" class="button--vote-button">`. You only need to substitute the part inside.
316
+ - Note that the [original view](https://github.com/decidim/decidim/blob/release/0.28-stable/decidim-proposals/app/views/decidim/proposals/proposals/_vote_button.html.erb) is overridden only inside the tag `<div id="proposal-<%= proposal.id %>-vote-button" class="button--vote-button">`. You only need to substitute the part inside.
321
317
 
322
318
  To cast a vote a `POST` action is needed with the parameters `proposal_id`, `from_proposals_list` and `weight`. The route where to send the vote can be constructed such as:
323
319
 
@@ -333,13 +329,13 @@ This view must implement the number of votes already cast. It requires an HTML t
333
329
 
334
330
  You can also completely hide this view (using `voting.show_votes_count_view = ""` in the manifest declaration). This is useful if you are using the same `show_vote_button_view` to also display the total counters (or your implementation does not use that).
335
331
 
336
- **Notes for view `proposal_m_cell_footer`**
332
+ **Notes for cell `voting.proposal_metadata_cell`**
337
333
 
338
- This view is used by the proposal cell in lists. It must implement the vote button and the vote count. The vote button must be a link with the same characteristics as the one explained above for the `show_vote_button_view` (typically you can just render the same view using `<%= render partial: my/path/to/view, { locals: model: proposal, from_proposals_list: true } %>`).
334
+ This is the Decidim cell used to provide the metadata that is rendered at the bottom of a proposal card. If empty, defaults to [ProposalMetadataCell](https://github.com/decidim/decidim/blob/release/0.28-stable/decidim-proposals/app/cells/decidim/proposals/proposal_metadata_cell.rb), **wich does not renders the votes**.
339
335
 
340
- Note that, it is strongly recommended to add and HTML tag element with the id `proposal-<%= proposal.id %>-votes-count` so the Ajax vote re-loader can work. Even if you don't use (in this case use a `style="display:none"` attribute), this is because the Ajax reloader always look for this element and throw JavaScript errors if not.
336
+ What this cell must do is to provide an array of items to render as part of the cell footer. Check the example used at the [voting cards implementation](app/cells/decidim/decidim_awesome/voting/proposal_metadata_cell.rb) for reference.
341
337
 
342
- ##### 17.1 GraphQL Types for weighted voting
338
+ ##### 16.1 GraphQL Types for weighted voting
343
339
 
344
340
  When a weighed voting mechanism is selected, the GraphQL API will show those weights separated in each proposal.
345
341
  The attribute that holds this information is `vote_weights`, a query example could look like this:
@@ -361,7 +357,7 @@ The attribute that holds this information is `vote_weights`, a query example cou
361
357
  }
362
358
  ```
363
359
 
364
- #### 18. Limiting amendments in proposals
360
+ #### 17. Limiting amendments in proposals
365
361
 
366
362
  By default, when proposals can be amended, any number of amendments can be created.
367
363
 
@@ -401,9 +397,8 @@ And then execute:
401
397
 
402
398
  ```bash
403
399
  bundle
404
- bundle exec rails decidim_decidim_awesome:install:migrations
405
- bundle exec rails decidim:upgrade
406
- bundle exec rails db:migrate
400
+ bin/rails decidim:upgrade
401
+ bin/rails db:migrate
407
402
  ```
408
403
 
409
404
  Go to `yourdomain/admin/decidim_awesome` and start tweaking things!
@@ -417,6 +412,7 @@ Go to `yourdomain/admin/decidim_awesome` and start tweaking things!
417
412
  > bin/rails decidim_decidim_awesome:webpacker:install
418
413
  > ```
419
414
 
415
+
420
416
  If you are upgrading from a version prior to 0.8, make sure to visit the URL `/admin/decidim_awesome/checks` and run image migrations for the old images:
421
417
 
422
418
  ![Check image migrations](examples/check_image_migrations.png)
@@ -433,25 +429,27 @@ RAILS_ENV=production bin/rails decidim_awesome:active_storage_migrations:check_m
433
429
  ```
434
430
 
435
431
  The correct version of Decidim Awesome should resolved automatically by the Bundler.
436
- However you can force some specific version using `gem "decidim-decidim_awesome", "~> 0.10.0"` in the Gemfile.
432
+ However you can force some specific version using `gem "decidim-decidim_awesome", "~> 0.11.0"` in the Gemfile.
437
433
 
438
434
  Depending on your Decidim version, choose the corresponding Awesome version to ensure compatibility:
439
435
 
440
436
  | Awesome version | Compatible Decidim versions |
441
- |-----------------|-----------------------------|
442
- | 0.10.x | >= 0.26.7, >= 0.27.3 |
443
- | 0.9.2 | >= 0.26.7, >= 0.27.3 |
444
- | 0.9.x | 0.26.x, 0.27.x |
445
- | 0.8.x | 0.25.x, 0.26.x |
446
- | 0.7.x | 0.23.x, 0.24.x |
447
- | 0.6.x | 0.22.x, 0.23.x |
448
- | 0.5.x | 0.21.x, 0.22.x |
437
+ |---|---|
438
+ | 0.11.x | 0.28.x |
439
+ | 0.10.x | >= 0.26.7, >= 0.27.x |
440
+ | 0.9.2 | >= 0.26.7, >= 0.27.3 |
441
+ | 0.9.x | 0.26.x, 0.27.x |
442
+ | 0.8.x | 0.25.x, 0.26.x |
443
+ | 0.7.x | 0.23.x, 0.24.x |
444
+ | 0.6.x | 0.22.x, 0.23.x |
445
+ | 0.5.x | 0.21.x, 0.22.x |
449
446
 
450
447
  > *Heads up!*
448
+ > * version 0.11.0 is only compatible with Decidim v0.28 as a major redesign makes backward compatibility impractical.
451
449
  > * version 0.10.0 requires database migrations! Don't forget the migrations step when updating.
452
450
  > * version 0.8.0 removes CSS Themes for tenants. If you have been using them you will have to manually migrate them to custom styles.
453
451
  > * version 0.8.0 uses ActiveStorage, same as Decidim 0.25. 2 new rake task have been introduced to facilitate the migration: `bin/rails decidim_awesome:active_storage_migrations:check_migration_from_carrierwave` and
454
- `bin/rails decidim_awesome:active_storage_migrations:migrate_from_carrierwave`
452
+ `bin/rails decidim_awesome:active_storage_migrations:migrate_from_carrierwave`
455
453
  > * version 0.7.1 requires database migrations! Don't forget the migrations step when updating.
456
454
 
457
455
  ## Configuration
@@ -469,13 +467,10 @@ In order to personalize default values, create an initializer such as:
469
467
  # Change some variables defaults
470
468
  Decidim::DecidimAwesome.configure do |config|
471
469
  # Enabled by default to all scopes, admins can still limit it's scope
472
- config.allow_images_in_full_editor = true
470
+ config.allow_images_in_editors = true
473
471
 
474
472
  # Disabled by default to all scopes, admins can enable it and limit it's scope
475
- config.allow_images_in_small_editor = false
476
-
477
- # De-activated, admins don't even see it as an option
478
- config.use_markdown_editor = :disabled
473
+ config.allow_videos_in_editors = false
479
474
 
480
475
  # Disable scoped admins
481
476
  config.scoped_admins = :disabled
@@ -567,6 +562,9 @@ DATABASE_USERNAME=<username> DATABASE_PASSWORD=<password> bundle exec rake test_
567
562
  DATABASE_USERNAME=<username> DATABASE_PASSWORD=<password> bundle exec rspec
568
563
  ```
569
564
 
565
+ > Note: the following is not currently applicable as version v0.11 is only compatible with version Decidim v0.28
566
+ > Is left here for future reference
567
+
570
568
  However, this project works with different versions of Decidim. In order to test them all, we maintain two different Gemfiles: `Gemfile` and `Gemfile.legacy`. The first one is used for development and testing the latest Decidim version supported, the second one is used for testing against the old Decidim version.
571
569
 
572
570
  You can run run tests against the legacy Decidim versions by using:
@@ -574,24 +572,24 @@ You can run run tests against the legacy Decidim versions by using:
574
572
  ```bash
575
573
  export DATABASE_USERNAME=<username>
576
574
  export DATABASE_PASSWORD=<password>
577
- RBENV_VERSION=2.7.6 BUNDLE_GEMFILE=Gemfile.legacy bundle
578
- RBENV_VERSION=2.7.6 BUNDLE_GEMFILE=Gemfile.legacy bundle exec rake test_app
579
- RBENV_VERSION=2.7.6 BUNDLE_GEMFILE=Gemfile.legacy bundle exec rspec
575
+ RBENV_VERSION=3.1.1 BUNDLE_GEMFILE=Gemfile.legacy bundle
576
+ RBENV_VERSION=3.1.1 BUNDLE_GEMFILE=Gemfile.legacy bundle exec rake test_app
577
+ RBENV_VERSION=3.1.1 BUNDLE_GEMFILE=Gemfile.legacy bundle exec rspec
580
578
  ```
581
579
 
582
- For convenience, you can use the scripts `bin/rspec` and `bin/rspec-legacy` to run tests against one or the other version:
580
+ For convenience, you can use the scripts `bin/test` and `bin/test-legacy` to run tests against one or the other version:
583
581
 
584
582
  ```bash
585
- bin/rspec spec/
586
- bin/rspec-legacy spec/
583
+ bin/test spec/
584
+ bin/test-legacy spec/
587
585
  ```
588
586
 
589
587
  - Rbenv is required for this script to work.
590
588
 
591
589
  > **NOTE:** Remember to reset the database when changing between tests:
592
590
  > ```bash
593
- > bin/rspec --reset
594
- > bin/rspec-legacy --reset
591
+ > bin/test --reset
592
+ > bin/test-legacy --reset
595
593
  > ```
596
594
 
597
595
 
@@ -626,4 +624,4 @@ This engine is distributed under the GNU AFFERO GENERAL PUBLIC LICENSE.
626
624
 
627
625
  ## Credits
628
626
 
629
- This plugin maintainted by ![PokeCode](app/packs/images/decidim/decidim_awesome/pokecode-logo.png)
627
+ This plugin maintainted by [![PokeCode](app/packs/images/decidim/decidim_awesome/pokecode-logo.png) PokeCode](https://pokecode.net/)
@@ -0,0 +1,20 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Decidim
4
+ module DecidimAwesome
5
+ module GlobalMenuCellOverride
6
+ extend ActiveSupport::Concern
7
+
8
+ included do
9
+ def cache_hash
10
+ [
11
+ "decidim/content_blocks/global_menu",
12
+ current_organization.cache_key_with_version,
13
+ I18n.locale,
14
+ awesome_config[:home_content_block_menu].to_s
15
+ ].join(Decidim.cache_key_separator)
16
+ end
17
+ end
18
+ end
19
+ end
20
+ end
@@ -0,0 +1,44 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Decidim
4
+ module DecidimAwesome
5
+ module ProposalLCellOverride
6
+ extend ActiveSupport::Concern
7
+
8
+ included do
9
+ private
10
+
11
+ def metadata_cell
12
+ awesome_voting_manifest_for(resource&.component)&.proposal_metadata_cell.presence || "decidim/proposals/proposal_metadata"
13
+ end
14
+
15
+ # rubocop:disable Metrics/CyclomaticComplexity
16
+ # rubocop:disable Metrics/PerceivedComplexity
17
+ def cache_hash
18
+ hash = []
19
+ hash << I18n.locale.to_s
20
+ hash << model.cache_key_with_version
21
+ hash << model.proposal_votes_count
22
+ hash << model.extra_fields&.reload&.vote_weight_totals
23
+ hash << model.endorsements_count
24
+ hash << model.comments_count
25
+ hash << Digest::MD5.hexdigest(model.component.cache_key_with_version)
26
+ hash << Digest::MD5.hexdigest(resource_image_path) if resource_image_path
27
+ hash << render_space? ? 1 : 0
28
+ if current_user
29
+ hash << current_user.cache_key_with_version
30
+ hash << current_user.follows?(model) ? 1 : 0
31
+ end
32
+ hash << model.follows_count
33
+ hash << Digest::MD5.hexdigest(model.authors.map(&:cache_key_with_version).to_s)
34
+ hash << (model.must_render_translation?(model.organization) ? 1 : 0) if model.respond_to?(:must_render_translation?)
35
+ hash << model.component.participatory_space.active_step.id if model.component.participatory_space.try(:active_step)
36
+
37
+ hash.join(Decidim.cache_key_separator)
38
+ end
39
+ # rubocop:enable Metrics/CyclomaticComplexity
40
+ # rubocop:enable Metrics/PerceivedComplexity
41
+ end
42
+ end
43
+ end
44
+ end
@@ -1,14 +1,7 @@
1
- <section class="wrapper-home map-block home-section">
2
- <div class="row">
1
+ <section class="map-block home__section">
2
+ <%= content_tag("h3", section_title) if section_title.present? %>
3
3
 
4
- <%= section_title %></h3>
5
-
6
- <div class="row">
7
- <div class="columns medium-12">
8
- <%= awesome_map_for global_map_components do %>
9
- <%= render partial: "decidim/decidim_awesome/map_component/map/map_template.html", locals: { categories: all_categories, map_height: model.settings.map_height } %>
10
- <% end %>
11
- </div>
12
- </div>
13
- </div>
4
+ <%= awesome_map_for global_map_components do %>
5
+ <%= render partial: "decidim/decidim_awesome/map_component/map/map_template.html", locals: { categories: all_categories, map_height: model.settings.map_height } %>
6
+ <% end %>
14
7
  </section>
@@ -0,0 +1,54 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Decidim
4
+ module DecidimAwesome
5
+ module Voting
6
+ # This cell renders metadata for an instance of a Proposal
7
+ class ProposalMetadataCell < ::Decidim::Proposals::ProposalMetadataCell
8
+ private
9
+
10
+ def proposal_items
11
+ [coauthors_item, comments_count_item, endorsements_count_item, weight_count_item, state_item, emendation_item]
12
+ end
13
+
14
+ def current_vote
15
+ @current_vote ||= Decidim::Proposals::ProposalVote.find_by(author: current_user, proposal: resource)
16
+ end
17
+
18
+ def user_voted_weight
19
+ current_vote&.weight
20
+ end
21
+
22
+ def all_weights
23
+ @all_weights ||= begin
24
+ weights = [3, 2, 1]
25
+ weights << 0 if resource.component.settings.voting_cards_show_abstain
26
+ weights.index_with do |weight|
27
+ resource.weight_count(weight)
28
+ end
29
+ end
30
+ end
31
+
32
+ def weight_tags
33
+ @weight_tags ||= all_weights.map do |num, weight|
34
+ content_tag "span", title: resource.manifest.label_for(num), class: "voting-weight_#{num}" do
35
+ "#{t("decidim.decidim_awesome.voting.voting_cards.weights.weight_#{num}_short")} #{weight}"
36
+ end.html_safe
37
+ end
38
+ end
39
+
40
+ def weight_count_item
41
+ return unless resource.respond_to?(:weight_count)
42
+ return if resource.component.current_settings.votes_hidden?
43
+ return if resource&.rejected? || resource&.withdrawn?
44
+
45
+ {
46
+ text: weight_tags.join(" | ").html_safe,
47
+ icon: "#{user_voted_weight ? "checkbox" : "close"}-circle-line",
48
+ data_attributes: all_weights.transform_keys { |num| "weight-#{num}" }
49
+ }
50
+ end
51
+ end
52
+ end
53
+ end
54
+ end
@@ -0,0 +1,18 @@
1
+ <%= decidim_modal id: "voting-cards-modal-help", class:"reveal vote_proposal_modal voting-voting_cards" do %>
2
+ <div data-dialog-container>
3
+ <div class="reveal__content">
4
+ <div class="instructions mb-4"><%= vote_instructions %></div>
5
+ <div class="current-choice voting-voting_cards mb-4">
6
+ <div class="vote-card"></div>
7
+ </div>
8
+ <div class="future-dismiss">
9
+ <%= check_box_tag "voting_cards-skip_help", current_component.id, false %>
10
+ <%= label_tag "voting_cards-skip_help", t("decidim.decidim_awesome.voting.voting_cards.modal.skip") %>
11
+ </div>
12
+ </div>
13
+ </div>
14
+ <div data-dialog-actions>
15
+ <button type="button" class="button button__lg button__primary hover:bg-secondary vote-action" style="background-color: #e02d2d;"><%= t("decidim.decidim_awesome.voting.voting_cards.modal.proceed") %></button>
16
+ <button type="button" class="button button__lg button__transparent-secondary cancel-action hollow secondary" data-dialog-close="voting-cards-modal-help"><%= t("decidim.decidim_awesome.voting.voting_cards.modal.cancel") %></button>
17
+ </div>
18
+ <% end %>