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
@@ -0,0 +1,18 @@
1
+ # frozen_string_literal: true
2
+
3
+ class RenameEditorImagesAwesomeConfig < ActiveRecord::Migration[6.1]
4
+ class AwesomeConfig < ApplicationRecord
5
+ self.table_name = :decidim_awesome_config
6
+ end
7
+
8
+ # rubocop:disable Rails/SkipsModelValidations
9
+ def up
10
+ AwesomeConfig.where(var: :allow_images_in_full_editor).update_all(var: :allow_images_in_editors)
11
+ AwesomeConfig.where(var: :allow_images_in_small_editor).destroy_all
12
+ end
13
+
14
+ def down
15
+ AwesomeConfig.where(var: :allow_images_in_editors).update_all(var: :allow_images_in_full_editor)
16
+ end
17
+ # rubocop:enable Rails/SkipsModelValidations
18
+ end
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- class AddDecidimAwesomeProposalPrivateFieldsDate < ActiveRecord::Migration[6.0]
3
+ class AddDecidimAwesomeProposalPrivateFieldsDate < ActiveRecord::Migration[6.1]
4
4
  class ProposalExtraField < ApplicationRecord
5
5
  self.table_name = :decidim_awesome_proposal_extra_fields
6
6
  end
data/db/seeds.rb CHANGED
@@ -7,7 +7,7 @@ if !Rails.env.production? || ENV.fetch("SEED", nil)
7
7
 
8
8
  # Set the htmleditor on to facilitate development
9
9
  admin_user = Decidim::User.find_by(
10
- organization: organization,
10
+ organization:,
11
11
  email: "admin@example.org"
12
12
  )
13
13
 
@@ -18,10 +18,10 @@ if !Rails.env.production? || ENV.fetch("SEED", nil)
18
18
  )
19
19
 
20
20
  # Enable images in general
21
- setting = Decidim::DecidimAwesome::AwesomeConfig.find_or_initialize_by(var: :allow_images_in_full_editor, organization: organization)
21
+ setting = Decidim::DecidimAwesome::AwesomeConfig.find_or_initialize_by(var: :allow_images_in_editors, organization:)
22
22
  setting.value = true
23
23
  setting.save!
24
- setting = Decidim::DecidimAwesome::AwesomeConfig.find_or_initialize_by(var: :allow_images_in_small_editor, organization: organization)
24
+ setting = Decidim::DecidimAwesome::AwesomeConfig.find_or_initialize_by(var: :allow_videos_in_editors, organization:)
25
25
  setting.value = true
26
26
  setting.save!
27
27
  end
@@ -16,7 +16,9 @@ module Decidim
16
16
  routes do
17
17
  # Add admin engine routes here
18
18
  resources :constraints
19
- resources :menu_hacks, except: [:show]
19
+ resources :menus, only: [:show] do
20
+ resources :hacks, except: [:show], controller: "menu_hacks"
21
+ end
20
22
  resources :custom_redirects, except: [:show]
21
23
  resources :config, param: :var, only: [:show, :update]
22
24
  resources :scoped_styles, param: :var, only: [:create, :destroy]
@@ -62,6 +64,7 @@ module Decidim
62
64
  end
63
65
  # submenus
64
66
  Decidim::DecidimAwesome::Menu.register_custom_fields_submenu!
67
+ Decidim::DecidimAwesome::Menu.register_menu_hacks_submenu!
65
68
  Decidim::DecidimAwesome::Menu.register_maintenance_admin_menu!
66
69
  Decidim::DecidimAwesome::Menu.register_awesome_admin_menu!
67
70
 
@@ -27,9 +27,8 @@ module Decidim
27
27
  def translations(locales: [])
28
28
  translations = display_translations
29
29
  translations = translations.slice(*locales) unless locales.empty?
30
- # rubocop:disable Style/OpenStructUse
31
- translations.map { |locale, fields| OpenStruct.new(locale: locale, fields: fields, machine_translated: defined_translations[locale].blank?) }
32
- # rubocop:enable Style/OpenStructUse
30
+
31
+ translations.map { |locale, fields| OpenStruct.new(locale:, fields:, machine_translated: defined_translations[locale].blank?) }
33
32
  end
34
33
 
35
34
  private
@@ -14,7 +14,7 @@ module Decidim
14
14
  autoload :TranslatedCustomFieldsType, "decidim/decidim_awesome/api/types/translated_custom_fields_type"
15
15
  autoload :LocalizedCustomFieldsType, "decidim/decidim_awesome/api/types/localized_custom_fields_type"
16
16
 
17
- # Awesome coms with some components for participatory spaces
17
+ # Awesome comes with some components for participatory spaces
18
18
  # Currently :awesome_map and :awesome_iframe, list them here
19
19
  # if you wan to disable them
20
20
  # NOTE if you have spaces with some of these components already configured
@@ -35,11 +35,11 @@ module Decidim
35
35
  # true => always true but admins can still restrict its scope
36
36
  # false => default false, admins can turn it true
37
37
  # :disabled => false and non available, hidden from admins
38
- config_accessor :allow_images_in_full_editor do
38
+ config_accessor :allow_images_in_editors do
39
39
  false
40
40
  end
41
41
 
42
- config_accessor :allow_images_in_small_editor do
42
+ config_accessor :allow_videos_in_editors do
43
43
  false
44
44
  end
45
45
 
@@ -47,28 +47,20 @@ module Decidim
47
47
  false
48
48
  end
49
49
 
50
- config_accessor :use_markdown_editor do
51
- false
52
- end
53
-
54
- config_accessor :allow_images_in_markdown_editor do
55
- false
56
- end
57
-
58
50
  # used to save forms in localstorage
59
51
  config_accessor :auto_save_forms do
60
- false
52
+ true
61
53
  end
62
54
 
63
55
  # Live chat widget linked to Telegram account or group
64
56
  # In the admin side only
65
57
  config_accessor :intergram_for_admins do
66
- false
58
+ true
67
59
  end
68
60
 
69
61
  # In the public side only
70
62
  config_accessor :intergram_for_public do
71
- false
63
+ true
72
64
  end
73
65
 
74
66
  # Configuration options to handle different validations in proposals
@@ -188,6 +180,10 @@ module Decidim
188
180
  []
189
181
  end
190
182
 
183
+ config_accessor :home_content_block_menu do
184
+ []
185
+ end
186
+
191
187
  # Allows admins to assignate "fake" admins scoped to some admin zones using the
192
188
  # same scope editor as :scoped_styles, valid values uses the same convention:
193
189
  # :disabled => false and non available, hidden from admins
@@ -290,6 +286,13 @@ module Decidim
290
286
  [:proposals, :reporting_propposals]
291
287
  end
292
288
 
289
+ # A URL where to obtain the translations for the FormBuilder component
290
+ # you can a custom place if you are worried about the CDN geolocation
291
+ # Download them from https://github.com/kevinchappell/formBuilder-languages
292
+ config_accessor :form_builder_langs_location do
293
+ "https://cdn.jsdelivr.net/npm/formbuilder-languages@1.1.0/"
294
+ end
295
+
293
296
  # Public: Stores an instance of ContentBlockRegistry
294
297
  def self.voting_registry
295
298
  @voting_registry ||= Decidim::ManifestRegistry.new("decidim_awesome/voting")
@@ -310,13 +313,31 @@ module Decidim
310
313
  end
311
314
  end
312
315
 
316
+ # appends to a hash a new value in a specified position so that the hash becomes:
317
+ # { a: 1, b: 2, c: 3 } => append_hash(hash, :b, :d, 4) => { a: 1, b: 2, d: 4, c: 3 }
318
+ # if key is not found then it will be inserted at the end
319
+ def self.hash_append!(hash, after_key, key, value)
320
+ insert_at = hash.to_a.index(hash.assoc(after_key))
321
+ insert_at = insert_at.nil? ? hash.size : insert_at + 1
322
+ hash.replace(hash.to_a.insert(insert_at, [key, value]).to_h)
323
+ end
324
+
325
+ # prepends to a hash a new value in a specified position so that the hash becomes:
326
+ # { a: 1, b: 2, c: 3 } => prepend_hash(hash, :b, :d, 4) => { a: 1, d: 4, b: 2, c: 3 }
327
+ # if key is not found then it will be inserted at the beggining
328
+ def self.hash_prepend!(hash, before_key, key, value)
329
+ insert_at = hash.to_a.index(hash.assoc(before_key))
330
+ insert_at = 0 if insert_at.nil?
331
+ hash.replace(hash.to_a.insert(insert_at, [key, value]).to_h)
332
+ end
333
+
313
334
  def self.collation_for(locale)
314
335
  @collation_for ||= {}
315
- @collation_for[locale] ||= ["#{locale}-x-icu", "#{locale[0..1]}%"].filter_map do |loc|
316
- sql = ApplicationRecord.sanitize_sql(["SELECT collname FROM pg_collation WHERE collname LIKE ? LIMIT 1", loc])
317
- res = ActiveRecord::Base.connection.execute(sql).first
336
+ @collation_for[locale] ||= begin
337
+ res = ActiveRecord::Base.connection.execute(Arel.sql("SELECT collname FROM pg_collation WHERE collname LIKE '#{locale}-x-icu' LIMIT 1")).first
338
+ res ||= ActiveRecord::Base.connection.execute(Arel.sql("SELECT collname FROM pg_collation WHERE collname LIKE '#{locale[0..1]}%' LIMIT 1")).first
318
339
  res["collname"] if res
319
- end.first
340
+ end
320
341
  end
321
342
 
322
343
  def self.enabled?(*config_vars)
@@ -337,17 +358,10 @@ module Decidim
337
358
  registered_components << [manifest, block]
338
359
  end
339
360
 
340
- # appends to a hash a new value in a specified position so that the hash becomes:
341
- # { a: 1, b: 2, c: 3 } => append_hash(hash, :b, :d, 4) => { a: 1, b: 2, d: 4, c: 3 }
342
- # if key is not found then it will be inserted at the end
343
- def self.hash_append!(hash, after_key, key, value)
344
- insert_at = hash.to_a.index(hash.assoc(after_key))
345
- insert_at = insert_at.nil? ? hash.size : insert_at + 1
346
- hash.replace(hash.to_a.insert(insert_at, [key, value]).to_h)
347
- end
348
-
361
+ # version 0.11 is compatible only with decidim 0.28
349
362
  def self.legacy_version?
350
- Decidim.version[0..3] == "0.26"
363
+ # Decidim.version[0..3] == "0.28"
364
+ false
351
365
  end
352
366
  end
353
367
  end
@@ -28,7 +28,7 @@ module Decidim
28
28
  end
29
29
 
30
30
  def show_public_intergram?
31
- return unless awesome_config[:intergram_for_public]
31
+ return false unless awesome_config[:intergram_for_public]
32
32
  return true unless awesome_config[:intergram_for_public_settings][:require_login]
33
33
 
34
34
  user_signed_in?
@@ -1,86 +1,65 @@
1
1
  decidim-admin:
2
2
  /app/views/layouts/decidim/admin/_header.html.erb:
3
- decidim-0.25: 1aff077428830b12306d6c42e6b37216
4
- decidim-0.27.5: ee303c717d9fc8ea77f644b29981b3f4
3
+ decidim-0.28: 25bf272ac5a70eb8a975f4889fa46095
4
+ decidim-0.28.c4d3889: 6391da1f357f9b260622ddd404a47987
5
+ decidim-0.28.1: b2ae319d5bcf43954bbe0edb9a4e3ffb
5
6
  decidim-core:
7
+ /app/packs/entrypoints/decidim_editor.js:
8
+ decidim-0.28: beddd77e3893fd0b7cd2679a7ee6e536
9
+ /app/packs/src/decidim/editor/index.js:
10
+ decidim-0.28: 90dfac3acae97202dec083955e2249e4
6
11
  /app/validators/etiquette_validator.rb:
7
- decidim-0.25: f7a4a652005385a994208f1ab41c4f08
8
- decidim-0.26.4: f1f0fdf15be88f695c8359afab80f73f
12
+ decidim-0.28: e9ad91d824ad48ac2075a088a0d21349
9
13
  /app/views/layouts/decidim/_head.html.erb:
10
- decidim-0.26: 0927fc81123addec70853c2e7986c538
11
- decidim-0.27: c82ac6defe55b6d4f6a54544dbf2ac58
12
- /app/packs/src/decidim/editor.js:
13
- decidim-0.25: 742698903a30034094c01aecaca6de84
14
- decidim-0.26: 651830d87aeeeff39316a787fc70d461
15
- decidim-0.26.4: eac4ea47c09762aa2e56300bf7e98f31
16
- decidim-0.27.3: a9585960d5979aa3adbf5561010513fe
14
+ decidim-0.28: e51e400a98821f4ca0fff26ebd4d0741
15
+ decidim-0.28.1: 8ac1af4e223d9a7a98136760b6194a75
16
+ /app/views/layouts/decidim/_decidim_javascript.html.erb:
17
+ decidim-0.28: dc60ed8abf7649611f18804b67b1408d
17
18
  /app/presenters/decidim/menu_presenter.rb:
18
- decidim-0.25: f3b05daf279f909f8b3b628658dd5810
19
+ decidim-0.28: 220c8865a43bd8b7b12a7f926f7f4324
19
20
  /app/presenters/decidim/menu_item_presenter.rb:
20
- decidim-0.25: 860ffb160ec5f8552cc2855a6a47851b
21
- decidim-0.26.4: d6d0129d81845c61884bcfd07885e911
22
- decidim-0.27: c82bc2ea3c8f792472670d5996613ecf
21
+ decidim-0.28: 4e4cd366a8a313079ac5fab466bd3679
23
22
  /app/helpers/decidim/amendments_helper.rb:
24
- decidim-0.25: 63532a04fcf07cf92b789833a9421416
25
- decidim-0.26: 636943ccb2e994fe0124dc87e72e49e9
23
+ decidim-0.28: df28f9321d1bc07757746ed608274e3d
24
+ /app/presenters/decidim/admin_log/component_presenter.rb:
25
+ decidim-0.28: 77e80d527727acdf117a0c4517a69a7c
26
26
  decidim-proposals:
27
27
  /lib/decidim/proposals/proposal_serializer.rb:
28
- decidim-0.26: 2d817775f79a19cfcf9cfae8e5b68c5a
29
- decidim-0.27.6: 3c2bc99fb00985714c8b55594fa0082e
28
+ decidim-0.28: bbd33bdc60defb734b3fb814666bb622
29
+ decidim-0.28.1: 7bd5cadb1127a4e81bd5f333670351bd
30
+ decidim-0.28.2: ab146c54850a4486d96cf50211679671
30
31
  /lib/decidim/api/proposal_type.rb:
31
32
  decidim-0.26: e38e4875e408ec4f658e28725c5a94d4
32
33
  /app/forms/decidim/proposals/proposal_wizard_create_step_form.rb:
33
- decidim-0.24: db69edd0ba8ffa3965a5c44a6bfaba8d
34
34
  decidim-0.27: b495d37088ecebcbe4ac9563bb3498d5
35
+ /app/forms/decidim/proposals/admin/proposal_form.rb:
36
+ decidim-0.28: 422632395194b19beed4c7c65f127ff5
35
37
  /app/helpers/decidim/proposals/application_helper.rb:
36
- decidim-0.26: 216c974bc425393c18b01bfc4eed4f0b
37
- decidim-0.26.4: 2e673d2aabe66a80a971d7ff80ebdbb8
38
- decidim-0.26.7: ddd9a1f88609c8c7b60c07882d026441
39
- decidim-0.27: c0ebeac39ebe4926bf0e5fc585a384d7
40
- decidim-0.27.1: a4f902d1c4829a7f7f62299686f8604e
41
- decidim-0.27.3: a9c9ed5eedaf7bf80afaf9ff5a89c254
38
+ decidim-0.28: 89df14045349cc2eaaec78f79f6140b1
39
+ decidim-0.28.2: 317b0347528e697fa405a792bcfa3db8
42
40
  /app/controllers/decidim/proposals/proposal_votes_controller.rb:
43
- decidim-0.26: 65ca00fdb4aaf30da37ad75aaf66e70a
44
- decidim-0.27: a1d416491752f4c2fb2668b29ceb8e09
45
- /app/views/decidim/proposals/collaborative_drafts/_edit_form_fields.html.erb:
46
- # this file is not overriden anymore but it needs to be the last version
47
- decidim-0.26: 519a0d34a9ffbd8b9c26d9b68ff4e2a3
48
- decidim-0.27.3: 949b2163c547742549531320bf5e0de1
49
- /app/views/decidim/proposals/collaborative_drafts/show.html.erb:
50
- # this file is not overriden anymore but it needs to be the last version
51
- decidim-0.26: 519a0d34a9ffbd8b9c26d9b68ff4e2a3
52
- decidim-0.27.3: b1ec22d35263a2ac96fe4604c0ceb752
41
+ decidim-0.28: f983e72c1ee8d31222d537533c762cd2
53
42
  /app/views/decidim/proposals/admin/proposals/_form.html.erb:
54
- decidim-0.25: 90a04984d4269398b7cd21aa33763a1f
55
- decidim-0.27: f60168e432e1d419e5aec5d3d1e53f0e
56
- decidim-0.27.6: 05d4ceb99f81a7ad71f2936614d89d23
43
+ decidim-0.28: 824463b320562c15fdb530bfebbf2f0f
57
44
  /app/views/decidim/proposals/proposals/_vote_button.html.erb:
58
- decidim-0.27: f7202c37fe042cd816a6f9fd0f9e6807
45
+ decidim-0.27: 3d087d807238f33b71e6b385db8ffc70
59
46
  /app/views/decidim/proposals/proposals/_votes_count.html.erb:
60
- decidim-0.27: 33339aae5004361e24c4c5b009cc2888
61
- /app/cells/decidim/proposals/proposal_m_cell.rb:
62
- decidim-0.26: 21cc09a45efa20dbcda5c943d820c867
63
- decidim-0.27: 9df97ded3e6594b65b85fcbf1e5b0644
64
- decidim-0.27.4: ce3b30cdddfee547b8fb089c0fddd8a4
65
- /app/cells/decidim/proposals/proposal_m/footer.erb:
66
- decidim-0.26: 7ade5bbd8412f44f1c4ed913ae1834c6
47
+ decidim-0.27: 6e663e5c82c27291b63f29f346df8737
48
+ /app/cells/decidim/proposals/proposal_l_cell.rb:
49
+ decidim-0.27.4: 5e111ed30bca9475bed8247e5e056747
50
+ /app/cells/decidim/proposals/proposal_metadata_cell.rb:
51
+ decidim-0.26: eedfd7f813aedbd819b519e03ae4a680
67
52
  /app/commands/decidim/proposals/create_proposal.rb:
68
- decidim-0.26: 8808a4239d750a86edd6e9c309533788
69
- decidim-0.27: 7a6b8a1ea733e1e331b5251accfc9126
53
+ decidim-0.28: 95c7bba44dbe477abdfbf450b7eee258
70
54
  /app/commands/decidim/proposals/create_collaborative_draft.rb:
71
- decidim-0.26: 4ad30f5a912fa5f76e94f686b7f475c1
72
- decidim-0.27: 2d9a8cef43690e54419f1bd0478fa580
55
+ decidim-0.28: ab3f937f15c6ed945e776fef34b18abf
73
56
  /app/commands/decidim/proposals/admin/create_proposal.rb:
74
- decidim-0.26: e057ebfc83bb8fa4dbfeea4058776f43
75
- decidim-0.27: 40db71d026e1f8e8086aa149bdd97106
57
+ decidim-0.28: aa0c093cb10b3ccfb046edd0018eae1d
76
58
  /app/commands/decidim/proposals/update_proposal.rb:
77
- decidim-0.26: 28ebdc4efcb2c9eab307d3bf9f4a7ef7
78
- decidim-0.27: 5e2f8ef1bfa4edd8fb5479c15c5f06de
59
+ decidim-0.28: 1cc15b946512f4d5a54d1cf5aea8450a
79
60
  /app/commands/decidim/proposals/update_collaborative_draft.rb:
80
- decidim-0.26: df8d09786857b31942c1e1bcb0290551
81
- decidim-0.27: 2ddf7f98cb085cb4565ec6ac257ca8c9
61
+ decidim-0.28: 7df5266382bd57db72832da391fe7e11
82
62
  /app/commands/decidim/proposals/admin/update_proposal.rb:
83
- decidim-0.26: 82478685f772c818d7300551891dc717
84
- decidim-0.27: aacc7c104abe2bbd2f09c0dfe4f74e0c
63
+ decidim-0.28: 67b691b6d1ce61cb198592ac25f76f74
85
64
  /app/presenters/decidim/proposals/proposal_presenter.rb:
86
- decidim-0.27: 105b7266bcdd8b947ababbb7ebb78789
65
+ decidim-0.28: 72910541010305f25baf297f4a58497b
@@ -71,7 +71,7 @@ module Decidim
71
71
  def setting_for(var)
72
72
  @vars.find_or_initialize_by(
73
73
  organization: @organization,
74
- var: var
74
+ var:
75
75
  )
76
76
  end
77
77
 
@@ -40,7 +40,7 @@ module Decidim
40
40
 
41
41
  def parse_xml(xml)
42
42
  @xml = xml
43
- @data = Nokogiri.XML(xml).xpath("//dl/dd")
43
+ @data = Nokogiri.XML(@xml).xpath("//dl/dd")
44
44
  return if @data.present?
45
45
 
46
46
  apply_to_first_textarea
@@ -62,7 +62,7 @@ module Decidim
62
62
  # Finds the first textarea and applies non-xml compatible content
63
63
  # when textarea has not wysiwyg assigned, strips html
64
64
  def apply_to_first_textarea
65
- # quill editor might leave html traces without any user content
65
+ # HTML editors might leave html traces without any user content
66
66
  # so we won't process it if there is no text (html free) result
67
67
  text = Nokogiri.HTML(xml).html? ? Nokogiri.HTML(xml).text.strip : text.strip
68
68
  return if text.blank?
@@ -87,12 +87,12 @@ module Decidim
87
87
  @fields
88
88
  end
89
89
 
90
- def deep_transform_values!(object, &block)
90
+ def deep_transform_values!(object, &)
91
91
  case object
92
92
  when Hash
93
- object.transform_values! { |value| deep_transform_values!(value, &block) }
93
+ object.transform_values! { |value| deep_transform_values!(value, &) }
94
94
  when Array
95
- object.map! { |e| deep_transform_values!(e, &block) }
95
+ object.map! { |e| deep_transform_values!(e, &) }
96
96
  else
97
97
  yield(object)
98
98
  end
@@ -76,16 +76,18 @@ module Decidim
76
76
  # add vote weight to proposal vote
77
77
  Decidim::Proposals::ProposalVote.include(Decidim::DecidimAwesome::HasVoteWeight)
78
78
  Decidim::Proposals::ProposalType.include(Decidim::DecidimAwesome::AddProposalTypeVoteWeights)
79
- Decidim::Proposals::ProposalMCell.include(Decidim::DecidimAwesome::ProposalMCellOverride)
79
+ Decidim::Proposals::ProposalLCell.include(Decidim::DecidimAwesome::ProposalLCellOverride)
80
80
  end
81
81
 
82
82
  # override user's admin property
83
83
  Decidim::User.include(Decidim::DecidimAwesome::UserOverride) if DecidimAwesome.enabled?(:scoped_admins)
84
84
 
85
85
  if DecidimAwesome.enabled?(:menu, :content_block_main_menu)
86
- # Decidim::ContentBlocks::GlobalMenuCell.include(Decidim::DecidimAwesome::GlobalMenuCellOverride)
86
+ Decidim::ContentBlocks::GlobalMenuCell.include(Decidim::DecidimAwesome::GlobalMenuCellOverride)
87
+ Decidim::BreadcrumbHelper.include(Decidim::DecidimAwesome::BreadcrumbHelperOverride)
87
88
  Decidim::MenuPresenter.include(Decidim::DecidimAwesome::MenuPresenterOverride)
88
89
  Decidim::MenuItemPresenter.include(Decidim::DecidimAwesome::MenuItemPresenterOverride)
90
+ Decidim::BreadcrumbRootMenuItemPresenter.include(Decidim::DecidimAwesome::BreadcrumbRootMenuItemPresenterOverride)
89
91
  end
90
92
 
91
93
  # Late registering of components to take into account initializer values
@@ -99,6 +101,10 @@ module Decidim
99
101
 
100
102
  initializer "decidim_decidim_awesome.overrides", after: "decidim.action_controller" do
101
103
  config.to_prepare do
104
+ # Auto-insert some csp directives
105
+ Decidim::ApplicationController.include(Decidim::DecidimAwesome::ContentSecurityPolicy)
106
+ Decidim::Admin::ApplicationController.include(Decidim::DecidimAwesome::ContentSecurityPolicy)
107
+
102
108
  # redirect unauthorized scoped admins to allowed places or custom redirects if configured
103
109
  Decidim::ErrorsController.include(Decidim::DecidimAwesome::NotFoundRedirect) if DecidimAwesome.enabled?(:scoped_admins, :custom_redirects)
104
110
 
@@ -172,7 +178,7 @@ module Decidim
172
178
  .where(component: component_instance)
173
179
  .includes(:scope, :category, :component)
174
180
 
175
- if space.user_roles(:valuator).where(user: user).any?
181
+ if space.user_roles(:valuator).where(user:).any?
176
182
  collection.with_valuation_assigned_to(user, space)
177
183
  else
178
184
  collection
@@ -191,9 +197,9 @@ module Decidim
191
197
  # register available processors
192
198
  Decidim::DecidimAwesome.voting_registry.register(:voting_cards) do |voting|
193
199
  voting.show_vote_button_view = "decidim/decidim_awesome/voting/voting_cards/show_vote_button"
194
- voting.show_votes_count_view = "decidim/decidim_awesome/voting/voting_cards/show_votes_count"
195
- voting.show_votes_count_view = "" # hide votes count if needed
196
- voting.proposal_m_cell_footer = "decidim/decidim_awesome/voting/voting_cards/proposal_m_cell_footer"
200
+ # voting.show_votes_count_view = "decidim/decidim_awesome/voting/voting_cards/show_votes_count"
201
+ voting.show_votes_count_view = "" # hide votes count if not needed (in this case is integrated in the show_vote_button_view)
202
+ voting.proposal_metadata_cell = "decidim/decidim_awesome/voting/proposal_metadata"
197
203
  voting.weight_validator do |weight, context|
198
204
  allowed = [1, 2, 3]
199
205
  allowed << 0 if context[:proposal]&.component&.settings&.voting_cards_show_abstain
@@ -257,6 +263,18 @@ module Decidim
257
263
  Cell::ViewModel.view_paths << File.expand_path("#{Decidim::DecidimAwesome::Engine.root}/app/cells")
258
264
  Cell::ViewModel.view_paths << File.expand_path("#{Decidim::DecidimAwesome::Engine.root}/app/views")
259
265
  end
266
+
267
+ initializer "decidim_decidim_awesome.register_icons" do
268
+ Decidim.icons.register(name: "editors-text", icon: "text", category: "system", description: "", engine: :decidim_awesome)
269
+ Decidim.icons.register(name: "surveys", icon: "survey-line", category: "system", description: "", engine: :decidim_awesome)
270
+ Decidim.icons.register(name: "brush", icon: "brush-line", category: "system", description: "", engine: :decidim_awesome)
271
+ Decidim.icons.register(name: "layers", icon: "stack-line", category: "system", description: "", engine: :decidim_awesome)
272
+ Decidim.icons.register(name: "pulse", icon: "pulse-line", category: "system", description: "", engine: :decidim_awesome)
273
+ Decidim.icons.register(name: "fire", icon: "fire-line", category: "system", description: "", engine: :decidim_awesome)
274
+ Decidim.icons.register(name: "line-chart-line", icon: "line-chart-line", category: "system", description: "", engine: :decidim_awesome)
275
+ Decidim.icons.register(name: "spy", icon: "spy-fill", category: "system", description: "", engine: :decidim_awesome)
276
+ Decidim.icons.register(name: "forbid-line", icon: "forbid-line", category: "system", description: "", engine: :decidim_awesome)
277
+ end
260
278
  end
261
279
  end
262
280
  end
@@ -17,7 +17,6 @@ Decidim::DecidimAwesome.register_component(:awesome_iframe) do |component|
17
17
  settings.attribute :announcement, type: :text, translated: true, editor: true
18
18
  settings.attribute :iframe, type: :text, default: ""
19
19
  settings.attribute :viewport_width, type: :boolean, default: false
20
- settings.attribute :no_margins, type: :boolean, default: false
21
20
  end
22
21
 
23
22
  component.settings(:step) do |settings|
@@ -41,7 +40,7 @@ Decidim::DecidimAwesome.register_component(:awesome_iframe) do |component|
41
40
  name: Decidim::Components::Namer.new(participatory_space.organization.available_locales, :awesome_iframe).i18n_name,
42
41
  manifest_name: :awesome_iframe,
43
42
  published_at: Time.current,
44
- participatory_space: participatory_space,
43
+ participatory_space:,
45
44
  settings: {
46
45
  announcement: { en: Faker::Lorem.paragraphs(number: 2).join("\n") },
47
46
  iframe: '<iframe src="https://picsum.photos/800/600" width="100%" height="700" frameborder="0"></iframe>'
@@ -15,7 +15,7 @@ module Decidim
15
15
  if config
16
16
  config.update!(updated_at: Time.current)
17
17
  else
18
- AwesomeConfig.create!(var: var, organization: organization)
18
+ AwesomeConfig.create!(var:, organization:)
19
19
  end
20
20
  end
21
21
 
@@ -34,7 +34,7 @@ module Decidim
34
34
  end
35
35
 
36
36
  def config
37
- AwesomeConfig.find_by(var: var, organization: organization)
37
+ AwesomeConfig.find_by(var:, organization:)
38
38
  end
39
39
 
40
40
  private
@@ -52,7 +52,7 @@ Decidim::DecidimAwesome.register_component(:awesome_map) do |component|
52
52
  name: Decidim::Components::Namer.new(participatory_space.organization.available_locales, :awesome_map).i18n_name,
53
53
  manifest_name: :awesome_map,
54
54
  published_at: Time.current,
55
- participatory_space: participatory_space,
55
+ participatory_space:,
56
56
  settings: {
57
57
  announcement: { en: Faker::Lorem.paragraphs(number: 2).join("\n") }
58
58
  }
@@ -10,21 +10,21 @@ module Decidim
10
10
  I18n.t("menu.editors", scope: "decidim.decidim_awesome.admin"),
11
11
  decidim_admin_decidim_awesome.config_path(:editors),
12
12
  position: 1,
13
- icon_name: "text",
13
+ icon_name: "editors-text",
14
14
  if: menus[:editors]
15
15
 
16
16
  menu.add_item :proposals,
17
17
  I18n.t("menu.proposals", scope: "decidim.decidim_awesome.admin"),
18
18
  decidim_admin_decidim_awesome.config_path(:proposals),
19
19
  position: 2,
20
- icon_name: "document",
20
+ icon_name: "documents",
21
21
  if: menus[:proposals]
22
22
 
23
23
  menu.add_item :surveys,
24
24
  I18n.t("menu.surveys", scope: "decidim.decidim_awesome.admin"),
25
25
  decidim_admin_decidim_awesome.config_path(:surveys),
26
26
  position: 3,
27
- icon_name: "spreadsheet",
27
+ icon_name: "surveys",
28
28
  if: menus[:surveys]
29
29
 
30
30
  menu.add_item :styles,
@@ -46,35 +46,36 @@ module Decidim
46
46
  I18n.t("menu.admins", scope: "decidim.decidim_awesome.admin"),
47
47
  decidim_admin_decidim_awesome.config_path(:admins),
48
48
  position: 6,
49
- icon_name: "people",
49
+ icon_name: "group-line",
50
50
  if: menus[:admins]
51
51
 
52
52
  menu.add_item :menu_hacks,
53
53
  I18n.t("menu.menu_hacks", scope: "decidim.decidim_awesome.admin"),
54
- decidim_admin_decidim_awesome.menu_hacks_path,
54
+ decidim_admin_decidim_awesome.menu_hacks_path(menus[:menu_hacks_menu] ? :menu : :home_content_block_menu),
55
55
  position: 7,
56
- icon_name: "menu",
57
- if: menus[:menu_hacks]
56
+ icon_name: "menu-line",
57
+ if: menus[:menu_hacks],
58
+ submenu: { target_menu: :menu_hacks_submenu }
58
59
 
59
60
  menu.add_item :custom_redirects,
60
61
  I18n.t("menu.custom_redirects", scope: "decidim.decidim_awesome.admin"),
61
62
  decidim_admin_decidim_awesome.custom_redirects_path,
62
63
  position: 8,
63
- icon_name: "share-boxed",
64
+ icon_name: "external-link-line",
64
65
  if: menus[:custom_redirects]
65
66
 
66
67
  menu.add_item :livechat,
67
68
  I18n.t("menu.livechat", scope: "decidim.decidim_awesome.admin"),
68
69
  decidim_admin_decidim_awesome.config_path(:livechat),
69
70
  position: 9,
70
- icon_name: "chat",
71
+ icon_name: "chat-1-line",
71
72
  if: menus[:livechat]
72
73
 
73
74
  menu.add_item :maintenance,
74
75
  I18n.t("maintenance", scope: "decidim.decidim_awesome.admin.menu.maintenance"),
75
76
  decidim_admin_decidim_awesome.maintenance_path(:private_data),
76
77
  position: 10,
77
- icon_name: "pulse",
78
+ icon_name: "tools-line",
78
79
  submenu: { target_menu: :maintenance_submenu }
79
80
  end
80
81
  end
@@ -85,25 +86,43 @@ module Decidim
85
86
  I18n.t("menu.title", scope: "decidim.decidim_awesome.admin.proposal_custom_fields"),
86
87
  decidim_admin_decidim_awesome.config_path(:proposal_custom_fields),
87
88
  position: 5.1,
88
- icon_name: "lock-unlocked",
89
+ icon_name: "draft-line",
89
90
  if: menus[:proposal_custom_fields]
90
91
 
91
92
  menu.add_item :proposal_private_custom_fields,
92
93
  I18n.t("proposal_private_custom_fields", scope: "decidim.decidim_awesome.admin.proposal_custom_fields"),
93
94
  decidim_admin_decidim_awesome.config_path(:proposal_private_custom_fields),
94
95
  position: 5.2,
95
- icon_name: "lock-locked",
96
+ icon_name: "spy",
96
97
  if: menus[:proposal_private_custom_fields]
97
98
  end
98
99
  end
99
100
 
101
+ def register_menu_hacks_submenu!
102
+ Decidim.menu :menu_hacks_submenu do |menu|
103
+ menu.add_item :main_menu,
104
+ I18n.t("menu.title", scope: "decidim.decidim_awesome.admin.menu_hacks.index"),
105
+ decidim_admin_decidim_awesome.menu_hacks_path(:menu),
106
+ position: 7.1,
107
+ icon_name: "global-line",
108
+ if: menus[:menu_hacks_menu]
109
+
110
+ menu.add_item :content_block_main_menu,
111
+ I18n.t("home_content_block_menu.title", scope: "decidim.decidim_awesome.admin.menu_hacks.index"),
112
+ decidim_admin_decidim_awesome.menu_hacks_path(:home_content_block_menu),
113
+ position: 7.2,
114
+ icon_name: "layout-masonry-line",
115
+ if: menus[:menu_hacks_home_content_block_menu]
116
+ end
117
+ end
118
+
100
119
  def register_maintenance_admin_menu!
101
120
  Decidim.menu :maintenance_submenu do |menu|
102
121
  menu.add_item :private_data,
103
122
  I18n.t("private_data", scope: "decidim.decidim_awesome.admin.menu.maintenance"),
104
123
  decidim_admin_decidim_awesome.maintenance_path(:private_data),
105
124
  position: 10,
106
- icon_name: "lock-locked"
125
+ icon_name: "spy-line"
107
126
 
108
127
  menu.add_item :checks,
109
128
  I18n.t("checks", scope: "decidim.decidim_awesome.admin.menu.maintenance"),
@@ -115,7 +134,7 @@ module Decidim
115
134
 
116
135
  def menus
117
136
  @menus ||= {
118
- editors: config_enabled?(:allow_images_in_full_editor, :allow_images_in_small_editor, :allow_videos_in_editors),
137
+ editors: config_enabled?(:allow_images_in_editors, :allow_videos_in_editors),
119
138
  proposals: config_enabled?(
120
139
  :allow_images_in_proposals,
121
140
  :validate_title_min_length, :validate_title_max_caps_percent,