decidim-decidim_awesome 0.10.3 → 0.11.1

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

Potentially problematic release.


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

Files changed (232) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +14 -5
  3. data/README.md +65 -67
  4. data/app/cells/concerns/decidim/decidim_awesome/global_menu_cell_override.rb +20 -0
  5. data/app/cells/concerns/decidim/decidim_awesome/proposal_l_cell_override.rb +44 -0
  6. data/app/cells/decidim/decidim_awesome/content_blocks/map/show.erb +5 -12
  7. data/app/cells/decidim/decidim_awesome/voting/proposal_metadata_cell.rb +54 -0
  8. data/app/cells/decidim/decidim_awesome/voting/voting_cards_proposal/modal.erb +18 -0
  9. data/app/cells/decidim/decidim_awesome/voting/voting_cards_proposal/show.erb +37 -32
  10. data/app/cells/decidim/decidim_awesome/voting/voting_cards_proposal_cell.rb +9 -4
  11. data/app/commands/concerns/decidim/decidim_awesome/admin/needs_constraint_helpers.rb +1 -1
  12. data/app/commands/concerns/decidim/decidim_awesome/proposals/create_proposal_override.rb +2 -2
  13. data/app/commands/concerns/decidim/decidim_awesome/proposals/update_proposal_override.rb +2 -2
  14. data/app/commands/decidim/decidim_awesome/admin/create_constraint.rb +1 -1
  15. data/app/commands/decidim/decidim_awesome/admin/destroy_custom_redirect.rb +1 -1
  16. data/app/commands/decidim/decidim_awesome/admin/destroy_menu_hack.rb +1 -1
  17. data/app/commands/decidim/decidim_awesome/admin/rename_scope_label.rb +1 -1
  18. data/app/commands/decidim/decidim_awesome/admin/update_constraint.rb +1 -1
  19. data/app/commands/decidim/decidim_awesome/admin/update_custom_redirect.rb +2 -2
  20. data/app/commands/decidim/decidim_awesome/command.rb +1 -7
  21. data/app/controllers/concerns/decidim/decidim_awesome/admin/maintenance_context.rb +1 -1
  22. data/app/controllers/concerns/decidim/decidim_awesome/admin_accountability/admin/filterable_helper.rb +3 -4
  23. data/app/controllers/concerns/decidim/decidim_awesome/content_security_policy.rb +34 -0
  24. data/app/controllers/concerns/decidim/decidim_awesome/not_found_redirect.rb +1 -1
  25. data/app/controllers/concerns/decidim/decidim_awesome/proposals/orderable_override.rb +22 -9
  26. data/app/controllers/concerns/decidim/decidim_awesome/proposals/proposal_votes_controller_override.rb +3 -3
  27. data/app/controllers/decidim/decidim_awesome/admin/admin_accountability_controller.rb +7 -7
  28. data/app/controllers/decidim/decidim_awesome/admin/checks_controller.rb +7 -7
  29. data/app/controllers/decidim/decidim_awesome/admin/config_controller.rb +8 -10
  30. data/app/controllers/decidim/decidim_awesome/admin/constraints_controller.rb +20 -19
  31. data/app/controllers/decidim/decidim_awesome/admin/custom_redirects_controller.rb +6 -8
  32. data/app/controllers/decidim/decidim_awesome/admin/maintenance_controller.rb +2 -2
  33. data/app/controllers/decidim/decidim_awesome/admin/menu_hacks_controller.rb +6 -8
  34. data/app/controllers/decidim/decidim_awesome/admin/proposal_custom_fields_controller.rb +2 -2
  35. data/app/controllers/decidim/decidim_awesome/admin/scoped_admins_controller.rb +2 -2
  36. data/app/controllers/decidim/decidim_awesome/admin/scoped_styles_controller.rb +2 -2
  37. data/app/controllers/decidim/decidim_awesome/blank_component_controller.rb +8 -3
  38. data/app/controllers/decidim/decidim_awesome/editor_images_controller.rb +3 -3
  39. data/app/controllers/decidim/decidim_awesome/iframe_component/iframe_controller.rb +11 -5
  40. data/app/forms/concerns/decidim/decidim_awesome/proposals/proposal_wizard_create_step_form_override.rb +1 -1
  41. data/app/forms/decidim/decidim_awesome/admin/config_form.rb +13 -25
  42. data/app/forms/decidim/decidim_awesome/admin/custom_redirect_form.rb +2 -2
  43. data/app/forms/decidim/decidim_awesome/admin/intergram_form.rb +4 -0
  44. data/app/forms/decidim/decidim_awesome/admin/menu_form.rb +4 -4
  45. data/app/helpers/concerns/decidim/decidim_awesome/amendments_helper_override.rb +8 -1
  46. data/app/helpers/concerns/decidim/decidim_awesome/breadcrumb_helper_override.rb +23 -0
  47. data/app/helpers/concerns/decidim/decidim_awesome/proposals/application_helper_override.rb +23 -39
  48. data/app/helpers/decidim/decidim_awesome/admin/config_constraints_helpers.rb +2 -2
  49. data/app/helpers/decidim/decidim_awesome/map_helper.rb +8 -27
  50. data/app/jobs/decidim/decidim_awesome/migrate_legacy_images_job.rb +5 -4
  51. data/app/middleware/decidim/decidim_awesome/current_config.rb +3 -5
  52. data/app/models/concerns/decidim/decidim_awesome/has_proposal_extra_fields.rb +1 -1
  53. data/app/models/decidim/decidim_awesome/awesome_config.rb +1 -1
  54. data/app/models/decidim/decidim_awesome/paper_trail_version.rb +4 -8
  55. data/app/models/decidim/decidim_awesome/proposal_extra_field.rb +1 -1
  56. data/app/models/decidim/decidim_awesome/vote_weight.rb +2 -2
  57. data/app/overrides/decidim/proposals/proposals/{show → _proposal_aside}/limit_amendments_modal.html.erb.deface +1 -1
  58. data/app/overrides/decidim/proposals/proposals/_vote_button/replace_vote_button.html.erb.deface +1 -1
  59. data/app/overrides/layouts/decidim/_decidim_javascript/add_awesome_tags.html.erb.deface +6 -0
  60. data/app/overrides/layouts/decidim/_head/add_awesome_tags.html.erb.deface +4 -11
  61. data/app/overrides/layouts/decidim/admin/_header/{replace_scripts.html.erb.deface → add_awesome_tags.html.erb.deface} +4 -4
  62. data/app/packs/entrypoints/decidim_admin_decidim_awesome.js +1 -2
  63. data/app/packs/entrypoints/decidim_admin_decidim_awesome_global.js +4 -0
  64. data/app/packs/entrypoints/decidim_admin_decidim_awesome_global.scss +1 -0
  65. data/app/packs/entrypoints/decidim_decidim_awesome.js +2 -2
  66. data/app/packs/entrypoints/decidim_editor.js +14 -0
  67. data/app/packs/src/decidim/decidim_awesome/admin/auto_edit.js +95 -70
  68. data/app/packs/src/decidim/decidim_awesome/admin/check_redirections.js +46 -41
  69. data/app/packs/src/decidim/decidim_awesome/admin/codemirror.js +3 -3
  70. data/app/packs/src/decidim/decidim_awesome/admin/constraint_form_events.js +115 -0
  71. data/app/packs/src/decidim/decidim_awesome/admin/custom_fields_builder.js +4 -1
  72. data/app/packs/src/decidim/decidim_awesome/admin/form_exit_warn.js +22 -11
  73. data/app/packs/src/decidim/decidim_awesome/admin/proposal_sortings.js +26 -8
  74. data/app/packs/src/decidim/decidim_awesome/admin/user_picker.js +34 -21
  75. data/app/packs/src/decidim/decidim_awesome/amendments/show_modal_on_limits.js +20 -22
  76. data/app/packs/src/decidim/decidim_awesome/awesome_admin.js +5 -16
  77. data/app/packs/src/decidim/decidim_awesome/awesome_admin_global.js +1 -0
  78. data/app/packs/src/decidim/decidim_awesome/awesome_application.js +0 -15
  79. data/app/packs/src/decidim/decidim_awesome/awesome_map/api/fetcher.js +33 -11
  80. data/app/packs/src/decidim/decidim_awesome/awesome_map/api/meetings_fetcher.js +9 -12
  81. data/app/packs/src/decidim/decidim_awesome/awesome_map/api/proposals_fetcher.js +28 -0
  82. data/app/packs/src/decidim/decidim_awesome/awesome_map/awesome_map.js +3 -4
  83. data/app/packs/src/decidim/decidim_awesome/awesome_map/controllers/controller.js +12 -12
  84. data/app/packs/src/decidim/decidim_awesome/awesome_map/controllers/meetings_controller.js +11 -7
  85. data/app/packs/src/decidim/decidim_awesome/awesome_map/controllers/proposals_controller.js +6 -13
  86. data/app/packs/src/decidim/decidim_awesome/awesome_map/controls_ui.js +51 -20
  87. data/app/packs/src/decidim/decidim_awesome/awesome_map/load_map.js +27 -18
  88. data/app/packs/src/decidim/decidim_awesome/editor/index.js +94 -0
  89. data/app/packs/src/decidim/decidim_awesome/forms/autosave.js +28 -23
  90. data/app/packs/src/decidim/decidim_awesome/forms/custom_fields_renderer.js +9 -14
  91. data/app/packs/src/decidim/decidim_awesome/forms/rich_text_plugin.js +27 -32
  92. data/app/packs/src/decidim/decidim_awesome/proposals/images.js +16 -10
  93. data/app/packs/src/decidim/decidim_awesome/voting/voting_cards.js +47 -38
  94. data/app/packs/stylesheets/decidim/decidim_awesome/admin/auto_edits.scss +11 -12
  95. data/app/packs/stylesheets/decidim/decidim_awesome/admin/check_redirections.scss +15 -0
  96. data/app/packs/stylesheets/decidim/decidim_awesome/admin/codemirror.scss +19 -12
  97. data/app/packs/stylesheets/decidim/decidim_awesome/admin/constraints.scss +8 -32
  98. data/app/packs/stylesheets/decidim/decidim_awesome/admin/custom_fields.scss +28 -78
  99. data/app/packs/stylesheets/decidim/decidim_awesome/admin/custom_styles.scss +48 -0
  100. data/app/packs/stylesheets/decidim/decidim_awesome/admin/intergram_fixes.scss +11 -0
  101. data/app/packs/stylesheets/decidim/decidim_awesome/admin/user_picker.scss +15 -24
  102. data/app/packs/stylesheets/decidim/decidim_awesome/amendments/modal.scss +5 -0
  103. data/app/packs/stylesheets/decidim/decidim_awesome/awesome_admin.scss +9 -47
  104. data/app/packs/stylesheets/decidim/decidim_awesome/awesome_admin_global.scss +3 -12
  105. data/app/packs/stylesheets/decidim/decidim_awesome/awesome_application.scss +3 -19
  106. data/app/packs/stylesheets/decidim/decidim_awesome/awesome_iframe/iframe.scss +1 -1
  107. data/app/packs/stylesheets/decidim/decidim_awesome/awesome_map/map.scss +27 -21
  108. data/app/packs/stylesheets/decidim/decidim_awesome/forms/autosave.scss +6 -6
  109. data/app/packs/stylesheets/decidim/decidim_awesome/forms/custom_fields.scss +32 -101
  110. data/app/packs/stylesheets/decidim/decidim_awesome/shared/spinner.scss +5 -26
  111. data/app/packs/stylesheets/decidim/decidim_awesome/voting/voting_cards.scss +34 -52
  112. data/app/permissions/decidim/decidim_awesome/permissions.rb +3 -4
  113. data/app/presenters/concerns/decidim/decidim_awesome/breadcrumb_root_menu_item_presenter_override.rb +23 -0
  114. data/app/presenters/concerns/decidim/decidim_awesome/menu_item_presenter_override.rb +10 -2
  115. data/app/presenters/concerns/decidim/decidim_awesome/menu_presenter_override.rb +8 -0
  116. data/app/presenters/decidim/decidim_awesome/participatory_space_role_presenter.rb +1 -1
  117. data/app/presenters/decidim/decidim_awesome/private_data_presenter.rb +11 -11
  118. data/app/presenters/decidim/decidim_awesome/user_entity_presenter.rb +1 -1
  119. data/app/queries/decidim/decidim_awesome/private_data_finder.rb +1 -1
  120. data/app/serializers/decidim/decidim_awesome/proposals/private_proposal_serializer.rb +0 -8
  121. data/app/views/decidim/decidim_awesome/admin/admin_accountability/index.html.erb +23 -17
  122. data/app/views/decidim/decidim_awesome/admin/checks/index.html.erb +1 -3
  123. data/app/views/decidim/decidim_awesome/admin/config/_autoedit_box_label.html.erb +3 -3
  124. data/app/views/decidim/decidim_awesome/admin/config/_constraints.html.erb +20 -21
  125. data/app/views/decidim/decidim_awesome/admin/config/_form_admins.html.erb +6 -5
  126. data/app/views/decidim/decidim_awesome/admin/config/_form_editors.html.erb +2 -2
  127. data/app/views/decidim/decidim_awesome/admin/config/_form_livechat.html.erb +39 -23
  128. data/app/views/decidim/decidim_awesome/admin/config/_form_proposal_custom_fields.html.erb +4 -6
  129. data/app/views/decidim/decidim_awesome/admin/config/_form_proposals.html.erb +64 -76
  130. data/app/views/decidim/decidim_awesome/admin/config/_form_styles.html.erb +15 -11
  131. data/app/views/decidim/decidim_awesome/admin/config/_form_surveys.html.erb +8 -6
  132. data/app/views/decidim/decidim_awesome/admin/config/show.html.erb +22 -12
  133. data/app/views/decidim/decidim_awesome/admin/constraints/_form.html.erb +1 -49
  134. data/app/views/decidim/decidim_awesome/admin/constraints/new.html.erb +14 -9
  135. data/app/views/decidim/decidim_awesome/admin/constraints/show.html.erb +14 -9
  136. data/app/views/decidim/decidim_awesome/admin/custom_redirects/_form.html.erb +20 -5
  137. data/app/views/decidim/decidim_awesome/admin/custom_redirects/edit.html.erb +5 -5
  138. data/app/views/decidim/decidim_awesome/admin/custom_redirects/index.html.erb +15 -15
  139. data/app/views/decidim/decidim_awesome/admin/custom_redirects/new.html.erb +5 -5
  140. data/app/views/decidim/decidim_awesome/admin/maintenance/_private_data.html.erb +4 -4
  141. data/app/views/decidim/decidim_awesome/admin/menu_hacks/_form.html.erb +6 -6
  142. data/app/views/decidim/decidim_awesome/admin/menu_hacks/edit.html.erb +21 -12
  143. data/app/views/decidim/decidim_awesome/admin/menu_hacks/index.html.erb +16 -18
  144. data/app/views/decidim/decidim_awesome/admin/menu_hacks/new.html.erb +21 -12
  145. data/app/views/decidim/decidim_awesome/admin/shared/_filters_with_date.html.erb +14 -18
  146. data/app/views/decidim/decidim_awesome/amendments/_modal.html.erb +18 -11
  147. data/app/views/decidim/decidim_awesome/custom_fields/_form_render.html.erb +3 -5
  148. data/app/views/decidim/decidim_awesome/iframe_component/iframe/show.html.erb +7 -12
  149. data/app/views/decidim/decidim_awesome/map_component/map/_map_template.html.erb +53 -37
  150. data/app/views/decidim/decidim_awesome/map_component/map/show.html.erb +14 -5
  151. data/app/views/decidim/decidim_awesome/voting/voting_cards/_show_vote_button.html.erb +0 -3
  152. data/app/views/layouts/decidim/decidim_awesome/_awesome_config.html.erb +9 -7
  153. data/app/views/layouts/decidim/decidim_awesome/_intergram_widget.html.erb +9 -6
  154. data/app/views/layouts/decidim/decidim_awesome/admin/_base.html.erb +3 -12
  155. data/config/assets.rb +3 -33
  156. data/config/i18n-tasks.yml +1 -0
  157. data/config/locales/ca.yml +17 -94
  158. data/config/locales/cs.yml +15 -93
  159. data/config/locales/de.yml +15 -91
  160. data/config/locales/en.yml +24 -28
  161. data/config/locales/es.yml +18 -96
  162. data/config/locales/eu.yml +8 -18
  163. data/config/locales/fr.yml +15 -94
  164. data/config/locales/hu.yml +4 -18
  165. data/config/locales/it.yml +9 -26
  166. data/config/locales/ja.yml +16 -93
  167. data/config/locales/lt.yml +2 -4
  168. data/config/locales/nl.yml +8 -18
  169. data/config/locales/pt-BR.yml +11 -25
  170. data/config/locales/ro-RO.yml +2 -14
  171. data/config/locales/sv.yml +10 -21
  172. data/config/rubocop/disabled.yml +11 -0
  173. data/config/rubocop/faker.yml +480 -0
  174. data/config/rubocop/rails.yml +88 -0
  175. data/config/rubocop/rspec.yml +65 -0
  176. data/config/rubocop/ruby.yml +1210 -0
  177. data/db/migrate/20240306175331_rename_editor_images_awesome_config.rb +18 -0
  178. data/db/migrate/20240729164227_add_decidim_awesome_proposal_private_fields_date.rb +1 -1
  179. data/db/seeds.rb +3 -3
  180. data/lib/decidim/decidim_awesome/admin_engine.rb +4 -1
  181. data/lib/decidim/decidim_awesome/api/types/translated_custom_fields_type.rb +2 -3
  182. data/lib/decidim/decidim_awesome/awesome.rb +42 -28
  183. data/lib/decidim/decidim_awesome/awesome_helpers.rb +1 -1
  184. data/lib/decidim/decidim_awesome/checksums.yml +39 -60
  185. data/lib/decidim/decidim_awesome/config.rb +1 -1
  186. data/lib/decidim/decidim_awesome/custom_fields.rb +5 -5
  187. data/lib/decidim/decidim_awesome/engine.rb +24 -6
  188. data/lib/decidim/decidim_awesome/iframe_component/component.rb +1 -2
  189. data/lib/decidim/decidim_awesome/lock.rb +2 -2
  190. data/lib/decidim/decidim_awesome/map_component/component.rb +1 -1
  191. data/lib/decidim/decidim_awesome/menu.rb +33 -14
  192. data/lib/decidim/decidim_awesome/menu_hacker.rb +4 -8
  193. data/lib/decidim/decidim_awesome/system_checker.rb +2 -4
  194. data/lib/decidim/decidim_awesome/test/factories.rb +10 -10
  195. data/lib/decidim/decidim_awesome/test/initializer.rb +3 -11
  196. data/lib/decidim/decidim_awesome/test/layouts/decidim/_head.html.erb +2 -2
  197. data/lib/decidim/decidim_awesome/test/layouts/decidim/admin/_header.html.erb +2 -2
  198. data/lib/decidim/decidim_awesome/test/shared_examples/box_label_editor_examples.rb +18 -18
  199. data/lib/decidim/decidim_awesome/test/shared_examples/config_examples.rb +3 -3
  200. data/lib/decidim/decidim_awesome/test/shared_examples/custom_fields_examples.rb +11 -11
  201. data/lib/decidim/decidim_awesome/test/shared_examples/custom_redirects_contexts.rb +7 -7
  202. data/lib/decidim/decidim_awesome/test/shared_examples/editor_examples.rb +26 -66
  203. data/lib/decidim/decidim_awesome/test/shared_examples/menu_hack_contexts.rb +10 -9
  204. data/lib/decidim/decidim_awesome/test/shared_examples/scoped_admins_examples.rb +30 -20
  205. data/lib/decidim/decidim_awesome/test/shared_examples/summary_examples.rb +19 -10
  206. data/lib/decidim/decidim_awesome/version.rb +2 -2
  207. data/lib/decidim/decidim_awesome/voting_manifest.rb +5 -10
  208. data/lib/decidim/decidim_awesome.rb +1 -2
  209. data/lib/tasks/decidim_awesome_active_storage_migrations_tasks.rake +1 -1
  210. data/lib/tasks/decidim_awesome_upgrade_tasks.rake +4 -0
  211. data/package.json +19 -28
  212. metadata +40 -56
  213. data/app/cells/concerns/decidim/decidim_awesome/proposal_m_cell_override.rb +0 -18
  214. data/app/cells/decidim/decidim_awesome/voting/voting_cards_counter/show.erb +0 -15
  215. data/app/cells/decidim/decidim_awesome/voting/voting_cards_counter/vote_button.erb +0 -15
  216. data/app/cells/decidim/decidim_awesome/voting/voting_cards_counter_cell.rb +0 -21
  217. data/app/cells/decidim/decidim_awesome/voting/voting_cards_proposal_modal/show.erb +0 -16
  218. data/app/cells/decidim/decidim_awesome/voting/voting_cards_proposal_modal_cell.rb +0 -20
  219. data/app/cells/decidim/proposals/proposal_m/footer.erb +0 -13
  220. data/app/overrides/layouts/decidim/_head/add_awesome_legacy_scripts.rb +0 -14
  221. data/app/overrides/layouts/decidim/admin/_header/replace_styles.html.erb.deface +0 -3
  222. data/app/packs/entrypoints/decidim_admin_decidim_awesome_custom_fields.js +0 -2
  223. data/app/packs/entrypoints/decidim_decidim_awesome_admin_form_exit_warn.js +0 -1
  224. data/app/packs/src/decidim/decidim_awesome/admin/constraints.js +0 -55
  225. data/app/packs/src/decidim/decidim_awesome/editors/editor.js +0 -213
  226. data/app/packs/stylesheets/decidim/decidim_awesome/editors/markdown_editor.scss +0 -19
  227. data/app/packs/stylesheets/decidim/decidim_awesome/editors/quill_editor.scss +0 -58
  228. data/app/packs/stylesheets/vendor/select2-foundation-theme.scss +0 -348
  229. data/app/serializers/concerns/decidim/decidim_awesome/proposal_serializer_override.rb +0 -65
  230. data/app/views/decidim/decidim_awesome/admin/config/_modal.html.erb +0 -11
  231. data/app/views/decidim/decidim_awesome/voting/voting_cards/_proposal_m_cell_footer.erb +0 -15
  232. /data/app/packs/src/decidim/decidim_awesome/{editors/tabs_focus.js → admin/tabs_change.js} +0 -0
@@ -1,63 +1,72 @@
1
- $(() => {
2
- if ($(".voting-voting_cards").length === 0 || $("#VotingCardsModalHelp").length === 0 || $(".sign-out-link").length === 0) {
1
+ document.addEventListener("DOMContentLoaded", () => {
2
+ const votingCards = document.querySelector(".voting-voting_cards");
3
+ const modal = document.getElementById("voting-cards-modal-help");
4
+ const signOutLink = document.querySelector('[href="/users/sign_out"]');
5
+
6
+ if (!votingCards || !modal || !signOutLink) {
3
7
  return;
4
8
  }
5
9
 
6
- const $modal = $("#VotingCardsModalHelp");
7
- const $card = $modal.find(".current-choice .vote-card");
8
- const $check = $("#voting_cards-skip_help");
10
+ const card = modal.querySelector(".current-choice .vote-card");
11
+ const check = document.getElementById("voting_cards-skip_help");
9
12
 
10
13
  const storage = () => {
11
- return JSON.parse(localStorage.getItem("hideTreeFlagsModalHelp") || "{}")
14
+ return JSON.parse(localStorage.getItem("awesome_voting_cards_hide_modal") || "{}");
12
15
  };
13
16
 
14
17
  const isChecked = () => {
15
- return storage()[$check.val()];
18
+ return storage()[check.value];
16
19
  };
17
20
 
18
21
  const saveState = (val) => {
19
22
  const show = storage();
20
- show[$check.val()] = val;
21
- localStorage.setItem("hideTreeFlagsModalHelp", JSON.stringify(show))
23
+ show[check.value] = val;
24
+ localStorage.setItem("awesome_voting_cards_hide_modal", JSON.stringify(show));
22
25
  };
23
26
 
24
27
  const showModal = () => {
25
- if (isChecked()) {
26
- return false;
27
- }
28
- if ($modal.is(":visible")) {
28
+ if (isChecked() || window.Decidim.currentDialogs[modal.id].isOpen) {
29
29
  return false;
30
30
  }
31
31
  return true;
32
32
  };
33
33
 
34
- $check.on("change", () => {
35
- saveState($check.is(":checked"))
36
- });
34
+ const bindVoteActions = () => {
35
+ document.querySelectorAll(".awesome-voting-card .vote-action").forEach((el) => {
36
+ el.addEventListener("click", (evt) => {
37
+ if (showModal()) {
38
+ evt.stopPropagation();
39
+ evt.preventDefault();
40
+ check.checked = isChecked();
41
+ modal.action = evt.currentTarget;
42
+ card.classList = evt.currentTarget.classList;
43
+ if (evt.currentTarget.children.length > 1) {
44
+ card.innerHTML = `${evt.currentTarget.children[1].outerHTML}<span class="vote-label">${evt.currentTarget.children[1].children[0].textContent}</span>`;
45
+ } else if (card.classList.contains("button")) {
46
+ card.classList.remove("button");
47
+ card.innerHTML = `<span class="vote-label">${evt.currentTarget.title}</span>`;
48
+ } else {
49
+ card.innerHTML = `<span class="vote-label">${evt.currentTarget.textContent}</span>`;
50
+ }
51
+ window.Decidim.currentDialogs[modal.id].open();
52
+ } else {
53
+ evt.currentTarget.closest(".voting-voting_cards").classList.add("loading");
54
+ }
55
+ });
56
+ });
57
+ };
37
58
 
38
- $modal.find(".vote-action").on("click", () => {
39
- $modal.data("action").click();
40
- $modal.foundation("close");
59
+ check.addEventListener("change", () => {
60
+ saveState(check.checked);
41
61
  });
42
62
 
43
- $(".button--vote-button .voting-voting_cards").on("click", ".vote-action", (evt) => {
44
- if (showModal()) {
45
- evt.stopPropagation();
46
- evt.preventDefault();
47
- $check.prop("checked", isChecked());
48
- $modal.data("action", evt.currentTarget);
49
- $card[0].classList = evt.currentTarget.classList;
50
- if (evt.currentTarget.children.length > 1) {
51
- $card.html(`${evt.currentTarget.children[1].outerHTML}<p class="vote-label">${evt.currentTarget.children[1].children[0].textContent}</p>`);
52
- } else if ($card[0].classList.contains("button")) {
53
- $card[0].classList.remove("button");
54
- $card.html(`<p class="vote-label">${evt.currentTarget.title}</p>`);
55
- } else {
56
- $card.html(`<p class="vote-label">${evt.currentTarget.textContent}</p>`);
57
- }
58
- $modal.foundation("open");
59
- } else {
60
- $(evt.currentTarget).closest(".voting-voting_cards").addClass("loading");
61
- }
63
+ modal.querySelector(".vote-action").addEventListener("click", () => {
64
+ modal.action.click();
65
+ setTimeout(() => window.Decidim.currentDialogs[modal.id].close());
62
66
  });
67
+
68
+ bindVoteActions();
69
+
70
+ // re-bind vote actions after AJAX events (due the use of Rails helper remote=treu)
71
+ document.body.addEventListener("ajax:success", () => bindVoteActions());
63
72
  });
@@ -1,16 +1,15 @@
1
- input.awesome-auto-edit {
2
- display: inline-block;
3
- width: auto;
4
- margin: 0 2px;
5
- padding: 1px;
6
- line-height: 0;
7
- height: auto;
1
+ a.awesome-auto-edit {
2
+ @apply inline-block;
3
+ }
4
+
5
+ a.awesome-auto-delete {
6
+ @apply float-right button button__xs button__text-secondary;
7
+ }
8
+
9
+ .form-defaults input[type="text"].awesome-auto-edit {
10
+ @apply inline-block m-0 py-[2px] px-[4px] h-auto w-auto leading-none outline-1 text-xs;
8
11
  }
9
12
 
10
13
  span.awesome-auto-edit {
11
- padding: 0 4px;
12
- background-color: #f0f0f0;
13
- border-radius: 5px;
14
- margin: 0;
15
- font-weight: 600;
14
+ @apply bg-background-4 px-2 rounded m-0 font-semibold;
16
15
  }
@@ -4,6 +4,21 @@
4
4
  text-align: left !important;
5
5
  }
6
6
 
7
+ th a.check-custom-redirections {
8
+ color: white;
9
+ }
10
+
11
+ th a.check-custom-redirections.disabled,
12
+ th a.check-custom-redirections.disabled:hover {
13
+ color: gray;
14
+ border: 1px solid gray;
15
+ background-color: #eee;
16
+ }
17
+
18
+ th a.check-custom-redirections:hover {
19
+ text-decoration: none;
20
+ }
21
+
7
22
  td.redirect-status {
8
23
  font-family: monospace;
9
24
 
@@ -1,10 +1,15 @@
1
- @import "codemirror/lib/codemirror.css";
1
+ /* Ensure the sticky save button is over codemirror */
2
+ .item__edit-sticky {
3
+ z-index: 2;
4
+ }
2
5
 
3
6
  .awesome-edit-config {
4
7
  .scoped_styles_container,
5
8
  .proposal_custom_fields_container {
9
+ @apply bg-background;
10
+
6
11
  &.private {
7
- outline: #fca5a5 dotted 2px;
12
+ @apply outline-2 outline-[#fca5a5] outline-dotted;
8
13
  }
9
14
 
10
15
  .form-error {
@@ -12,21 +17,23 @@
12
17
  }
13
18
 
14
19
  > .CodeMirror {
15
- border-top-left-radius: 5px;
16
- border-top-right-radius: 5px;
17
- border-top: 0.5em solid #e0e0e0;
18
- border-right: 0.5em solid #e0e0e0;
19
- border-bottom: 0.5em solid #e0e0e0;
20
- min-height: 6em;
21
- height: 8em;
22
- padding: 0;
23
- max-height: 40em;
20
+ border-radius: 4px;
21
+ border-bottom-left-radius: 0;
22
+ border-bottom-right-radius: 0;
23
+ border: 5px solid #eee;
24
+ border-left: none;
25
+ min-height: 4em;
26
+ height: auto;
24
27
  resize: vertical;
25
28
  overflow: vertical !important;
29
+ padding: 0;
30
+ margin: 0;
31
+ width: 100%;
32
+ font-size: 0.9rem;
26
33
 
27
34
  > .CodeMirror-scroll {
28
35
  > .CodeMirror-gutters {
29
- background: #e0e0e0;
36
+ background: #eee;
30
37
  }
31
38
  }
32
39
  }
@@ -1,8 +1,5 @@
1
1
  .constraints-editor {
2
- background: #f6f6f6;
3
- padding: 1rem;
4
- margin: 0.5rem 0 2rem;
5
- border-radius: 5px;
2
+ margin-top: 1rem;
6
3
 
7
4
  h5 {
8
5
  font-weight: 600;
@@ -14,7 +11,7 @@
14
11
  .label {
15
12
  font-weight: normal;
16
13
  font-size: 0.8rem;
17
- padding: 0.3rem 0.5rem;
14
+ padding: 1px 5px;
18
15
 
19
16
  &.participatory_space_manifest {
20
17
  background-color: #f7b230;
@@ -46,48 +43,27 @@
46
43
 
47
44
  .constraints-list {
48
45
  margin: 16px 20px;
49
- padding: 0 20px 0 0;
46
+ padding: 0 20px 14px 33px;
50
47
  list-style-type: disc;
51
48
 
49
+ .button__xs {
50
+ padding: 1px 5px;
51
+ font-size: 0.8rem;
52
+ }
53
+
52
54
  li {
53
55
  margin: 0 1em 0 0;
54
56
  padding: 0;
55
57
  }
56
58
 
57
- button.edit-condition,
58
- a.delete-condition {
59
- margin-left: 1rem;
60
- }
61
-
62
- button.edit-condition {
63
- color: $secondary-color;
64
- cursor: pointer;
65
-
66
- &:hover {
67
- text-decoration: underline;
68
- }
69
- }
70
-
71
59
  &.inactive {
72
60
  .label:not(.constraint-none) {
73
61
  filter: saturate(10%);
74
62
  }
75
63
  }
76
-
77
- &.no-items {
78
- margin: 0;
79
- padding-bottom: 14px;
80
- list-style-type: none;
81
- }
82
64
  }
83
65
 
84
66
  .flash[hidden] {
85
67
  display: none;
86
68
  }
87
-
88
- .add-condition .icon {
89
- width: 11px;
90
- height: 11px;
91
- margin-right: 0.3rem;
92
- }
93
69
  }
@@ -1,100 +1,50 @@
1
- // hide custom-fields inside tabs, an extra (unique) container is used instead
2
- .color-box {
3
- display: inline-block;
4
- height: 1em;
5
- width: 1em;
6
- margin-left: 1em;
7
- vertical-align: middle;
8
-
9
- &:first-child {
10
- margin-left: 0;
11
- }
1
+ @import "stylesheets/decidim/editor";
12
2
 
13
- $colors: (
14
- "primary": $primary,
15
- "secondary": $secondary,
16
- "success": $success,
17
- "warning": $warning,
18
- "alert": $alert,
19
- "highlight": $highlight,
20
- "highlight_alternative": $highlight_alternative,
21
- );
22
-
23
- @each $name, $color in $colors {
24
- &.#{$name} {
25
- background-color: $color;
26
- }
3
+ // hide custom-fields inside tabs, an extra (unique) container is used instead
4
+ .tabs-content {
5
+ .proposal_custom_field {
6
+ display: none;
27
7
  }
28
8
  }
29
9
 
30
10
  .proposal_custom_fields {
31
11
  &_editor {
32
- background-color: #e0e0e0;
33
- padding: 0.5em 0.5em 1em;
34
- border-top-left-radius: 5px;
35
- border-top-right-radius: 5px;
36
-
37
12
  ul.frmb,
38
13
  .form-wrap.form-builder .frmb li.form-field,
39
14
  .form-wrap.form-builder .stage-wrap.empty {
40
- background-color: $body-background;
41
- margin-right: 0.5rem;
15
+ @apply bg-background mr-2;
16
+ }
42
17
 
43
- .field-actions {
44
- display: flex;
45
- justify-content: space-between;
46
- align-items: center;
47
- }
18
+ border-top-left-radius: 5px;
19
+ border-top-right-radius: 5px;
48
20
 
49
- .field-actions .btn {
50
- display: flex;
51
- justify-content: center;
52
- align-items: center;
53
- }
21
+ svg {
22
+ @apply fill-black;
54
23
  }
55
24
 
56
- label {
57
- display: inline-block;
58
- max-width: 100%;
59
- font-weight: $global-weight-bold !important;
25
+ li > label {
26
+ line-height: 27px !important;
27
+ font-size: 16px !important;
60
28
  }
61
29
 
62
- li[type] {
63
- display: block;
64
- width: 100%;
65
- height: inherit;
66
- margin: inherit;
67
- border: inherit;
68
- box-shadow: inherit;
69
- font-size: inherit;
70
- font-weight: inherit;
71
- line-height: inherit;
72
- color: inherit;
73
- }
30
+ input.form-control {
31
+ background-color: #fff;
32
+ border: 1px solid #ccc !important;
33
+ box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
74
34
 
75
- .form-group {
76
- background-color: inherit;
77
- margin: 0;
78
- padding: 0;
35
+ &:focus {
36
+ outline: 0;
37
+ box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075),
38
+ 0 0 8px rgba(102, 175, 233, 0.6) !important;
39
+ }
79
40
  }
80
41
 
81
- .form-wrap.form-builder .form-group {
82
- margin-bottom: 10px !important;
42
+ .frmb-control li {
43
+ cursor: cell !important;
83
44
  }
84
-
85
- .form-control {
86
- color: #555;
87
- background-color: #fff;
88
- border: 1px solid #ccc;
89
- box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
90
- transition: border-color ease-in-out 0.15s, box-shadow ease-in-out 0.15s;
91
- margin: 0;
92
- padding: 6px 12px;
45
+ // drag and drop is disabled, let's not show the move cursor
46
+ .frmb .prev-holder {
47
+ cursor: default !important;
93
48
  }
94
49
  }
95
50
  }
96
-
97
- // Custom fields tuning
98
- .rendered-form .form-control.ql-container {
99
- height: auto !important;
100
- }
@@ -0,0 +1,48 @@
1
+ .color-box {
2
+ display: inline-block;
3
+ height: 1em;
4
+ width: 1em;
5
+ margin-left: 1em;
6
+ vertical-align: middle;
7
+
8
+ &:first-child {
9
+ margin-left: 0;
10
+ }
11
+
12
+ &.primary {
13
+ background-color: var(--primary);
14
+ }
15
+
16
+ &.secondary {
17
+ background-color: var(--secondary);
18
+ }
19
+
20
+ &.tertiary {
21
+ background-color: var(--tertiary);
22
+ }
23
+
24
+ &.alert {
25
+ background-color: var(--alert);
26
+ }
27
+
28
+ &.warning {
29
+ background-color: var(--warning);
30
+ }
31
+
32
+ &.success {
33
+ background-color: var(--success);
34
+ }
35
+ }
36
+
37
+ .colors-help {
38
+ p {
39
+ @apply block text-sm text-gray-2 font-normal prose-a:text-secondary prose-a:underline;
40
+
41
+ margin-bottom: 1em;
42
+ }
43
+
44
+ .colors {
45
+ white-space: unset;
46
+ font-size: 0.7rem;
47
+ }
48
+ }
@@ -0,0 +1,11 @@
1
+ #intergramRoot {
2
+ bottom: 3.5rem;
3
+ right: -0.5rem;
4
+ position: fixed;
5
+ z-index: 1000;
6
+ width: 100%;
7
+
8
+ > div {
9
+ position: absolute !important;
10
+ }
11
+ }
@@ -1,29 +1,20 @@
1
- @import "select2/dist/css/select2.css";
2
- @import "stylesheets/vendor/select2-foundation-theme";
1
+ @import "tom-select/dist/scss/tom-select";
3
2
 
4
- .multiusers-select-container {
5
- form label {
6
- margin-bottom: 1rem;
7
- }
3
+ /* overwrite tom-select defaults */
4
+ .ts {
5
+ &-control {
6
+ @apply border-gray text-md min-h-[40px];
8
7
 
9
- .switch-paddle {
10
- display: inline-block;
11
- vertical-align: middle;
12
- margin-right: 1em;
13
- }
14
- }
15
-
16
- .select2-container--foundation .select2-selection--multiple {
17
- .select2-selection__choice {
18
- display: inline-block;
19
- float: none;
20
- font-weight: normal;
8
+ input {
9
+ @apply font-normal text-black text-md;
10
+ }
21
11
 
22
12
  .is-admin {
23
13
  &::before {
24
14
  content: "⛔";
25
15
  display: inline-block;
26
16
  margin-right: 0.3em;
17
+ text-decoration: none;
27
18
  }
28
19
 
29
20
  text-decoration: line-through;
@@ -31,11 +22,11 @@
31
22
  }
32
23
  }
33
24
 
34
- textarea.select2-search__field {
35
- resize: none;
36
- }
37
- }
25
+ &-dropdown {
26
+ @apply text-md text-gray-2 font-normal;
38
27
 
39
- .form-conversations-submit {
40
- margin-top: 2rem;
28
+ .active {
29
+ @apply text-white bg-secondary;
30
+ }
31
+ }
41
32
  }
@@ -0,0 +1,5 @@
1
+ #LimitAmendmentsModal {
2
+ .instructions {
3
+ @apply grid gap-4 prose-a:text-secondary;
4
+ }
5
+ }
@@ -1,38 +1,24 @@
1
- @import "entrypoints/decidim_admin";
2
1
  @import "stylesheets/decidim/decidim_awesome/admin/constraints";
2
+ @import "stylesheets/decidim/decidim_awesome/admin/custom_styles";
3
3
  @import "stylesheets/decidim/decidim_awesome/admin/custom_fields";
4
4
  @import "stylesheets/decidim/decidim_awesome/admin/auto_edits";
5
5
  @import "stylesheets/decidim/decidim_awesome/admin/check_redirections";
6
- @import "stylesheets/decidim/decidim_awesome/editors/markdown_editor";
7
- @import "stylesheets/decidim/decidim_awesome/editors/quill_editor";
6
+ @import "stylesheets/decidim/decidim_awesome/admin/user_picker";
7
+ @import "stylesheets/decidim/decidim_awesome/admin/codemirror";
8
+ @import "stylesheets/decidim/decidim_awesome/shared/spinner";
9
+
10
+ // Remove the 20% right column from the item__edit class
11
+ // .item__edit {
12
+ // @apply grid grid-cols-1 md:grid-cols-[100%_0%] mb-8;
13
+ // }
8
14
 
9
15
  .pokecode-credits {
10
16
  float: right;
11
17
  margin: 0 1em 0.5em 0;
12
-
13
- // position: absolute;
14
- // bottom: 0;
15
- // right: 0;
16
- // margin: 1em;
17
18
  font-size: 0.8em;
18
19
  }
19
20
 
20
21
  .decidim_awesome {
21
- &.modal {
22
- .spinner {
23
- @include spinner(25px, #aaa, var(--secondary), 800ms);
24
-
25
- vertical-align: middle;
26
- display: none;
27
- }
28
-
29
- &.loading {
30
- .spinner {
31
- display: inline-block;
32
- }
33
- }
34
- }
35
-
36
22
  &-form {
37
23
  margin-bottom: 2em;
38
24
  border-bottom: 1px solid #999;
@@ -48,27 +34,3 @@
48
34
  padding-bottom: 0;
49
35
  }
50
36
  }
51
-
52
- // Some global fixes
53
- .form label {
54
- .help-text {
55
- display: block;
56
- margin-top: -1.5em;
57
- font-weight: normal;
58
- margin-bottom: 1.5em;
59
- }
60
- }
61
-
62
- .form-input-extra-before ~ .form-error {
63
- margin-top: -2.5rem;
64
- }
65
-
66
- tbody tr.menu_hack-addition {
67
- background: rgb(255, 248, 222);
68
- }
69
-
70
- .secondary-nav {
71
- li .icon {
72
- margin-right: 0.5rem;
73
- }
74
- }
@@ -5,22 +5,13 @@
5
5
  .component__show {
6
6
  &_private_data {
7
7
  &-grid {
8
- background-color: $body-background;
9
- display: grid;
10
- grid-template-columns: repeat(2, 1fr);
11
- gap: 1rem;
12
- margin: 1rem 0;
13
- padding: 0.5rem;
8
+ @apply bg-background grid-cols-2 gap-4 my-4 p-2;
14
9
 
15
10
  .date_info {
16
- font-style: italic;
17
- color: $medium-gray;
18
- font-size: 0.875rem;
19
- margin-top: 1rem;
11
+ @apply italic text-gray text-sm mt-4;
20
12
 
21
13
  a {
22
- font-style: normal;
23
- color: $secondary-color;
14
+ @apply not-italic text-secondary;
24
15
  }
25
16
  }
26
17
  }
@@ -1,21 +1,5 @@
1
- @import "codemirror/lib/codemirror"; // used by inscribemde
2
- @import "stylesheets/decidim/decidim_awesome/editors/markdown_editor";
3
- @import "stylesheets/decidim/decidim_awesome/editors/quill_editor";
1
+ @import "stylesheets/decidim/decidim_awesome/voting/voting_cards";
2
+ @import "stylesheets/decidim/decidim_awesome/shared/spinner";
4
3
  @import "stylesheets/decidim/decidim_awesome/forms/autosave";
5
4
  @import "stylesheets/decidim/decidim_awesome/forms/custom_fields";
6
- @import "stylesheets/decidim/decidim_awesome/voting/voting_cards";
7
-
8
- .decidim_awesome-custom_fields {
9
- dd {
10
- > div:last-child {
11
- margin-bottom: 1rem;
12
- }
13
-
14
- &[name="textarea"] {
15
- > div > p {
16
- margin-top: 1rem;
17
- margin-bottom: 0;
18
- }
19
- }
20
- }
21
- }
5
+ @import "stylesheets/decidim/decidim_awesome/amendments/modal";
@@ -1,4 +1,4 @@
1
- .wrapper {
1
+ .participatory-space__container {
2
2
  .awesome-iframe {
3
3
  margin: 0 auto;
4
4