decidim-decidim_awesome 0.10.2 → 0.11.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (265) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +34 -0
  3. data/README.md +177 -60
  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 +24 -0
  6. data/app/cells/decidim/decidim_awesome/content_blocks/map/show.erb +5 -12
  7. data/app/cells/decidim/decidim_awesome/content_blocks/map_cell.rb +9 -5
  8. data/app/cells/decidim/decidim_awesome/voting/proposal_metadata_cell.rb +54 -0
  9. data/app/cells/decidim/decidim_awesome/voting/voting_cards_proposal/modal.erb +18 -0
  10. data/app/cells/decidim/decidim_awesome/voting/voting_cards_proposal/show.erb +37 -32
  11. data/app/cells/decidim/decidim_awesome/voting/voting_cards_proposal_cell.rb +9 -4
  12. data/app/commands/concerns/decidim/decidim_awesome/admin/needs_constraint_helpers.rb +2 -2
  13. data/app/commands/concerns/decidim/decidim_awesome/proposals/admin/update_proposal_override.rb +31 -0
  14. data/app/commands/concerns/decidim/decidim_awesome/proposals/create_collaborative_draft_override.rb +27 -0
  15. data/app/commands/concerns/decidim/decidim_awesome/proposals/create_proposal_override.rb +27 -0
  16. data/app/commands/concerns/decidim/decidim_awesome/proposals/update_collaborative_draft_override.rb +27 -0
  17. data/app/commands/concerns/decidim/decidim_awesome/proposals/update_proposal_override.rb +26 -0
  18. data/app/commands/decidim/decidim_awesome/admin/create_constraint.rb +1 -1
  19. data/app/commands/decidim/decidim_awesome/admin/create_proposal_custom_field.rb +4 -3
  20. data/app/commands/decidim/decidim_awesome/admin/destroy_custom_redirect.rb +1 -1
  21. data/app/commands/decidim/decidim_awesome/admin/destroy_menu_hack.rb +1 -1
  22. data/app/commands/decidim/decidim_awesome/admin/destroy_proposal_custom_field.rb +6 -3
  23. data/app/commands/decidim/decidim_awesome/admin/rename_scope_label.rb +1 -1
  24. data/app/commands/decidim/decidim_awesome/admin/update_constraint.rb +1 -1
  25. data/app/commands/decidim/decidim_awesome/admin/update_custom_redirect.rb +2 -2
  26. data/app/commands/decidim/decidim_awesome/command.rb +1 -7
  27. data/app/controllers/concerns/decidim/decidim_awesome/admin/maintenance_context.rb +43 -0
  28. data/app/controllers/concerns/decidim/decidim_awesome/admin_accountability/admin/filterable_helper.rb +4 -3
  29. data/app/controllers/concerns/decidim/decidim_awesome/content_security_policy.rb +34 -0
  30. data/app/controllers/concerns/decidim/decidim_awesome/limit_pending_amendments.rb +35 -0
  31. data/app/controllers/concerns/decidim/decidim_awesome/not_found_redirect.rb +1 -1
  32. data/app/controllers/concerns/decidim/decidim_awesome/proposals/orderable_override.rb +9 -22
  33. data/app/controllers/concerns/decidim/decidim_awesome/proposals/proposal_votes_controller_override.rb +3 -3
  34. data/app/controllers/decidim/decidim_awesome/admin/admin_accountability_controller.rb +7 -7
  35. data/app/controllers/decidim/decidim_awesome/admin/application_controller.rb +2 -0
  36. data/app/controllers/decidim/decidim_awesome/admin/checks_controller.rb +14 -10
  37. data/app/controllers/decidim/decidim_awesome/admin/config_controller.rb +10 -9
  38. data/app/controllers/decidim/decidim_awesome/admin/constraints_controller.rb +23 -20
  39. data/app/controllers/decidim/decidim_awesome/admin/custom_redirects_controller.rb +6 -10
  40. data/app/controllers/decidim/decidim_awesome/admin/maintenance_controller.rb +76 -0
  41. data/app/controllers/decidim/decidim_awesome/admin/menu_hacks_controller.rb +6 -10
  42. data/app/controllers/decidim/decidim_awesome/admin/proposal_custom_fields_controller.rb +14 -6
  43. data/app/controllers/decidim/decidim_awesome/admin/scoped_admins_controller.rb +2 -2
  44. data/app/controllers/decidim/decidim_awesome/admin/scoped_styles_controller.rb +2 -2
  45. data/app/controllers/decidim/decidim_awesome/blank_component_controller.rb +8 -3
  46. data/app/controllers/decidim/decidim_awesome/editor_images_controller.rb +3 -3
  47. data/app/controllers/decidim/decidim_awesome/iframe_component/iframe_controller.rb +18 -5
  48. data/app/forms/concerns/decidim/decidim_awesome/proposals/proposal_form_override.rb +21 -0
  49. data/app/forms/{decidim → concerns/decidim}/decidim_awesome/proposals/proposal_wizard_create_step_form_override.rb +2 -1
  50. data/app/forms/decidim/decidim_awesome/admin/config_form.rb +28 -14
  51. data/app/forms/decidim/decidim_awesome/admin/custom_redirect_form.rb +2 -2
  52. data/app/forms/decidim/decidim_awesome/admin/intergram_form.rb +4 -0
  53. data/app/forms/decidim/decidim_awesome/admin/menu_form.rb +4 -4
  54. data/app/helpers/concerns/decidim/decidim_awesome/amendments_helper_override.rb +65 -0
  55. data/app/helpers/concerns/decidim/decidim_awesome/breadcrumb_helper_override.rb +23 -0
  56. data/app/helpers/concerns/decidim/decidim_awesome/proposals/application_helper_override.rb +110 -0
  57. data/app/helpers/decidim/decidim_awesome/admin/config_constraints_helpers.rb +6 -27
  58. data/app/helpers/decidim/decidim_awesome/map_helper.rb +8 -27
  59. data/app/jobs/decidim/decidim_awesome/destroy_private_data_job.rb +22 -0
  60. data/app/jobs/decidim/decidim_awesome/migrate_legacy_images_job.rb +5 -4
  61. data/app/middleware/decidim/decidim_awesome/current_config.rb +3 -5
  62. data/app/models/concerns/decidim/decidim_awesome/has_proposal_extra_fields.rb +39 -10
  63. data/app/models/decidim/decidim_awesome/awesome_config.rb +1 -1
  64. data/app/models/decidim/decidim_awesome/paper_trail_version.rb +8 -4
  65. data/app/models/decidim/decidim_awesome/proposal_extra_field.rb +35 -1
  66. data/app/models/decidim/decidim_awesome/vote_weight.rb +2 -2
  67. data/app/overrides/decidim/proposals/admin/proposals/show/add_private_body.html.erb.deface +7 -0
  68. data/app/overrides/decidim/proposals/admin/proposals/show/replace_body.html.erb.deface +5 -0
  69. data/app/overrides/decidim/proposals/proposals/_proposal_aside/limit_amendments_modal.html.erb.deface +5 -0
  70. data/app/overrides/decidim/proposals/proposals/_vote_button/replace_vote_button.html.erb.deface +1 -1
  71. data/app/overrides/layouts/decidim/_decidim_javascript/add_awesome_tags.html.erb.deface +6 -0
  72. data/app/overrides/layouts/decidim/_head/add_awesome_tags.html.erb.deface +4 -11
  73. data/app/overrides/layouts/decidim/admin/_header/{replace_scripts.html.erb.deface → add_awesome_tags.html.erb.deface} +4 -4
  74. data/app/packs/entrypoints/decidim_admin_decidim_awesome.js +1 -2
  75. data/app/packs/entrypoints/decidim_admin_decidim_awesome_global.js +4 -0
  76. data/app/packs/entrypoints/decidim_admin_decidim_awesome_global.scss +1 -0
  77. data/app/packs/entrypoints/decidim_decidim_awesome.js +2 -2
  78. data/app/packs/entrypoints/decidim_decidim_awesome_map.scss +1 -1
  79. data/app/packs/entrypoints/decidim_editor.js +14 -0
  80. data/app/packs/src/decidim/decidim_awesome/admin/auto_edit.js +96 -69
  81. data/app/packs/src/decidim/decidim_awesome/admin/check_redirections.js +46 -41
  82. data/app/packs/src/decidim/decidim_awesome/admin/codemirror.js +3 -3
  83. data/app/packs/src/decidim/decidim_awesome/admin/constraint_form_events.js +115 -0
  84. data/app/packs/src/decidim/decidim_awesome/admin/custom_fields_builder.js +9 -5
  85. data/app/packs/src/decidim/decidim_awesome/admin/form_exit_warn.js +22 -11
  86. data/app/packs/src/decidim/decidim_awesome/admin/proposal_sortings.js +26 -8
  87. data/app/packs/src/decidim/decidim_awesome/admin/tabs_change.js +31 -0
  88. data/app/packs/src/decidim/decidim_awesome/admin/user_picker.js +34 -21
  89. data/app/packs/src/decidim/decidim_awesome/amendments/show_modal_on_limits.js +28 -0
  90. data/app/packs/src/decidim/decidim_awesome/awesome_admin.js +5 -16
  91. data/app/packs/src/decidim/decidim_awesome/awesome_admin_global.js +1 -0
  92. data/app/packs/src/decidim/decidim_awesome/awesome_application.js +1 -15
  93. data/app/packs/src/decidim/decidim_awesome/awesome_map/api/fetcher.js +33 -11
  94. data/app/packs/src/decidim/decidim_awesome/awesome_map/api/meetings_fetcher.js +9 -12
  95. data/app/packs/src/decidim/decidim_awesome/awesome_map/api/proposals_fetcher.js +28 -0
  96. data/app/packs/src/decidim/decidim_awesome/awesome_map/awesome_map.js +3 -4
  97. data/app/packs/src/decidim/decidim_awesome/awesome_map/controllers/controller.js +12 -12
  98. data/app/packs/src/decidim/decidim_awesome/awesome_map/controllers/meetings_controller.js +11 -7
  99. data/app/packs/src/decidim/decidim_awesome/awesome_map/controllers/proposals_controller.js +6 -13
  100. data/app/packs/src/decidim/decidim_awesome/awesome_map/controls_ui.js +51 -20
  101. data/app/packs/src/decidim/decidim_awesome/awesome_map/load_map.js +27 -18
  102. data/app/packs/src/decidim/decidim_awesome/editor/index.js +94 -0
  103. data/app/packs/src/decidim/decidim_awesome/forms/autosave.js +28 -23
  104. data/app/packs/src/decidim/decidim_awesome/forms/custom_fields_renderer.js +29 -25
  105. data/app/packs/src/decidim/decidim_awesome/forms/rich_text_plugin.js +27 -32
  106. data/app/packs/src/decidim/decidim_awesome/proposals/custom_fields.js +31 -15
  107. data/app/packs/src/decidim/decidim_awesome/proposals/images.js +16 -10
  108. data/app/packs/src/decidim/decidim_awesome/voting/voting_cards.js +47 -38
  109. data/app/packs/stylesheets/decidim/decidim_awesome/admin/auto_edits.scss +11 -12
  110. data/app/packs/stylesheets/decidim/decidim_awesome/admin/check_redirections.scss +15 -0
  111. data/app/packs/stylesheets/decidim/decidim_awesome/admin/codemirror.scss +24 -12
  112. data/app/packs/stylesheets/decidim/decidim_awesome/admin/constraints.scss +49 -29
  113. data/app/packs/stylesheets/decidim/decidim_awesome/admin/custom_fields.scss +28 -71
  114. data/app/packs/stylesheets/decidim/decidim_awesome/admin/custom_styles.scss +48 -0
  115. data/app/packs/stylesheets/decidim/decidim_awesome/admin/intergram_fixes.scss +11 -0
  116. data/app/packs/stylesheets/decidim/decidim_awesome/admin/user_picker.scss +17 -26
  117. data/app/packs/stylesheets/decidim/decidim_awesome/amendments/modal.scss +5 -0
  118. data/app/packs/stylesheets/decidim/decidim_awesome/awesome_admin.scss +11 -49
  119. data/app/packs/stylesheets/decidim/decidim_awesome/awesome_admin_global.scss +19 -0
  120. data/app/packs/stylesheets/decidim/decidim_awesome/awesome_application.scss +4 -19
  121. data/app/packs/stylesheets/decidim/decidim_awesome/awesome_iframe/iframe.scss +1 -1
  122. data/app/packs/stylesheets/decidim/decidim_awesome/awesome_map/map.scss +41 -35
  123. data/app/packs/stylesheets/decidim/decidim_awesome/forms/autosave.scss +6 -6
  124. data/app/packs/stylesheets/decidim/decidim_awesome/forms/custom_fields.scss +118 -0
  125. data/app/packs/stylesheets/decidim/decidim_awesome/shared/spinner.scss +26 -0
  126. data/app/packs/stylesheets/decidim/decidim_awesome/voting/voting_cards.scss +41 -59
  127. data/app/permissions/decidim/decidim_awesome/admin/permissions.rb +14 -3
  128. data/app/permissions/decidim/decidim_awesome/permissions.rb +3 -4
  129. data/app/presenters/concerns/decidim/decidim_awesome/breadcrumb_root_menu_item_presenter_override.rb +23 -0
  130. data/app/presenters/{decidim → concerns/decidim}/decidim_awesome/menu_item_presenter_override.rb +10 -2
  131. data/app/presenters/{decidim → concerns/decidim}/decidim_awesome/menu_presenter_override.rb +8 -0
  132. data/app/presenters/concerns/decidim/decidim_awesome/proposals/proposal_presenter_override.rb +20 -0
  133. data/app/presenters/decidim/decidim_awesome/admin_log/component_presenter_override.rb +30 -0
  134. data/app/presenters/decidim/decidim_awesome/participatory_space_role_presenter.rb +1 -1
  135. data/app/presenters/decidim/decidim_awesome/private_data_presenter.rb +70 -0
  136. data/app/presenters/decidim/decidim_awesome/user_entity_presenter.rb +1 -1
  137. data/app/queries/decidim/decidim_awesome/private_data_finder.rb +19 -0
  138. data/app/serializers/concerns/decidim/decidim_awesome/proposals/proposal_serializer_methods.rb +72 -0
  139. data/app/serializers/concerns/decidim/decidim_awesome/proposals/proposal_serializer_override.rb +38 -0
  140. data/app/serializers/decidim/decidim_awesome/proposals/private_proposal_serializer.rb +34 -0
  141. data/app/types/concerns/decidim/decidim_awesome/add_proposal_type_custom_fields.rb +59 -0
  142. data/app/types/concerns/decidim/decidim_awesome/{proposal_type_override.rb → add_proposal_type_vote_weights.rb} +3 -1
  143. data/app/views/decidim/decidim_awesome/admin/admin_accountability/index.html.erb +23 -17
  144. data/app/views/decidim/decidim_awesome/admin/checks/index.html.erb +50 -48
  145. data/app/views/decidim/decidim_awesome/admin/config/_autoedit_box_label.html.erb +7 -2
  146. data/app/views/decidim/decidim_awesome/admin/config/_constraints.html.erb +25 -18
  147. data/app/views/decidim/decidim_awesome/admin/config/_form_admins.html.erb +7 -6
  148. data/app/views/decidim/decidim_awesome/admin/config/_form_editors.html.erb +12 -16
  149. data/app/views/decidim/decidim_awesome/admin/config/_form_livechat.html.erb +39 -23
  150. data/app/views/decidim/decidim_awesome/admin/config/_form_proposal_custom_fields.html.erb +35 -17
  151. data/app/views/decidim/decidim_awesome/admin/config/_form_proposal_private_custom_fields.html.erb +1 -0
  152. data/app/views/decidim/decidim_awesome/admin/config/_form_proposals.html.erb +68 -80
  153. data/app/views/decidim/decidim_awesome/admin/config/_form_styles.html.erb +16 -12
  154. data/app/views/decidim/decidim_awesome/admin/config/_form_surveys.html.erb +8 -6
  155. data/app/views/decidim/decidim_awesome/admin/config/show.html.erb +22 -12
  156. data/app/views/decidim/decidim_awesome/admin/constraints/_form.html.erb +1 -49
  157. data/app/views/decidim/decidim_awesome/admin/constraints/new.html.erb +14 -9
  158. data/app/views/decidim/decidim_awesome/admin/constraints/show.html.erb +14 -9
  159. data/app/views/decidim/decidim_awesome/admin/custom_redirects/_form.html.erb +20 -5
  160. data/app/views/decidim/decidim_awesome/admin/custom_redirects/edit.html.erb +5 -5
  161. data/app/views/decidim/decidim_awesome/admin/custom_redirects/index.html.erb +14 -13
  162. data/app/views/decidim/decidim_awesome/admin/custom_redirects/new.html.erb +5 -5
  163. data/app/views/decidim/decidim_awesome/admin/maintenance/_private_data.html.erb +44 -0
  164. data/app/views/decidim/decidim_awesome/admin/maintenance/show.html.erb +44 -0
  165. data/app/views/decidim/decidim_awesome/admin/menu_hacks/_form.html.erb +6 -6
  166. data/app/views/decidim/decidim_awesome/admin/menu_hacks/edit.html.erb +21 -12
  167. data/app/views/decidim/decidim_awesome/admin/menu_hacks/index.html.erb +39 -42
  168. data/app/views/decidim/decidim_awesome/admin/menu_hacks/new.html.erb +21 -12
  169. data/app/views/decidim/decidim_awesome/admin/proposals/_editor.html.erb +8 -5
  170. data/app/views/decidim/decidim_awesome/admin/proposals/_private_body.html.erb +20 -0
  171. data/app/views/decidim/decidim_awesome/admin/shared/_filters_with_date.html.erb +14 -18
  172. data/app/views/decidim/decidim_awesome/amendments/_modal.html.erb +23 -0
  173. data/app/views/decidim/decidim_awesome/custom_fields/_form_render.html.erb +8 -2
  174. data/app/views/decidim/decidim_awesome/iframe_component/iframe/show.html.erb +7 -12
  175. data/app/views/decidim/decidim_awesome/map_component/map/_map_template.html.erb +53 -37
  176. data/app/views/decidim/decidim_awesome/map_component/map/show.html.erb +14 -5
  177. data/app/views/decidim/decidim_awesome/voting/voting_cards/_show_vote_button.html.erb +0 -3
  178. data/app/views/layouts/decidim/decidim_awesome/_awesome_config.html.erb +9 -7
  179. data/app/views/layouts/decidim/decidim_awesome/_intergram_widget.html.erb +9 -6
  180. data/app/views/layouts/decidim/decidim_awesome/admin/_base.html.erb +12 -0
  181. data/app/views/layouts/decidim/decidim_awesome/admin/application.html.erb +1 -73
  182. data/app/views/layouts/decidim/decidim_awesome/admin/maintenance.html.erb +19 -0
  183. data/config/assets.rb +3 -33
  184. data/config/i18n-tasks.yml +23 -3
  185. data/config/locales/ca.yml +110 -23
  186. data/config/locales/cs.yml +121 -19
  187. data/config/locales/de.yml +61 -20
  188. data/config/locales/en.yml +125 -35
  189. data/config/locales/es.yml +109 -22
  190. data/config/locales/eu.yml +22 -5
  191. data/config/locales/fr.yml +107 -20
  192. data/config/locales/hu.yml +53 -12
  193. data/config/locales/it.yml +22 -20
  194. data/config/locales/ja.yml +107 -20
  195. data/config/locales/lt.yml +0 -8
  196. data/config/locales/nl.yml +16 -17
  197. data/config/locales/pt-BR.yml +23 -20
  198. data/config/locales/pt-PT.yml +0 -1
  199. data/config/locales/ro-RO.yml +11 -7
  200. data/config/locales/sv.yml +24 -13
  201. data/config/rubocop/disabled.yml +11 -0
  202. data/config/rubocop/faker.yml +480 -0
  203. data/config/rubocop/rails.yml +88 -0
  204. data/config/rubocop/rspec.yml +65 -0
  205. data/config/rubocop/ruby.yml +1210 -0
  206. data/db/migrate/20240306175331_rename_editor_images_awesome_config.rb +18 -0
  207. data/db/migrate/20240531224204_add_decidim_awesome_proposal_private_fields.rb +29 -0
  208. data/db/migrate/20240729164227_add_decidim_awesome_proposal_private_fields_date.rb +20 -0
  209. data/db/seeds.rb +3 -3
  210. data/lib/decidim/decidim_awesome/admin_engine.rb +26 -7
  211. data/lib/decidim/decidim_awesome/api/types/localized_custom_fields_type.rb +22 -0
  212. data/lib/decidim/decidim_awesome/api/types/translated_custom_fields_type.rb +51 -0
  213. data/lib/decidim/decidim_awesome/awesome.rb +74 -23
  214. data/lib/decidim/decidim_awesome/awesome_helpers.rb +6 -2
  215. data/lib/decidim/decidim_awesome/checksums.yml +47 -44
  216. data/lib/decidim/decidim_awesome/config.rb +1 -1
  217. data/lib/decidim/decidim_awesome/custom_fields.rb +13 -5
  218. data/lib/decidim/decidim_awesome/engine.rb +165 -56
  219. data/lib/decidim/decidim_awesome/iframe_component/component.rb +1 -2
  220. data/lib/decidim/decidim_awesome/lock.rb +47 -0
  221. data/lib/decidim/decidim_awesome/map_component/component.rb +1 -1
  222. data/lib/decidim/decidim_awesome/menu.rb +165 -0
  223. data/lib/decidim/decidim_awesome/menu_hacker.rb +4 -8
  224. data/lib/decidim/decidim_awesome/system_checker.rb +2 -4
  225. data/lib/decidim/decidim_awesome/test/factories.rb +10 -10
  226. data/lib/decidim/decidim_awesome/test/initializer.rb +7 -12
  227. data/lib/decidim/decidim_awesome/test/layouts/decidim/_head.html.erb +2 -2
  228. data/lib/decidim/decidim_awesome/test/layouts/decidim/admin/_header.html.erb +2 -2
  229. data/lib/decidim/decidim_awesome/test/shared_examples/{box_label_editor.rb → box_label_editor_examples.rb} +17 -17
  230. data/lib/decidim/decidim_awesome/test/shared_examples/config_examples.rb +23 -5
  231. data/lib/decidim/decidim_awesome/test/shared_examples/custom_fields_examples.rb +155 -0
  232. data/lib/decidim/decidim_awesome/test/shared_examples/custom_redirects_contexts.rb +7 -7
  233. data/lib/decidim/decidim_awesome/test/shared_examples/editor_examples.rb +42 -58
  234. data/lib/decidim/decidim_awesome/test/shared_examples/menu_hack_contexts.rb +9 -8
  235. data/lib/decidim/decidim_awesome/test/shared_examples/scoped_admins_examples.rb +32 -24
  236. data/lib/decidim/decidim_awesome/test/shared_examples/summary_examples.rb +97 -22
  237. data/lib/decidim/decidim_awesome/version.rb +2 -2
  238. data/lib/decidim/decidim_awesome/voting_manifest.rb +5 -10
  239. data/lib/decidim/decidim_awesome.rb +1 -2
  240. data/lib/tasks/decidim_awesome_active_storage_migrations_tasks.rake +1 -1
  241. data/lib/tasks/decidim_awesome_upgrade_tasks.rake +4 -0
  242. data/package.json +21 -30
  243. metadata +86 -63
  244. data/app/cells/concerns/decidim/decidim_awesome/proposal_m_cell_override.rb +0 -38
  245. data/app/cells/decidim/decidim_awesome/voting/voting_cards_counter/show.erb +0 -15
  246. data/app/cells/decidim/decidim_awesome/voting/voting_cards_counter/vote_button.erb +0 -15
  247. data/app/cells/decidim/decidim_awesome/voting/voting_cards_counter_cell.rb +0 -21
  248. data/app/cells/decidim/decidim_awesome/voting/voting_cards_proposal_modal/show.erb +0 -16
  249. data/app/cells/decidim/decidim_awesome/voting/voting_cards_proposal_modal_cell.rb +0 -20
  250. data/app/cells/decidim/proposals/proposal_m/footer.erb +0 -13
  251. data/app/helpers/decidim/decidim_awesome/amendments_helper_override.rb +0 -48
  252. data/app/helpers/decidim/decidim_awesome/proposals/application_helper_override.rb +0 -78
  253. data/app/overrides/layouts/decidim/_head/add_awesome_legacy_scripts.rb +0 -14
  254. data/app/overrides/layouts/decidim/admin/_header/replace_styles.html.erb.deface +0 -3
  255. data/app/packs/entrypoints/decidim_admin_decidim_awesome_custom_fields.js +0 -2
  256. data/app/packs/entrypoints/decidim_decidim_awesome_admin_form_exit_warn.js +0 -1
  257. data/app/packs/src/decidim/decidim_awesome/admin/constraints.js +0 -55
  258. data/app/packs/src/decidim/decidim_awesome/editors/editor.js +0 -218
  259. data/app/packs/src/decidim/decidim_awesome/editors/tabs_focus.js +0 -22
  260. data/app/packs/stylesheets/decidim/decidim_awesome/editors/markdown_editor.scss +0 -19
  261. data/app/packs/stylesheets/decidim/decidim_awesome/editors/quill_editor.scss +0 -58
  262. data/app/packs/stylesheets/vendor/select2-foundation-theme.scss +0 -348
  263. data/app/serializers/concerns/decidim/decidim_awesome/proposal_serializer_override.rb +0 -64
  264. data/app/views/decidim/decidim_awesome/admin/config/_modal.html.erb +0 -11
  265. data/app/views/decidim/decidim_awesome/voting/voting_cards/_proposal_m_cell_footer.erb +0 -15
@@ -1,13 +1,22 @@
1
- <%= decidim_form_for(@form, url: menu_hack_path, method: :patch, html: { class: :form }) do |f| %>
2
- <div class="card">
3
- <div class="card-divider">
4
- <h2 class="card-title"><%= t ".title" %></h2>
5
- </div>
6
- <div class="card-section">
7
- <%= render partial: "form", object: f %>
8
- </div>
1
+ <div class="item_show__header">
2
+ <h2 class="item_show__header-title">
3
+ <%= t(".title") %>
4
+ </h2>
5
+ </div>
6
+ <div class="item__edit item__edit-1col">
7
+ <div class="item__edit-form">
8
+ <%= decidim_form_for(@form, url: menu_hack_path(params[:menu_id]), method: :patch, html: { class: "form form-defaults" }) do |f| %>
9
+ <div class="card pt-4">
10
+ <div class="card-section">
11
+ <%= render partial: "form", object: f %>
12
+ </div>
13
+ </div>
14
+
15
+ <div class="item__edit-sticky">
16
+ <div class="item__edit-sticky-container">
17
+ <%= f.submit t(".save"), class: "button button__sm button__secondary" %>
18
+ </div>
19
+ </div>
20
+ <% end %>
9
21
  </div>
10
- <div class="button--double form-general-submit">
11
- <%= f.submit t(".save") %>
12
- </div>
13
- <% end %>
22
+ </div>
@@ -1,44 +1,41 @@
1
- <div class="card">
2
- <div class="card-divider">
3
- <h2 class="card-title">
4
- <%= t(".title") %>
5
- <%= link_to t(".new"), decidim_admin_decidim_awesome.new_menu_hack_path, class: "button tiny button--title" %>
6
- </h2>
7
- </div>
8
- <div class="card-section">
9
- <div class="row column decidim_awesome-form">
10
- <table class="table-list">
11
- <thead>
12
- <tr>
13
- <th><%= t("menu.raw_label", scope: "activemodel.attributes") %></th>
14
- <th><%= t("menu.url", scope: "activemodel.attributes") %></th>
15
- <th><%= t("menu.position", scope: "activemodel.attributes") %></th>
16
- <th><%= t("menu.target", scope: "activemodel.attributes") %></th>
17
- <th><%= t("menu.visibility", scope: "activemodel.attributes") %></th>
18
- <th class="actions"></th>
1
+ <div class="item_show__header">
2
+ <h2 class="item_show__header-title">
3
+ <%= t(".#{params[:menu_id]}.title") %>
4
+ <%= link_to t(".new"), decidim_admin_decidim_awesome.new_menu_hack_path, class: "button button__sm button__secondary ml-auto" %>
5
+ </h2>
6
+ </div>
7
+ <div class="table-scroll">
8
+ <table class="table-list">
9
+ <thead>
10
+ <tr>
11
+ <th><%= t("menu.raw_label", scope: "activemodel.attributes") %></th>
12
+ <th><%= t("menu.url", scope: "activemodel.attributes") %></th>
13
+ <th><%= t("menu.position", scope: "activemodel.attributes") %></th>
14
+ <th><%= t("menu.target", scope: "activemodel.attributes") %></th>
15
+ <th><%= t("menu.visibility", scope: "activemodel.attributes") %></th>
16
+ <th class="actions"><%= t("decidim.decidim_awesome.admin.actions") %></th>
17
+ </tr>
18
+ </thead>
19
+ <tbody>
20
+ <% current_items.each do |item| %>
21
+ <tr<%= " class=menu_hack-addition" if item.try(:overrided?) == false %>>
22
+ <td><%= item.label %></td>
23
+ <td><%= item.url %></td>
24
+ <td><%= item.position %></td>
25
+ <td><%= target_options.invert[item.try(:target)||""] %></td>
26
+ <td><%= visibility_options.invert[item.try(:visibility)] %></td>
27
+ <td class="table-list__actions">
28
+ <%= icon_link_to "pencil-line", decidim_admin_decidim_awesome.edit_menu_hack_path(params[:menu_id], md5(item.url)), t(".edit"), class: "action-icon--edit" %>
29
+ <% if item.respond_to?(:overrided?) %>
30
+ <%= icon_link_to "close-circle-line", decidim_admin_decidim_awesome.menu_hack_path(params[:menu_id], md5(item.url)), t(".remove#{'_hack' if item.overrided?}"), method: :delete, class: "action-icon--remove", data: { confirm: t(".confirm_destroy") } %>
31
+ <% else %>
32
+ <span class="action-icon">
33
+ <%= icon "close-circle-line", class: "action-icon action-icon--disabled", role: "img" %>
34
+ </span>
35
+ <% end %>
36
+ </td>
19
37
  </tr>
20
- </thead>
21
- <tbody>
22
- <% current_items.each do |item| %>
23
- <tr<%= " class=menu_hack-addition" if item.try(:overrided?) == false %>>
24
- <td><%= item.label %></td>
25
- <td><%= item.url %></td>
26
- <td><%= item.position %></td>
27
- <td><%= target_options.invert[item.try(:target)||""] %></td>
28
- <td><%= visibility_options.invert[item.try(:visibility)] %></td>
29
- <td class="table-list__actions">
30
- <%= icon_link_to "pencil", decidim_admin_decidim_awesome.edit_menu_hack_path(md5(item.url)), t(".edit"), class: "action-icon--edit" %>
31
- <% if item.respond_to?(:overrided?) %>
32
- <%= icon_link_to "circle-x", decidim_admin_decidim_awesome.menu_hack_path(md5(item.url)), t(".remove#{'_hack' if item.overrided?}"), method: :delete, class: "action-icon--remove", data: { confirm: t(".confirm_destroy") } %>
33
- <% else %>
34
- <span class="action-icon">
35
- <%= icon "circle-x", class: "action-icon action-icon--disabled", role: "img" %>
36
- </span>
37
- <% end %>
38
- </td>
39
- </tr>
40
- <% end %>
41
- </tbody>
42
- </table>
43
- </div>
38
+ <% end %>
39
+ </tbody>
40
+ </table>
44
41
  </div>
@@ -1,13 +1,22 @@
1
- <%= decidim_form_for(@form, url: menu_hacks_path, html: { class: :form }) do |f| %>
2
- <div class="card">
3
- <div class="card-divider">
4
- <h2 class="card-title"><%= t ".title" %></h2>
5
- </div>
6
- <div class="card-section">
7
- <%= render partial: "form", object: f %>
8
- </div>
1
+ <div class="item_show__header">
2
+ <h2 class="item_show__header-title">
3
+ <%= t(".title") %>
4
+ </h2>
5
+ </div>
6
+ <div class="item__edit item__edit-1col">
7
+ <div class="item__edit-form">
8
+ <%= decidim_form_for(@form, url: menu_hacks_path(params[:menu_id]), html: { class: "form form-defaults" }) do |f| %>
9
+ <div class="card pt-4">
10
+ <div class="card-section">
11
+ <%= render partial: "form", object: f %>
12
+ </div>
13
+ </div>
14
+
15
+ <div class="item__edit-sticky">
16
+ <div class="item__edit-sticky-container">
17
+ <%= f.submit t(".save"), class: "button button__sm button__secondary" %>
18
+ </div>
19
+ </div>
20
+ <% end %>
9
21
  </div>
10
- <div class="button--double form-general-submit">
11
- <%= f.submit t(".save") %>
12
- </div>
13
- <% end %>
22
+ </div>
@@ -1,6 +1,9 @@
1
- <%= admin_editor_for_proposal_body(form) %>
2
- <% unless awesome_proposal_custom_fields.blank? %>
3
- <div class="proposal_custom_field">
4
- <div class="loading-spinner"></div>
5
- </div>
1
+ <% if Decidim::DecidimAwesome.enabled?(:proposal_custom_fields) && editor = admin_editor_for_proposal_body(form) %>
2
+ <%= editor %>
3
+ <% else %>
4
+ <%= form.translated :editor, :body, hashtaggable: true, aria: { label: :body } %>
5
+ <% end %>
6
+
7
+ <% if Decidim::DecidimAwesome.enabled?(:proposal_private_custom_fields) && private_custom_fields = awesome_proposal_custom_fields_for(:private_body) %>
8
+ <%= render_proposal_custom_fields_override(private_custom_fields, form, :private_body) if private_custom_fields.present? %>
6
9
  <% end %>
@@ -0,0 +1,20 @@
1
+ <div class="card-section" data-component="accordion" id="accordion-private_body">
2
+ <button class="card-divider-button" data-controls="panel-private_body" type="button">
3
+ <%= icon "arrow-right-s-line" %>
4
+ <h2 class="card-title">
5
+ <%= t "decidim.decidim_awesome.admin.proposal_custom_fields.private_body" %>
6
+ </h2>
7
+ </button>
8
+ <div id="panel-private_body">
9
+ <div class="component__show_private_data-grid">
10
+ <div><%= Decidim::ContentProcessor.render_without_format(render_sanitized_content(proposal, :private_body)).html_safe %></div>
11
+ <% if proposal&.extra_fields&.private_body_updated_at %>
12
+ <div class="date_info">
13
+ <%= t("decidim.decidim_awesome.admin.proposal_custom_fields.private_data_last_update", time_ago: time_ago_in_words(proposal.extra_fields.private_body_updated_at)) if proposal.extra_fields.private_body.present? %>
14
+ <%= t("decidim.decidim_awesome.admin.proposal_custom_fields.private_data_last_remove", time_ago: time_ago_in_words(proposal.extra_fields.private_body_updated_at)) if proposal.extra_fields.private_body.blank? %>
15
+ <%= link_to t("decidim.decidim_awesome.admin.proposal_custom_fields.remove_private_data"), decidim_admin_decidim_awesome.maintenance_path(:private_data) if proposal.extra_fields.private_body_updated_at && proposal.extra_fields.private_body_updated_at < Decidim::DecidimAwesome.private_data_expiration_time.ago %>
16
+ </div>
17
+ <% end %>
18
+ </div>
19
+ </div>
20
+ </div>
@@ -1,41 +1,42 @@
1
- <div class="filters__section">
2
- <div class="fcell filter">
1
+ <div class="filters__section p-4 flex mb-0">
2
+ <div class="fcell filter self-start">
3
3
  <ul class="dropdown menu" data-dropdown-menu data-close-on-click-inside="false">
4
4
  <li>
5
- <a href="#" class="dropdown button">
5
+ <a href="#" class="dropdown button button__sm button__secondary">
6
6
  <%= t("filter_label", scope: "decidim.admin.filters") %>
7
+ <%= icon "arrow-down-s-fill", class: "dropdown-filter-icon" %>
7
8
  </a>
8
9
  <%= dropdown_submenu(submenu_options_tree(i18n_ctx)) %>
9
10
  </li>
10
11
  </ul>
11
12
  </div>
12
13
  <div class="fcell search">
13
- <%= search_form_for(query, url: url_for) do |form| %>
14
+ <%= search_form_for(query, url: url_for, html: { class: "form-defaults form" }) do |form| %>
14
15
  <%= applied_filters_hidden_field_tags %>
15
- <div class="input-group">
16
+ <div class="input-group flex items-center">
16
17
  <%= form.search_field(
17
18
  search_field_predicate,
18
- class: "input-group-field",
19
+ class: "input-group-field shadow-md border-alert",
19
20
  label: false,
20
21
  placeholder: t(search_field_predicate,
21
22
  collection: collection_name,
22
23
  scope: "decidim.admin.filters.search_placeholder")
23
24
  ) %>
24
25
  <div class="input-group-button">
25
- <button type="submit" class="button">
26
- <%= icon "magnifying-glass", aria_label: t("search_label", scope: "decidim.admin.filters") %>
26
+ <button type="submit" class="text-secondary py-2 px-4 rounded-r focus:outline-none outline-none">
27
+ <%= icon "search-line", class: "fill-secondary w-4 h-4", aria_label: t("search_label", scope: "decidim.admin.filters") %>
27
28
  </button>
28
29
  </div>
29
30
  </div>
30
- <div class="input-group mt-xs">
31
- <div class="input-group-field">
31
+ <div class="input-group flex mt-4 w-full justify-center">
32
+ <div class="input-group-field flex flex-col w-full">
32
33
  <%= form.label t("search_field_start_date", scope: "decidim.admin.filters.label") %>
33
34
  <%= form.date_field(:created_at_gteq,
34
35
  class: "input-group-field",
35
36
  label: false,
36
37
  datepicker: true) %>
37
38
  </div>
38
- <div class="input-group-field">
39
+ <div class="input-group-field flex flex-col w-full">
39
40
  <%= form.label t("search_field_end_date", scope: "decidim.admin.filters.label") %>
40
41
  <%= form.date_field(:created_at_lteq,
41
42
  class: "input-group-field",
@@ -46,11 +47,6 @@
46
47
  <% end %>
47
48
  </div>
48
49
  </div>
49
- <div class="card-section fcell grid-x">
50
- <div class="cell medium-10 filter-status">
51
- <%= applied_filters_tags(i18n_ctx) %>
52
- </div>
53
- <div class="cell auto text-right">
54
- <%= admin_filters_pagination %>
55
- </div>
50
+ <div class="fcell grid-x" data-applied-filters-tags>
51
+ <%= applied_filters_tags(i18n_ctx) %>
56
52
  </div>
@@ -0,0 +1,23 @@
1
+ <!--the modal window will be used in another pr-->
2
+ <%= decidim_modal id: "LimitAmendmentsModal", data: { "limit-amendments": current_component.settings&.limit_pending_amendments } do %>
3
+ <div data-dialog-container>
4
+ <%= icon "notification-3-fill" %>
5
+ <h3 data-dialog-title><%= t("decidim.decidim_awesome.amendments.modal.amendment_exists") %></h3>
6
+
7
+ <div>
8
+ <div class="instructions">
9
+ <%= t("decidim.decidim_awesome.amendments.modal.explanation_html",
10
+ proposal_link: present(@proposal).proposal_path + "#comments") %>
11
+
12
+ <% emendations = @proposal.emendations.not_hidden.where(decidim_amendments: { state: Decidim::Amendment.states["evaluating"] }) %>
13
+ <% if current_component.current_settings&.amendments_visibility == "all" && emendations %>
14
+ <%= t("decidim.decidim_awesome.amendments.modal.current_amendment_html",
15
+ amendment_link: present(emendations&.first).proposal_path) %>
16
+ <% end %>
17
+ </div>
18
+ </div>
19
+ </div>
20
+ <div data-dialog-actions>
21
+ <button type="button" class="button button__sm md:button__lg button__transparent-secondary cancel-action" data-dialog-close="LimitAmendmentsModal"><%= t("decidim.decidim_awesome.amendments.modal.dismiss") %></button>
22
+ </div>
23
+ <% end %>
@@ -1,6 +1,12 @@
1
- <div class="proposal_custom_field" id="proposa-custom-field-<%= name %>" data-spec="<%= spec.to_json %>" data-name="<%= "#{form.object_name}[#{name}]" %>">
2
- <div class="loading-spinner"></div>
1
+ <div class="decidim_awesome-custom_fields <%= name %>">
2
+ <% if name == :private_body %>
3
+ <p class="private_body-disclosure help-text"><%= icon "spy" %><%= t("decidim.decidim_awesome.proposal_private_custom_fields_disclosure") %></p>
4
+ <% end %>
5
+ <div class="proposal_custom_field proposal_custom_field--<%= name %>" id="proposal-custom-field-<%= name %>" data-spec="<%= spec.to_json %>" data-editor-options="<%= editor_options[:editor].to_json %>" data-name="<%= "#{form.object_name}[#{name}]" %>">
6
+ <div class="loading-spinner"></div>
7
+ </div>
3
8
  </div>
4
9
 
10
+ <%= editor_upload.html_safe %>
5
11
  <%= form.hidden_field name %>
6
12
  <%= form.error_for name %>
@@ -1,14 +1,9 @@
1
- <%= announcement = render(partial: "decidim/shared/component_announcement") %>
1
+ <main class="participatory-space__container">
2
+ <%= announcement = render(partial: "decidim/shared/component_announcement") %>
2
3
 
3
- <%= stylesheet_pack_tag "decidim_decidim_awesome_iframe" %>
4
+ <%= append_stylesheet_pack_tag "decidim_decidim_awesome_iframe" %>
4
5
 
5
- <style rel="stylesheet" type="text/css">
6
- <% if remove_margins? %>
7
- <%= ".wrapper { padding-left: 0;padding-right: 0;padding-bottom: 0; }" %>
8
- <%= ".wrapper { padding-top: 0; }" unless announcement.present? %>
9
- <% end %>
10
- </style>
11
-
12
- <div class="awesome-iframe<%= " row" if viewport_width? %>">
13
- <%= iframe %>
14
- </div>
6
+ <section id="<%= viewport_width? ? "iframe-block" : "html-block-html" %>" class="awesome-iframe layout-main__section">
7
+ <%= iframe %>
8
+ </section>
9
+ </main>
@@ -1,59 +1,72 @@
1
1
  <div class="loading-spinner"></div>
2
2
 
3
3
  <script id="marker-proposal-popup" type="text/x-jsrender">
4
- <div class="map-info__content">
5
- <h3>{{:title.translation}}</h3>
6
- <div id="bodyContent">
7
- <div class="description">{{:body.translation}}</div>
8
- <div class="map__date-adress">
9
- <div class="address card__extra">
10
- <div class="address__icon">{{:icon}}</div>
11
- <div class="address__details">
12
- <span>{{>address}}</span><br>
4
+ <div class="space-y-6">
5
+ <div class="card__list">
6
+ <div class="card__list-content">
7
+ <a href="{{>link}}" target="proposal">
8
+ <h3 class="h4 card__list-title">{{:title.translation}}</h3>
9
+ <div class="card__list-metadata">
10
+ <span>
11
+ <%= icon "account-circle-line" %>
12
+ {{:authorName}}
13
+ </span>
14
+ <span>
15
+ <%= icon "wechat-line" %>
16
+ {{:totalCommentsCount}}
17
+ </span>
18
+ <span>
19
+ <%= icon "like" %>
20
+ {{:endorsementsCount}}
21
+ </span>
22
+ <span>
23
+ <span class="label {{:stateClass}}">{{:humanState}}</span>
24
+ </span>
25
+ {{if isAmendment() }}
26
+ <span>
27
+ <%= icon "other" %>
28
+ <%= t("activerecord.models.decidim/amendment", count: 1) %>
29
+ </span>
30
+ {{/if}}
13
31
  </div>
14
- </div>
15
- </div>
16
- <div class="map-info__button">
17
- <a href="{{>link}}" class="button button--sc">
18
- <%= t("view_proposal", scope: "decidim.decidim_awesome.map_component.map.show") %>
32
+ <div class="text-sm">{{>address}}</div>
19
33
  </a>
34
+ <div class="description">
35
+ <div>{{:body.translation}}</div>
36
+ </div>
20
37
  </div>
21
38
  </div>
22
39
  </div>
23
40
  </script>
24
41
 
25
42
  <script id="marker-meeting-popup" type="text/x-jsrender">
26
- <div class="map-info__content">
27
- <h3>{{:title.translation}}</h3>
28
- <div id="bodyContent">
29
- <div class="description">{{:body.translation}}</div>
30
- <div class="map__date-adress">
31
- <div class="card__datetime">
32
- <div class="card__datetime__date">
33
- {{>startTimeDay}} <span class="card__datetime__month">{{>startTimeMonth}} {{>startTimeYear}}</span>
34
- </div>
35
- <div class="card__datetime__time">{{>starTime}}</div>
36
- </div>
37
- <div class="address card__extra">
38
- <div class="address__icon">{{:icon}}</div>
39
- <div class="address__details">
40
- <strong>{{:location.translation}}</strong><br>
41
- <span>{{>address}}</span><br>
42
- <span>{{:locationHints.translation}}</span>
43
+ <div class="space-y-6">
44
+ <div class="card__list">
45
+ <div class="card__list-content">
46
+ <a href="{{>link}}" target="meeting">
47
+ <h3 class="h4 card__list-title">{{:title.translation}}</h3>
48
+ <div class="card__list-metadata">
49
+ <span>
50
+ <%= icon "calendar-line" %>
51
+ {{:dateRange}}
52
+ </span>
53
+ <span>
54
+ <%= icon "{{:icon}}", ignore_missing: true %>
55
+ {{:meetingType}}
56
+ </span>
43
57
  </div>
44
- </div>
45
- </div>
46
- <div class="map-info__button">
47
- <a href="{{>link}}" class="button button--sc">
48
- <%= t("view_meeting", scope: "decidim.meetings.meetings_map") %>
58
+ <div class="text-sm">{{>address}}</div>
49
59
  </a>
60
+ <div class="description">
61
+ {{:body.translation}}
62
+ </div>
50
63
  </div>
51
64
  </div>
52
65
  </div>
53
66
  </script>
54
67
 
55
68
  <style type="text/css">
56
- #awesome-map .google-map, .wrapper #awesome-map .google-map {
69
+ #awesome-map .dynamic-map {
57
70
  height: <%= map_height %>px;
58
71
  }
59
72
  <% current_categories(categories).each do |category| %>
@@ -65,4 +78,7 @@
65
78
  <script>
66
79
  window.AwesomeMap = window.AwesomeMap || {};
67
80
  window.AwesomeMap.categories = <%= current_categories(categories).to_json.html_safe %>;
81
+ window.AwesomeMapProposalTexts = <%= Decidim::Proposals::Proposal::STATES.to_h { |state, _| [state, t("decidim.proposals.answers.#{state}")] }.to_json.html_safe %>;
82
+ window.AwesomeMapMeetingTypes = <%= Decidim::Meetings::Meeting::TYPE_OF_MEETING.to_h { |type, _| [type, Decidim.icons.all[type.to_s]["icon"]] }.to_json.html_safe %>;
83
+ window.AwesomeMapMeetingTexts = <%= Decidim::Meetings::Meeting::TYPE_OF_MEETING.to_h { |type, _| [type, t("decidim.meetings.meetings.filters.type_values.#{type}")] }.to_json.html_safe %>;
68
84
  </script>
@@ -1,7 +1,16 @@
1
- <%= render partial: "decidim/shared/component_announcement" %>
1
+ <main class="participatory-space__container">
2
+ <% announcement = translated_attribute(current_settings.announcement).presence || translated_attribute(component_settings.announcement).presence %>
3
+ <% if strip_tags(announcement).present? %>
4
+ <section>
5
+ <%= cell("decidim/announcement", announcement, local_assigns.merge(callout_class: "editor-content")) %>
6
+ </section>
7
+ <% end %>
2
8
 
3
- <%= render partial: "api_ready" %>
9
+ <%= render partial: "api_ready" %>
4
10
 
5
- <%= awesome_map_for map_components do %>
6
- <%= render partial: "map_template", locals: { categories: current_participatory_space.categories, map_height: current_component.settings.map_height } %>
7
- <% end %>
11
+ <section id="map-block" class="awesome-iframe layout-main__section">
12
+ <%= awesome_map_for map_components do %>
13
+ <%= render partial: "map_template", locals: { categories: current_participatory_space.categories, map_height: current_component.settings.map_height } %>
14
+ <% end %>
15
+ </section>
16
+ </main>
@@ -1,6 +1,3 @@
1
1
  <div class="voting-voting_cards">
2
2
  <%= cell("decidim/decidim_awesome/voting/voting_cards_proposal", proposal, from_proposals_list: true) %>
3
- <% if current_component.settings.voting_cards_show_modal_help %>
4
- <%= cell("decidim/decidim_awesome/voting/voting_cards_proposal_modal", proposal) %>
5
- <% end %>
6
3
  </div>
@@ -2,21 +2,23 @@
2
2
  window.DecidimAwesome = <%= javascript_config_vars %>;
3
3
  window.DecidimAwesome.currentLocale = "<%= current_locale %>";
4
4
  window.DecidimAwesome.version = "<%= Decidim::DecidimAwesome::VERSION %>";
5
- window.DecidimAwesome.editor_uploader_path = "<%= decidim_decidim_awesome.editor_images_path %>";
6
- window.DecidimAwesome.rename_scope_label_path = "<%= decidim_admin_decidim_awesome.rename_scope_label_path %>";
5
+ window.DecidimAwesome.editorUploaderPath = "<%= decidim_decidim_awesome.editor_images_path %>";
6
+ window.DecidimAwesome.renameScopeLabelPath = "<%= decidim_admin_decidim_awesome.rename_scope_label_path %>";
7
7
  window.DecidimAwesome.texts = {
8
- "drag_and_drop_image": "<%= j t(".drag_and_drop_image") %>",
9
- "autosaved_success": "<%= j t(".autosaved_success") %>",
10
- "autosaved_error": "<%= j t(".autosaved_error") %>",
11
- "autosaved_retrieved": "<%= j t(".autosaved_retrieved") %>",
8
+ "dragAndDropImage": "<%= j t(".drag_and_drop_image") %>",
9
+ "autosavedSuccess": "<%= j t(".autosaved_success") %>",
10
+ "autosavedError": "<%= j t(".autosaved_error") %>",
11
+ "autosavedRetrieved": "<%= j t(".autosaved_retrieved") %>",
12
12
  "categories": "<%= j t(".categories") %>",
13
13
  "hashtags": "<%= j t(".hashtags") %>",
14
14
  "proposals": "<%= j t(".proposals") %>",
15
15
  "meetings": "<%= j t(".meetings") %>",
16
16
  "amendments": "<%= j t(".amendments") %>",
17
17
  "items": "<%= j t(".items") %>",
18
- "select_deselect_all": "<%= j t(".select_deselect_all") %>"
18
+ "selectDeselectAll": "<%= j t(".select_deselect_all") %>",
19
+ "officialAuthor": "<%= j t("decidim.blogs.models.post.fields.official_blog_post") %>",
19
20
  }
21
+ window.DecidimAwesome.formBuilderLangsLocation = "<%= j Decidim::DecidimAwesome.form_builder_langs_location %>";
20
22
  <% if defined?(questionnaire) && questionnaire&.id %>
21
23
  window.DecidimAwesome.current_questionnaire = "edit_questionnaire_<%= questionnaire.id %>";
22
24
  <% if defined? visitor_already_answered? %>
@@ -1,16 +1,19 @@
1
1
  <script>
2
- window.intergramId = "<%= j (settings[:chat_id]).html_safe %>";
3
-
4
- window.intergramOnOpen = {};
5
- window.intergramOnOpen.visitorName = "<%= j current_user&.nickname %>";
2
+ window.intergramId = "<%= j (settings[:chat_id])&.html_safe %>";
3
+ window.intergramOnOpen = {
4
+ visitorName: "<%= j current_user&.nickname %>"
5
+ };
6
6
  window.intergramCustomizations = {
7
7
  titleClosed: "<%= j (settings[:title_closed].presence || t("decidim.decidim_awesome.config.intergram.title_closed")).html_safe %>",
8
8
  titleOpen: "<%= j (settings[:title_open].presence || t("decidim.decidim_awesome.config.intergram.title_open")).html_safe %>",
9
9
  introMessage: "<%= j (settings[:intro_message].presence || t("decidim.decidim_awesome.config.intergram.intro_message")).html_safe %>",
10
10
  autoResponse: "<%= j (settings[:auto_response].presence || t("decidim.decidim_awesome.config.intergram.auto_response")).html_safe %>",
11
11
  autoNoResponse: "<%= j (settings[:auto_no_response].presence || t("decidim.decidim_awesome.config.intergram.auto_no_response")).html_safe %>",
12
- mainColor: "<%= j (settings[:color].presence || "#E91E63").html_safe %>",
12
+ mainColor: "<%= j (settings[:color].presence || (current_organization.colors && current_organization.colors["primary"]) || "#E91E63").html_safe %>",
13
13
  alwaysUseFloatingButton: <%= settings[:use_floating_button] ? "true" : "false" %> // Use the mobile floating button also on large screens
14
14
  };
15
15
  </script>
16
- <script id="intergram" type="text/javascript" src="<%= awesome_config[:intergram_url] %>"></script>
16
+
17
+ <% if settings[:chat_id].present? %>
18
+ <script id="intergram" type="text/javascript" src="<%= awesome_config[:intergram_url] %>"></script>
19
+ <% end %>
@@ -0,0 +1,12 @@
1
+ <% add_secondary_root_menu(:awesome_admin_menu) %>
2
+
3
+ <%= append_stylesheet_pack_tag "decidim_admin_decidim_awesome", media: "all" %>
4
+ <%= append_javascript_pack_tag "decidim_admin_decidim_awesome", defer: true %>
5
+
6
+ <%= render "layouts/decidim/admin/application" do %>
7
+ <%= yield %>
8
+
9
+ <div class="pokecode-credits"><%= t("credits", scope: "decidim.decidim_awesome", version: link_to(awesome_version, "https://github.com/decidim-ice/decidim-module-decidim_awesome/"), company: link_to("PokeCode", "https://pokecode.net")).html_safe %></div>
10
+ <% end %>
11
+
12
+ <%= render partial: "layouts/decidim/decidim_awesome/awesome_config" %>