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,9 +1,8 @@
1
- require("formBuilder/dist/form-render.min.js")
1
+ import "formBuilder/dist/form-render.min.js";
2
2
  import "src/decidim/decidim_awesome/forms/rich_text_plugin"
3
3
 
4
4
  export default class CustomFieldsRenderer { // eslint-disable-line no-unused-vars
5
- constructor(containerSelector) {
6
- this.containerSelector = containerSelector || ".proposal_custom_field:last";
5
+ constructor() {
7
6
  this.lang = this.getLang(window.DecidimAwesome.currentLocale);
8
7
  }
9
8
 
@@ -56,13 +55,13 @@ export default class CustomFieldsRenderer { // eslint-disable-line no-unused-var
56
55
  */
57
56
  dataToXML(data) {
58
57
  const $dl = $("<dl/>");
59
- let $dd = null,
60
- $div = null,
61
- $dt = null,
62
- datum = null,
63
- key = null,
64
- label = null,
65
- text = null,
58
+ let $dd = null,
59
+ $div = null,
60
+ $dt = null,
61
+ datum = null,
62
+ key = null,
63
+ label = null,
64
+ text = null,
66
65
  val = null;
67
66
  $dl.attr("class", "decidim_awesome-custom_fields");
68
67
  $dl.attr("data-generator", "decidim_awesome");
@@ -113,21 +112,23 @@ export default class CustomFieldsRenderer { // eslint-disable-line no-unused-var
113
112
  $dl.append($dd);
114
113
  }
115
114
  }
115
+ // console.log("dataToXML", $dl[0].outerHTML);
116
116
  return `<xml>${$dl[0].outerHTML}</xml>`;
117
117
  }
118
118
 
119
119
  fixBuggyFields() {
120
- if (!this.$container) {
120
+ if (!this.$element) {
121
121
  return false;
122
122
  }
123
123
 
124
124
  /**
125
125
  * Hack to fix required checkboxes being reset
126
- * Issue: https://github.com/Platoniq/decidim-module-decidim_awesome/issues/82
126
+ * Issue: https://github.com/decidim-ice/decidim-module-decidim_awesome/issues/82
127
127
  */
128
- this.$container.find(".formbuilder-checkbox-group").each((_key, group) => {
128
+ this.$element.find(".formbuilder-checkbox-group").each((_key, group) => {
129
129
  const inputs = $(".formbuilder-checkbox input", group);
130
- const data = this.spec.find((obj) => obj.type === "checkbox-group");
130
+ const $label = $(group).find("label");
131
+ const data = this.spec.find((obj) => obj.type === "checkbox-group" && obj.name === $label.attr("for"));
131
132
  let values = data.userData;
132
133
  if (!inputs.length || !data || !values) {
133
134
  return;
@@ -164,9 +165,9 @@ export default class CustomFieldsRenderer { // eslint-disable-line no-unused-var
164
165
 
165
166
  /**
166
167
  * Hack to fix required radio buttons "other" value
167
- * Issue: https://github.com/Platoniq/decidim-module-decidim_awesome/issues/133
168
+ * Issue: https://github.com/decidim-ice/decidim-module-decidim_awesome/issues/133
168
169
  */
169
- this.$container.find(".formbuilder-radio input.other-val").on("input", (input) => {
170
+ this.$element.find(".formbuilder-radio input.other-val").on("input", (input) => {
170
171
  const $input = $(input.currentTarget);
171
172
  const $group = $input.closest(".formbuilder-radio-group");
172
173
  $group.find("input").each((_key, radio) => {
@@ -181,10 +182,10 @@ export default class CustomFieldsRenderer { // eslint-disable-line no-unused-var
181
182
 
182
183
  // Saves xml to the hidden input
183
184
  storeData() {
184
- if (!this.$container) {
185
+ if (!this.$element) {
185
186
  return false;
186
187
  }
187
- const $form = this.$container.closest("form");
188
+ const $form = this.$element.closest("form");
188
189
  const $body = $form.find(`input[name="${this.$element.data("name")}"]`);
189
190
  if ($body.length && this.instance) {
190
191
  this.spec = this.instance.userData;
@@ -198,18 +199,21 @@ export default class CustomFieldsRenderer { // eslint-disable-line no-unused-var
198
199
  init($element) {
199
200
  this.$element = $element;
200
201
  this.spec = $element.data("spec");
201
- if (!this.$container) {
202
- this.$container = $(this.containerSelector);
203
- }
204
202
  // console.log("init", $element, "this", this)
205
- // always use the last field (in case of multilang tabs we only render one form due a limitation of the library to handle several instances)
206
- this.instance = this.$container.formRender({
203
+ // in case of multilang tabs we only render one form due a limitation in the library for handling several instances
204
+ this.instance = $element.formRender({
207
205
  i18n: {
208
206
  locale: this.lang,
209
- location: "https://cdn.jsdelivr.net/npm/formbuilder-languages@1.1.0/"
207
+ location: window.DecidimAwesome.formBuilderLangsLocation
210
208
  },
211
209
  formData: this.spec,
212
- render: true
210
+ render: true,
211
+ disableInjectedStyle: true,
212
+ controlConfig: {
213
+ "textarea.richtext": {
214
+ editorOptions: $element.data("editorOptions")
215
+ }
216
+ }
213
217
  });
214
218
  this.fixBuggyFields();
215
219
  }
@@ -4,7 +4,8 @@
4
4
  *
5
5
  * Registers Decidim Richtext as a subtype for the textarea control
6
6
  */
7
- import {createQuillEditor} from "src/decidim/decidim_awesome/editors/editor"
7
+
8
+ import createEditor from "src/decidim/decidim_awesome/editor";
8
9
 
9
10
  // configure the class for runtime loading
10
11
  if (!window.fbControls) {
@@ -40,7 +41,7 @@ window.fbControls.push(function(controlClass, allControlClasses) {
40
41
  * @return {void}
41
42
  */
42
43
  configure() {
43
- window.fbEditors.richtext = {};
44
+ window.fbEditors.tiptap = {};
44
45
  }
45
46
 
46
47
  /**
@@ -60,19 +61,24 @@ window.fbControls.push(function(controlClass, allControlClasses) {
60
61
  value: (userData && userData[0]) || value || ""
61
62
  });
62
63
 
63
- const css = this.markup(
64
- "style",
65
- `
66
- #${attrs.id} { height: auto; min-height: 6rem; padding-left: 0; padding-right: 0; }
67
- #${attrs.id} div.ql-container { height: ${attrs.rows || 1}rem; }
68
- #${attrs.id} p.help-text { margin-top: .5rem; }
69
- `,
70
- { type: "text/css" }
71
- );
72
- const wrapperAttrs = {...attrs, "data-toolbar": "full" };
73
- // console.log("build value", value, "userData", userData, "attrs", attrs, attrs.id, "wrapperAttrs", wrapperAttrs);
74
- this.wrapper = this.markup("div", null, wrapperAttrs);
75
- return this.markup("div", [css, this.input, this.wrapper], attrs);
64
+ this.editorInput = this.markup("div", null, {
65
+ style: "height: 25rem",
66
+ class: "editor-input"
67
+ });
68
+
69
+ const options = this.classConfig && this.classConfig.editorOptions || {"contentTypes": {image: ["image/jpeg", "image/png"]}};
70
+ const wrapperAttrs = {
71
+ "id": attrs.id,
72
+ "name": attrs.name,
73
+ "type": attrs.type,
74
+ "className": "editor-container",
75
+ "data-toolbar": "basic",
76
+ "data-disabled": "false",
77
+ "data-options": JSON.stringify(options)
78
+ };
79
+ // console.log("build value", value, "userData", userData, "attrs", attrs, attrs.id, "wrapperAttrs", wrapperAttrs,"this",this);
80
+ this.wrapper = this.markup("div", this.editorInput, wrapperAttrs);
81
+ return this.markup("div", [this.input, this.wrapper], {style: "margin-top: 1rem"});
76
82
  }
77
83
 
78
84
  /**
@@ -81,26 +87,15 @@ window.fbControls.push(function(controlClass, allControlClasses) {
81
87
  * @return {Object} evt - event
82
88
  */
83
89
  onRender(evt) {
84
- // const value = this.config.value || '';
85
- if (window.fbEditors.richtext[this.id]) {
86
- // console.log("todo destroy", window.fbEditors.richtext[this.id]);
87
- // window.fbEditors.richtext[this.id].richtext('destroy')
90
+ if (window.fbEditors.tiptap[this.id]) {
91
+ console.log("destroying editor", window.fbEditors.tiptap[this.id]);
92
+ window.fbEditors.tiptap[this.id].instance.destroy();
88
93
  }
89
94
 
90
- window.fbEditors.quill[this.id] = {};
91
- const editor = window.fbEditors.quill[this.id];
92
- // createQuillEditor does all the job to update the hidden input wrapper
93
- editor.instance = createQuillEditor(this.wrapper);
94
- // editor.data = new Delta();
95
- // if (value) {
96
- // editor.instance.setContents(window.JSON.parse(this.parsedHtml(value)));
97
- // }
98
- // editor.instance.on('text-change', function(delta) {
99
- // console.log("text-change", "delta", delta, "editor", editor);
100
- // // // editor.data = editor.data.compose(delta);
101
- // });
95
+ window.fbEditors.tiptap[this.id] = {};
96
+ const editor = window.fbEditors.tiptap[this.id];
97
+ editor.instance = createEditor(this.wrapper);
102
98
 
103
- // console.log("render! editor", editor, "this", this, "value", value);
104
99
  return evt;
105
100
  }
106
101
  }
@@ -1,22 +1,38 @@
1
1
  import CustomFieldsRenderer from "src/decidim/decidim_awesome/forms/custom_fields_renderer"
2
2
 
3
- window.DecidimAwesome.CustomFieldsRenderer = window.DecidimAwesome.CustomFieldsRenderer || new CustomFieldsRenderer();
4
-
5
3
  $(() => {
4
+ window.DecidimAwesome.CustomFieldsRenderer = window.DecidimAwesome.CustomFieldsRenderer || new CustomFieldsRenderer();
5
+ window.DecidimAwesome.PrivateCustomFieldsRenderer = window.DecidimAwesome.PrivateCustomFieldsRenderer || new CustomFieldsRenderer();
6
+
6
7
  // use admin multilang specs if exists
7
- let $el = $("proposal_custom_field:first", ".tabs-title.is-active");
8
- if (!$el.length) {
9
- $el = $(".proposal_custom_field:first");
8
+ const $public = $(".proposal_custom_field:first");
9
+ const $private = $(".proposal_custom_field.proposal_custom_field--private_body:first");
10
+ let $form = null;
11
+ if ($public.length) {
12
+ window.DecidimAwesome.CustomFieldsRenderer.init($public);
13
+ $form = window.DecidimAwesome.CustomFieldsRenderer.$element.closest("form");
10
14
  }
11
- window.DecidimAwesome.CustomFieldsRenderer.init($el);
12
-
13
- window.DecidimAwesome.CustomFieldsRenderer.$container.closest("form").on("submit", (evt) => {
14
- if (evt.target.checkValidity()) {
15
- // save current editor
16
- window.DecidimAwesome.CustomFieldsRenderer.storeData();
17
- } else {
18
- evt.preventDefault();
19
- evt.target.reportValidity();
15
+ if ($private.length) {
16
+ window.DecidimAwesome.PrivateCustomFieldsRenderer.init($private);
17
+ if (!$form) {
18
+ $form = window.DecidimAwesome.PrivateCustomFieldsRenderer.$element.closest("form");
20
19
  }
21
- });
20
+ }
21
+
22
+ if ($form) {
23
+ $form.on("submit", (evt) => {
24
+ if (evt.target.checkValidity()) {
25
+ // save current editors
26
+ if ($public.length) {
27
+ window.DecidimAwesome.CustomFieldsRenderer.storeData();
28
+ }
29
+ if ($private.length) {
30
+ window.DecidimAwesome.PrivateCustomFieldsRenderer.storeData();
31
+ }
32
+ } else {
33
+ evt.preventDefault();
34
+ evt.target.reportValidity();
35
+ }
36
+ });
37
+ }
22
38
  });
@@ -1,24 +1,30 @@
1
- $(() => {
1
+ import { attach } from "inline-attacher";
2
+
3
+ document.addEventListener("DOMContentLoaded", () => {
2
4
  window.DecidimAwesome = window.DecidimAwesome || {};
3
5
 
4
- const token = $('meta[name="csrf-token"]').attr("content");
5
- const $textarea = $("textarea#proposal_body");
6
- const text = window.DecidimAwesome.texts.drag_and_drop_image;
6
+ const token = document.querySelector('meta[name="csrf-token"]') && document.querySelector('meta[name="csrf-token"]').getAttribute("content");
7
+ const textarea = document.querySelector("textarea#proposal_body");
7
8
 
8
- if (!$textarea.length) {
9
+ if (!textarea) {
9
10
  return;
10
11
  }
11
12
 
12
13
  if (window.DecidimAwesome.allow_images_in_proposals) {
13
14
  // Add the capability to upload images only (they will be presented as links)
14
15
 
15
- $textarea.after(`<p class="help-text">${text}</p>`);
16
- $textarea.inlineattachment({
17
- uploadUrl: window.DecidimAwesome.editor_uploader_path,
16
+ const span = document.createElement("span");
17
+ span.className = "input-character-counter__text";
18
+ span.innerHTML = window.DecidimAwesome.texts.dragAndDropImage;
19
+ textarea.parentNode.appendChild(span);
20
+ attach(textarea, {
21
+ uploadUrl: window.DecidimAwesome.editorUploaderPath,
18
22
  uploadFieldName: "image",
19
- jsonFieldName: "url",
23
+ responseUrlKey: "url",
20
24
  progressText: "[Uploading file...]",
21
- urlText: "{filename}",
25
+ urlText: (url, response) => {
26
+ return response.url;
27
+ },
22
28
  extraHeaders: { "X-CSRF-Token": token }
23
29
  });
24
30
  }
@@ -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,27 +1,39 @@
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
+
11
+ &.private {
12
+ @apply outline-2 outline-[#fca5a5] outline-dotted;
13
+ }
14
+
6
15
  .form-error {
7
16
  margin: 0;
8
17
  }
9
18
 
10
- >.CodeMirror {
11
- border-top-left-radius: 5px;
12
- border-top-right-radius: 5px;
13
- border-top: .5em solid #e0e0e0;
14
- border-right: .5em solid #e0e0e0;
15
- border-bottom: .5em solid #e0e0e0;
16
- min-height: 6em;
19
+ > .CodeMirror {
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;
17
26
  height: auto;
18
- max-height: 40em;
19
27
  resize: vertical;
20
28
  overflow: vertical !important;
29
+ padding: 0;
30
+ margin: 0;
31
+ width: 100%;
32
+ font-size: 0.9rem;
21
33
 
22
- >.CodeMirror-scroll {
23
- >.CodeMirror-gutters {
24
- background: #e0e0e0;
34
+ > .CodeMirror-scroll {
35
+ > .CodeMirror-gutters {
36
+ background: #eee;
25
37
  }
26
38
  }
27
39
  }
@@ -1,43 +1,59 @@
1
1
  .constraints-editor {
2
- background: #f6f6f6;
3
- padding: 1rem;
4
- margin: -.5rem 0 2rem;
5
- border-radius: 5px;
2
+ margin-top: 1rem;
6
3
 
7
- .constraints-list {
8
- padding: 0;
9
- // margin:0 0 1em 0 ;
10
- li {
11
- margin: 0 1em 0 0;
12
- padding: 0;
4
+ h5 {
5
+ font-weight: 600;
6
+ color: rgb(62 76 92 / var(--tw-text-opacity));
7
+ font-size: 14px;
8
+ line-height: 18px;
9
+ }
10
+
11
+ .label {
12
+ font-weight: normal;
13
+ font-size: 0.8rem;
14
+ padding: 1px 5px;
15
+
16
+ &.participatory_space_manifest {
17
+ background-color: #f7b230;
18
+ color: #000;
13
19
  }
14
20
 
15
- .label {
16
- &.participatory_space_manifest {
17
- background-color: #f7b230;
18
- }
21
+ &.participatory_space_slug {
22
+ background-color: #19b380;
23
+ color: #fff;
24
+ }
19
25
 
20
- &.participatory_space_slug {
21
- background-color: #19b380;
22
- }
26
+ &.component_manifest {
27
+ background-color: #b31919;
28
+ color: #fff;
29
+ }
23
30
 
24
- &.component_manifest {
25
- background-color: #b31919;
26
- }
31
+ &.component_id {
32
+ background-color: #ee449c;
33
+ color: #fff;
34
+ }
27
35
 
28
- &.component_id {
29
- background-color: #ee449c;
36
+ &.constraint {
37
+ &-none {
38
+ background-color: #ff3000;
39
+ color: #fff;
30
40
  }
41
+ }
42
+ }
31
43
 
32
- &.constraint {
33
- &-none {
34
- background-color: #ff3000;
35
- }
36
- }
44
+ .constraints-list {
45
+ margin: 16px 20px;
46
+ padding: 0 20px 14px 33px;
47
+ list-style-type: disc;
48
+
49
+ .button__xs {
50
+ padding: 1px 5px;
51
+ font-size: 0.8rem;
37
52
  }
38
53
 
39
- a {
40
- margin-left: 1rem;
54
+ li {
55
+ margin: 0 1em 0 0;
56
+ padding: 0;
41
57
  }
42
58
 
43
59
  &.inactive {
@@ -46,4 +62,8 @@
46
62
  }
47
63
  }
48
64
  }
65
+
66
+ .flash[hidden] {
67
+ display: none;
68
+ }
49
69
  }