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,108 +1,96 @@
1
- <div class="row column decidim_awesome-form">
2
- <% if config_enabled? :allow_images_in_proposals %>
3
- <p class="text-info"><%= t("rich_text_editor_in_public_views", scope: "decidim.decidim_awesome.admin.config") if current_organization.rich_text_editor_in_public_views %></p>
4
-
5
- <%= form.check_box :allow_images_in_proposals, disabled: current_organization.rich_text_editor_in_public_views %>
6
- <p class="help-text"><%= t("help.allow_images_in_proposals", scope: "decidim.decidim_awesome.admin.config.form") %></p>
7
-
8
- <% unless current_organization.rich_text_editor_in_public_views %>
1
+ <div class="form__wrapper decidim_awesome-form gap-0">
2
+ <% if config_enabled?(:allow_images_in_proposals) && !current_organization.rich_text_editor_in_public_views %>
3
+ <div class="row column">
4
+ <%= form.check_box :allow_images_in_proposals, help_text: t("help.allow_images_in_proposals", scope: "decidim.decidim_awesome.admin.config.form") %>
9
5
  <%= render(partial: "decidim/decidim_awesome/admin/config/constraints", locals: { key: :allow_images_in_proposals, constraints: constraints_for(:allow_images_in_proposals) }) %>
10
- <% end %>
6
+ </div>
11
7
  <% end %>
12
- </div>
13
-
14
- <% if config_enabled? :additional_proposal_sortings %>
15
- </div> <!-- .card-section -->
16
- </div><!-- .card -->
17
8
 
18
- <div class="card">
19
- <div class="card-divider">
9
+ <% if config_enabled?(:additional_proposal_sortings) %>
10
+ <div class="row column">
20
11
  <h2 class="card-title"><%= t("additional_proposal_sortings.title", scope: "decidim.decidim_awesome.admin.config.form") %></h2>
21
12
  </div>
22
- <div class="card-section">
23
- <div class="row column decidim_awesome-form">
24
- <%= form.select :additional_proposal_sortings, @form.additional_proposal_sorting_labels, { include_blank: false }, { multiple: true } %>
25
- <p class="help-text">
26
- <%= t("additional_proposal_sortings.help", scope: "decidim.decidim_awesome.admin.config.form") %> <%= link_to t("additional_proposal_sortings.enable_all", scope: "decidim.decidim_awesome.admin.config.form"), "#", id: "additional_proposal_sortings-enable-all" %>.
27
- </p>
28
-
29
- <%= render(partial: "decidim/decidim_awesome/admin/config/constraints", locals: { key: :additional_proposal_sortings, constraints: constraints_for(:additional_proposal_sortings) }) %>
30
- </div>
31
- <% end %>
13
+ <div class="row column">
14
+ <%= form.select :additional_proposal_sortings, @form.additional_proposal_sorting_labels, { include_blank: false }, { multiple: true } %>
32
15
 
33
- <% if config_enabled? %i(validate_title_min_length validate_title_max_caps_percent validate_title_max_marks_together validate_title_start_with_caps) %>
34
- </div> <!-- .card-section -->
35
- </div><!-- .card -->
16
+ <p class="help-text"><%= t("additional_proposal_sortings.help", scope: "decidim.decidim_awesome.admin.config.form") %> <%= link_to t("additional_proposal_sortings.enable_all", scope: "decidim.decidim_awesome.admin.config.form"), "#", id: "additional_proposal_sortings-enable-all" %>.</p>
36
17
 
37
- <div class="card">
38
- <div class="card-divider">
18
+ <%= render(partial: "decidim/decidim_awesome/admin/config/constraints", locals: { key: :additional_proposal_sortings, constraints: constraints_for(:additional_proposal_sortings) }) %>
19
+ </div>
20
+ <% end %>
21
+
22
+ <% if config_enabled?(:validate_title_min_length, :validate_title_max_caps_percent, :validate_title_max_marks_together, :validate_title_start_with_caps) %>
23
+ <div class="row column">
39
24
  <h2 class="card-title"><%= t("validators.title", scope: "decidim.decidim_awesome.admin.config.form") %></h2>
40
25
  </div>
41
- <div class="card-section">
42
- <div class="row column decidim_awesome-form">
43
- <% if config_enabled? :validate_title_start_with_caps %>
44
- <%= form.check_box :validate_title_start_with_caps %>
26
+ <% if config_enabled? :validate_title_start_with_caps %>
27
+ <div class="row column">
28
+ <%= form.check_box :validate_title_start_with_caps %>
45
29
 
46
- <%= render(partial: "decidim/decidim_awesome/admin/config/constraints", locals: { key: :validate_title_start_with_caps, constraints: constraints_for(:validate_title_start_with_caps) }) %>
47
- <% end %>
30
+ <%= render(partial: "decidim/decidim_awesome/admin/config/constraints", locals: { key: :validate_title_start_with_caps, constraints: constraints_for(:validate_title_start_with_caps) }) %>
31
+ </div>
32
+ <% end %>
48
33
 
49
- <% if config_enabled? :validate_title_min_length %>
50
- <%= form.number_field :validate_title_min_length %>
51
- <p class="help-text"><%= t("help.validate_title_min_length", scope: "decidim.decidim_awesome.admin.config.form") %></p>
34
+ <% if config_enabled?(:validate_title_min_length) %>
35
+ <div class="row column">
36
+ <%= form.number_field :validate_title_min_length, help_text: t("help.validate_title_min_length", scope: "decidim.decidim_awesome.admin.config.form") %>
52
37
 
53
- <%= render(partial: "decidim/decidim_awesome/admin/config/constraints", locals: { key: :validate_title_min_length, constraints: constraints_for(:validate_title_min_length) }) %>
54
- <% end %>
38
+ <%= render(partial: "decidim/decidim_awesome/admin/config/constraints", locals: { key: :validate_title_min_length, constraints: constraints_for(:validate_title_min_length) }) %>
39
+ </div>
40
+ <% end %>
55
41
 
56
- <% if config_enabled? :validate_title_max_caps_percent %>
57
- <%= form.number_field :validate_title_max_caps_percent %>
58
- <p class="help-text"><%= t("help.validate_title_max_caps_percent", scope: "decidim.decidim_awesome.admin.config.form") %></p>
42
+ <% if config_enabled?(:validate_title_max_caps_percent) %>
43
+ <div class="row column">
44
+ <%= form.number_field :validate_title_max_caps_percent, help_text: t("help.validate_title_max_caps_percent", scope: "decidim.decidim_awesome.admin.config.form") %>
59
45
 
60
- <%= render(partial: "decidim/decidim_awesome/admin/config/constraints", locals: { key: :validate_title_max_caps_percent, constraints: constraints_for(:validate_title_max_caps_percent) }) %>
61
- <% end %>
46
+ <%= render(partial: "decidim/decidim_awesome/admin/config/constraints", locals: { key: :validate_title_max_caps_percent, constraints: constraints_for(:validate_title_max_caps_percent) }) %>
47
+ </div>
48
+ <% end %>
62
49
 
63
- <% if config_enabled? :validate_title_max_marks_together %>
64
- <%= form.number_field :validate_title_max_marks_together %>
65
- <p class="help-text"><%= t("help.validate_title_max_marks_together", scope: "decidim.decidim_awesome.admin.config.form") %></p>
50
+ <% if config_enabled?(:validate_title_max_marks_together) %>
51
+ <div class="row column">
52
+ <%= form.number_field :validate_title_max_marks_together, help_text: t("help.validate_title_max_marks_together", scope: "decidim.decidim_awesome.admin.config.form") %>
66
53
 
67
- <%= render(partial: "decidim/decidim_awesome/admin/config/constraints", locals: { key: :validate_title_max_marks_together, constraints: constraints_for(:validate_title_max_marks_together) }) %>
68
- <% end %>
54
+ <%= render(partial: "decidim/decidim_awesome/admin/config/constraints", locals: { key: :validate_title_max_marks_together, constraints: constraints_for(:validate_title_max_marks_together) }) %>
69
55
  </div>
70
- <% end %>
71
-
72
- <% if config_enabled? %i(validate_body_min_length validate_body_max_caps_percent validate_body_max_marks_together validate_body_start_with_caps) %>
73
- </div> <!-- .card-section -->
74
- </div><!-- .card -->
56
+ <% end %>
57
+ <% end %>
75
58
 
76
- <div class="card">
77
- <div class="card-divider">
59
+ <% if config_enabled?(:validate_body_min_length, :validate_body_max_caps_percent, :validate_body_max_marks_together, :validate_body_start_with_caps) %>
60
+ <div class="row column">
78
61
  <h2 class="card-title"><%= t("validators.body", scope: "decidim.decidim_awesome.admin.config.form") %></h2>
79
62
  </div>
80
- <div class="card-section">
81
- <% if config_enabled? :validate_body_start_with_caps %>
82
- <%= form.check_box :validate_body_start_with_caps %>
83
63
 
84
- <%= render(partial: "decidim/decidim_awesome/admin/config/constraints", locals: { key: :validate_body_start_with_caps, constraints: constraints_for(:validate_body_start_with_caps) }) %>
85
- <% end %>
64
+ <% if config_enabled?(:validate_body_start_with_caps) %>
65
+ <div class="row column">
66
+ <%= form.check_box :validate_body_start_with_caps %>
67
+
68
+ <%= render(partial: "decidim/decidim_awesome/admin/config/constraints", locals: { key: :validate_body_start_with_caps, constraints: constraints_for(:validate_body_start_with_caps) }) %>
69
+ </div>
70
+ <% end %>
86
71
 
87
- <% if config_enabled? :validate_body_min_length %>
88
- <%= form.number_field :validate_body_min_length %>
89
- <p class="help-text"><%= t("help.validate_body_min_length", scope: "decidim.decidim_awesome.admin.config.form") %></p>
72
+ <% if config_enabled?(:validate_body_min_length) %>
73
+ <div class="row column">
74
+ <%= form.number_field :validate_body_min_length, help_text: t("help.validate_body_min_length", scope: "decidim.decidim_awesome.admin.config.form") %>
90
75
 
91
- <%= render(partial: "decidim/decidim_awesome/admin/config/constraints", locals: { key: :validate_body_min_length, constraints: constraints_for(:validate_body_min_length) }) %>
92
- <% end %>
76
+ <%= render(partial: "decidim/decidim_awesome/admin/config/constraints", locals: { key: :validate_body_min_length, constraints: constraints_for(:validate_body_min_length) }) %>
77
+ </div>
78
+ <% end %>
93
79
 
94
- <% if config_enabled? :validate_body_max_caps_percent %>
95
- <%= form.number_field :validate_body_max_caps_percent %>
96
- <p class="help-text"><%= t("help.validate_body_max_caps_percent", scope: "decidim.decidim_awesome.admin.config.form") %></p>
80
+ <% if config_enabled?(:validate_body_max_caps_percent) %>
81
+ <div class="row column">
82
+ <%= form.number_field :validate_body_max_caps_percent, help_text: t("help.validate_body_max_caps_percent", scope: "decidim.decidim_awesome.admin.config.form") %>
97
83
 
98
- <%= render(partial: "decidim/decidim_awesome/admin/config/constraints", locals: { key: :validate_body_max_caps_percent, constraints: constraints_for(:validate_body_max_caps_percent) }) %>
99
- <% end %>
84
+ <%= render(partial: "decidim/decidim_awesome/admin/config/constraints", locals: { key: :validate_body_max_caps_percent, constraints: constraints_for(:validate_body_max_caps_percent) }) %>
85
+ </div>
86
+ <% end %>
100
87
 
101
- <% if config_enabled? :validate_body_max_marks_together %>
102
- <%= form.number_field :validate_body_max_marks_together %>
103
- <p class="help-text"><%= t("help.validate_body_max_marks_together", scope: "decidim.decidim_awesome.admin.config.form") %></p>
88
+ <% if config_enabled?(:validate_body_max_marks_together) %>
89
+ <div class="row column">
90
+ <%= form.number_field :validate_body_max_marks_together, help_text: t("help.validate_body_max_marks_together", scope: "decidim.decidim_awesome.admin.config.form") %>
104
91
 
105
- <%= render(partial: "decidim/decidim_awesome/admin/config/constraints", locals: { key: :validate_body_max_marks_together, constraints: constraints_for(:validate_body_max_marks_together) }) %>
106
- <% end %>
92
+ <%= render(partial: "decidim/decidim_awesome/admin/config/constraints", locals: { key: :validate_body_max_marks_together, constraints: constraints_for(:validate_body_max_marks_together) }) %>
107
93
  </div>
108
- <% end %>
94
+ <% end %>
95
+ <% end %>
96
+ </div>
@@ -1,16 +1,19 @@
1
- <div class="row column decidim_awesome-form">
1
+ <div class="form__wrapper row column decidim_awesome-form">
2
2
  <% if config_enabled? :scoped_styles %>
3
- <p class="help-text"><%= t("help.scoped_styles", scope: "decidim.decidim_awesome.admin.config.form") %>
4
- <%= t("help.scoped_styles_variables", scope: "decidim.decidim_awesome.admin.config.form") %>
5
- </p>
6
- <p class="help-text" style="white-space: unset">
7
- <% ["primary", "secondary", "success", "warning", "alert", "highlight", "highlight_alternative"].each do |color| %>
8
- <span class="color-box <%= color %>" style="background-color: <%= current_organization.colors[color] %>"></span> var(--<%= color %>)
3
+ <div class="colors-help">
4
+ <p><%= t("help.scoped_styles", scope: "decidim.decidim_awesome.admin.config.form") %>
5
+ <%= t("help.scoped_styles_variables", scope: "decidim.decidim_awesome.admin.config.form") %>
6
+ </p>
7
+ <p class="colors">
8
+ <% ["primary", "secondary", "tertiary", "success", "warning", "alert"].each do |color| %>
9
+ <span class="color-box <%= color %>" style="background-color: <%= current_organization.colors[color] %>"></span>
10
+ <code>var(--<%= color %>)</code>
9
11
  <% end %>
10
- </p>
12
+ </p>
13
+ </div>
11
14
 
12
15
  <% form.object.scoped_styles&.each do |key, value| %>
13
- <div class="scoped_styles_container" data-key="<%= key %>">
16
+ <div class="scoped_styles_container p-4 js-box-container" data-key="<%= key %>">
14
17
  <%= render(partial: "decidim/decidim_awesome/admin/config/autoedit_box_label", locals: { var: "scoped_styles", key: key, scope: "scoped_style_#{key}", delete_path: decidim_admin_decidim_awesome.scoped_style_path(key: key) }) %>
15
18
  <p class="form-error is-visible" id="custom-style-error-<%= key %>"><%= errors[key.to_sym].join("<br>") if errors %></p>
16
19
  <%= text_area_tag key, value, name: "config[scoped_styles][#{key}]", rows: 5 %>
@@ -18,9 +21,10 @@
18
21
  </div>
19
22
  <% end %>
20
23
 
21
- <%= link_to t("new", scope: "decidim.decidim_awesome.admin.config.form_scoped_styles"), decidim_admin_decidim_awesome.scoped_styles_path, method: :post %>
24
+ <%= link_to decidim_admin_decidim_awesome.scoped_styles_path, method: :post, class: "button button__sm button__text-secondary mr-auto" do %>
25
+ <%= icon("add-box-line") %>
26
+ <%= t("new", scope: "decidim.decidim_awesome.admin.config.form_scoped_styles") %>
27
+ <% end %>
22
28
 
23
29
  <% end %>
24
30
  </div>
25
-
26
- <%= javascript_pack_tag "decidim_decidim_awesome_admin_form_exit_warn" %>
@@ -1,9 +1,11 @@
1
- <div class="row column decidim_awesome-form">
1
+ <div class="form__wrapper decidim_awesome-form">
2
2
  <% if config_enabled? :auto_save_forms %>
3
-
4
- <%= form.check_box :auto_save_forms %>
5
- <p class="help-text"><%= t("help.auto_save_forms", scope: "decidim.decidim_awesome.admin.config.form") %></p>
6
-
7
- <%= render(partial: "decidim/decidim_awesome/admin/config/constraints", locals: { key: :auto_save_forms, constraints: constraints_for(:auto_save_forms) }) %>
3
+ <div class="row column">
4
+ <%= form.check_box :auto_save_forms %>
5
+ <span class="help-text mb-4" style="margin-top: -1rem;">
6
+ <%= t("help.auto_save_forms", scope: "decidim.decidim_awesome.admin.config.form") %>
7
+ </span>
8
+ <%= render(partial: "decidim/decidim_awesome/admin/config/constraints", locals: { key: :auto_save_forms, constraints: constraints_for(:auto_save_forms) }) %>
9
+ </div>
8
10
  <% end %>
9
11
  </div>
@@ -1,14 +1,24 @@
1
- <%= decidim_form_for(@form, method: :patch, url: decidim_admin_decidim_awesome.config_path(config_var), html: { class: "awesome-edit-config" }, data: { "safe-path" => decidim_admin_decidim_awesome.config_path(config_var) }) do |f| %>
2
- <div class="card">
3
- <div class="card-divider">
4
- <h2 class="card-title"><%= t(".title", setting: config_var) %></h2>
1
+ <div class="item_show__header">
2
+ <h2 class="item_show__header-title">
3
+ <%= t(".title", setting: t(config_var, scope: "decidim.decidim_awesome.admin.config.title")) %>
4
+ </h2>
5
+ </div>
6
+ <div class="card">
7
+ <div class="card-section">
8
+ <div class="item__edit item__edit-1col">
9
+ <div class="item__edit-form">
10
+ <%= decidim_form_for(@form, method: :patch, url: decidim_admin_decidim_awesome.config_path(config_var), html: { class: "form-defaults awesome-edit-config" }, data: { "safe-path" => decidim_admin_decidim_awesome.config_path(config_var) }) do |f| %>
11
+ <div class="card-section">
12
+ <%= render "form_#{config_var}", form: f, errors: defined?(errors) ? errors : nil %>
13
+ </div>
14
+
15
+ <div class="item__edit-sticky">
16
+ <div class="item__edit-sticky-container">
17
+ <%= f.submit t(".update"), class: "button button__sm button__secondary" %>
18
+ </div>
19
+ </div>
20
+ <% end %>
21
+ </div>
5
22
  </div>
6
- <div class="card-section">
7
- <%= render partial: "form_#{config_var}", locals: { form: f, errors: defined?(errors) ? errors : nil } %>
8
- </div>
9
- </div>
10
- <div class="button--double form-general-submit">
11
- <%= f.submit t(".update") %>
12
23
  </div>
13
- <% end %>
14
- <%= render partial: "modal" %>
24
+ </div>
@@ -1,4 +1,4 @@
1
- <div class="field" id="constraint-form-<%= params[:id] %>">
1
+ <div class="form__wrapper" id="constraint-form-<%= params[:id] %>">
2
2
 
3
3
  <%= form.select :participatory_space_manifest, participatory_space_manifests.invert, include_blank: true %>
4
4
  <%= form.select :participatory_space_slug, participatory_spaces_list(@form.participatory_space_manifest).invert, include_blank: true %>
@@ -6,51 +6,3 @@
6
6
  <%= form.select :component_id, components_list(@form.participatory_space_manifest, @form.participatory_space_slug).invert, include_blank: true %>
7
7
 
8
8
  </div>
9
-
10
- <script type="text/javascript">
11
-
12
- (function() {
13
- var div = document.getElementById('constraint-form-<%= params[:id] %>');
14
- var space_manifest = div.getElementsByTagName("select")[0];
15
- var space_slug = div.getElementsByTagName("select")[1];
16
- var component_manifest = div.getElementsByTagName("select")[2];
17
- var component_id = div.getElementsByTagName("select")[3];
18
-
19
- space_manifest.addEventListener('change', function(e) {
20
- var event = new CustomEvent("constraint:change", {
21
- detail: [{
22
- key: "participatory_space_manifest",
23
- value: e.target.value
24
- }]
25
- });
26
- // Dispatch detail as event so main processor will reload accordingly
27
- document.body.dispatchEvent(event);
28
- });
29
-
30
- space_slug.addEventListener('change', function(e) {
31
- var event = new CustomEvent("constraint:change", {
32
- detail: [{
33
- key: "participatory_space_manifest",
34
- value: space_manifest.value
35
- },{
36
- key: "participatory_space_slug",
37
- value: e.target.value
38
- }]
39
- });
40
- // Dispatch detail as event so main processor will reload accordingly
41
- document.body.dispatchEvent(event);
42
- });
43
-
44
- // Component manfiest and component id are mutually exclusive
45
- component_manifest.addEventListener('change', function(e) {
46
- if(e.target.value)
47
- component_id.value = "";
48
- });
49
-
50
- component_id.addEventListener('change', function(e) {
51
- if(e.target.value)
52
- component_manifest.value = "";
53
- });
54
- })();
55
-
56
- </script>
@@ -1,14 +1,19 @@
1
- <%= decidim_form_for(@form, url: constraints_path(key: params[:key]), remote: true) do |f| %>
2
- <div class="card">
3
- <div class="card-divider">
4
- <h2 class="card-title"><%= t ".constraint" %></h2>
5
- </div>
6
- <div class="card-section">
1
+ <%= decidim_form_for(@form, url: constraints_path(key: params[:key]), remote: true, html: { class: "form-defaults" }) do |f| %>
2
+ <div data-dialog-container>
3
+ <%= icon "lock-line" %>
4
+ <h2 tabindex="-1" data-dialog-title><%= t ".constraint" %></h2>
5
+
6
+ <div>
7
7
  <%= render partial: "form", object: f %>
8
8
  </div>
9
9
  </div>
10
- <div class="button--double form-general-submit">
11
- <button type="submit" class="button" name="commit" data-close><%= t(".save") %></button>
12
- <button class="button hollow" type="button" data-close><%= t(".cancel") %></button>
10
+
11
+ <div data-dialog-actions>
12
+ <button class="button button__sm md:button__lg button__transparent-secondary" type="button"
13
+ data-dialog-close="<%= "new-modal-#{params[:key]}" %>">
14
+ <%= t(".cancel") %>
15
+ </button>
16
+
17
+ <%= f.submit t(".save"), class: "button button__sm md:button__lg button__secondary", data: { "dialog-close": "new-modal-#{params[:key]}" } %>
13
18
  </div>
14
19
  <% end %>
@@ -1,14 +1,19 @@
1
- <%= decidim_form_for(@form, url: constraint_path, method: :patch, remote: true) do |f| %>
2
- <div class="card">
3
- <div class="card-divider">
4
- <h2 class="card-title"><%= t ".constraint" %></h2>
5
- </div>
6
- <div class="card-section">
1
+ <%= decidim_form_for(@form, url: constraint_path, method: :patch, remote: true, html: { class: "form-defaults" }) do |f| %>
2
+ <div data-dialog-container>
3
+ <%= icon "lock-line" %>
4
+ <h2 tabindex="-1" data-dialog-title><%= t ".constraint" %></h2>
5
+
6
+ <div>
7
7
  <%= render partial: "form", object: f %>
8
8
  </div>
9
9
  </div>
10
- <div class="button--double form-general-submit">
11
- <%= f.submit t(".save") %>
12
- <button class="button hollow" type="button" data-close><%= t(".cancel") %></button>
10
+
11
+ <div data-dialog-actions>
12
+ <button class="button button__sm md:button__lg button__transparent-secondary" type="button"
13
+ data-dialog-close="<%= "edit-modal-#{params[:key]}" %>">
14
+ <%= t(".cancel") %>
15
+ </button>
16
+
17
+ <%= f.submit t(".save"), class: "button button__sm md:button__lg button__secondary", data: { "dialog-close": "edit-modal-#{params[:key]}" } %>
13
18
  </div>
14
19
  <% end %>
@@ -1,6 +1,21 @@
1
- <div>
2
- <%= form.text_field :origin, help_text: t(".origin_help") %>
3
- <%= form.text_field :destination, help_text: t(".destination_help") %>
4
- <%= form.check_box :active %>
5
- <%= form.check_box :pass_query, help_text: t(".pass_query_help").html_safe %>
1
+ <div class="flex flex-col">
2
+ <div class="mb-6">
3
+ <%= form.text_field :origin, class: "h-12 w-full" %>
4
+ <p class="help-text">
5
+ <%= t(".origin_help") %>
6
+ </p>
7
+ </div>
8
+ <div class="mb-6">
9
+ <%= form.text_field :destination, class: "h-12 w-full" %>
10
+ <p class="help-text">
11
+ <%= t(".destination_help") %>
12
+ </p>
13
+ </div>
14
+ <%= form.check_box :active, class: "mb-6" %>
15
+ <div class="mb-6">
16
+ <%= form.check_box :pass_query %>
17
+ </div>
18
+ <p class="help-text">
19
+ <%= t(".pass_query_help").html_safe %>
20
+ </p>
6
21
  </div>
@@ -1,13 +1,13 @@
1
- <%= decidim_form_for(@form, url: custom_redirect_path, method: :patch, html: { class: :form }) do |f| %>
1
+ <%= decidim_form_for(@form, url: custom_redirect_path, method: :patch, html: { class: "form-defaults form new_custom_redirect_" }) do |f| %>
2
2
  <div class="card">
3
- <div class="card-divider">
3
+ <div class="bg-gray-6 p-4 rounded-t">
4
4
  <h2 class="card-title"><%= t ".title" %></h2>
5
5
  </div>
6
- <div class="card-section">
6
+ <div class="card-section p-4">
7
7
  <%= render partial: "form", object: f %>
8
8
  </div>
9
9
  </div>
10
- <div class="button--double form-general-submit">
11
- <%= f.submit t(".save") %>
10
+ <div class="flex items-center justify-center mt-12 w-full text-white form-general-submit">
11
+ <%= f.submit t(".save"), class: "button button__lg button__secondary" %>
12
12
  </div>
13
13
  <% end %>
@@ -1,21 +1,22 @@
1
+ <div class="item_show__header">
2
+ <h2 class="item_show__header-title">
3
+ <%= t(".title") %>
4
+ <%= link_to t(".new"), decidim_admin_decidim_awesome.new_custom_redirect_path, class: "button button__secondary button__xs tiny button--title text-white" %>
5
+ </h2>
6
+ </div>
7
+
1
8
  <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_custom_redirect_path, class: "button tiny button--title" %>
6
- </h2>
7
- </div>
8
- <div class="card-section">
9
- <p class="help-text"><%= t(".description").html_safe %></p>
10
- <div class="row column decidim_awesome-form">
9
+ <div class="card-section p-4">
10
+ <p class="help-text -mt-2 mb-4"><%= t(".description").html_safe %></p>
11
+ <div class="table-scroll decidim_awesome-form">
11
12
  <table class="table-list custom-redirections-table">
12
13
  <thead>
13
14
  <tr>
14
15
  <th><%= t("custom_redirect.active", scope: "activemodel.attributes") %></th>
15
16
  <th><%= t("custom_redirect.origin", scope: "activemodel.attributes") %></th>
16
17
  <th><%= t("custom_redirect.destination", scope: "activemodel.attributes") %></th>
17
- <th class="redirect-status"><%= link_to(t(".check_redirections"), "#", class: "button small pull-right secondary check-custom-redirections") if current_config.present? %></th>
18
- <th class="actions"></th>
18
+ <th class="redirect-status"><%= link_to(t(".check_redirections"), "#", class: "button button__secondary button__xs pull-right secondary check-custom-redirections") if current_config.present? %></th>
19
+ <th class="actions"><%= t("decidim.decidim_awesome.admin.actions") %></th>
19
20
  </tr>
20
21
  </thead>
21
22
  <tbody>
@@ -26,8 +27,8 @@
26
27
  <td><%= item["destination"] %></td>
27
28
  <td class="redirect-status"></td>
28
29
  <td class="table-list__actions">
29
- <%= icon_link_to "pencil", decidim_admin_decidim_awesome.edit_custom_redirect_path(md5(origin)), t(".edit"), class: "action-icon--edit" %>
30
- <%= icon_link_to "circle-x", decidim_admin_decidim_awesome.custom_redirect_path(md5(origin)), t(".remove"), method: :delete, class: "action-icon--remove", data: { confirm: t(".confirm_destroy") } %>
30
+ <%= icon_link_to "pencil-line", decidim_admin_decidim_awesome.edit_custom_redirect_path(md5(origin)), t(".edit"), class: "action-icon--edit" %>
31
+ <%= icon_link_to "close-circle-line", decidim_admin_decidim_awesome.custom_redirect_path(md5(origin)), t(".remove"), method: :delete, class: "action-icon--remove", data: { confirm: t(".confirm_destroy") } %>
31
32
  </td>
32
33
  </tr>
33
34
  <% end %>
@@ -1,13 +1,13 @@
1
- <%= decidim_form_for(@form, url: custom_redirects_path, html: { class: :form }) do |f| %>
1
+ <%= decidim_form_for(@form, url: custom_redirects_path, html: { class: "form-defaults form new_custom_redirect_" }) do |f| %>
2
2
  <div class="card">
3
- <div class="card-divider">
3
+ <div class="bg-gray-6 p-4 rounded-t">
4
4
  <h2 class="card-title"><%= t ".title" %></h2>
5
5
  </div>
6
- <div class="card-section">
6
+ <div class="card-section p-4">
7
7
  <%= render partial: "form", object: f %>
8
8
  </div>
9
9
  </div>
10
- <div class="button--double form-general-submit">
11
- <%= f.submit t(".save") %>
10
+ <div class="flex items-center justify-center mt-12 w-full text-white form-general-submit">
11
+ <%= f.submit t(".save"), class: "button button__lg button__secondary" %>
12
12
  </div>
13
13
  <% end %>
@@ -0,0 +1,44 @@
1
+ <div class="mb-8">
2
+ <p class="help-text"><%= t(".help_html", time_ago:) %>
3
+ </div>
4
+
5
+ <% if collection.empty? %>
6
+ <div class="callout warning"><%= t(".no_data", time_ago:) %></div>
7
+ <% else %>
8
+ <div class="table-scroll autorefresh" data-url="<%= maintenance_path(:private_data).split("?").first %>">
9
+ <table class="table-list">
10
+ <thead>
11
+ <tr>
12
+ <th><%= t(".component") %></th>
13
+ <th><%= t(".items_count") %></th>
14
+ <th><%= t(".last_date") %></th>
15
+ <th><%= t("decidim.decidim_awesome.admin.actions") %></th>
16
+ </tr>
17
+ </thead>
18
+
19
+ <tbody>
20
+ <% collection.each do |resource| %>
21
+ <% item = present(resource) %>
22
+ <tr data-id="<%= item.id %>">
23
+ <td><%= link_to item.name, item.path %></td>
24
+ <td data-autorefresh="total"><%= item.total %></td>
25
+ <td data-autorefresh="time_ago"><%= item.time_ago %></td>
26
+ <td data-autorefresh="done">
27
+ <% if item.locked? %>
28
+ <span class="loading-spinner primary" title="<%= t(".removing") %>"></span>
29
+ <% elsif item.destroyable? %>
30
+ <%= link_to destroy_private_data_maintenance_path(:private_data, resource_id: item), method: :delete, class: "button button__primary button__xs tiny", data: { confirm: t(".confirm_delete") } do %>
31
+ <%= icon "delete-bin-line" %>
32
+ <%= t(".delete") %>
33
+ <% end %>
34
+ <% else %>
35
+ <span class="not-destroyable" title="<%= t(".not_destroyable") %>"><%= icon "forbid-line" %></span>
36
+ <% end %>
37
+ </td>
38
+ </tr>
39
+ <% end %>
40
+ </tbody>
41
+ </table>
42
+ </div>
43
+ <% end %>
44
+ <%= paginate collection, theme: "decidim" %>
@@ -0,0 +1,44 @@
1
+ <div class="card-section section_<%= current_view %>">
2
+ <%= render current_view %>
3
+ </div>
4
+
5
+ <script>
6
+ document.addEventListener("DOMContentLoaded", function() {
7
+ const wrappers = document.querySelectorAll('.autorefresh');
8
+
9
+ function updateTableWithJsonData(element) {
10
+ const trs = element.querySelectorAll('tr[data-id]');
11
+ const tr_ids = [...trs].map(tr => parseInt(tr.dataset.id, 10));
12
+
13
+ fetch(element.dataset.url + "?" + new URLSearchParams({resources: tr_ids}))
14
+ .then(response => response.json())
15
+ .then(data => {
16
+ trs.forEach(tr => {
17
+ const items = tr.querySelectorAll('[data-autorefresh]');
18
+ const id = parseInt(tr.dataset.id, 10);
19
+ const newData = data.find(item => item.id === id);
20
+ // console.log("newData", newData, "items", items, "id", id, "tr", tr, "data", data);
21
+ if (newData) {
22
+ items.forEach(item => {
23
+ const field = item.dataset.autorefresh;
24
+ if (field && newData[field]) {
25
+ item.innerHTML = newData[field];
26
+ }
27
+ });
28
+ if (newData.locked) {
29
+ setTimeout(() => updateTableWithJsonData(element), 1000);
30
+ }
31
+ }
32
+ });
33
+ })
34
+ .catch(error => {
35
+ console.error('Error fetching data:', error);
36
+ });
37
+ }
38
+
39
+ wrappers.forEach(element => {
40
+ updateTableWithJsonData(element);
41
+ });
42
+ });
43
+ </script>
44
+ </script>
@@ -1,7 +1,7 @@
1
- <div>
2
- <%= form.translated :text_field, :raw_label, help_text: t(".label_help") %>
3
- <%= form.text_field :url , readonly: form.object.url.present? %>
4
- <%= form.text_field :position %>
5
- <%= form.select :target, target_options %>
6
- <%= form.select :visibility, visibility_options %>
1
+ <div class="form__wrapper gap-0">
2
+ <%= form.translated :text_field, :raw_label, class: "mb-6", help_text: t(".label_help") %>
3
+ <%= form.text_field :url , class: "mb-6", readonly: form.object.url.present? %>
4
+ <%= form.text_field :position, class: "mb-6" %>
5
+ <%= form.select :target, target_options, {}, class: "mb-6" %>
6
+ <%= form.select :visibility, visibility_options, {}, class: "mb-8" %>
7
7
  </div>