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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +14 -5
- data/README.md +65 -67
- data/app/cells/concerns/decidim/decidim_awesome/global_menu_cell_override.rb +20 -0
- data/app/cells/concerns/decidim/decidim_awesome/proposal_l_cell_override.rb +44 -0
- data/app/cells/decidim/decidim_awesome/content_blocks/map/show.erb +5 -12
- data/app/cells/decidim/decidim_awesome/voting/proposal_metadata_cell.rb +54 -0
- data/app/cells/decidim/decidim_awesome/voting/voting_cards_proposal/modal.erb +18 -0
- data/app/cells/decidim/decidim_awesome/voting/voting_cards_proposal/show.erb +37 -32
- data/app/cells/decidim/decidim_awesome/voting/voting_cards_proposal_cell.rb +9 -4
- data/app/commands/concerns/decidim/decidim_awesome/admin/needs_constraint_helpers.rb +1 -1
- data/app/commands/concerns/decidim/decidim_awesome/proposals/create_proposal_override.rb +2 -2
- data/app/commands/concerns/decidim/decidim_awesome/proposals/update_proposal_override.rb +2 -2
- data/app/commands/decidim/decidim_awesome/admin/create_constraint.rb +1 -1
- data/app/commands/decidim/decidim_awesome/admin/destroy_custom_redirect.rb +1 -1
- data/app/commands/decidim/decidim_awesome/admin/destroy_menu_hack.rb +1 -1
- data/app/commands/decidim/decidim_awesome/admin/rename_scope_label.rb +1 -1
- data/app/commands/decidim/decidim_awesome/admin/update_constraint.rb +1 -1
- data/app/commands/decidim/decidim_awesome/admin/update_custom_redirect.rb +2 -2
- data/app/commands/decidim/decidim_awesome/command.rb +1 -7
- data/app/controllers/concerns/decidim/decidim_awesome/admin/maintenance_context.rb +1 -1
- data/app/controllers/concerns/decidim/decidim_awesome/admin_accountability/admin/filterable_helper.rb +3 -4
- data/app/controllers/concerns/decidim/decidim_awesome/content_security_policy.rb +34 -0
- data/app/controllers/concerns/decidim/decidim_awesome/not_found_redirect.rb +1 -1
- data/app/controllers/concerns/decidim/decidim_awesome/proposals/orderable_override.rb +22 -9
- data/app/controllers/concerns/decidim/decidim_awesome/proposals/proposal_votes_controller_override.rb +3 -3
- data/app/controllers/decidim/decidim_awesome/admin/admin_accountability_controller.rb +7 -7
- data/app/controllers/decidim/decidim_awesome/admin/checks_controller.rb +7 -7
- data/app/controllers/decidim/decidim_awesome/admin/config_controller.rb +8 -10
- data/app/controllers/decidim/decidim_awesome/admin/constraints_controller.rb +20 -19
- data/app/controllers/decidim/decidim_awesome/admin/custom_redirects_controller.rb +6 -8
- data/app/controllers/decidim/decidim_awesome/admin/maintenance_controller.rb +2 -2
- data/app/controllers/decidim/decidim_awesome/admin/menu_hacks_controller.rb +6 -8
- data/app/controllers/decidim/decidim_awesome/admin/proposal_custom_fields_controller.rb +2 -2
- data/app/controllers/decidim/decidim_awesome/admin/scoped_admins_controller.rb +2 -2
- data/app/controllers/decidim/decidim_awesome/admin/scoped_styles_controller.rb +2 -2
- data/app/controllers/decidim/decidim_awesome/blank_component_controller.rb +8 -3
- data/app/controllers/decidim/decidim_awesome/editor_images_controller.rb +3 -3
- data/app/controllers/decidim/decidim_awesome/iframe_component/iframe_controller.rb +11 -5
- data/app/forms/concerns/decidim/decidim_awesome/proposals/proposal_wizard_create_step_form_override.rb +1 -1
- data/app/forms/decidim/decidim_awesome/admin/config_form.rb +13 -25
- data/app/forms/decidim/decidim_awesome/admin/custom_redirect_form.rb +2 -2
- data/app/forms/decidim/decidim_awesome/admin/intergram_form.rb +4 -0
- data/app/forms/decidim/decidim_awesome/admin/menu_form.rb +4 -4
- data/app/helpers/concerns/decidim/decidim_awesome/amendments_helper_override.rb +8 -1
- data/app/helpers/concerns/decidim/decidim_awesome/breadcrumb_helper_override.rb +23 -0
- data/app/helpers/concerns/decidim/decidim_awesome/proposals/application_helper_override.rb +23 -39
- data/app/helpers/decidim/decidim_awesome/admin/config_constraints_helpers.rb +2 -2
- data/app/helpers/decidim/decidim_awesome/map_helper.rb +8 -27
- data/app/jobs/decidim/decidim_awesome/migrate_legacy_images_job.rb +5 -4
- data/app/middleware/decidim/decidim_awesome/current_config.rb +3 -5
- data/app/models/concerns/decidim/decidim_awesome/has_proposal_extra_fields.rb +1 -1
- data/app/models/decidim/decidim_awesome/awesome_config.rb +1 -1
- data/app/models/decidim/decidim_awesome/paper_trail_version.rb +4 -8
- data/app/models/decidim/decidim_awesome/proposal_extra_field.rb +1 -1
- data/app/models/decidim/decidim_awesome/vote_weight.rb +2 -2
- data/app/overrides/decidim/proposals/proposals/{show → _proposal_aside}/limit_amendments_modal.html.erb.deface +1 -1
- data/app/overrides/decidim/proposals/proposals/_vote_button/replace_vote_button.html.erb.deface +1 -1
- data/app/overrides/layouts/decidim/_decidim_javascript/add_awesome_tags.html.erb.deface +6 -0
- data/app/overrides/layouts/decidim/_head/add_awesome_tags.html.erb.deface +4 -11
- data/app/overrides/layouts/decidim/admin/_header/{replace_scripts.html.erb.deface → add_awesome_tags.html.erb.deface} +4 -4
- data/app/packs/entrypoints/decidim_admin_decidim_awesome.js +1 -2
- data/app/packs/entrypoints/decidim_admin_decidim_awesome_global.js +4 -0
- data/app/packs/entrypoints/decidim_admin_decidim_awesome_global.scss +1 -0
- data/app/packs/entrypoints/decidim_decidim_awesome.js +2 -2
- data/app/packs/entrypoints/decidim_editor.js +14 -0
- data/app/packs/src/decidim/decidim_awesome/admin/auto_edit.js +95 -70
- data/app/packs/src/decidim/decidim_awesome/admin/check_redirections.js +46 -41
- data/app/packs/src/decidim/decidim_awesome/admin/codemirror.js +3 -3
- data/app/packs/src/decidim/decidim_awesome/admin/constraint_form_events.js +115 -0
- data/app/packs/src/decidim/decidim_awesome/admin/custom_fields_builder.js +4 -1
- data/app/packs/src/decidim/decidim_awesome/admin/form_exit_warn.js +22 -11
- data/app/packs/src/decidim/decidim_awesome/admin/proposal_sortings.js +26 -8
- data/app/packs/src/decidim/decidim_awesome/admin/user_picker.js +34 -21
- data/app/packs/src/decidim/decidim_awesome/amendments/show_modal_on_limits.js +20 -22
- data/app/packs/src/decidim/decidim_awesome/awesome_admin.js +5 -16
- data/app/packs/src/decidim/decidim_awesome/awesome_admin_global.js +1 -0
- data/app/packs/src/decidim/decidim_awesome/awesome_application.js +0 -15
- data/app/packs/src/decidim/decidim_awesome/awesome_map/api/fetcher.js +33 -11
- data/app/packs/src/decidim/decidim_awesome/awesome_map/api/meetings_fetcher.js +9 -12
- data/app/packs/src/decidim/decidim_awesome/awesome_map/api/proposals_fetcher.js +28 -0
- data/app/packs/src/decidim/decidim_awesome/awesome_map/awesome_map.js +3 -4
- data/app/packs/src/decidim/decidim_awesome/awesome_map/controllers/controller.js +12 -12
- data/app/packs/src/decidim/decidim_awesome/awesome_map/controllers/meetings_controller.js +11 -7
- data/app/packs/src/decidim/decidim_awesome/awesome_map/controllers/proposals_controller.js +6 -13
- data/app/packs/src/decidim/decidim_awesome/awesome_map/controls_ui.js +51 -20
- data/app/packs/src/decidim/decidim_awesome/awesome_map/load_map.js +27 -18
- data/app/packs/src/decidim/decidim_awesome/editor/index.js +94 -0
- data/app/packs/src/decidim/decidim_awesome/forms/autosave.js +28 -23
- data/app/packs/src/decidim/decidim_awesome/forms/custom_fields_renderer.js +9 -14
- data/app/packs/src/decidim/decidim_awesome/forms/rich_text_plugin.js +27 -32
- data/app/packs/src/decidim/decidim_awesome/proposals/images.js +16 -10
- data/app/packs/src/decidim/decidim_awesome/voting/voting_cards.js +47 -38
- data/app/packs/stylesheets/decidim/decidim_awesome/admin/auto_edits.scss +11 -12
- data/app/packs/stylesheets/decidim/decidim_awesome/admin/check_redirections.scss +15 -0
- data/app/packs/stylesheets/decidim/decidim_awesome/admin/codemirror.scss +19 -12
- data/app/packs/stylesheets/decidim/decidim_awesome/admin/constraints.scss +8 -32
- data/app/packs/stylesheets/decidim/decidim_awesome/admin/custom_fields.scss +28 -78
- data/app/packs/stylesheets/decidim/decidim_awesome/admin/custom_styles.scss +48 -0
- data/app/packs/stylesheets/decidim/decidim_awesome/admin/intergram_fixes.scss +11 -0
- data/app/packs/stylesheets/decidim/decidim_awesome/admin/user_picker.scss +15 -24
- data/app/packs/stylesheets/decidim/decidim_awesome/amendments/modal.scss +5 -0
- data/app/packs/stylesheets/decidim/decidim_awesome/awesome_admin.scss +9 -47
- data/app/packs/stylesheets/decidim/decidim_awesome/awesome_admin_global.scss +3 -12
- data/app/packs/stylesheets/decidim/decidim_awesome/awesome_application.scss +3 -19
- data/app/packs/stylesheets/decidim/decidim_awesome/awesome_iframe/iframe.scss +1 -1
- data/app/packs/stylesheets/decidim/decidim_awesome/awesome_map/map.scss +27 -21
- data/app/packs/stylesheets/decidim/decidim_awesome/forms/autosave.scss +6 -6
- data/app/packs/stylesheets/decidim/decidim_awesome/forms/custom_fields.scss +32 -101
- data/app/packs/stylesheets/decidim/decidim_awesome/shared/spinner.scss +5 -26
- data/app/packs/stylesheets/decidim/decidim_awesome/voting/voting_cards.scss +34 -52
- data/app/permissions/decidim/decidim_awesome/permissions.rb +3 -4
- data/app/presenters/concerns/decidim/decidim_awesome/breadcrumb_root_menu_item_presenter_override.rb +23 -0
- data/app/presenters/concerns/decidim/decidim_awesome/menu_item_presenter_override.rb +10 -2
- data/app/presenters/concerns/decidim/decidim_awesome/menu_presenter_override.rb +8 -0
- data/app/presenters/decidim/decidim_awesome/participatory_space_role_presenter.rb +1 -1
- data/app/presenters/decidim/decidim_awesome/private_data_presenter.rb +11 -11
- data/app/presenters/decidim/decidim_awesome/user_entity_presenter.rb +1 -1
- data/app/queries/decidim/decidim_awesome/private_data_finder.rb +1 -1
- data/app/serializers/decidim/decidim_awesome/proposals/private_proposal_serializer.rb +0 -8
- data/app/views/decidim/decidim_awesome/admin/admin_accountability/index.html.erb +23 -17
- data/app/views/decidim/decidim_awesome/admin/checks/index.html.erb +1 -3
- data/app/views/decidim/decidim_awesome/admin/config/_autoedit_box_label.html.erb +3 -3
- data/app/views/decidim/decidim_awesome/admin/config/_constraints.html.erb +20 -21
- data/app/views/decidim/decidim_awesome/admin/config/_form_admins.html.erb +6 -5
- data/app/views/decidim/decidim_awesome/admin/config/_form_editors.html.erb +2 -2
- data/app/views/decidim/decidim_awesome/admin/config/_form_livechat.html.erb +39 -23
- data/app/views/decidim/decidim_awesome/admin/config/_form_proposal_custom_fields.html.erb +4 -6
- data/app/views/decidim/decidim_awesome/admin/config/_form_proposals.html.erb +64 -76
- data/app/views/decidim/decidim_awesome/admin/config/_form_styles.html.erb +15 -11
- data/app/views/decidim/decidim_awesome/admin/config/_form_surveys.html.erb +8 -6
- data/app/views/decidim/decidim_awesome/admin/config/show.html.erb +22 -12
- data/app/views/decidim/decidim_awesome/admin/constraints/_form.html.erb +1 -49
- data/app/views/decidim/decidim_awesome/admin/constraints/new.html.erb +14 -9
- data/app/views/decidim/decidim_awesome/admin/constraints/show.html.erb +14 -9
- data/app/views/decidim/decidim_awesome/admin/custom_redirects/_form.html.erb +20 -5
- data/app/views/decidim/decidim_awesome/admin/custom_redirects/edit.html.erb +5 -5
- data/app/views/decidim/decidim_awesome/admin/custom_redirects/index.html.erb +15 -15
- data/app/views/decidim/decidim_awesome/admin/custom_redirects/new.html.erb +5 -5
- data/app/views/decidim/decidim_awesome/admin/maintenance/_private_data.html.erb +4 -4
- data/app/views/decidim/decidim_awesome/admin/menu_hacks/_form.html.erb +6 -6
- data/app/views/decidim/decidim_awesome/admin/menu_hacks/edit.html.erb +21 -12
- data/app/views/decidim/decidim_awesome/admin/menu_hacks/index.html.erb +16 -18
- data/app/views/decidim/decidim_awesome/admin/menu_hacks/new.html.erb +21 -12
- data/app/views/decidim/decidim_awesome/admin/shared/_filters_with_date.html.erb +14 -18
- data/app/views/decidim/decidim_awesome/amendments/_modal.html.erb +18 -11
- data/app/views/decidim/decidim_awesome/custom_fields/_form_render.html.erb +3 -5
- data/app/views/decidim/decidim_awesome/iframe_component/iframe/show.html.erb +7 -12
- data/app/views/decidim/decidim_awesome/map_component/map/_map_template.html.erb +53 -37
- data/app/views/decidim/decidim_awesome/map_component/map/show.html.erb +14 -5
- data/app/views/decidim/decidim_awesome/voting/voting_cards/_show_vote_button.html.erb +0 -3
- data/app/views/layouts/decidim/decidim_awesome/_awesome_config.html.erb +9 -7
- data/app/views/layouts/decidim/decidim_awesome/_intergram_widget.html.erb +9 -6
- data/app/views/layouts/decidim/decidim_awesome/admin/_base.html.erb +3 -12
- data/config/assets.rb +3 -33
- data/config/i18n-tasks.yml +1 -0
- data/config/locales/ca.yml +17 -94
- data/config/locales/cs.yml +15 -93
- data/config/locales/de.yml +15 -91
- data/config/locales/en.yml +24 -28
- data/config/locales/es.yml +18 -96
- data/config/locales/eu.yml +8 -18
- data/config/locales/fr.yml +15 -94
- data/config/locales/hu.yml +4 -18
- data/config/locales/it.yml +9 -26
- data/config/locales/ja.yml +16 -93
- data/config/locales/lt.yml +2 -4
- data/config/locales/nl.yml +8 -18
- data/config/locales/pt-BR.yml +11 -25
- data/config/locales/ro-RO.yml +2 -14
- data/config/locales/sv.yml +10 -21
- data/config/rubocop/disabled.yml +11 -0
- data/config/rubocop/faker.yml +480 -0
- data/config/rubocop/rails.yml +88 -0
- data/config/rubocop/rspec.yml +65 -0
- data/config/rubocop/ruby.yml +1210 -0
- data/db/migrate/20240306175331_rename_editor_images_awesome_config.rb +18 -0
- data/db/migrate/20240729164227_add_decidim_awesome_proposal_private_fields_date.rb +1 -1
- data/db/seeds.rb +3 -3
- data/lib/decidim/decidim_awesome/admin_engine.rb +4 -1
- data/lib/decidim/decidim_awesome/api/types/translated_custom_fields_type.rb +2 -3
- data/lib/decidim/decidim_awesome/awesome.rb +42 -28
- data/lib/decidim/decidim_awesome/awesome_helpers.rb +1 -1
- data/lib/decidim/decidim_awesome/checksums.yml +39 -60
- data/lib/decidim/decidim_awesome/config.rb +1 -1
- data/lib/decidim/decidim_awesome/custom_fields.rb +5 -5
- data/lib/decidim/decidim_awesome/engine.rb +24 -6
- data/lib/decidim/decidim_awesome/iframe_component/component.rb +1 -2
- data/lib/decidim/decidim_awesome/lock.rb +2 -2
- data/lib/decidim/decidim_awesome/map_component/component.rb +1 -1
- data/lib/decidim/decidim_awesome/menu.rb +33 -14
- data/lib/decidim/decidim_awesome/menu_hacker.rb +4 -8
- data/lib/decidim/decidim_awesome/system_checker.rb +2 -4
- data/lib/decidim/decidim_awesome/test/factories.rb +10 -10
- data/lib/decidim/decidim_awesome/test/initializer.rb +3 -11
- data/lib/decidim/decidim_awesome/test/layouts/decidim/_head.html.erb +2 -2
- data/lib/decidim/decidim_awesome/test/layouts/decidim/admin/_header.html.erb +2 -2
- data/lib/decidim/decidim_awesome/test/shared_examples/box_label_editor_examples.rb +18 -18
- data/lib/decidim/decidim_awesome/test/shared_examples/config_examples.rb +3 -3
- data/lib/decidim/decidim_awesome/test/shared_examples/custom_fields_examples.rb +11 -11
- data/lib/decidim/decidim_awesome/test/shared_examples/custom_redirects_contexts.rb +7 -7
- data/lib/decidim/decidim_awesome/test/shared_examples/editor_examples.rb +26 -66
- data/lib/decidim/decidim_awesome/test/shared_examples/menu_hack_contexts.rb +10 -9
- data/lib/decidim/decidim_awesome/test/shared_examples/scoped_admins_examples.rb +30 -20
- data/lib/decidim/decidim_awesome/test/shared_examples/summary_examples.rb +19 -10
- data/lib/decidim/decidim_awesome/version.rb +2 -2
- data/lib/decidim/decidim_awesome/voting_manifest.rb +5 -10
- data/lib/decidim/decidim_awesome.rb +1 -2
- data/lib/tasks/decidim_awesome_active_storage_migrations_tasks.rake +1 -1
- data/lib/tasks/decidim_awesome_upgrade_tasks.rake +4 -0
- data/package.json +19 -28
- metadata +40 -56
- data/app/cells/concerns/decidim/decidim_awesome/proposal_m_cell_override.rb +0 -18
- data/app/cells/decidim/decidim_awesome/voting/voting_cards_counter/show.erb +0 -15
- data/app/cells/decidim/decidim_awesome/voting/voting_cards_counter/vote_button.erb +0 -15
- data/app/cells/decidim/decidim_awesome/voting/voting_cards_counter_cell.rb +0 -21
- data/app/cells/decidim/decidim_awesome/voting/voting_cards_proposal_modal/show.erb +0 -16
- data/app/cells/decidim/decidim_awesome/voting/voting_cards_proposal_modal_cell.rb +0 -20
- data/app/cells/decidim/proposals/proposal_m/footer.erb +0 -13
- data/app/overrides/layouts/decidim/_head/add_awesome_legacy_scripts.rb +0 -14
- data/app/overrides/layouts/decidim/admin/_header/replace_styles.html.erb.deface +0 -3
- data/app/packs/entrypoints/decidim_admin_decidim_awesome_custom_fields.js +0 -2
- data/app/packs/entrypoints/decidim_decidim_awesome_admin_form_exit_warn.js +0 -1
- data/app/packs/src/decidim/decidim_awesome/admin/constraints.js +0 -55
- data/app/packs/src/decidim/decidim_awesome/editors/editor.js +0 -213
- data/app/packs/stylesheets/decidim/decidim_awesome/editors/markdown_editor.scss +0 -19
- data/app/packs/stylesheets/decidim/decidim_awesome/editors/quill_editor.scss +0 -58
- data/app/packs/stylesheets/vendor/select2-foundation-theme.scss +0 -348
- data/app/serializers/concerns/decidim/decidim_awesome/proposal_serializer_override.rb +0 -65
- data/app/views/decidim/decidim_awesome/admin/config/_modal.html.erb +0 -11
- data/app/views/decidim/decidim_awesome/voting/voting_cards/_proposal_m_cell_footer.erb +0 -15
- /data/app/packs/src/decidim/decidim_awesome/{editors/tabs_focus.js → admin/tabs_change.js} +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 107f5d454725a66c2a3a7658d9c841616a4556f634a6615c5f124ad2815c94b2
|
4
|
+
data.tar.gz: cc18503da6d79d49787f40a6a6da9fe659d64c05183c599a30800a25a874c5b9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7da76c3a55fac5f16814946e9de813e7e30f2f56523a62143b20ad52bf16863abfd5da3a79ac44c7a0aedffc4e9ddec232bed2732153474ac586cecac0acb302
|
7
|
+
data.tar.gz: d5c566fe5297b253b6004ad23007fc22d7a47c5aa9a0a310de319799c2fdfced27cf1b0c0861e8c9341d041eeb556571c0d65b8ae16d56fcb6b16eafe30a7d54
|
data/CHANGELOG.md
CHANGED
@@ -1,11 +1,11 @@
|
|
1
1
|
CHANGELOG
|
2
2
|
=========
|
3
3
|
|
4
|
-
v0.
|
4
|
+
v0.11.1
|
5
5
|
------
|
6
6
|
|
7
7
|
Compatibility:
|
8
|
-
- Decidim v0.
|
8
|
+
- Decidim v0.28.x
|
9
9
|
|
10
10
|
Features:
|
11
11
|
- Added Private Custom Fields feature
|
@@ -13,8 +13,17 @@ Features:
|
|
13
13
|
- Added GraphQL types for custom fields in the API
|
14
14
|
- Adds parsed information about custom fields in the Proposals export
|
15
15
|
- Adds parsed information bout private custom fields when admins exports private data
|
16
|
-
- Adds a maintenance menu with tools to remove old private
|
17
|
-
|
16
|
+
- Adds a maintenance menu with tools to remove old private data
|
17
|
+
|
18
|
+
v0.11
|
19
|
+
------
|
20
|
+
|
21
|
+
Compatibility:
|
22
|
+
- Decidim v0.28.x
|
23
|
+
|
24
|
+
Features:
|
25
|
+
- Redesign to version 0.28
|
26
|
+
- Removed markdown editor
|
18
27
|
|
19
28
|
v0.10.2
|
20
29
|
------
|
@@ -71,7 +80,7 @@ Compatibility:
|
|
71
80
|
|
72
81
|
Features:
|
73
82
|
- Fixes for the menu hacker
|
74
|
-
|
83
|
+
|
75
84
|
v0.9.1
|
76
85
|
------
|
77
86
|
|
data/README.md
CHANGED
@@ -1,16 +1,14 @@
|
|
1
1
|
# Decidim::DecidimAwesome
|
2
2
|
|
3
|
-
[![[CI] Tests 0.
|
4
|
-
[![[CI] Tests 0.26](https://github.com/decidim-ice/decidim-module-decidim_awesome/actions/workflows/tests-legacy.yml/badge.svg)](https://github.com/decidim-ice/decidim-module-decidim_awesome/actions/workflows/tests-legacy.yml)
|
3
|
+
[![[CI] Tests 0.28](https://github.com/decidim-ice/decidim-module-decidim_awesome/actions/workflows/tests.yml/badge.svg)](https://github.com/decidim-ice/decidim-module-decidim_awesome/actions/workflows/tests.yml)
|
5
4
|
[![[CI] Lint](https://github.com/decidim-ice/decidim-module-decidim_awesome/actions/workflows/lint.yml/badge.svg)](https://github.com/decidim-ice/decidim-module-decidim_awesome/actions/workflows/lint.yml)
|
6
|
-
[![[CI] Precompile](https://github.com/decidim-ice/decidim-module-decidim_awesome/actions/workflows/precompile.yml/badge.svg)](https://github.com/decidim-ice/decidim-module-decidim_awesome/actions/workflows/precompile.yml)
|
7
5
|
[![Maintainability](https://api.codeclimate.com/v1/badges/2dada53525dd5a944089/maintainability)](https://codeclimate.com/github/decidim-ice/decidim-module-decidim_awesome/maintainability)
|
8
6
|
[![Test Coverage](https://codecov.io/gh/decidim-ice/decidim-module-decidim_awesome/branch/main/graph/badge.svg?token=TFBMCLLZJG)](https://codecov.io/gh/decidim-ice/decidim-module-decidim_awesome)
|
9
7
|
|
10
|
-
Usability and UX tweaks for Decidim
|
8
|
+
**Usability and UX tweaks for Decidim.**
|
11
9
|
|
12
10
|
This plugin allows the administrators to expand the possibilities of Decidim beyond some existing limitations.
|
13
|
-
All tweaks are provided in a optional fashion with granular permissions that let the administrator to choose exactly where to apply those mods. Some tweaks can be applied to
|
11
|
+
All tweaks are provided in a optional fashion with granular permissions that let the administrator to choose exactly where to apply those mods. Some tweaks can be applied to an assembly, other in an specific participatory process or even in a type of component only (for instance, only in proposals).
|
14
12
|
|
15
13
|
**DISCLAIMER: This module is heavily tested and widely used, however we do not accept any responsibility for breaking anything. Feedback is appreciated though.**
|
16
14
|
|
@@ -31,13 +29,13 @@ Each hack can be scoped to one or more specific participatory spaces or componen
|
|
31
29
|
|
32
30
|
### Tweaks:
|
33
31
|
|
34
|
-
#### 1. Image support for the
|
32
|
+
#### 1. Image support for the RichText editor
|
35
33
|
|
36
34
|
Modifies the WYSIWYG editor in Decidim by adding the possibility to insert images. When uploading images, Drag & Drop is supported. Images will be uploaded to the server and inserted as external resources (it doesn't use base64 in-line encoding).
|
37
35
|
|
38
36
|
This feature allows you use images in newsletters as well.
|
39
37
|
|
40
|
-
![Images in
|
38
|
+
![Images in RichText Editor](examples/quill-images.png)
|
41
39
|
|
42
40
|
#### 2. Auto-save for surveys and forms
|
43
41
|
|
@@ -47,27 +45,23 @@ It works purely in the client side by using LocalStorage capabilities of the bro
|
|
47
45
|
|
48
46
|
Saving the form removes the stored data.
|
49
47
|
|
50
|
-
![Auto save in forms](examples/auto-save.
|
48
|
+
![Auto save in forms](examples/auto-save.gif)
|
51
49
|
|
52
50
|
#### 3. Images in proposals
|
53
51
|
|
54
|
-
Event if you haven't activated the WYSIWYG editor (
|
52
|
+
Event if you haven't activated the WYSIWYG editor (RichText) in public views (eg: proposals use a simple textarea if rich text editor has not been activated for users). You can allow users to upload images in them by drag & drop over the text area.
|
55
53
|
|
56
54
|
![Proposal images](examples/proposal-images.png)
|
57
55
|
|
58
|
-
#### 4.
|
59
|
-
|
60
|
-
Allows to use markdown when creating proposals instead of a bare textarea.
|
61
|
-
|
62
|
-
#### 5. Admin scope configuration
|
56
|
+
#### 4. Restrict scope for tweaks
|
63
57
|
|
64
58
|
All tweaks can be configured and scoped to a specific participatory space, a type of participatory space, a type of component or a specific component.
|
65
59
|
|
66
|
-
Many scopes can be defined for every tweak.
|
60
|
+
Many scopes can be defined for every tweak. If a tweak is not scoped, it will be applied globally.
|
67
61
|
|
68
|
-
![
|
62
|
+
![Tweak scopes](examples/tweak-scopes.png)
|
69
63
|
|
70
|
-
####
|
64
|
+
#### 5. Awesome map component
|
71
65
|
|
72
66
|
This is a component you can add in any participatory space. It retrieves all the geolocated content in that participatory space (meetings or proposals) and displays it in a big map.
|
73
67
|
|
@@ -75,25 +69,25 @@ It also provides a simple search by category, each category is assigned to a dif
|
|
75
69
|
|
76
70
|
![Awesome map](examples/awesome-map.png)
|
77
71
|
|
78
|
-
####
|
72
|
+
#### 6. Fullscreen Iframe component
|
79
73
|
|
80
74
|
Another simple component that can be used to embed and Iframe with any external content in it that fills all the viewport.
|
81
75
|
|
82
76
|
![Fullscreen iframe](examples/fullscreen-iframe.png)
|
83
77
|
|
84
|
-
####
|
78
|
+
#### 7. Live support chat
|
85
79
|
|
86
|
-
With this feature you can have a support chat in Decidim. It is linked to a [Telegram](https://telegram.org/) group or a single user chat using the [
|
80
|
+
With this feature you can have a support chat in Decidim. It is linked to a [Telegram](https://telegram.org/) group or a single user chat using the [IntergramBot](https://web.telegram.org/#/im?p=@IntergramBot). Just invite the bot to a group or chat with it directly, grab your ID, put it on the Awesome settings and have fun!. For more info or for hosting your own version of the bot check the [Intergram project](https://github.com/idoco/intergram).
|
87
81
|
|
88
82
|
![Intergram screenshot](examples/intergram.png)
|
89
83
|
|
90
|
-
####
|
84
|
+
#### 8. Custom CSS applied only according scoped restrictions
|
91
85
|
|
92
86
|
With this feature you can create directly in the admin a CSS snipped that is only applied globally, in a particular assembly or even a single proposal!
|
93
87
|
|
94
88
|
![CSS screenshot](examples/custom_styles.png)
|
95
89
|
|
96
|
-
####
|
90
|
+
#### 9. Change the main menu of Decidim entirely!
|
97
91
|
|
98
92
|
Feel free to hide, modify or add items in the Decidim's main menu. You can also change the order, establish some conditions (like showing only for logged users) or open in a new window.
|
99
93
|
|
@@ -102,7 +96,7 @@ Feel free to hide, modify or add items in the Decidim's main menu. You can also
|
|
102
96
|
![Menu hacks screenshot](examples/menu-3.png)
|
103
97
|
![Menu hacks screenshot](examples/menu-4.png)
|
104
98
|
|
105
|
-
####
|
99
|
+
#### 10. Assign admins to specific scopes and prevent them modify anything else
|
106
100
|
|
107
101
|
Convert any user on the platform (that is not currently an admin) to a limited subset of participatory spaces or event components. Just add users to a box and scope them to some constraints. These users will see the "Edit" button in everywhere they have permissions. Any access to non allowed zones will redirect the user to the admin index page.
|
108
102
|
|
@@ -110,7 +104,7 @@ Convert any user on the platform (that is not currently an admin) to a limited s
|
|
110
104
|
![Scoped admins unauthorized](examples/scoped_admins_unauthorized.png)
|
111
105
|
![Scoped admins configuration](examples/scoped_admins_config.png)
|
112
106
|
|
113
|
-
####
|
107
|
+
#### 11. Custom fields for proposals
|
114
108
|
|
115
109
|
Now admins can substitute the body of a proposal with a set of form fields.
|
116
110
|
Edition is make with a Drag & Drop interface in the admin and can (and should) be scoped to apply only to certain proposal components.
|
@@ -137,7 +131,9 @@ Decidim::DecidimAwesome.configure do |config|
|
|
137
131
|
end
|
138
132
|
```
|
139
133
|
|
140
|
-
#####
|
134
|
+
##### 11.1. GraphQL types for custom fields
|
135
|
+
|
136
|
+
#### 11.1. GraphQL types for custom fields
|
141
137
|
|
142
138
|
Custom fields are displayed in the GaphQL API according to their definition in a formatted array of objects in the attribute `bodyFields`.
|
143
139
|
|
@@ -179,14 +175,14 @@ A query to extract this information could look like this (see that the original
|
|
179
175
|
You can then use this custom type in your GraphQL queries and mutations to handle the custom fields in proposals.
|
180
176
|
|
181
177
|
|
182
|
-
#####
|
178
|
+
##### 11.2. Private Custom fields
|
183
179
|
|
184
180
|
Similar to the custom fields feature, but only admins can see the content of the fields. This is useful for adding metadata to proposals that should not be visible to the public (such as contact data).
|
185
181
|
Data is stored encrypted in the database.
|
186
182
|
|
187
183
|
![Private Custom fields screenshot](examples/private_custom_fields.png)
|
188
184
|
|
189
|
-
####
|
185
|
+
#### 12. Custom Redirections (or URL shortener feature)
|
190
186
|
|
191
187
|
Admins can create custom paths that redirect to other places. Destinations can be internal absolute paths or external sites.
|
192
188
|
There's also possible to choose to sanitize (ie: remove) any query string or to maintain it (so you can decide to use).
|
@@ -206,7 +202,7 @@ Using a link with a query string (ie: `/take-me-somewhere?locale=es`) that will
|
|
206
202
|
|
207
203
|
![Custom redirections screenshot](examples/custom-redirections.png)
|
208
204
|
|
209
|
-
####
|
205
|
+
#### 13. Custom validation rules for title and body in proposals
|
210
206
|
|
211
207
|
Configure as you wish how the fields "title" and "body" are validated in proposals creation.
|
212
208
|
|
@@ -219,7 +215,7 @@ Rules available:
|
|
219
215
|
|
220
216
|
![Custom validations](examples/custom_validations.png)
|
221
217
|
|
222
|
-
####
|
218
|
+
#### 14. Admin accountability
|
223
219
|
|
224
220
|
This feature allows you to list all the users that are, or have been at any point in time, admins, valuators, user managers or any other role in Decidim. Including global admin roles or private admins of a particular participatory space.
|
225
221
|
|
@@ -227,7 +223,7 @@ Results can be filtered by role and by time range and also exported as CSV or ot
|
|
227
223
|
|
228
224
|
![Admin accountability](examples/admin_accountability.png)
|
229
225
|
|
230
|
-
####
|
226
|
+
#### 15. Additional proposal sortings
|
231
227
|
|
232
228
|
![Proposal sorting](examples/proposal_sorting.png)
|
233
229
|
![Proposal sorting admin](examples/proposal_sorting-admin.png)
|
@@ -256,7 +252,7 @@ Decidim::DecidimAwesome.configure do |config|
|
|
256
252
|
end
|
257
253
|
```
|
258
254
|
|
259
|
-
####
|
255
|
+
#### 16. Weighted voting
|
260
256
|
|
261
257
|
This feature allows you to configure a proposals component to use a weighted voting system. This means that each vote can have a different weight and the result of the vote is calculated as the sum of all the weights.
|
262
258
|
|
@@ -279,7 +275,7 @@ if Decidim::DecidimAwesome.enabled?(:weighted_proposal_voting)
|
|
279
275
|
voting.show_vote_button_view = "decidim/decidim_awesome/voting/no_admins_vote/show_vote_button"
|
280
276
|
voting.show_votes_count_view = "decidim/decidim_awesome/voting/no_admins_vote/show_votes_count"
|
281
277
|
# voting.show_votes_count_view = "" # hide votes count if needed
|
282
|
-
voting.
|
278
|
+
voting.proposal_metadata_cell = "decidim/decidim_awesome/voting/proposal_metadata"
|
283
279
|
# define a weight validator (optional, by default all weights are valid)
|
284
280
|
voting.weight_validator do |weight, context|
|
285
281
|
# don't allow admins to vote
|
@@ -305,11 +301,11 @@ A manifest must define a vote button view for the main proposal view, a vote cou
|
|
305
301
|
|
306
302
|
All views are optional, if set to `nil` they will use the original ones. If set to an empty string `""` they will be hidden.
|
307
303
|
|
308
|
-
The `weight_validator` is a Proc that receives the weight value and the context with the current user and the proposal and returns true or false if the weight is valid or not.
|
304
|
+
The `weight_validator` is a `Proc` that receives the weight value and the context with the current user and the proposal and returns true or false if the weight is valid or not.
|
309
305
|
|
310
306
|
**Notes for view `show_vote_button_view`**
|
311
307
|
|
312
|
-
When building a new view for the vote button ([see the original](https://github.com/decidim/decidim/blob/release/0.
|
308
|
+
When building a new view for the vote button ([see the original](https://github.com/decidim/decidim/blob/release/0.28-stable/decidim-proposals/app/views/decidim/proposals/proposals/_vote_button.html.erb)) is important to take into account the following situations:
|
313
309
|
|
314
310
|
- If there's a `current_user` logged in
|
315
311
|
- If votes are blocked `if current_settings.votes_blocked?`
|
@@ -317,7 +313,7 @@ When building a new view for the vote button ([see the original](https://github.
|
|
317
313
|
- If maximum votes have already reached `if proposal.maximum_votes_reached?`
|
318
314
|
- If the proposal can accumulate supports beyond maximum `if proposal.can_accumulate_supports_beyond_threshold`
|
319
315
|
- If the current component allows the user to participate `if current_component.participatory_space.can_participate?(current_user)`
|
320
|
-
- Note that the [original view](https://github.com/decidim/decidim/blob/release/0.
|
316
|
+
- Note that the [original view](https://github.com/decidim/decidim/blob/release/0.28-stable/decidim-proposals/app/views/decidim/proposals/proposals/_vote_button.html.erb) is overridden only inside the tag `<div id="proposal-<%= proposal.id %>-vote-button" class="button--vote-button">`. You only need to substitute the part inside.
|
321
317
|
|
322
318
|
To cast a vote a `POST` action is needed with the parameters `proposal_id`, `from_proposals_list` and `weight`. The route where to send the vote can be constructed such as:
|
323
319
|
|
@@ -333,13 +329,13 @@ This view must implement the number of votes already cast. It requires an HTML t
|
|
333
329
|
|
334
330
|
You can also completely hide this view (using `voting.show_votes_count_view = ""` in the manifest declaration). This is useful if you are using the same `show_vote_button_view` to also display the total counters (or your implementation does not use that).
|
335
331
|
|
336
|
-
**Notes for
|
332
|
+
**Notes for cell `voting.proposal_metadata_cell`**
|
337
333
|
|
338
|
-
This
|
334
|
+
This is the Decidim cell used to provide the metadata that is rendered at the bottom of a proposal card. If empty, defaults to [ProposalMetadataCell](https://github.com/decidim/decidim/blob/release/0.28-stable/decidim-proposals/app/cells/decidim/proposals/proposal_metadata_cell.rb), **wich does not renders the votes**.
|
339
335
|
|
340
|
-
|
336
|
+
What this cell must do is to provide an array of items to render as part of the cell footer. Check the example used at the [voting cards implementation](app/cells/decidim/decidim_awesome/voting/proposal_metadata_cell.rb) for reference.
|
341
337
|
|
342
|
-
#####
|
338
|
+
##### 16.1 GraphQL Types for weighted voting
|
343
339
|
|
344
340
|
When a weighed voting mechanism is selected, the GraphQL API will show those weights separated in each proposal.
|
345
341
|
The attribute that holds this information is `vote_weights`, a query example could look like this:
|
@@ -361,7 +357,7 @@ The attribute that holds this information is `vote_weights`, a query example cou
|
|
361
357
|
}
|
362
358
|
```
|
363
359
|
|
364
|
-
####
|
360
|
+
#### 17. Limiting amendments in proposals
|
365
361
|
|
366
362
|
By default, when proposals can be amended, any number of amendments can be created.
|
367
363
|
|
@@ -401,9 +397,8 @@ And then execute:
|
|
401
397
|
|
402
398
|
```bash
|
403
399
|
bundle
|
404
|
-
|
405
|
-
|
406
|
-
bundle exec rails db:migrate
|
400
|
+
bin/rails decidim:upgrade
|
401
|
+
bin/rails db:migrate
|
407
402
|
```
|
408
403
|
|
409
404
|
Go to `yourdomain/admin/decidim_awesome` and start tweaking things!
|
@@ -417,6 +412,7 @@ Go to `yourdomain/admin/decidim_awesome` and start tweaking things!
|
|
417
412
|
> bin/rails decidim_decidim_awesome:webpacker:install
|
418
413
|
> ```
|
419
414
|
|
415
|
+
|
420
416
|
If you are upgrading from a version prior to 0.8, make sure to visit the URL `/admin/decidim_awesome/checks` and run image migrations for the old images:
|
421
417
|
|
422
418
|
![Check image migrations](examples/check_image_migrations.png)
|
@@ -433,25 +429,27 @@ RAILS_ENV=production bin/rails decidim_awesome:active_storage_migrations:check_m
|
|
433
429
|
```
|
434
430
|
|
435
431
|
The correct version of Decidim Awesome should resolved automatically by the Bundler.
|
436
|
-
However you can force some specific version using `gem "decidim-decidim_awesome", "~> 0.
|
432
|
+
However you can force some specific version using `gem "decidim-decidim_awesome", "~> 0.11.0"` in the Gemfile.
|
437
433
|
|
438
434
|
Depending on your Decidim version, choose the corresponding Awesome version to ensure compatibility:
|
439
435
|
|
440
436
|
| Awesome version | Compatible Decidim versions |
|
441
|
-
|
442
|
-
| 0.
|
443
|
-
| 0.
|
444
|
-
| 0.9.
|
445
|
-
| 0.
|
446
|
-
| 0.
|
447
|
-
| 0.
|
448
|
-
| 0.
|
437
|
+
|---|---|
|
438
|
+
| 0.11.x | 0.28.x |
|
439
|
+
| 0.10.x | >= 0.26.7, >= 0.27.x |
|
440
|
+
| 0.9.2 | >= 0.26.7, >= 0.27.3 |
|
441
|
+
| 0.9.x | 0.26.x, 0.27.x |
|
442
|
+
| 0.8.x | 0.25.x, 0.26.x |
|
443
|
+
| 0.7.x | 0.23.x, 0.24.x |
|
444
|
+
| 0.6.x | 0.22.x, 0.23.x |
|
445
|
+
| 0.5.x | 0.21.x, 0.22.x |
|
449
446
|
|
450
447
|
> *Heads up!*
|
448
|
+
> * version 0.11.0 is only compatible with Decidim v0.28 as a major redesign makes backward compatibility impractical.
|
451
449
|
> * version 0.10.0 requires database migrations! Don't forget the migrations step when updating.
|
452
450
|
> * version 0.8.0 removes CSS Themes for tenants. If you have been using them you will have to manually migrate them to custom styles.
|
453
451
|
> * version 0.8.0 uses ActiveStorage, same as Decidim 0.25. 2 new rake task have been introduced to facilitate the migration: `bin/rails decidim_awesome:active_storage_migrations:check_migration_from_carrierwave` and
|
454
|
-
|
452
|
+
`bin/rails decidim_awesome:active_storage_migrations:migrate_from_carrierwave`
|
455
453
|
> * version 0.7.1 requires database migrations! Don't forget the migrations step when updating.
|
456
454
|
|
457
455
|
## Configuration
|
@@ -469,13 +467,10 @@ In order to personalize default values, create an initializer such as:
|
|
469
467
|
# Change some variables defaults
|
470
468
|
Decidim::DecidimAwesome.configure do |config|
|
471
469
|
# Enabled by default to all scopes, admins can still limit it's scope
|
472
|
-
config.
|
470
|
+
config.allow_images_in_editors = true
|
473
471
|
|
474
472
|
# Disabled by default to all scopes, admins can enable it and limit it's scope
|
475
|
-
config.
|
476
|
-
|
477
|
-
# De-activated, admins don't even see it as an option
|
478
|
-
config.use_markdown_editor = :disabled
|
473
|
+
config.allow_videos_in_editors = false
|
479
474
|
|
480
475
|
# Disable scoped admins
|
481
476
|
config.scoped_admins = :disabled
|
@@ -567,6 +562,9 @@ DATABASE_USERNAME=<username> DATABASE_PASSWORD=<password> bundle exec rake test_
|
|
567
562
|
DATABASE_USERNAME=<username> DATABASE_PASSWORD=<password> bundle exec rspec
|
568
563
|
```
|
569
564
|
|
565
|
+
> Note: the following is not currently applicable as version v0.11 is only compatible with version Decidim v0.28
|
566
|
+
> Is left here for future reference
|
567
|
+
|
570
568
|
However, this project works with different versions of Decidim. In order to test them all, we maintain two different Gemfiles: `Gemfile` and `Gemfile.legacy`. The first one is used for development and testing the latest Decidim version supported, the second one is used for testing against the old Decidim version.
|
571
569
|
|
572
570
|
You can run run tests against the legacy Decidim versions by using:
|
@@ -574,24 +572,24 @@ You can run run tests against the legacy Decidim versions by using:
|
|
574
572
|
```bash
|
575
573
|
export DATABASE_USERNAME=<username>
|
576
574
|
export DATABASE_PASSWORD=<password>
|
577
|
-
RBENV_VERSION=
|
578
|
-
RBENV_VERSION=
|
579
|
-
RBENV_VERSION=
|
575
|
+
RBENV_VERSION=3.1.1 BUNDLE_GEMFILE=Gemfile.legacy bundle
|
576
|
+
RBENV_VERSION=3.1.1 BUNDLE_GEMFILE=Gemfile.legacy bundle exec rake test_app
|
577
|
+
RBENV_VERSION=3.1.1 BUNDLE_GEMFILE=Gemfile.legacy bundle exec rspec
|
580
578
|
```
|
581
579
|
|
582
|
-
For convenience, you can use the scripts `bin/
|
580
|
+
For convenience, you can use the scripts `bin/test` and `bin/test-legacy` to run tests against one or the other version:
|
583
581
|
|
584
582
|
```bash
|
585
|
-
bin/
|
586
|
-
bin/
|
583
|
+
bin/test spec/
|
584
|
+
bin/test-legacy spec/
|
587
585
|
```
|
588
586
|
|
589
587
|
- Rbenv is required for this script to work.
|
590
588
|
|
591
589
|
> **NOTE:** Remember to reset the database when changing between tests:
|
592
590
|
> ```bash
|
593
|
-
> bin/
|
594
|
-
> bin/
|
591
|
+
> bin/test --reset
|
592
|
+
> bin/test-legacy --reset
|
595
593
|
> ```
|
596
594
|
|
597
595
|
|
@@ -626,4 +624,4 @@ This engine is distributed under the GNU AFFERO GENERAL PUBLIC LICENSE.
|
|
626
624
|
|
627
625
|
## Credits
|
628
626
|
|
629
|
-
This plugin maintainted by ![PokeCode](app/packs/images/decidim/decidim_awesome/pokecode-logo.png)
|
627
|
+
This plugin maintainted by [![PokeCode](app/packs/images/decidim/decidim_awesome/pokecode-logo.png) PokeCode](https://pokecode.net/)
|
@@ -0,0 +1,20 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Decidim
|
4
|
+
module DecidimAwesome
|
5
|
+
module GlobalMenuCellOverride
|
6
|
+
extend ActiveSupport::Concern
|
7
|
+
|
8
|
+
included do
|
9
|
+
def cache_hash
|
10
|
+
[
|
11
|
+
"decidim/content_blocks/global_menu",
|
12
|
+
current_organization.cache_key_with_version,
|
13
|
+
I18n.locale,
|
14
|
+
awesome_config[:home_content_block_menu].to_s
|
15
|
+
].join(Decidim.cache_key_separator)
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
@@ -0,0 +1,44 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Decidim
|
4
|
+
module DecidimAwesome
|
5
|
+
module ProposalLCellOverride
|
6
|
+
extend ActiveSupport::Concern
|
7
|
+
|
8
|
+
included do
|
9
|
+
private
|
10
|
+
|
11
|
+
def metadata_cell
|
12
|
+
awesome_voting_manifest_for(resource&.component)&.proposal_metadata_cell.presence || "decidim/proposals/proposal_metadata"
|
13
|
+
end
|
14
|
+
|
15
|
+
# rubocop:disable Metrics/CyclomaticComplexity
|
16
|
+
# rubocop:disable Metrics/PerceivedComplexity
|
17
|
+
def cache_hash
|
18
|
+
hash = []
|
19
|
+
hash << I18n.locale.to_s
|
20
|
+
hash << model.cache_key_with_version
|
21
|
+
hash << model.proposal_votes_count
|
22
|
+
hash << model.extra_fields&.reload&.vote_weight_totals
|
23
|
+
hash << model.endorsements_count
|
24
|
+
hash << model.comments_count
|
25
|
+
hash << Digest::MD5.hexdigest(model.component.cache_key_with_version)
|
26
|
+
hash << Digest::MD5.hexdigest(resource_image_path) if resource_image_path
|
27
|
+
hash << render_space? ? 1 : 0
|
28
|
+
if current_user
|
29
|
+
hash << current_user.cache_key_with_version
|
30
|
+
hash << current_user.follows?(model) ? 1 : 0
|
31
|
+
end
|
32
|
+
hash << model.follows_count
|
33
|
+
hash << Digest::MD5.hexdigest(model.authors.map(&:cache_key_with_version).to_s)
|
34
|
+
hash << (model.must_render_translation?(model.organization) ? 1 : 0) if model.respond_to?(:must_render_translation?)
|
35
|
+
hash << model.component.participatory_space.active_step.id if model.component.participatory_space.try(:active_step)
|
36
|
+
|
37
|
+
hash.join(Decidim.cache_key_separator)
|
38
|
+
end
|
39
|
+
# rubocop:enable Metrics/CyclomaticComplexity
|
40
|
+
# rubocop:enable Metrics/PerceivedComplexity
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
@@ -1,14 +1,7 @@
|
|
1
|
-
<section class="
|
2
|
-
|
1
|
+
<section class="map-block home__section">
|
2
|
+
<%= content_tag("h3", section_title) if section_title.present? %>
|
3
3
|
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
<div class="columns medium-12">
|
8
|
-
<%= awesome_map_for global_map_components do %>
|
9
|
-
<%= render partial: "decidim/decidim_awesome/map_component/map/map_template.html", locals: { categories: all_categories, map_height: model.settings.map_height } %>
|
10
|
-
<% end %>
|
11
|
-
</div>
|
12
|
-
</div>
|
13
|
-
</div>
|
4
|
+
<%= awesome_map_for global_map_components do %>
|
5
|
+
<%= render partial: "decidim/decidim_awesome/map_component/map/map_template.html", locals: { categories: all_categories, map_height: model.settings.map_height } %>
|
6
|
+
<% end %>
|
14
7
|
</section>
|
@@ -0,0 +1,54 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Decidim
|
4
|
+
module DecidimAwesome
|
5
|
+
module Voting
|
6
|
+
# This cell renders metadata for an instance of a Proposal
|
7
|
+
class ProposalMetadataCell < ::Decidim::Proposals::ProposalMetadataCell
|
8
|
+
private
|
9
|
+
|
10
|
+
def proposal_items
|
11
|
+
[coauthors_item, comments_count_item, endorsements_count_item, weight_count_item, state_item, emendation_item]
|
12
|
+
end
|
13
|
+
|
14
|
+
def current_vote
|
15
|
+
@current_vote ||= Decidim::Proposals::ProposalVote.find_by(author: current_user, proposal: resource)
|
16
|
+
end
|
17
|
+
|
18
|
+
def user_voted_weight
|
19
|
+
current_vote&.weight
|
20
|
+
end
|
21
|
+
|
22
|
+
def all_weights
|
23
|
+
@all_weights ||= begin
|
24
|
+
weights = [3, 2, 1]
|
25
|
+
weights << 0 if resource.component.settings.voting_cards_show_abstain
|
26
|
+
weights.index_with do |weight|
|
27
|
+
resource.weight_count(weight)
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
32
|
+
def weight_tags
|
33
|
+
@weight_tags ||= all_weights.map do |num, weight|
|
34
|
+
content_tag "span", title: resource.manifest.label_for(num), class: "voting-weight_#{num}" do
|
35
|
+
"#{t("decidim.decidim_awesome.voting.voting_cards.weights.weight_#{num}_short")} #{weight}"
|
36
|
+
end.html_safe
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
40
|
+
def weight_count_item
|
41
|
+
return unless resource.respond_to?(:weight_count)
|
42
|
+
return if resource.component.current_settings.votes_hidden?
|
43
|
+
return if resource&.rejected? || resource&.withdrawn?
|
44
|
+
|
45
|
+
{
|
46
|
+
text: weight_tags.join(" | ").html_safe,
|
47
|
+
icon: "#{user_voted_weight ? "checkbox" : "close"}-circle-line",
|
48
|
+
data_attributes: all_weights.transform_keys { |num| "weight-#{num}" }
|
49
|
+
}
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
53
|
+
end
|
54
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
<%= decidim_modal id: "voting-cards-modal-help", class:"reveal vote_proposal_modal voting-voting_cards" do %>
|
2
|
+
<div data-dialog-container>
|
3
|
+
<div class="reveal__content">
|
4
|
+
<div class="instructions mb-4"><%= vote_instructions %></div>
|
5
|
+
<div class="current-choice voting-voting_cards mb-4">
|
6
|
+
<div class="vote-card"></div>
|
7
|
+
</div>
|
8
|
+
<div class="future-dismiss">
|
9
|
+
<%= check_box_tag "voting_cards-skip_help", current_component.id, false %>
|
10
|
+
<%= label_tag "voting_cards-skip_help", t("decidim.decidim_awesome.voting.voting_cards.modal.skip") %>
|
11
|
+
</div>
|
12
|
+
</div>
|
13
|
+
</div>
|
14
|
+
<div data-dialog-actions>
|
15
|
+
<button type="button" class="button button__lg button__primary hover:bg-secondary vote-action" style="background-color: #e02d2d;"><%= t("decidim.decidim_awesome.voting.voting_cards.modal.proceed") %></button>
|
16
|
+
<button type="button" class="button button__lg button__transparent-secondary cancel-action hollow secondary" data-dialog-close="voting-cards-modal-help"><%= t("decidim.decidim_awesome.voting.voting_cards.modal.cancel") %></button>
|
17
|
+
</div>
|
18
|
+
<% end %>
|