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,26 +1,32 @@
1
1
  <div class="card">
2
- <div class="card-divider">
3
- <h2 class="card-title"><%= t(".title") %>
4
- <span class="exports dropdown tiny button button--simple button--title" data-toggle="export-dropdown">
5
- <%= t "exports.button", scope: "decidim.decidim_awesome.admin.admin_accountability" %>
6
- </span>
7
- <div class="dropdown-pane" id="export-dropdown" data-dropdown data-auto-focus="true" data-close-on-click="true">
8
- <ul class="vertical menu add-components">
9
- <% %w{CSV JSON Excel}.each do |format| %>
10
- <li class="exports--format--<%= format.downcase %> exports--registrations">
11
- <%= link_to t("decidim.decidim_awesome.admin.admin_accountability.exports.export_as", export_format:
12
- format.upcase), export_admin_accountability_path(export_params.merge(format: format)), method: :post %>
13
- </li>
14
- <% end %>
15
- </ul>
2
+ <div class="bg-gray-6 p-4 rounded-t">
3
+ <h2 class="card-title flex md:flex-row justify-between sm:flex-wrap">
4
+ <%= t(".title") %>
5
+ <div class="flex gap-4">
6
+ <%= link_to t(global? ? ".see_spaces" : ".see_global"), admin_accountability_path(admins: !global?), class: "button button__sm button__transparent-secondary tiny button--title new" %>
7
+ <span class="exports button button__sm button__secondary tiny button--simple button--title" data-toggle="export-dropdown">
8
+ <%= t "exports.button", scope: "decidim.decidim_awesome.admin.admin_accountability" %>
9
+ <%= icon "arrow-down-s-fill" %>
10
+ </span>
11
+ <div class="dropdown-pane" id="export-dropdown" data-dropdown data-auto-focus="true" data-close-on-click="true">
12
+ <ul class="vertical menu add-components">
13
+ <% %w{CSV JSON Excel}.each do |format| %>
14
+ <li class="exports--format--<%= format.downcase %> exports--registrations">
15
+ <%= link_to t("decidim.decidim_awesome.admin.admin_accountability.exports.export_as", export_format:
16
+ format.upcase), export_admin_accountability_path(export_params.merge(format: format)),
17
+ method: :post,
18
+ class: "focus-visible:outline-none" %>
19
+ </li>
20
+ <% end %>
21
+ </ul>
22
+ </div>
16
23
  </div>
17
- <%= link_to t(global? ? ".see_spaces" : ".see_global"), admin_accountability_path(admins: !global?), class: "button tiny button--title new" %>
18
- </h2>
24
+ </h2>
19
25
  </div>
20
26
 
21
27
  <%= render partial: "decidim/decidim_awesome/admin/shared/filters_with_date", locals: { i18n_ctx: "admin_accountability" } %>
22
28
 
23
- <div class="card-section">
29
+ <div class="card-section p-4">
24
30
  <p class="help-text"><%= t(global? ? ".global_description" : ".description") %></p>
25
31
 
26
32
  <% if global_users_missing_date %>
@@ -1,28 +1,31 @@
1
- <div class="card">
2
- <div class="card-divider">
3
- <h2 class="card-title"><%= t ".title" %></h2>
4
- </div>
5
- <div class="card-section">
6
- <p>
7
- <span class="label <%= decidim_version_valid? ? "success" : "alert" %>"><%= t ".decidim_version", version: decidim_version %></span>
8
- <%= check decidim_version_valid? %>
9
- </p>
10
- </div>
11
- <div class="card-section">
12
- <p><%= t(".images_migrated") %>
13
- <% if images_migrated? %>
14
- <%= check true %></p>
15
- <% else %>
16
- <%= check false %></p>
17
- <div class="callout alert">
18
- <p><%= t(".pending_image_migrations", total: pending_image_migrations).html_safe %></p>
19
- <%= link_to t(".start_image_migrations"), migrate_images_path, method: :post, class: "button" %>
20
- </div>
21
- <% end %>
22
- </div>
23
- <div class="card-section">
24
- <ul class="vertical menu">
25
- <% overrides.each do |group, props| %>
1
+ <!--
2
+ Force tailwind to compile these classes
3
+ class="fill-success fill-alert"
4
+ -->
5
+
6
+ <div class="card-section decidim-version">
7
+ <p>
8
+ <span class="label <%= decidim_version_valid? ? "success" : "alert" %>"><%= t ".decidim_version", version: decidim_version %></span>
9
+ <%= check decidim_version_valid? %>
10
+ </p>
11
+ </div>
12
+
13
+ <div class="card-section">
14
+ <p><%= t(".images_migrated") %>
15
+ <% if images_migrated? %>
16
+ <%= check true %></p>
17
+ <% else %>
18
+ <%= check false %></p>
19
+ <div class="callout alert">
20
+ <p><%= t(".pending_image_migrations", total: pending_image_migrations).html_safe %></p>
21
+ <%= link_to t(".start_image_migrations"), migrate_images_path, method: :post, class: "button" %>
22
+ </div>
23
+ <% end %>
24
+ </div>
25
+
26
+ <div class="card-section">
27
+ <ul class="vertical menu">
28
+ <% overrides.each do |group, props| %>
26
29
  <li>
27
30
  <strong><%= t ".#{group}" %></strong>
28
31
  <ul class="vertical menu">
@@ -36,16 +39,16 @@
36
39
  </ul>
37
40
  <br>
38
41
  </li>
39
- <% end %>
40
- </ul>
41
- <ul class="vertical menu heads">
42
- <li>
43
- <strong><%= t ".head_tags" %></strong>
44
- <ul class="vertical menu">
42
+ <% end %>
43
+ </ul>
44
+ <ul class="vertical menu heads">
45
+ <li>
46
+ <strong><%= t ".head_tags" %></strong>
47
+ <ul class="vertical menu">
45
48
  <% {
46
- CSS: "//head/link[@rel='stylesheet'][contains(@href,'decidim_decidim_awesome')]",
47
- JavaScript: "//script[contains(@src,'decidim_decidim_awesome')]"
48
- }.each do |part, xpath| %>
49
+ CSS: "//head/link[@rel='stylesheet'][contains(@href,'decidim_decidim_awesome')]",
50
+ JavaScript: "//script[contains(@src,'decidim_decidim_awesome')]"
51
+ }.each do |part, xpath| %>
49
52
  <li>
50
53
  <%= part %>
51
54
  <% if head.xpath(xpath).count.positive? %>
@@ -56,16 +59,16 @@
56
59
  <code class="help-text code-block"><%= head_addons(part) %></code>
57
60
  <% end %>
58
61
  </li>
59
- <% end %>
60
- </ul>
61
- </li>
62
- <li>
63
- <strong><%= t ".admin_head_tags" %></strong>
64
- <ul class="vertical menu">
62
+ <% end %>
63
+ </ul>
64
+ </li>
65
+ <li>
66
+ <strong><%= t ".admin_head_tags" %></strong>
67
+ <ul class="vertical menu">
65
68
  <% {
66
- CSS: "//head/link[@rel='stylesheet'][contains(@href,'decidim_admin_decidim_awesome')]",
67
- JavaScript: "//script[contains(@src,'decidim_admin_decidim_awesome')]"
68
- }.each do |part, xpath| %>
69
+ CSS: "//head/link[@rel='stylesheet'][contains(@href,'decidim_admin_decidim_awesome')]",
70
+ JavaScript: "//script[contains(@src,'decidim_admin_decidim_awesome')]"
71
+ }.each do |part, xpath| %>
69
72
  <li>
70
73
  <%= part %>
71
74
  <% if admin_head.xpath(xpath).count.positive? %>
@@ -76,9 +79,8 @@
76
79
  <code class="help-text code-block"><%= admin_addons(part) %></code>
77
80
  <% end %>
78
81
  </li>
79
- <% end %>
80
- </ul>
81
- </li>
82
- </ul>
83
- </div>
82
+ <% end %>
83
+ </ul>
84
+ </li>
85
+ </ul>
84
86
  </div>
@@ -2,6 +2,11 @@
2
2
  <%= t("config.#{var}",
3
3
  scope: "activemodel.attributes",
4
4
  id: "<span class='awesome-auto-edit' data-var='#{var}' data-scope='#{scope}' data-key='#{key}'>#{key}</span>").html_safe %>
5
- <%= icon_link_to "pencil", "#", t("edit_label", scope: "decidim.decidim_awesome.admin.config.form"), class: "action-icon--edit awesome-auto-edit", data: { "scope" => "#{scope}" } %>
6
- <%= link_to t("remove", scope: "decidim.decidim_awesome.admin.config.form_#{var}"), delete_path, method: :delete, class: "float-right delete-box", data: { confirm: t("sure_to_remove", scope: "decidim.decidim_awesome.admin.config.form_#{var}") } %>
5
+
6
+ <%= icon_link_to "pencil-line", "#", t("edit_label", scope: "decidim.decidim_awesome.admin.config.form"), class: "awesome-auto-edit", data: { "scope" => "#{scope}" } %>
7
+
8
+ <%= link_to delete_path, method: :delete, class: "awesome-auto-delete", title: t("remove", scope: "decidim.decidim_awesome.admin.config.form_#{var}"), data: { confirm: t("sure_to_remove", scope: "decidim.decidim_awesome.admin.config.form_#{var}") } do %>
9
+ <%= icon "delete-bin-line" %>
10
+ <%= t("delete", scope: "decidim.decidim_awesome.admin.config.form_#{var}") %>
11
+ <% end %>
7
12
  <% end %>
@@ -1,27 +1,34 @@
1
- <div class="constraints-editor" data-key="<%= key %>">
2
- <div class="callout" style="display:none" data-closable>
3
- <p></p>
4
- <button class="close-button" aria-label="Dismiss alert" type="button" data-close>
5
- <span aria-hidden="true">&times;</span>
6
- </button>
7
- </div>
8
-
9
- <h5><%= t ".title" %></h5>
1
+ <div class="constraints-editor mb-8 mt-4" data-key="<%= key %>">
2
+ <%= cell "decidim/announcement", "<p></p>".html_safe, hidden: true %>
3
+ <h5 class="mb-2"><%= t ".title" %></h5>
10
4
  <% if constraints.blank? %>
11
5
  <span class="label warning"><%= t ".always" %></span>
12
6
  <% end %>
13
7
 
14
8
  <ul class="constraints-list<%= " inactive" if constraints&.detect{|c| c.settings["participatory_space_manifest"]=="none" } %>">
15
9
  <% constraints&.each do |constraint| %>
16
- <li>
17
- <% constraint.settings.reverse_each do |k, val| %>
18
- <span class="label <%= k %> constraint-<%= val %>"><%= translate_constraint_value constraint, k %></span>
19
- <% end %>
20
- <a href="<%= constraint_path(id: constraint.id, key: key) %>" class="edit-condition"><%= t ".edit" %></a>
21
- <%= link_to t(".delete"), constraint_path(id: constraint.id), remote: true, method: :delete %>
22
- </li>
23
- <% end %>
10
+ <li>
11
+ <% constraint.settings.reverse_each do |k, val| %>
12
+ <span class="label <%= k %> constraint-<%= val %>"><%= translate_constraint_value constraint, k %></span>
13
+ <% end %>
14
+
15
+ <div class="inline-flex items-center gap-1 ml-10">
16
+ <button id="<%= "edit-#{key}-#{constraint.id}" %>" type="button" name="button" class="edit-condition button button__xs button__transparent-secondary" data-dialog-open="<%= "edit-modal-#{key}" %>" data-constraints-url="<%= constraint_path(id: constraint.id, key: key) %>">
17
+ <%= t ".edit" %>
18
+ </button>
19
+
20
+ <%= link_to t(".delete"), constraint_path(id: constraint.id), remote: true, method: :delete, class: "button button__xs button__transparent-primary" %>
21
+ </div>
22
+ </li>
23
+ <% end %>
24
24
  </ul>
25
- <a href="<%= new_constraint_path(key: key) %>" class="add-condition" data-open="constraintsModal"><%= t ".add_condition" %></a>
25
+
26
+ <button id="<%= "new-#{key}" %>" type="button" name="button" class="add-condition button button__xs button__secondary" data-dialog-open="<%= "new-modal-#{key}" %>" data-constraints-url="<%= new_constraint_path(key: key) %>">
27
+ <%= icon "add-box-line" %>
28
+ <%= t ".add_condition" %>
29
+ </button>
26
30
 
27
31
  </div>
32
+
33
+ <%= decidim_modal id: "edit-modal-#{key}", data: { constraint: key }, remote: true %>
34
+ <%= decidim_modal id: "new-modal-#{key}", data: { constraint: key }, remote: true %>
@@ -1,21 +1,22 @@
1
- <div class="row column decidim_awesome-form">
1
+ <div class="form__wrapper row column decidim_awesome-form">
2
2
  <% if config_enabled? :scoped_admins %>
3
3
  <p class="help-text"><%= t("help.scoped_admins", scope: "decidim.decidim_awesome.admin.config.form") %></p>
4
4
 
5
5
  <% form.object.scoped_admins&.each do |key, value| %>
6
- <div class="scoped_admins_container" data-key="<%= key %>">
6
+ <div class="card p-4 scoped_admins_container js-box-container" data-key="<%= key %>">
7
7
  <%= render(partial: "decidim/decidim_awesome/admin/config/autoedit_box_label", locals: { var: "scoped_admins", key: key, scope: "scoped_admin_#{key}", delete_path: decidim_admin_decidim_awesome.scoped_admin_path(key: key) }) %>
8
8
  <p class="form-error is-visible" id="scoped-admin-error-<%= $key %>"><%= errors[key.to_sym].join("<br>") if errors %></p>
9
9
 
10
- <%= select_tag "config[scoped_admins][#{key}]", options_from_collection_for_select(users_for(value), :id, :text, proc { true }), { include_blank: false , class: "multiusers-select", multiple: true, data: { url: decidim_admin_decidim_awesome.users_path } } %>
10
+ <%= select_tag "config[scoped_admins][#{key}]", options_for_select(users_for(value), value), { include_blank: false , class: "multiusers-select", multiple: true, data: { url: decidim_admin_decidim_awesome.users_path } } %>
11
11
 
12
12
  <%= render(partial: "decidim/decidim_awesome/admin/config/constraints", locals: { key: "scoped_admin_#{key}", constraints: constraints_for("scoped_admin_#{key}") }) %>
13
13
  </div>
14
14
  <% end %>
15
15
 
16
- <%= link_to t("new", scope: "decidim.decidim_awesome.admin.config.form_scoped_admins"), decidim_admin_decidim_awesome.scoped_admins_path, method: :post %>
16
+ <%= link_to decidim_admin_decidim_awesome.scoped_admins_path, method: :post, class: "button button__sm button__text-secondary mr-auto" do %>
17
+ <%= icon("add-box-line") %>
18
+ <%= t("new", scope: "decidim.decidim_awesome.admin.config.form_scoped_admins") %>
19
+ <% end %>
17
20
 
18
21
  <% end %>
19
22
  </div>
20
-
21
- <%= javascript_pack_tag "decidim_decidim_awesome_admin_form_exit_warn" %>
@@ -1,18 +1,14 @@
1
- <div class="row column decidim_awesome-form">
2
- <p class="help-text"><%= t("help.drag_and_drop_supported", scope: "decidim.decidim_awesome.admin.config.form") %></p>
3
- <p class="help-text"><%= t("help.original_editor_override", scope: "decidim.decidim_awesome.admin.config.form") %></p>
4
-
5
- <% enabled_configs([:allow_images_in_full_editor, :allow_images_in_small_editor]).each do |key| %>
6
- <%= form.check_box key %>
7
- <p class="help-text"><%= t("help.#{key}", scope: "decidim.decidim_awesome.admin.config.form") %></p>
8
-
9
- <%= render(partial: "decidim/decidim_awesome/admin/config/constraints", locals: { key: key, constraints: constraints_for(key) }) %>
10
- <% end %>
11
-
12
- <% enabled_configs([:use_markdown_editor, :allow_images_in_markdown_editor]).each do |key| %>
13
- <%= form.check_box key %>
14
- <p class="help-text"><%= t("help.#{key}", scope: "decidim.decidim_awesome.admin.config.form") %></p>
15
-
16
- <%= render(partial: "decidim/decidim_awesome/admin/config/constraints", locals: { key: key, constraints: constraints_for(key) }) %>
1
+ <div class="form__wrapper decidim_awesome-form">
2
+ <div class="row column">
3
+ <p class="help-text"><%= t("help.drag_and_drop_supported", scope: "decidim.decidim_awesome.admin.config.form") %>
4
+ <%= t("help.original_editor_override", scope: "decidim.decidim_awesome.admin.config.form") %></p>
5
+ </div>
6
+
7
+ <% enabled_configs([:allow_images_in_editors, :allow_videos_in_editors]).each do |key| %>
8
+ <div class="row column card p-4">
9
+ <%= form.check_box key, help_text: t("help.#{key}", scope: "decidim.decidim_awesome.admin.config.form") %>
10
+
11
+ <%= render(partial: "decidim/decidim_awesome/admin/config/constraints", locals: { key: key, constraints: constraints_for(key) }) %>
12
+ </div>
17
13
  <% end %>
18
14
  </div>
@@ -1,44 +1,60 @@
1
- <div class="row column decidim_awesome-form">
1
+ <div class="form__wrapper decidim_awesome-form">
2
2
  <% if config_enabled? :intergram_for_public %>
3
+ <div class="row column">
3
4
  <%= form.check_box :intergram_for_public %>
4
- <p class="help-text"><%= t("help.intergram_about", scope: "decidim.decidim_awesome.admin.config.form").html_safe %></p>
5
+ <span class="help-text mb-4" style="margin-top:-1rem;">
6
+ <%= t("help.intergram_about", scope: "decidim.decidim_awesome.admin.config.form").html_safe %>
7
+ </span>
5
8
 
6
9
  <%= render(partial: "decidim/decidim_awesome/admin/config/constraints", locals: { key: :intergram_for_public, constraints: constraints_for(:intergram_for_public) }) %>
7
10
 
8
11
  <%= fields_for "config[intergram_for_public_settings]", form.object.intergram_for_public_settings do |f| %>
9
- <%= f.text_field :chat_id, label: t("intergram_chat_id", scope: "activemodel.attributes.config") %>
10
- <p class="help-text"><%= t("help.intergram_config", scope: "decidim.decidim_awesome.admin.config.form").html_safe %></p>
12
+ <div class="mb-4">
13
+ <%= f.text_field :chat_id, label: t("intergram_chat_id", scope: "activemodel.attributes.config") %>
14
+ <p class="help-text" style="margin-top: -1rem;">
15
+ <%= t("help.intergram_config", scope: "decidim.decidim_awesome.admin.config.form").html_safe %>
16
+ </p>
17
+ </div>
18
+
11
19
  <%= f.check_box :require_login, label: t("intergram_require_login", scope: "activemodel.attributes.config") %>
12
- <%= f.check_box :use_floating_button, label: t("intergram_use_floating_button", scope: "activemodel.attributes.config") %>
13
- <%= f.color_field :color, label: t("intergram_color", scope: "activemodel.attributes.config") %>
20
+ <%= f.check_box :use_floating_button, class: "mb-4", label: t("intergram_use_floating_button", scope: "activemodel.attributes.config"), label_options: { class: "block" } %>
21
+ <%= f.color_field :color, class: "mb-4 block w-full p-1", label: t("intergram_color", scope: "activemodel.attributes.config") %>
14
22
 
15
- <%= f.text_field :title_open, label: t("intergram_title_open", scope: "activemodel.attributes.config"), placeholder: t("decidim.decidim_awesome.config.intergram.title_open") %>
16
- <%= f.text_field :title_closed, label: t("intergram_title_closed", scope: "activemodel.attributes.config"), placeholder: t("decidim.decidim_awesome.config.intergram.title_closed") %>
17
- <%= f.text_field :intro_message, label: t("intergram_intro_message", scope: "activemodel.attributes.config"), placeholder: t("decidim.decidim_awesome.config.intergram.intro_message") %>
18
- <%= f.text_field :auto_no_response, label: t("intergram_auto_no_response", scope: "activemodel.attributes.config"), placeholder: t("decidim.decidim_awesome.config.intergram.auto_no_response") %>
23
+ <%= f.text_field :title_open, class: "mb-4", label: t("intergram_title_open", scope: "activemodel.attributes.config"), placeholder: t("decidim.decidim_awesome.config.intergram.title_open") %>
24
+ <%= f.text_field :title_closed, class: "mb-4", label: t("intergram_title_closed", scope: "activemodel.attributes.config"), placeholder: t("decidim.decidim_awesome.config.intergram.title_closed") %>
25
+ <%= f.text_field :intro_message, class: "mb-4", label: t("intergram_intro_message", scope: "activemodel.attributes.config"), placeholder: t("decidim.decidim_awesome.config.intergram.intro_message") %>
26
+ <%= f.text_field :auto_no_response, class: "mb-4", label: t("intergram_auto_no_response", scope: "activemodel.attributes.config"), placeholder: t("decidim.decidim_awesome.config.intergram.auto_no_response") %>
19
27
  <% end %>
28
+ </div>
20
29
  <% end %>
21
30
  </div>
22
31
 
23
- <div class="row column decidim_awesome-form">
32
+ <div class="form__wrapper decidim_awesome-form">
24
33
  <% if config_enabled? :intergram_for_admins %>
34
+ <div class="row column">
25
35
  <%= form.check_box :intergram_for_admins %>
26
- <p class="help-text"><%= t("help.intergram_about", scope: "decidim.decidim_awesome.admin.config.form").html_safe %></p>
36
+ <span class="help-text mb-4" style="margin-top:-1rem;">
37
+ <%= t("help.intergram_about", scope: "decidim.decidim_awesome.admin.config.form").html_safe %>
38
+ </span>
27
39
 
28
40
  <%= render(partial: "decidim/decidim_awesome/admin/config/constraints", locals: { key: :intergram_for_admins, constraints: constraints_for(:intergram_for_admins) }) %>
29
41
 
30
42
  <%= fields_for "config[intergram_for_admins_settings]", form.object.intergram_for_admins_settings do |f| %>
31
- <%= f.text_field :chat_id, label: t("intergram_chat_id", scope: "activemodel.attributes.config") %>
32
- <p class="help-text"><%= t("help.intergram_config", scope: "decidim.decidim_awesome.admin.config.form").html_safe %></p>
33
-
34
- <%= f.check_box :use_floating_button, label: t("intergram_use_floating_button", scope: "activemodel.attributes.config") %>
35
- <%= f.color_field :color, label: t("intergram_color", scope: "activemodel.attributes.config") %>
36
-
37
- <%= f.text_field :title_open, label: t("intergram_title_open", scope: "activemodel.attributes.config"), placeholder: t("decidim.decidim_awesome.config.intergram.title_open") %>
38
- <%= f.text_field :title_closed, label: t("intergram_title_closed", scope: "activemodel.attributes.config"), placeholder: t("decidim.decidim_awesome.config.intergram.title_closed") %>
39
- <%= f.text_field :intro_message, label: t("intergram_intro_message", scope: "activemodel.attributes.config"), placeholder: t("decidim.decidim_awesome.config.intergram.intro_message") %>
40
- <%= f.text_field :auto_no_response, label: t("intergram_auto_no_response", scope: "activemodel.attributes.config"), placeholder: t("decidim.decidim_awesome.config.intergram.auto_no_response") %>
43
+ <div class="mb-4">
44
+ <%= f.text_field :chat_id, label: t("intergram_chat_id", scope: "activemodel.attributes.config") %>
45
+ <p class="help-text" style="margin-top: -1rem;">
46
+ <%= t("help.intergram_config", scope: "decidim.decidim_awesome.admin.config.form").html_safe %>
47
+ </p>
48
+ </div>
49
+
50
+ <%= f.check_box :use_floating_button, class: "mb-4", label: t("intergram_use_floating_button", scope: "activemodel.attributes.config") %>
51
+ <%= f.color_field :color, class: "mb-4 block w-full p-1", label: t("intergram_color", scope: "activemodel.attributes.config") %>
52
+
53
+ <%= f.text_field :title_open, class: "mb-4", label: t("intergram_title_open", scope: "activemodel.attributes.config"), placeholder: t("decidim.decidim_awesome.config.intergram.title_open") %>
54
+ <%= f.text_field :title_closed, class: "mb-4", label: t("intergram_title_closed", scope: "activemodel.attributes.config"), placeholder: t("decidim.decidim_awesome.config.intergram.title_closed") %>
55
+ <%= f.text_field :intro_message, class: "mb-4", label: t("intergram_intro_message", scope: "activemodel.attributes.config"), placeholder: t("decidim.decidim_awesome.config.intergram.intro_message") %>
56
+ <%= f.text_field :auto_no_response, class: "mb-4", label: t("intergram_auto_no_response", scope: "activemodel.attributes.config"), placeholder: t("decidim.decidim_awesome.config.intergram.auto_no_response") %>
41
57
  <% end %>
42
-
58
+ </div>
43
59
  <% end %>
44
60
  </div>
@@ -1,25 +1,43 @@
1
- <div class="callout warning"><%= t("caution", scope: "decidim.decidim_awesome.admin.config") %></div>
2
- <div class="row column decidim_awesome-form">
3
- <% if config_enabled? :proposal_custom_fields %>
4
- <p class="help-text"><%= t("help.proposal_custom_fields", scope: "decidim.decidim_awesome.admin.config.form") %></p>
5
- <p class="help-text"><%= t("help.proposal_custom_fields_example", scope: "decidim.decidim_awesome.admin.config.form") %></p>
6
- <p class="help-text"><%= t("help.proposal_custom_fields_translations", scope: "decidim.decidim_awesome.admin.config.form") %></p>
7
-
8
- <% form.object.proposal_custom_fields&.each do |key, value| %>
9
- <div class="proposal_custom_fields_container" data-key="<%= key %>">
10
- <%= render(partial: "decidim/decidim_awesome/admin/config/autoedit_box_label", locals: { var: "proposal_custom_fields", key: key, scope: "proposal_custom_field_#{key}", delete_path: decidim_admin_decidim_awesome.proposal_custom_field_path(key: key) }) %>
1
+ <%
2
+ priv = (config_var == "proposal_private_custom_fields")
3
+ field = priv ? "proposal_private_custom_field" : "proposal_custom_field"
4
+ %>
5
+ <div class="form__wrapper row column decidim_awesome-form">
6
+ <% if config_enabled? config_var %>
7
+ <% if priv %>
8
+ <div>
9
+ <p class="help-text text-alert"><%= t("help.proposal_private_custom_fields", scope: "decidim.decidim_awesome.admin.config.form") %></p>
10
+ <p class="help-text"><%= t("help.proposal_private_custom_fields_translations",
11
+ scope: "decidim.decidim_awesome.admin.config.form",
12
+ warning: content_tag(:i, t("decidim.decidim_awesome.proposal_private_custom_fields_disclosure")),
13
+ key: content_tag("code", "decidim.decidim_awesome.proposal_private_custom_fields_disclosure")
14
+ ).html_safe %></p>
15
+ </div>
16
+ <% else %>
17
+ <div class="colors-help">
18
+ <p class="help-text"><%= t("help.proposal_custom_fields", scope: "decidim.decidim_awesome.admin.config.form") %></p>
19
+ <p class="help-text"><%= t("help.proposal_custom_fields_example", scope: "decidim.decidim_awesome.admin.config.form") %></p>
20
+ <p class="help-text"><%= t("help.proposal_custom_fields_translations", scope: "decidim.decidim_awesome.admin.config.form") %></p>
21
+ </div>
22
+ <% end %>
23
+ <% form.object.send(config_var)&.each do |key, value| %>
24
+ <div class="card p-4 proposal_custom_fields_container<%= " private" if priv %> js-box-container" data-key="<%= key %>" data-var="<%= config_var %>">
25
+ <%= render("decidim/decidim_awesome/admin/config/autoedit_box_label", var: config_var, key: key, scope: "#{field}_#{key}", delete_path: decidim_admin_decidim_awesome.proposal_custom_field_path(key: key, private: priv)) %>
11
26
  <p class="form-error is-visible"><%= errors[key.to_sym].join("<br>") if errors %></p>
12
- <%= hidden_field_tag key, value, name: "config[proposal_custom_fields][#{key}]" %>
13
- <div class="proposal_custom_fields_editor">
27
+
28
+ <%= hidden_field_tag key, value, name: "config[#{config_var}][#{key}]" %>
29
+
30
+ <div class="proposal_custom_fields_editor mt-4<%= " private" if priv %>">
14
31
  <div class="loading-spinner"></div>
15
32
  </div>
16
- <%= render(partial: "decidim/decidim_awesome/admin/config/constraints", locals: { key: "proposal_custom_field_#{key}", constraints: constraints_for("proposal_custom_field_#{key}") }) %>
33
+
34
+ <%= render("decidim/decidim_awesome/admin/config/constraints", key: "#{field}_#{key}", constraints: constraints_for("#{field}_#{key}")) %>
17
35
  </div>
18
36
  <% end %>
19
37
 
20
- <%= link_to t(".new"), decidim_admin_decidim_awesome.proposal_custom_fields_path, method: :post %>
21
-
38
+ <%= link_to decidim_admin_decidim_awesome.proposal_custom_fields_path(private: priv), method: :post, class: "button button__sm button__text-secondary mr-auto" do %>
39
+ <%= icon("add-box-line") %>
40
+ <%= t("new", scope: "decidim.decidim_awesome.admin.config.form_#{config_var}") %>
41
+ <% end %>
22
42
  <% end %>
23
43
  </div>
24
-
25
- <%= javascript_pack_tag "decidim_decidim_awesome_admin_form_exit_warn" %>
@@ -0,0 +1 @@
1
+ <%= render "form_proposal_custom_fields", **local_assigns %>