decidim-decidim_awesome 0.6.6 → 0.8.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (245) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +93 -36
  3. data/Rakefile +11 -12
  4. data/app/cells/decidim/decidim_awesome/content_blocks/map/error.erb +11 -0
  5. data/app/cells/decidim/decidim_awesome/content_blocks/map/show.erb +14 -0
  6. data/app/cells/decidim/decidim_awesome/content_blocks/map_cell.rb +65 -0
  7. data/app/cells/decidim/decidim_awesome/content_blocks/map_form/show.erb +65 -0
  8. data/app/cells/decidim/decidim_awesome/content_blocks/map_form_cell.rb +19 -0
  9. data/app/commands/concerns/decidim/decidim_awesome/admin/needs_constraint_helpers.rb +32 -0
  10. data/app/commands/decidim/decidim_awesome/admin/create_custom_redirect.rb +51 -0
  11. data/app/commands/decidim/decidim_awesome/admin/create_proposal_custom_field.rb +45 -0
  12. data/app/commands/decidim/decidim_awesome/admin/create_scoped_admin.rb +38 -0
  13. data/app/commands/decidim/decidim_awesome/admin/destroy_constraint.rb +4 -0
  14. data/app/commands/decidim/decidim_awesome/admin/destroy_custom_redirect.rb +47 -0
  15. data/app/commands/decidim/decidim_awesome/admin/destroy_proposal_custom_field.rb +40 -0
  16. data/app/commands/decidim/decidim_awesome/admin/destroy_scoped_admin.rb +40 -0
  17. data/app/commands/decidim/decidim_awesome/admin/destroy_scoped_style.rb +1 -1
  18. data/app/commands/decidim/decidim_awesome/admin/rename_scope_label.rb +58 -0
  19. data/app/commands/decidim/decidim_awesome/admin/update_config.rb +5 -1
  20. data/app/commands/decidim/decidim_awesome/admin/update_custom_redirect.rb +49 -0
  21. data/app/commands/decidim/decidim_awesome/create_editor_image.rb +12 -5
  22. data/app/controllers/concerns/decidim/decidim_awesome/not_found_redirect.rb +58 -0
  23. data/app/controllers/decidim/decidim_awesome/admin/checks_controller.rb +15 -22
  24. data/app/controllers/decidim/decidim_awesome/admin/config_controller.rb +41 -20
  25. data/app/controllers/decidim/decidim_awesome/admin/constraints_controller.rb +4 -0
  26. data/app/controllers/decidim/decidim_awesome/admin/custom_redirects_controller.rb +91 -0
  27. data/app/controllers/decidim/decidim_awesome/admin/menu_hacks_controller.rb +7 -10
  28. data/app/controllers/decidim/decidim_awesome/admin/proposal_custom_fields_controller.rb +38 -0
  29. data/app/controllers/decidim/decidim_awesome/admin/scoped_admins_controller.rb +38 -0
  30. data/app/controllers/decidim/decidim_awesome/admin/scoped_styles_controller.rb +38 -0
  31. data/app/controllers/decidim/decidim_awesome/blank_component_controller.rb +19 -0
  32. data/app/controllers/decidim/decidim_awesome/editor_images_controller.rb +2 -3
  33. data/app/controllers/decidim/decidim_awesome/iframe_component/iframe_controller.rb +1 -1
  34. data/app/controllers/decidim/decidim_awesome/map_component/map_controller.rb +2 -9
  35. data/app/forms/decidim/decidim_awesome/admin/config_form.rb +52 -0
  36. data/app/forms/decidim/decidim_awesome/admin/constraint_form.rb +3 -1
  37. data/app/forms/decidim/decidim_awesome/admin/custom_redirect_form.rb +45 -0
  38. data/app/forms/decidim/decidim_awesome/editor_image_form.rb +3 -2
  39. data/app/forms/decidim/decidim_awesome/proposals/proposal_wizard_create_step_form_override.rb +38 -0
  40. data/app/helpers/decidim/decidim_awesome/admin/config_constraints_helpers.rb +32 -15
  41. data/app/helpers/decidim/decidim_awesome/admin/system_checker_helpers.rb +36 -0
  42. data/app/helpers/decidim/decidim_awesome/amendments_helper_override.rb +48 -0
  43. data/app/helpers/decidim/decidim_awesome/map_helper.rb +76 -57
  44. data/app/helpers/decidim/decidim_awesome/proposals/application_helper_override.rb +78 -0
  45. data/app/jobs/decidim/decidim_awesome/migrate_legacy_images_job.rb +106 -0
  46. data/app/middleware/decidim/decidim_awesome/current_config.rb +182 -0
  47. data/app/models/decidim/decidim_awesome/awesome_config.rb +15 -0
  48. data/app/models/decidim/decidim_awesome/editor_image.rb +4 -9
  49. data/app/models/decidim/decidim_awesome/user_override.rb +25 -0
  50. data/app/packs/entrypoints/decidim_admin_decidim_awesome.js +5 -0
  51. data/app/packs/entrypoints/decidim_admin_decidim_awesome.scss +1 -0
  52. data/app/packs/entrypoints/decidim_admin_decidim_awesome_custom_fields.js +2 -0
  53. data/app/packs/entrypoints/decidim_decidim_awesome.js +9 -0
  54. data/app/packs/entrypoints/decidim_decidim_awesome.scss +1 -0
  55. data/app/packs/entrypoints/decidim_decidim_awesome_admin_form_exit_warn.js +1 -0
  56. data/app/packs/entrypoints/decidim_decidim_awesome_custom_fields.js +1 -0
  57. data/app/packs/entrypoints/decidim_decidim_awesome_iframe.scss +1 -0
  58. data/app/packs/entrypoints/decidim_decidim_awesome_map.js +5 -0
  59. data/app/packs/entrypoints/decidim_decidim_awesome_map.scss +1 -0
  60. data/app/{assets → packs}/images/decidim/decidim_awesome/platoniq-logo.png +0 -0
  61. data/app/packs/src/decidim/decidim_awesome/admin/auto_edit.js +82 -0
  62. data/app/packs/src/decidim/decidim_awesome/admin/check_redirections.js +48 -0
  63. data/app/packs/src/decidim/decidim_awesome/admin/codemirror.js +14 -0
  64. data/app/packs/src/decidim/decidim_awesome/admin/constraints.js +55 -0
  65. data/app/packs/src/decidim/decidim_awesome/admin/custom_fields_builder.js +77 -0
  66. data/app/{assets/javascripts/decidim/decidim_awesome/admin/form_exit_warn.js.es6 → packs/src/decidim/decidim_awesome/admin/form_exit_warn.js} +0 -2
  67. data/app/packs/src/decidim/decidim_awesome/admin/user_picker.js +24 -0
  68. data/app/packs/src/decidim/decidim_awesome/awesome_admin.js +23 -0
  69. data/app/packs/src/decidim/decidim_awesome/awesome_application.js +17 -0
  70. data/app/{assets/javascripts/decidim/decidim_awesome/awesome_map/api_fetcher.js.es6 → packs/src/decidim/decidim_awesome/awesome_map/api/api_fetcher.js} +1 -15
  71. data/app/packs/src/decidim/decidim_awesome/awesome_map/api/fetcher.js +131 -0
  72. data/app/packs/src/decidim/decidim_awesome/awesome_map/api/meetings_fetcher.js +59 -0
  73. data/app/packs/src/decidim/decidim_awesome/awesome_map/api/proposals_fetcher.js +52 -0
  74. data/app/packs/src/decidim/decidim_awesome/awesome_map/awesome_map.js +130 -0
  75. data/app/packs/src/decidim/decidim_awesome/awesome_map/controllers/controller.js +112 -0
  76. data/app/packs/src/decidim/decidim_awesome/awesome_map/controllers/meetings_controller.js +31 -0
  77. data/app/packs/src/decidim/decidim_awesome/awesome_map/controllers/proposals_controller.js +88 -0
  78. data/app/packs/src/decidim/decidim_awesome/awesome_map/controls_ui.js +221 -0
  79. data/app/packs/src/decidim/decidim_awesome/awesome_map/load_map.js +51 -0
  80. data/app/packs/src/decidim/decidim_awesome/editors/editor.js +190 -0
  81. data/app/packs/src/decidim/decidim_awesome/editors/tabs_focus.js +22 -0
  82. data/app/{assets/javascripts/decidim/decidim_awesome/forms/autosave.js.es6 → packs/src/decidim/decidim_awesome/forms/autosave.js} +20 -17
  83. data/app/packs/src/decidim/decidim_awesome/forms/custom_fields_renderer.js +207 -0
  84. data/app/packs/src/decidim/decidim_awesome/forms/rich_text_plugin.js +107 -0
  85. data/app/packs/src/decidim/decidim_awesome/proposals/custom_fields.js +22 -0
  86. data/app/packs/src/decidim/decidim_awesome/proposals/images.js +25 -0
  87. data/{vendor/assets/javascripts → app/packs/src/vendor}/image-resize.min.js +0 -0
  88. data/{vendor/assets/javascripts → app/packs/src/vendor}/image-upload.min.js +0 -0
  89. data/app/packs/src/vendor/jquery.truncate.js +105 -0
  90. data/app/packs/src/vendor/leaflet.featuregroup.subgroup.js +184 -0
  91. data/app/packs/stylesheets/decidim/decidim_awesome/admin/auto_edits.scss +16 -0
  92. data/app/packs/stylesheets/decidim/decidim_awesome/admin/check_redirections.scss +28 -0
  93. data/app/packs/stylesheets/decidim/decidim_awesome/admin/codemirror.scss +29 -0
  94. data/app/{assets → packs}/stylesheets/decidim/decidim_awesome/admin/constraints.scss +21 -9
  95. data/app/packs/stylesheets/decidim/decidim_awesome/admin/custom_fields.scss +93 -0
  96. data/app/packs/stylesheets/decidim/decidim_awesome/admin/user_picker.scss +41 -0
  97. data/app/packs/stylesheets/decidim/decidim_awesome/awesome_admin.scss +71 -0
  98. data/app/packs/stylesheets/decidim/decidim_awesome/awesome_application.scss +19 -0
  99. data/app/{assets → packs}/stylesheets/decidim/decidim_awesome/awesome_iframe/iframe.scss +3 -3
  100. data/app/packs/stylesheets/decidim/decidim_awesome/awesome_map/map.scss +176 -0
  101. data/app/{assets → packs}/stylesheets/decidim/decidim_awesome/editors/markdown_editor.scss +6 -4
  102. data/app/packs/stylesheets/decidim/decidim_awesome/editors/quill_editor.scss +58 -0
  103. data/app/{assets → packs}/stylesheets/decidim/decidim_awesome/forms/autosave.scss +2 -2
  104. data/app/packs/stylesheets/vendor/select2-foundation-theme.scss +348 -0
  105. data/app/permissions/decidim/decidim_awesome/admin/permissions.rb +2 -0
  106. data/app/presenters/decidim/decidim_awesome/menu_item_presenter_override.rb +25 -0
  107. data/app/presenters/decidim/decidim_awesome/menu_presenter_override.rb +23 -0
  108. data/app/uploaders/decidim/cw/decidim_awesome/image_uploader.rb +26 -0
  109. data/app/uploaders/decidim/decidim_awesome/image_uploader.rb +4 -21
  110. data/app/views/decidim/decidim_awesome/admin/checks/index.html.erb +28 -22
  111. data/app/views/decidim/decidim_awesome/admin/config/_autoedit_box_label.html.erb +7 -0
  112. data/app/views/decidim/decidim_awesome/admin/config/_constraints.html.erb +3 -3
  113. data/app/views/decidim/decidim_awesome/admin/config/_form_admins.html.erb +21 -0
  114. data/app/views/decidim/decidim_awesome/admin/config/_form_editors.html.erb +1 -3
  115. data/app/views/decidim/decidim_awesome/admin/config/_form_proposal_custom_fields.html.erb +25 -0
  116. data/app/views/decidim/decidim_awesome/admin/config/_form_proposals.html.erb +0 -2
  117. data/app/views/decidim/decidim_awesome/admin/config/_form_styles.html.erb +11 -12
  118. data/app/views/decidim/decidim_awesome/admin/config/_modal.html.erb +1 -1
  119. data/app/views/decidim/decidim_awesome/admin/config/show.html.erb +3 -4
  120. data/app/views/decidim/decidim_awesome/admin/constraints/new.html.erb +1 -1
  121. data/app/views/decidim/decidim_awesome/admin/custom_redirects/_form.html.erb +6 -0
  122. data/app/views/decidim/decidim_awesome/admin/custom_redirects/edit.html.erb +13 -0
  123. data/app/views/decidim/decidim_awesome/admin/custom_redirects/index.html.erb +37 -0
  124. data/app/views/decidim/decidim_awesome/admin/custom_redirects/new.html.erb +13 -0
  125. data/app/views/decidim/decidim_awesome/admin/menu_hacks/edit.html.erb +1 -1
  126. data/app/views/decidim/decidim_awesome/admin/menu_hacks/new.html.erb +1 -1
  127. data/app/views/decidim/decidim_awesome/admin/proposals/_editor.html.erb +6 -0
  128. data/app/views/decidim/decidim_awesome/custom_fields/_form_render.html.erb +6 -0
  129. data/app/views/decidim/decidim_awesome/iframe_component/iframe/show.html.erb +1 -1
  130. data/app/views/decidim/decidim_awesome/map_component/map/_api_ready.html.erb +3 -0
  131. data/app/views/decidim/decidim_awesome/map_component/map/_map_template.html.erb +68 -0
  132. data/app/views/decidim/decidim_awesome/map_component/map/{error.erb → error.html.erb} +2 -0
  133. data/app/views/decidim/decidim_awesome/map_component/map/show.html.erb +3 -96
  134. data/app/views/decidim/proposals/admin/proposals/_form.html.erb +101 -0
  135. data/app/views/decidim/proposals/collaborative_drafts/_edit_form_fields.html.erb +83 -0
  136. data/app/views/decidim/proposals/collaborative_drafts/show.html.erb +1 -0
  137. data/app/views/layouts/decidim/admin/decidim_awesome.html.erb +34 -16
  138. data/app/views/layouts/decidim/decidim_awesome/_awesome_config.html.erb +6 -1
  139. data/app/views/layouts/decidim/decidim_awesome/_custom_styles.html.erb +1 -1
  140. data/app/views/v0.25/decidim/proposals/collaborative_drafts/_show.html.erb +128 -0
  141. data/app/views/{v0.23 → v0.25}/layouts/decidim/_head.html.erb +12 -10
  142. data/app/views/v0.25/layouts/decidim/admin/_header.html.erb +11 -0
  143. data/app/views/v0.26/decidim/proposals/collaborative_drafts/_show.html.erb +128 -0
  144. data/app/views/{v0.22 → v0.26}/layouts/decidim/_head.html.erb +18 -10
  145. data/app/views/v0.26/layouts/decidim/admin/_header.html.erb +11 -0
  146. data/config/assets.rb +46 -0
  147. data/config/i18n-tasks.yml +6 -0
  148. data/config/locales/ca.yml +147 -13
  149. data/config/locales/cs.yml +137 -3
  150. data/config/locales/en.yml +170 -11
  151. data/config/locales/es.yml +136 -2
  152. data/config/locales/eu.yml +1 -161
  153. data/config/locales/fr.yml +276 -142
  154. data/config/locales/it.yml +346 -0
  155. data/config/locales/ja.yml +345 -0
  156. data/config/locales/nl.yml +167 -136
  157. data/config/locales/pt-BR.yml +346 -0
  158. data/config/locales/pt-PT.yml +7 -0
  159. data/config/locales/pt.yml +7 -0
  160. data/config/locales/sv.yml +109 -152
  161. data/db/migrate/20210628150825_change_awesome_config_var_type.rb +12 -0
  162. data/lib/decidim/decidim_awesome/admin_engine.rb +19 -12
  163. data/lib/decidim/decidim_awesome/awesome.rb +214 -0
  164. data/lib/decidim/decidim_awesome/awesome_helpers.rb +17 -17
  165. data/lib/decidim/decidim_awesome/checksums.yml +23 -16
  166. data/lib/decidim/decidim_awesome/config.rb +55 -9
  167. data/lib/decidim/decidim_awesome/content_parsers/editor_images_parser.rb +39 -0
  168. data/lib/decidim/decidim_awesome/context_analyzers/request_analyzer.rb +27 -21
  169. data/lib/decidim/decidim_awesome/custom_fields.rb +94 -0
  170. data/lib/decidim/decidim_awesome/engine.rb +42 -14
  171. data/lib/decidim/decidim_awesome/iframe_component/admin_engine.rb +23 -0
  172. data/lib/decidim/decidim_awesome/iframe_component/component.rb +6 -6
  173. data/lib/decidim/decidim_awesome/map_component/admin_engine.rb +23 -0
  174. data/lib/decidim/decidim_awesome/map_component/component.rb +13 -6
  175. data/lib/decidim/decidim_awesome/map_component/engine.rb +34 -0
  176. data/lib/decidim/decidim_awesome/menu_hacker.rb +2 -1
  177. data/lib/decidim/decidim_awesome/system_checker.rb +1 -1
  178. data/lib/decidim/decidim_awesome/test/factories.rb +2 -2
  179. data/lib/decidim/decidim_awesome/test/initializer.rb +25 -0
  180. data/lib/decidim/decidim_awesome/test/layouts/decidim/_head.html.erb +30 -2
  181. data/lib/decidim/decidim_awesome/test/layouts/decidim/admin/_header.html.erb +7 -2
  182. data/lib/decidim/decidim_awesome/test/shared_examples/box_label_editor.rb +116 -0
  183. data/lib/decidim/decidim_awesome/test/shared_examples/config_examples.rb +18 -0
  184. data/lib/decidim/decidim_awesome/test/shared_examples/controller_examples.rb +13 -0
  185. data/lib/decidim/decidim_awesome/test/shared_examples/current_config_examples.rb +143 -0
  186. data/lib/decidim/decidim_awesome/test/shared_examples/custom_redirects_contexts.rb +47 -0
  187. data/lib/decidim/decidim_awesome/test/shared_examples/editor_examples.rb +4 -0
  188. data/lib/decidim/decidim_awesome/test/shared_examples/menu_hack_contexts.rb +0 -17
  189. data/lib/decidim/decidim_awesome/test/shared_examples/scoped_admins_examples.rb +420 -0
  190. data/lib/decidim/decidim_awesome/test/shared_examples/summary_examples.rb +202 -0
  191. data/lib/decidim/decidim_awesome/version.rb +2 -2
  192. data/lib/decidim/decidim_awesome.rb +4 -119
  193. data/lib/tasks/decidim_awesome_active_storage_migrations_tasks.rake +37 -0
  194. data/lib/tasks/decidim_awesome_webpacker_tasks.rake +62 -0
  195. metadata +148 -83
  196. data/app/assets/config/decidim_admin_decidim_awesome_manifest.css +0 -3
  197. data/app/assets/config/decidim_admin_decidim_awesome_manifest.js +0 -2
  198. data/app/assets/config/decidim_decidim_awesome_manifest.css +0 -5
  199. data/app/assets/config/decidim_decidim_awesome_manifest.js +0 -3
  200. data/app/assets/images/decidim/decidim_awesome/loading.gif +0 -0
  201. data/app/assets/javascripts/decidim/decidim_awesome/admin/constraints.js.es6 +0 -54
  202. data/app/assets/javascripts/decidim/decidim_awesome/admin.js +0 -2
  203. data/app/assets/javascripts/decidim/decidim_awesome/application.js +0 -4
  204. data/app/assets/javascripts/decidim/decidim_awesome/awesome_map/categories.js.es6 +0 -25
  205. data/app/assets/javascripts/decidim/decidim_awesome/awesome_map/legacy_map.js.es6 +0 -225
  206. data/app/assets/javascripts/decidim/decidim_awesome/awesome_map/legacy_proposals.js.es6 +0 -82
  207. data/app/assets/javascripts/decidim/decidim_awesome/awesome_map/map.js.es6 +0 -215
  208. data/app/assets/javascripts/decidim/decidim_awesome/awesome_map/meetings.js.es6 +0 -131
  209. data/app/assets/javascripts/decidim/decidim_awesome/awesome_map/proposals.js.es6 +0 -94
  210. data/app/assets/javascripts/decidim/decidim_awesome/editors/markdown_view.js.es6 +0 -12
  211. data/app/assets/javascripts/decidim/decidim_awesome/editors/quill_editor.js.es6 +0 -160
  212. data/app/assets/javascripts/decidim/decidim_awesome/proposals/images.js.es6 +0 -25
  213. data/app/assets/stylesheets/decidim/decidim_awesome/admin.scss +0 -49
  214. data/app/assets/stylesheets/decidim/decidim_awesome/application.scss +0 -8
  215. data/app/assets/stylesheets/decidim/decidim_awesome/awesome_map/leaflet.scss.erb +0 -9
  216. data/app/assets/stylesheets/decidim/decidim_awesome/awesome_map/map.scss +0 -66
  217. data/app/assets/stylesheets/decidim/decidim_awesome/editors/markdown_view.scss +0 -27
  218. data/app/assets/stylesheets/decidim/decidim_awesome/editors/quill_editor.scss +0 -7
  219. data/app/awesome_overrides/presenters/decidim/menu_presenter_override.rb +0 -39
  220. data/app/awesome_overrides/presenters/decidim/proposals/proposal_presenter_override.rb +0 -64
  221. data/app/controllers/decidim/decidim_awesome/iframe_component/application_controller.rb +0 -15
  222. data/app/controllers/decidim/decidim_awesome/map_component/application_controller.rb +0 -15
  223. data/app/views/v0.22/layouts/decidim/admin/_header.html.erb +0 -11
  224. data/app/views/v0.23/layouts/decidim/admin/_header.html.erb +0 -12
  225. data/lib/decidim/decidim_awesome/content_renderers/markdown_renderer.rb +0 -18
  226. data/lib/decidim/decidim_awesome/content_renderers.rb +0 -9
  227. data/lib/decidim/decidim_awesome/test/themes/css.lvh.me.css +0 -3
  228. data/lib/decidim/decidim_awesome/test/themes/erb.lvh.me.scss.erb +0 -2
  229. data/lib/decidim/decidim_awesome/test/themes/scss.lvh.me.scss +0 -1
  230. data/lib/decidim/decidim_awesome/test/themes/test-theme/body.scss +0 -4
  231. data/vendor/assets/images/layers-2x.png +0 -0
  232. data/vendor/assets/images/layers.png +0 -0
  233. data/vendor/assets/images/marker-icon.png +0 -0
  234. data/vendor/assets/javascripts/codemirror-4.inline-attachment.js +0 -89
  235. data/vendor/assets/javascripts/form-storage.js +0 -824
  236. data/vendor/assets/javascripts/highlight.min.js +0 -44
  237. data/vendor/assets/javascripts/inline-attachment.js +0 -399
  238. data/vendor/assets/javascripts/inscrybmde.min.js +0 -7
  239. data/vendor/assets/javascripts/jquery.inline-attachment.js +0 -66
  240. data/vendor/assets/javascripts/jsrender.min.js +0 -4
  241. data/vendor/assets/javascripts/leaflet.featuregroup.subgroup.js +0 -6
  242. data/vendor/assets/stylesheets/default.min.css +0 -1
  243. data/vendor/assets/stylesheets/foundation.min.css +0 -1
  244. data/vendor/assets/stylesheets/github.min.css +0 -2
  245. data/vendor/assets/stylesheets/inscrybmde.min.css +0 -8
@@ -2,140 +2,110 @@ sv:
2
2
  activemodel:
3
3
  attributes:
4
4
  config:
5
- allow_images_in_full_editor: Allow images in the full HTML editor
6
- allow_images_in_markdown_editor: Allow images in the markdown editor
7
- allow_images_in_proposals: Allow images in the proposals editor
8
- allow_images_in_small_editor: Allow images in the minimal HTML editor
9
- auto_save_forms: Auto save forms in local storage
10
- intergram_auto_no_response: A message that is sent one minute after the user sends its first message and no response was received
11
- intergram_auto_response: A message that is sent immediately after the user sends its first message
12
- intergram_chat_id: Chat ID
13
- intergram_color: Color of the widget
14
- intergram_for_admins: Enable Intergram Chat in the admin backend
15
- intergram_intro_message: First message when the user opens the chat for the first time
16
- intergram_require_login: Only for logged users
17
- intergram_title_closed: Closed chat title
18
- intergram_title_open: Opened chat title
19
- intergram_use_floating_button: If checked, the closed chat is always a button instead of a text
20
- scoped_styles: 'Custom styles #%{id}'
21
- use_markdown_editor: Use a Markdown editor instead of the HTML editor
5
+ allow_images_in_full_editor: Tillåt bilder i den fullständiga HTML-editorn
6
+ allow_images_in_markdown_editor: Tillåt bilder i den fullständiga Markdown-editorn
7
+ allow_images_in_proposals: Tillåt bilder i förslagsfältet
8
+ allow_images_in_small_editor: Tillåt bilder i den minimala HTML-editorn
9
+ auto_save_forms: Spara formulär automatiskt i lokal lagring
10
+ intergram_chat_id: Chatt ID
11
+ intergram_color: Huvudfärg för widget
12
+ intergram_intro_message: Första meddelandet när användaren öppnar chatten för första gången
13
+ intergram_require_login: Endast för inloggade användare
14
+ proposal_custom_fields: Tilläggsfält %{id}
15
+ scoped_styles: Tilläggsstilar %{id}
22
16
  constraint:
23
- component_id: or specifically in
24
- component_manifest: Only in components of type
25
- participatory_space_manifest: Apply to participatory spaces of type
26
- participatory_space_slug: Only in
17
+ component_id: eller specifikt i
18
+ participatory_space_slug: Endast i
19
+ custom_redirect:
20
+ active: Aktiv
21
+ destination: Mål
22
+ origin: Ursprung
23
+ status: Status
27
24
  menu:
28
25
  position: Position
29
- raw_label: Label
30
- target: Opens in
31
- url: URL
32
- visibility: Visibility
26
+ raw_label: Text
27
+ target: Öppna i
28
+ url: Webbadress
29
+ visibility: Synlighet
30
+ proposal:
31
+ proposal_custom_fields: Tilläggsfält
33
32
  decidim:
34
33
  admin:
35
34
  menu:
36
- decidim_awesome: Decidim awesome
35
+ decidim_awesome: Decidim Awesome
37
36
  components:
38
37
  awesome_iframe:
39
- name: Fullscreen Iframe
38
+ name: Fullskärm Iframe
40
39
  settings:
41
40
  global:
42
- announcement: Announcement
43
- iframe: Iframe code
44
- iframe_help: 'Put your code as html: <iframe width="100%" height="700" frameBorder="0" allowFullscreen src="..."></iframe>. Content will be sanitized from other HTML tags. Ensure to use 100% as width to fill the screen.'
45
- no_margins: No margins between the iframe and the rest of the page
46
- viewport_width: Limit maximum width to the application viewport
41
+ announcement: Meddelande
42
+ iframe: Iframe kod
47
43
  step:
48
- announcement: Announcement
49
- iframe: Iframe code
44
+ announcement: Meddelande
45
+ iframe: Iframe kod
50
46
  awesome_map:
51
- name: Awesome Map
47
+ name: Karta
52
48
  settings:
53
49
  global:
54
- announcement: Announcement
55
- collapse: Start with collapsed menu
56
- map_height: Map height (px)
50
+ announcement: Meddelande
51
+ map_height: Karthöjd (px)
52
+ menu_amendments: Visa ändringsförslag
53
+ menu_meetings: Visa möten
57
54
  step:
58
- announcement: Announcement
59
- show_accepted: Show accepted proposals
60
- show_evaluating: Show evaluating proposals
61
- show_not_answered: Show not answered proposals
62
- show_rejected: Show rejected proposals
63
- show_withdrawn: Show withdrawn proposals
55
+ announcement: Meddelande
56
+ show_accepted: Visa godkända förslag
57
+ show_evaluating: Visa förslag som utvärderas
64
58
  decidim_awesome:
65
59
  admin:
66
60
  checks:
67
61
  index:
68
- admin_head_tags: Awesome tags included in the admin application header
69
- decidim-admin: From Admin module
70
- decidim-core: From Core module
71
- decidim-proposals: From Proposals module
62
+ decidim-admin: Från Admin modul
63
+ decidim-core: Från Core modul
64
+ decidim-proposals: Från Proposals modul
72
65
  decidim_version: Decidim version %{version}
73
- errors:
74
- CSS: Head does not contain the required <link> stylesheet entries. To solve it, you can manually add it to your custom _head.html.erb
75
- JavaScript: Head does not contain the required <script> Javascript entries. To solve it, you can manually add it to your custom admin/_header.html.erb
76
- head_tags: Awesome tags included in the application header
77
- title: System compatibility checks
66
+ images_migrated: Bilder migrerade till ActiveStorage
78
67
  config:
79
68
  constraints:
80
- add_condition: Add case
81
- always: Always
82
- delete: Delete
83
- edit: Edit
84
- title: 'Applicable only in these cases:'
85
- create_scoped_style:
86
- error: Error creating a new CSS box! %{error}
87
- success: CSS box %{key} created successfully
88
- destroy_scoped_style:
89
- error: Error removing CSS box! %{error}
90
- success: CSS box %{key} removed successfully
91
- experimental: Experimental options
69
+ add_condition: Lägg till begränsning
70
+ always: Alltid
71
+ delete: Radera
72
+ edit: Redigera
92
73
  form:
74
+ edit_label: Byt namn på etikett
93
75
  help:
94
- allow_images_in_full_editor: This will add an image uploader icon in all the editors WYSIWYG with the full toolbar enabled.
95
- allow_images_in_markdown_editor: This will allow markdown editor to upload images by copy & paste or drag & drop.
96
- allow_images_in_proposals: This will allow to upload images in the proposals editor, available to any user
97
- allow_images_in_small_editor: This will add an image uploader icon in all the editors WYSIWYG with minimal options in the toolbar enabled.
98
- auto_save_forms: This will use LocalStorage to automatically save data introduced by users in surveys and other forms while they are filling it. Data will be restored in a future visit with the same browser in case the form is not submitted. If the form is submitted, data will be removed. If users remove their LocalStorage data, data won't be restored either.
99
- drag_and_drop_supported: When uploading images, Drag & Drop is supported. Images will be uploaded to the server and inserted as external resources (it doesn't use base64 inline encoding).
100
- intergram_about: Intergram uses Telegram messenger to handle a live support chat widget embedded in the bottom of the page.
101
- intergram_config: 'Invite the <a href="https://web.telegram.org/#/im?p=@IntergramBot">@Intergram bot</a> to your group or start a chat with it directly. <a href="https://github.com/idoco/intergram#embed-intergram-in-your-website-with-these-2-simple-steps">+ info</a>'
102
- scoped_styles: Create custom CSS that applies only in certain parts of the public web (use the restrictions editor for that)
103
- scoped_styles_variables: 'You can use the following CSS variables for organization customized colors:'
104
76
  use_markdown_editor: This will substitute the Quill WYSIWYG editor, use a Markdown editor instead. Text will be rendered as HTML in the public pages (text in database will be saved as markdown text)
105
- form_styles:
106
- new: Add a new CSS box
107
- remove: Remove this CSS box
108
- sure_to_remove: Are you sure you want to destroy this CSS box?
109
- rich_text_editor_in_public_views: 'NOTE: "Rich text editor for participants" is enabled, this option won''t apply. Use the editors hacks instead to enable images in proposals.'
77
+ form_scoped_styles:
78
+ remove: Ta bort CSS-rutan
79
+ process_groups: Dialoggrupper
110
80
  show:
111
- title: Tweaks for %{setting}
112
- update: Update configuration
113
- system: Everywhere except participatory spaces
114
- update:
115
- error: Error updating configuration! %{error}
116
- success: Configuration updated successfully
81
+ title: Tweaks för %{setting}
82
+ update: Uppdatera konfiguration
117
83
  constraints:
118
- create:
119
- error: Error creating condition case
120
- success: Condition case created successfully
121
- destroy:
122
- error: Error removing condition case
123
- success: Condition case removed successfully
124
- errors:
125
- not_unique: Same condition already exists
126
84
  new:
127
- cancel: Cancel
128
- constraint: New condition case
129
- save: Save
85
+ cancel: Avbryt
86
+ constraint: Ny begränsning
87
+ save: Spara
130
88
  show:
131
- cancel: Cancel
132
- constraint: Edit condition case
133
- save: Save
134
- update:
135
- error: Error updating condition case
136
- success: Condition case updated successfully
89
+ cancel: Avbryt
90
+ constraint: Redigera begränsning
91
+ save: Spara
92
+ custom_redirects:
93
+ edit:
94
+ save: Spara
95
+ title: Redigera omdirigering
96
+ index:
97
+ check_redirections: "✔ Kontrollera omdirigeringar"
98
+ edit: Redigera omdirigering
99
+ new: Ny omdirigering
100
+ remove: Ta bort omdirigering
101
+ title: Anpassade omdirigeringar
102
+ new:
103
+ save: Spara
104
+ title: Ny omdirigering
137
105
  menu:
106
+ admins: Begränsade administratörer
138
107
  checks: System compatibility
108
+ custom_redirects: Anpassade omdirigeringar
139
109
  editors: Editor hacks
140
110
  livechat: Live Chat
141
111
  menu_hacks: Menu tweaks
@@ -143,58 +113,46 @@ sv:
143
113
  styles: Custom styles
144
114
  surveys: Surveys & forms
145
115
  menu_hacks:
146
- create:
147
- error: Error creating menu item! %{error}
148
- success: Menu item created successfully
149
- destroy:
150
- error: Error removing menu item! %{error}
151
- success: Menu item removed successfully
152
116
  edit:
153
- save: Save
154
- title: Edit menu item
117
+ save: Spara
118
+ title: Redigera menyobjekt
155
119
  form:
156
- label_help: Translations aren't automatically detected, be sure to fill in all the fields!
157
120
  target:
158
- blank: New window
159
- self: Same window
121
+ blank: Nytt fönster
122
+ self: Samma fönster
160
123
  visibility:
161
- default: Visible
162
- hidden: Always hidden
163
- logged: Only visible for logged users
164
- non_logged: Only visible for non-logged users
124
+ default: Synligt
125
+ hidden: Alltid dolt
126
+ logged: Endast synlig för inloggade användare
165
127
  index:
166
- confirm_destroy: Are you sure to remove this customization?
167
- edit: Edit
168
- new: New item
169
- remove: Remove addition
170
- remove_hack: Remove customization
171
- title: Main menu
128
+ edit: Redigera
129
+ new: Ny menyknapp
130
+ remove: Ta bort menyknapp
131
+ remove_hack: Ta bort menyknapp
132
+ title: Huvudmeny
172
133
  new:
173
- save: Save
174
- title: New menu item
175
- update:
176
- error: Error updating menu item! %{error}
177
- success: Menu item updated successfully
178
- url_exists: The same URL is already configured, please edit that instead of creating it again.
134
+ save: Spara
135
+ title: Ny menyknapp
179
136
  config:
180
137
  intergram:
181
- auto_no_response: It seems that no one is available to answer right now. Please tell us how we can contact you, and we will get back to you as soon as we can.
182
- auto_response: Looking for the first available admin (It might take a minute)
183
- intro_message: Hello! How can we help you?
184
- title_closed: Click to chat!
185
- title_open: Let's chat!
186
- credits: Decidim Awesome %{version} · Made with ♥ by Platoniq
187
- editor_images:
188
- create:
189
- error: Error uploading image!
190
- success: Image uploaded successfully
138
+ title_closed: Klicka här för att chatta!
139
+ title_open: Låt oss chatta!
140
+ content_blocks:
141
+ map:
142
+ map_height: Karthöjd (px)
143
+ map_settings: Kartinställningar
144
+ menu_amendments: Visa ändringsförslag
145
+ menu_meetings: Visa möten
146
+ name: Karta
147
+ show_accepted: Visa godkända förslag
148
+ show_evaluating: Visa förslag som utvärderas
149
+ text_settings: Textinställningar
150
+ title: Titel
191
151
  map_component:
192
152
  map:
193
- error:
194
- unavailable: The map is unavailable. Please configure geocoding to enable this component.
195
153
  show:
196
- view_meeting: View meeting
197
- view_proposal: View proposal
154
+ view_meeting: Visa möte
155
+ view_proposal: Visa förslag
198
156
  layouts:
199
157
  decidim:
200
158
  admin:
@@ -202,11 +160,10 @@ sv:
202
160
  title: Decidim Tweaks
203
161
  decidim_awesome:
204
162
  awesome_config:
205
- amendments: Amendments
206
- autosaved_error: LocalStorage is not supported in your browser, form cannot be saved automatically.
207
- autosaved_retrieved: Data for this form has been recovered from a previous session
208
- autosaved_success: Data saved in local storage
209
- categories: Categories
210
- drag_and_drop_image: Add images by dragging & dropping or pasting them.
211
- meetings: Meetings
212
- proposals: Proposals
163
+ amendments: Ändringsförslag
164
+ categories: Kategorier
165
+ hashtags: Hashtaggar
166
+ items: föremål
167
+ meetings: Möten
168
+ proposals: Förslag
169
+ select_deselect_all: Markera/avmarkera alla
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+
3
+ class ChangeAwesomeConfigVarType < ActiveRecord::Migration[5.2]
4
+ def change
5
+ change_column :decidim_awesome_config, :var, :string
6
+
7
+ Decidim::DecidimAwesome::AwesomeConfig.find_each do |config|
8
+ config.var.gsub!('"', "")
9
+ config.save!
10
+ end
11
+ end
12
+ end
@@ -1,9 +1,13 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require "decidim/decidim_awesome/awesome_helpers"
4
+
3
5
  module Decidim
4
6
  module DecidimAwesome
5
7
  # This is the engine that runs on the public interface of `DecidimAwesome`.
6
8
  class AdminEngine < ::Rails::Engine
9
+ include AwesomeHelpers
10
+
7
11
  isolate_namespace Decidim::DecidimAwesome::Admin
8
12
 
9
13
  paths["db/migrate"] = nil
@@ -13,15 +17,16 @@ module Decidim
13
17
  # Add admin engine routes here
14
18
  resources :constraints
15
19
  resources :menu_hacks, except: [:show]
20
+ resources :custom_redirects, except: [:show]
16
21
  resources :config, param: :var, only: [:show, :update]
17
- post :new_scoped_style, to: "config#new_scoped_style"
18
- post :destroy_scoped_style, param: :key, to: "config#destroy_scoped_style"
22
+ resources :scoped_styles, param: :var, only: [:create, :destroy]
23
+ resources :proposal_custom_fields, param: :var, only: [:create, :destroy]
24
+ resources :scoped_admins, param: :var, only: [:create, :destroy]
25
+ get :users, to: "config#users"
26
+ post :rename_scope_label, to: "config#rename_scope_label"
19
27
  get :checks, to: "checks#index"
20
- root to: "config#show", var: :editors
21
- end
22
-
23
- initializer "decidim_admin_awesome.assets" do |app|
24
- app.config.assets.precompile += %w(decidim_admin_decidim_awesome_manifest.js decidim_admin_decidim_awesome_manifest.css)
28
+ post :migrate_images, to: "checks#migrate_images"
29
+ root to: "config#show"
25
30
  end
26
31
 
27
32
  initializer "decidim_decidim_awesome.admin_mount_routes" do
@@ -32,11 +37,13 @@ module Decidim
32
37
 
33
38
  initializer "decidim_awesome.admin_menu" do
34
39
  Decidim.menu :admin_menu do |menu|
35
- menu.item I18n.t("menu.decidim_awesome", scope: "decidim.admin", default: "Decidim Awesome"),
36
- decidim_admin_decidim_awesome.config_path(:editors),
37
- icon_name: "fire",
38
- position: 7.5,
39
- active: is_active_link?(decidim_admin_decidim_awesome.config_path(:editors), :inclusive)
40
+ menu.add_item :awesome_menu,
41
+ I18n.t("menu.decidim_awesome", scope: "decidim.admin", default: "Decidim Awesome"),
42
+ decidim_admin_decidim_awesome.config_path(:editors),
43
+ icon_name: "fire",
44
+ position: 7.5,
45
+ active: is_active_link?(decidim_admin_decidim_awesome.config_path(:editors), :inclusive),
46
+ if: defined?(current_user) && current_user&.read_attribute("admin")
40
47
  end
41
48
  end
42
49
 
@@ -0,0 +1,214 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Decidim
4
+ module DecidimAwesome
5
+ include ActiveSupport::Configurable
6
+
7
+ autoload :Config, "decidim/decidim_awesome/config"
8
+ autoload :SystemChecker, "decidim/decidim_awesome/system_checker"
9
+ autoload :ContextAnalyzers, "decidim/decidim_awesome/context_analyzers"
10
+ autoload :MenuHacker, "decidim/decidim_awesome/menu_hacker"
11
+ autoload :CustomFields, "decidim/decidim_awesome/custom_fields"
12
+
13
+ # Awesome coms with some components for participatory spaces
14
+ # Currently :awesome_map and :awesome_iframe, list them here
15
+ # if you wan to disable them
16
+ # NOTE if you have spaces with some of these components already configured
17
+ # and then they are deactivated, it will break you application as there will be
18
+ # references in the database
19
+ #
20
+ # use only symbols here
21
+ config_accessor :disabled_components do
22
+ [
23
+ # :awesome_map,
24
+ # :awesome_iframe
25
+ ]
26
+ end
27
+
28
+ # Boolean configuration options
29
+ #
30
+ # Default values for configuration options:
31
+ # true => always true but admins can still restrict its scope
32
+ # false => default false, admins can turn it true
33
+ # :disabled => false and non available, hidden from admins
34
+ config_accessor :allow_images_in_full_editor do
35
+ false
36
+ end
37
+
38
+ config_accessor :allow_images_in_small_editor do
39
+ false
40
+ end
41
+
42
+ config_accessor :allow_images_in_proposals do
43
+ false
44
+ end
45
+
46
+ config_accessor :use_markdown_editor do
47
+ false
48
+ end
49
+
50
+ config_accessor :allow_images_in_markdown_editor do
51
+ false
52
+ end
53
+
54
+ # used to save forms in localstorage
55
+ config_accessor :auto_save_forms do
56
+ false
57
+ end
58
+
59
+ # Live chat widget linked to Telegram account or group
60
+ config_accessor :intergram_for_admins do
61
+ false
62
+ end
63
+
64
+ config_accessor :intergram_for_public do
65
+ false
66
+ end
67
+
68
+ # allows admins to created specific CSS snippets affecting only some specific parts
69
+ # Valid values differ a little from the previous convention:
70
+ # :disabled => false and non available, hidden from admins
71
+ # Hash => hash of different css text, each key will be used for the contraints
72
+ # Admins create this hash dynamically but some pre-defined css boxes can be created here as:
73
+ # {
74
+ # some_identifier: ".wrapper { background: red; }"
75
+ # }
76
+ config_accessor :scoped_styles do
77
+ {}
78
+ end
79
+
80
+ # custom fields for proposals using JSON specification:
81
+ # https://github.com/jsonform/jsonform/wiki
82
+ # Valid values uses the same structure as :scoped_styles
83
+ # :disabled => false and non available, hidden from admins
84
+ # Hash => hash of different JSON texts, each key will be used for the contraints
85
+ # Admins can create this hash dynamically but some pre-defined css boxes can be created here as:
86
+ # {
87
+ # some_identifier: "{ ... some definition... }"
88
+ # }
89
+ config_accessor :proposal_custom_fields do
90
+ {}
91
+ end
92
+
93
+ # allows to keep modifications for the main menu
94
+ # can return :disabled to completly remove this feature
95
+ # otherwise it should be an array (some overrides can be specified by default):
96
+ # [
97
+ # {
98
+ # url: "/a-new-link",
99
+ # label: { "en" => "The label to show in the menu" },
100
+ # position: 10
101
+ # }
102
+ # ]
103
+ config_accessor :menu do
104
+ []
105
+ end
106
+
107
+ # Allows admins to assignate "fake" admins scoped to some admin zones using the
108
+ # same scope editor as :scoped_styles, valid values uses the same convention:
109
+ # :disabled => false and non available, hidden from admins
110
+ # Hash => hash of different admin ids, each key will be used for the contraints
111
+ # Admins create this hash dynamically but some pre-defined admin boxes can be created here as:
112
+ # {
113
+ # some_identifier: [1234, 5678, 90123]
114
+ # }
115
+ #
116
+ # To test this feature in development, ensure that config/environmnets/development.rb is configured as:
117
+ # config.action_dispatch.show_exceptions = true
118
+ # config.action_dispatch.show_detailed_exceptions = false
119
+ # config.consider_all_requests_local = false
120
+ config_accessor :scoped_admins do
121
+ {}
122
+ end
123
+
124
+ # Allow to configure custom redirections
125
+ # can return :disabled to completly remove this feature
126
+ # You can initialize some default redirection if desired as follows:
127
+ # {
128
+ # "/decidim-docs" => { destination: "http://docs.decidim.org", active: true }
129
+ # }
130
+ #
131
+ # To test this feature in development, ensure that config/environmnets/development.rb is configured as:
132
+ # config.action_dispatch.show_exceptions = true
133
+ # config.action_dispatch.show_detailed_exceptions = false
134
+ # config.consider_all_requests_local = false
135
+
136
+ config_accessor :custom_redirects do
137
+ {}
138
+ end
139
+
140
+ # these settings do not follow the :disabled convention but
141
+ # depends on the previous intergram configurations
142
+ config_accessor :intergram_url do
143
+ "https://www.intergram.xyz/js/widget.js"
144
+ end
145
+
146
+ # no need to override these settings, there admin-configurable
147
+ config_accessor :intergram_for_admins_settings do
148
+ {
149
+ chat_id: nil,
150
+ color: nil,
151
+ use_floating_button: false,
152
+ title_closed: nil,
153
+ title_open: nil,
154
+ intro_message: nil,
155
+ auto_response: nil,
156
+ auto_no_response: nil
157
+ }
158
+ end
159
+
160
+ config_accessor :intergram_for_public_settings do
161
+ {
162
+ chat_id: nil,
163
+ require_login: true,
164
+ color: nil,
165
+ use_floating_button: false,
166
+ title_closed: nil,
167
+ title_open: nil,
168
+ intro_message: nil,
169
+ auto_response: nil,
170
+ auto_no_response: nil
171
+ }
172
+ end
173
+
174
+ # additional correspondences between participatory spaces manifests and routes
175
+ # ie: /admin/assemblies and /admin/assemblies_types are both treated as a "assembly" participatory space in terms of permission scoping
176
+ # This can be tuned in a initialized if some other hacks over routes are applied
177
+ # if a registered participatory space is not listed here then the name manifest will be used as a default route /manifest_name /admin/manifes_name
178
+ config_accessor :participatory_spaces_routes_context do
179
+ {
180
+ # route in admin is diferent than in the frontend: /processes, /admin/participatory_processes
181
+ participatory_processes: [:participatory_processes, :processes],
182
+ # both /admin/assemblies and /admin/assemblies_types are considered assemblies
183
+ assemblies: [:assemblies, :assemblies_types],
184
+ # route in admin is diferent than in the frontend: /process_groups, /admin/participatory_process_groups
185
+ process_groups: [:processes_groups, :participatory_process_groups]
186
+ }
187
+ end
188
+
189
+ #
190
+ # HELPERS
191
+ #
192
+ # pass a single config var or an array of them
193
+ # any non disabled match will return as true
194
+ def self.enabled?(config_vars)
195
+ config_vars = [config_vars] unless config_vars.respond_to?(:detect)
196
+
197
+ config_vars.detect do |item|
198
+ next unless config.has_key?(item.to_sym)
199
+
200
+ config.send(item) != :disabled
201
+ end
202
+ end
203
+
204
+ def self.registered_components
205
+ @registered_components ||= []
206
+ end
207
+
208
+ # Wrapp component registering to register component later, after initializer
209
+ # so we can honor disabled_components config
210
+ def self.register_component(manifest, &block)
211
+ registered_components << [manifest, block]
212
+ end
213
+ end
214
+ end
@@ -10,8 +10,12 @@ module Decidim
10
10
  def awesome_config_instance
11
11
  return @awesome_config_instance if @awesome_config_instance
12
12
 
13
- @awesome_config_instance = Config.new request.env["decidim.current_organization"]
14
- @awesome_config_instance.context_from_request request
13
+ # if already created in the middleware, reuse it as it might have additional constraints
14
+ @awesome_config_instance = request.env["decidim_awesome.current_config"]
15
+ unless @awesome_config_instance.is_a? Config
16
+ @awesome_config_instance = Config.new request.env["decidim.current_organization"]
17
+ @awesome_config_instance.context_from_request request
18
+ end
15
19
  @awesome_config_instance
16
20
  end
17
21
 
@@ -20,7 +24,7 @@ module Decidim
20
24
  end
21
25
 
22
26
  def javascript_config_vars
23
- awesome_config.except(:scoped_styles).to_json.html_safe
27
+ awesome_config.except(:scoped_styles, :proposal_custom_fields, :scoped_admins).to_json.html_safe
24
28
  end
25
29
 
26
30
  def show_public_intergram?
@@ -42,23 +46,19 @@ module Decidim
42
46
  ::Decidim::DecidimAwesome::VERSION
43
47
  end
44
48
 
45
- def tenant_stylesheets
46
- return @tenant_stylesheets if @tenant_stylesheets
47
-
48
- prefix = Rails.root.join("app", "assets", "themes", current_organization.host)
49
- return @tenant_stylesheets = current_organization.host.to_s if File.exist?("#{prefix}.css") || File.exist?("#{prefix}.scss") || File.exist?("#{prefix}.scss.erb")
50
- end
51
-
52
49
  # Collects all CSS that is applied in the current URL context
53
50
  def awesome_custom_styles
54
- return unless awesome_config[:scoped_styles]
55
- return @awesome_custom_styles if @awesome_custom_styles
51
+ @awesome_custom_styles ||= awesome_config_instance.collect_sub_configs_values("scoped_style")
52
+ end
56
53
 
57
- styles = awesome_config[:scoped_styles]&.filter do |key, _value|
58
- config = AwesomeConfig.find_by(var: "scoped_style_#{key}", organization: current_organization)
59
- @awesome_config_instance.valid_in_context?(config&.constraints)
60
- end
61
- @awesome_custom_styles = styles.values.join("\n")
54
+ # Collects all proposal custom fields that is applied in the current URL context
55
+ def awesome_scoped_admins
56
+ @awesome_scoped_admins ||= awesome_config_instance.collect_sub_configs_values("scoped_admin")
57
+ end
58
+
59
+ # Collects all proposal custom fields that is applied in the current URL context
60
+ def awesome_proposal_custom_fields
61
+ @awesome_proposal_custom_fields ||= awesome_config_instance.collect_sub_configs_values("proposal_custom_field")
62
62
  end
63
63
 
64
64
  def version_prefix