decidim-decidim_awesome 0.10.2 → 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 +24 -0
- data/README.md +177 -60
- data/app/cells/concerns/decidim/decidim_awesome/global_menu_cell_override.rb +20 -0
- data/app/cells/concerns/decidim/decidim_awesome/{proposal_m_cell_override.rb → proposal_l_cell_override.rb} +10 -4
- data/app/cells/decidim/decidim_awesome/content_blocks/map/show.erb +5 -12
- data/app/cells/decidim/decidim_awesome/content_blocks/map_cell.rb +9 -5
- 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 +2 -2
- data/app/commands/concerns/decidim/decidim_awesome/proposals/admin/update_proposal_override.rb +31 -0
- data/app/commands/concerns/decidim/decidim_awesome/proposals/create_collaborative_draft_override.rb +27 -0
- data/app/commands/concerns/decidim/decidim_awesome/proposals/create_proposal_override.rb +27 -0
- data/app/commands/concerns/decidim/decidim_awesome/proposals/update_collaborative_draft_override.rb +27 -0
- data/app/commands/concerns/decidim/decidim_awesome/proposals/update_proposal_override.rb +26 -0
- data/app/commands/decidim/decidim_awesome/admin/create_constraint.rb +1 -1
- data/app/commands/decidim/decidim_awesome/admin/create_proposal_custom_field.rb +4 -3
- 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/destroy_proposal_custom_field.rb +6 -3
- 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 +43 -0
- data/app/controllers/concerns/decidim/decidim_awesome/admin_accountability/admin/filterable_helper.rb +1 -1
- data/app/controllers/concerns/decidim/decidim_awesome/content_security_policy.rb +34 -0
- data/app/controllers/concerns/decidim/decidim_awesome/limit_pending_amendments.rb +35 -0
- data/app/controllers/concerns/decidim/decidim_awesome/not_found_redirect.rb +1 -1
- data/app/controllers/concerns/decidim/decidim_awesome/proposals/proposal_votes_controller_override.rb +3 -3
- data/app/controllers/decidim/decidim_awesome/admin/application_controller.rb +2 -0
- data/app/controllers/decidim/decidim_awesome/admin/checks_controller.rb +14 -10
- data/app/controllers/decidim/decidim_awesome/admin/config_controller.rb +10 -9
- data/app/controllers/decidim/decidim_awesome/admin/constraints_controller.rb +23 -20
- data/app/controllers/decidim/decidim_awesome/admin/custom_redirects_controller.rb +6 -10
- data/app/controllers/decidim/decidim_awesome/admin/maintenance_controller.rb +76 -0
- data/app/controllers/decidim/decidim_awesome/admin/menu_hacks_controller.rb +6 -10
- data/app/controllers/decidim/decidim_awesome/admin/proposal_custom_fields_controller.rb +14 -6
- 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 +18 -5
- data/app/forms/concerns/decidim/decidim_awesome/proposals/proposal_form_override.rb +21 -0
- data/app/forms/{decidim → concerns/decidim}/decidim_awesome/proposals/proposal_wizard_create_step_form_override.rb +2 -1
- data/app/forms/decidim/decidim_awesome/admin/config_form.rb +28 -14
- 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 +65 -0
- 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 +110 -0
- data/app/helpers/decidim/decidim_awesome/admin/config_constraints_helpers.rb +6 -27
- data/app/helpers/decidim/decidim_awesome/map_helper.rb +8 -27
- data/app/jobs/decidim/decidim_awesome/destroy_private_data_job.rb +22 -0
- 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 +39 -10
- data/app/models/decidim/decidim_awesome/awesome_config.rb +1 -1
- data/app/models/decidim/decidim_awesome/paper_trail_version.rb +3 -3
- data/app/models/decidim/decidim_awesome/proposal_extra_field.rb +35 -1
- data/app/models/decidim/decidim_awesome/vote_weight.rb +2 -2
- data/app/overrides/decidim/proposals/admin/proposals/show/add_private_body.html.erb.deface +7 -0
- data/app/overrides/decidim/proposals/admin/proposals/show/replace_body.html.erb.deface +5 -0
- data/app/overrides/decidim/proposals/proposals/_proposal_aside/limit_amendments_modal.html.erb.deface +5 -0
- 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_decidim_awesome_map.scss +1 -1
- data/app/packs/entrypoints/decidim_editor.js +14 -0
- data/app/packs/src/decidim/decidim_awesome/admin/auto_edit.js +96 -69
- 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 +9 -5
- 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/tabs_change.js +31 -0
- 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 +28 -0
- 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 +1 -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 +29 -25
- data/app/packs/src/decidim/decidim_awesome/forms/rich_text_plugin.js +27 -32
- data/app/packs/src/decidim/decidim_awesome/proposals/custom_fields.js +31 -15
- 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 +24 -12
- data/app/packs/stylesheets/decidim/decidim_awesome/admin/constraints.scss +49 -29
- data/app/packs/stylesheets/decidim/decidim_awesome/admin/custom_fields.scss +28 -71
- 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 +17 -26
- data/app/packs/stylesheets/decidim/decidim_awesome/amendments/modal.scss +5 -0
- data/app/packs/stylesheets/decidim/decidim_awesome/awesome_admin.scss +11 -49
- data/app/packs/stylesheets/decidim/decidim_awesome/awesome_admin_global.scss +19 -0
- data/app/packs/stylesheets/decidim/decidim_awesome/awesome_application.scss +4 -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 +41 -35
- data/app/packs/stylesheets/decidim/decidim_awesome/forms/autosave.scss +6 -6
- data/app/packs/stylesheets/decidim/decidim_awesome/forms/custom_fields.scss +118 -0
- data/app/packs/stylesheets/decidim/decidim_awesome/shared/spinner.scss +26 -0
- data/app/packs/stylesheets/decidim/decidim_awesome/voting/voting_cards.scss +41 -59
- data/app/permissions/decidim/decidim_awesome/admin/permissions.rb +14 -3
- 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/{decidim → concerns/decidim}/decidim_awesome/menu_item_presenter_override.rb +10 -2
- data/app/presenters/{decidim → concerns/decidim}/decidim_awesome/menu_presenter_override.rb +8 -0
- data/app/presenters/concerns/decidim/decidim_awesome/proposals/proposal_presenter_override.rb +20 -0
- data/app/presenters/decidim/decidim_awesome/admin_log/component_presenter_override.rb +30 -0
- data/app/presenters/decidim/decidim_awesome/participatory_space_role_presenter.rb +1 -1
- data/app/presenters/decidim/decidim_awesome/private_data_presenter.rb +70 -0
- data/app/presenters/decidim/decidim_awesome/user_entity_presenter.rb +1 -1
- data/app/queries/decidim/decidim_awesome/private_data_finder.rb +19 -0
- data/app/serializers/concerns/decidim/decidim_awesome/proposals/proposal_serializer_methods.rb +72 -0
- data/app/serializers/concerns/decidim/decidim_awesome/proposals/proposal_serializer_override.rb +38 -0
- data/app/serializers/decidim/decidim_awesome/proposals/private_proposal_serializer.rb +34 -0
- data/app/types/concerns/decidim/decidim_awesome/add_proposal_type_custom_fields.rb +59 -0
- data/app/types/concerns/decidim/decidim_awesome/{proposal_type_override.rb → add_proposal_type_vote_weights.rb} +3 -1
- 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 +50 -48
- data/app/views/decidim/decidim_awesome/admin/config/_autoedit_box_label.html.erb +7 -2
- data/app/views/decidim/decidim_awesome/admin/config/_constraints.html.erb +25 -18
- data/app/views/decidim/decidim_awesome/admin/config/_form_admins.html.erb +7 -6
- data/app/views/decidim/decidim_awesome/admin/config/_form_editors.html.erb +12 -16
- 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 +35 -17
- data/app/views/decidim/decidim_awesome/admin/config/_form_proposal_private_custom_fields.html.erb +1 -0
- data/app/views/decidim/decidim_awesome/admin/config/_form_proposals.html.erb +68 -80
- data/app/views/decidim/decidim_awesome/admin/config/_form_styles.html.erb +16 -12
- 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 +14 -13
- 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 +44 -0
- data/app/views/decidim/decidim_awesome/admin/maintenance/show.html.erb +44 -0
- 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 +39 -42
- data/app/views/decidim/decidim_awesome/admin/menu_hacks/new.html.erb +21 -12
- data/app/views/decidim/decidim_awesome/admin/proposals/_editor.html.erb +8 -5
- data/app/views/decidim/decidim_awesome/admin/proposals/_private_body.html.erb +20 -0
- 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 +23 -0
- data/app/views/decidim/decidim_awesome/custom_fields/_form_render.html.erb +8 -2
- 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 +12 -0
- data/app/views/layouts/decidim/decidim_awesome/admin/application.html.erb +1 -73
- data/app/views/layouts/decidim/decidim_awesome/admin/maintenance.html.erb +19 -0
- data/config/assets.rb +3 -33
- data/config/i18n-tasks.yml +23 -3
- data/config/locales/ca.yml +28 -17
- data/config/locales/cs.yml +39 -14
- data/config/locales/de.yml +25 -15
- data/config/locales/en.yml +125 -35
- data/config/locales/es.yml +26 -16
- data/config/locales/eu.yml +7 -3
- data/config/locales/fr.yml +25 -16
- data/config/locales/hu.yml +43 -8
- data/config/locales/it.yml +8 -15
- data/config/locales/ja.yml +26 -15
- data/config/locales/lt.yml +0 -4
- data/config/locales/nl.yml +9 -14
- data/config/locales/pt-BR.yml +9 -14
- data/config/locales/ro-RO.yml +0 -3
- data/config/locales/sv.yml +9 -9
- 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/20240531224204_add_decidim_awesome_proposal_private_fields.rb +29 -0
- data/db/migrate/20240729164227_add_decidim_awesome_proposal_private_fields_date.rb +20 -0
- data/db/seeds.rb +3 -3
- data/lib/decidim/decidim_awesome/admin_engine.rb +26 -7
- data/lib/decidim/decidim_awesome/api/types/localized_custom_fields_type.rb +22 -0
- data/lib/decidim/decidim_awesome/api/types/translated_custom_fields_type.rb +51 -0
- data/lib/decidim/decidim_awesome/awesome.rb +70 -19
- data/lib/decidim/decidim_awesome/awesome_helpers.rb +6 -2
- data/lib/decidim/decidim_awesome/checksums.yml +46 -44
- data/lib/decidim/decidim_awesome/config.rb +1 -1
- data/lib/decidim/decidim_awesome/custom_fields.rb +13 -5
- data/lib/decidim/decidim_awesome/engine.rb +165 -56
- data/lib/decidim/decidim_awesome/iframe_component/component.rb +1 -2
- data/lib/decidim/decidim_awesome/lock.rb +47 -0
- data/lib/decidim/decidim_awesome/map_component/component.rb +1 -1
- data/lib/decidim/decidim_awesome/menu.rb +165 -0
- 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 +7 -12
- 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.rb → box_label_editor_examples.rb} +17 -17
- data/lib/decidim/decidim_awesome/test/shared_examples/config_examples.rb +23 -5
- data/lib/decidim/decidim_awesome/test/shared_examples/custom_fields_examples.rb +155 -0
- 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 +42 -58
- data/lib/decidim/decidim_awesome/test/shared_examples/menu_hack_contexts.rb +9 -8
- data/lib/decidim/decidim_awesome/test/shared_examples/scoped_admins_examples.rb +32 -24
- data/lib/decidim/decidim_awesome/test/shared_examples/summary_examples.rb +97 -22
- 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 +21 -30
- metadata +83 -60
- 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/helpers/decidim/decidim_awesome/amendments_helper_override.rb +0 -48
- data/app/helpers/decidim/decidim_awesome/proposals/application_helper_override.rb +0 -78
- 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 -218
- data/app/packs/src/decidim/decidim_awesome/editors/tabs_focus.js +0 -22
- 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 -64
- 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
@@ -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 %>
|
@@ -1,35 +1,40 @@
|
|
1
|
-
<
|
1
|
+
<div class="flex flex-col justify-center awesome-voting-card">
|
2
|
+
<h4 class="heading4 vote-title mb-2" style="font-size:1.375rem;"><%= title %></h4>
|
2
3
|
|
3
|
-
<div class="flex
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
</div>
|
4
|
+
<div class="flex flex-row gap-1.5 mt-4">
|
5
|
+
<%= vote_block_for(proposal, 3) %>
|
6
|
+
<%= vote_block_for(proposal, 2) %>
|
7
|
+
<%= vote_block_for(proposal, 1) %>
|
8
|
+
</div>
|
9
|
+
|
10
|
+
<% if component_settings.voting_cards_show_abstain? %>
|
11
|
+
<%= action_authorized_link_to :vote,
|
12
|
+
voted_for?(0) ? t("decidim.decidim_awesome.voting.voting_cards.abstained") : proposal.manifest.label_for(0),
|
13
|
+
proposal_vote_path(0),
|
14
|
+
link_options(0).merge({
|
15
|
+
title: t("decidim.decidim_awesome.voting.voting_cards.voting_for", proposal: sanitized_title, type: proposal.manifest.label_for(0)),
|
16
|
+
class: "button button__sm button__transparent-secondary mb-4 vote-action abstain-button #{classes_for(0)}"
|
17
|
+
}) %>
|
18
|
+
<% end %>
|
8
19
|
|
9
|
-
<% if
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
20
|
+
<% if voted_for_any? && !current_settings.votes_blocked? %>
|
21
|
+
<p class="text-center" style="margin-bottom:1rem;">
|
22
|
+
<%= action_authorized_link_to :unvote,
|
23
|
+
t("decidim.decidim_awesome.voting.voting_cards.change_vote"),
|
24
|
+
proposal_vote_path(current_vote&.weight),
|
25
|
+
remote: true,
|
26
|
+
method: :delete,
|
27
|
+
id: "change-vote",
|
28
|
+
class: "change-vote-button vote-action font-semibold" %>
|
29
|
+
</p>
|
30
|
+
<% elsif proposal.maximum_votes_reached? && !proposal.can_accumulate_supports_beyond_threshold && current_component.participatory_space.can_participate?(current_user) %>
|
31
|
+
<p class="text-center"><%= t("decidim.proposals.proposals.vote_button.maximum_votes_reached") %></p>
|
32
|
+
<% elsif vote_limit_enabled? && remaining_votes_count_for(current_user) <= 0 %>
|
33
|
+
<p class="text-center"><%= t("decidim.proposals.proposals.vote_button.no_votes_remaining") %></p>
|
34
|
+
<% elsif current_settings.votes_blocked? || !current_component.participatory_space.can_participate?(current_user) %>
|
35
|
+
<p class="text-center"><%= t("decidim.proposals.proposals.vote_button.votes_blocked") %></p>
|
36
|
+
<% end %>
|
37
|
+
|
38
|
+
</div>
|
18
39
|
|
19
|
-
|
20
|
-
<p class="text-center">
|
21
|
-
<%= action_authorized_link_to :unvote,
|
22
|
-
t("decidim.decidim_awesome.voting.voting_cards.change_vote"),
|
23
|
-
proposal_vote_path(current_vote&.weight),
|
24
|
-
remote: true,
|
25
|
-
method: :delete,
|
26
|
-
id: "change-vote",
|
27
|
-
class: "change-vote-button vote-action" %>
|
28
|
-
</p>
|
29
|
-
<% elsif proposal.maximum_votes_reached? && !proposal.can_accumulate_supports_beyond_threshold && current_component.participatory_space.can_participate?(current_user) %>
|
30
|
-
<p class="text-center"><%= t("decidim.proposals.proposals.vote_button.maximum_votes_reached") %></p>
|
31
|
-
<% elsif vote_limit_enabled? && remaining_votes_count_for(current_user) <= 0 %>
|
32
|
-
<p class="text-center"><%= t("decidim.proposals.proposals.vote_button.no_votes_remaining") %></p>
|
33
|
-
<% elsif current_settings.votes_blocked? || !current_component.participatory_space.can_participate?(current_user) %>
|
34
|
-
<p class="text-center"><%= t("decidim.proposals.proposals.vote_button.votes_blocked") %></p>
|
35
|
-
<% end %>
|
40
|
+
<%= render :modal if current_component.settings.voting_cards_show_modal_help %>
|
@@ -12,11 +12,16 @@ module Decidim
|
|
12
12
|
|
13
13
|
def vote_block_for(proposal, weight)
|
14
14
|
render partial: "vote_block", locals: {
|
15
|
-
proposal
|
16
|
-
weight:
|
15
|
+
proposal:,
|
16
|
+
weight:
|
17
17
|
}
|
18
18
|
end
|
19
19
|
|
20
|
+
def vote_instructions
|
21
|
+
translated_attribute(current_component.settings.voting_cards_instructions).presence || t("decidim.decidim_awesome.voting.voting_cards.default_instructions_html",
|
22
|
+
organization: current_organization.name)
|
23
|
+
end
|
24
|
+
|
20
25
|
def proposal_votes(weight)
|
21
26
|
model.weight_count(weight)
|
22
27
|
end
|
@@ -30,7 +35,7 @@ module Decidim
|
|
30
35
|
end
|
31
36
|
|
32
37
|
def proposal_vote_path(weight)
|
33
|
-
proposal_proposal_vote_path(proposal_id: proposal.id, from_proposals_list
|
38
|
+
proposal_proposal_vote_path(proposal_id: proposal.id, from_proposals_list:, weight:)
|
34
39
|
end
|
35
40
|
|
36
41
|
def link_options(weight)
|
@@ -68,7 +73,7 @@ module Decidim
|
|
68
73
|
return true
|
69
74
|
end
|
70
75
|
|
71
|
-
|
76
|
+
true if vote_limit_enabled? && remaining_votes_count_for(current_user) <= 0
|
72
77
|
end
|
73
78
|
|
74
79
|
def voted_for_any?
|
@@ -11,7 +11,7 @@ module Decidim
|
|
11
11
|
subconfig = AwesomeConfig.find_or_initialize_by(var: "#{var}_#{@ident}", organization: @organization)
|
12
12
|
@constraint = ConfigConstraint.create!(
|
13
13
|
awesome_config: subconfig,
|
14
|
-
settings:
|
14
|
+
settings:
|
15
15
|
)
|
16
16
|
end
|
17
17
|
|
@@ -20,7 +20,7 @@ module Decidim
|
|
20
20
|
return true if constraint.awesome_config.constraints.count > 1
|
21
21
|
|
22
22
|
case constraint.awesome_config.var.to_s
|
23
|
-
when /^
|
23
|
+
when /^proposal_(private_)?custom_field/
|
24
24
|
false
|
25
25
|
else
|
26
26
|
true
|
data/app/commands/concerns/decidim/decidim_awesome/proposals/admin/update_proposal_override.rb
ADDED
@@ -0,0 +1,31 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Decidim
|
4
|
+
module DecidimAwesome
|
5
|
+
module Proposals
|
6
|
+
module Admin
|
7
|
+
##
|
8
|
+
# Decorates update draft and update proposal
|
9
|
+
# to avoid private field to be logged in PaperTrail.
|
10
|
+
module UpdateProposalOverride
|
11
|
+
extend ActiveSupport::Concern
|
12
|
+
|
13
|
+
included do
|
14
|
+
private
|
15
|
+
|
16
|
+
alias_method :decidim_original_update_proposal, :update_proposal
|
17
|
+
|
18
|
+
def update_proposal
|
19
|
+
decidim_original_update_proposal
|
20
|
+
update_private_field!
|
21
|
+
end
|
22
|
+
|
23
|
+
def update_private_field!
|
24
|
+
@proposal.update_private_body!(form.private_body) if form.private_body.present?
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
data/app/commands/concerns/decidim/decidim_awesome/proposals/create_collaborative_draft_override.rb
ADDED
@@ -0,0 +1,27 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Decidim
|
4
|
+
module DecidimAwesome
|
5
|
+
module Proposals
|
6
|
+
##
|
7
|
+
# Decorate create_collaborative_draft to avoid
|
8
|
+
# private data to be in PaperTrail
|
9
|
+
module CreateCollaborativeDraftOverride
|
10
|
+
extend ActiveSupport::Concern
|
11
|
+
|
12
|
+
included do
|
13
|
+
private
|
14
|
+
|
15
|
+
alias_method :decidim_original_create_collaborative_draft, :create_collaborative_draft
|
16
|
+
|
17
|
+
def create_collaborative_draft
|
18
|
+
created_draft = decidim_original_create_collaborative_draft
|
19
|
+
# Update the proposal with the private body, to
|
20
|
+
# avoid tracebility on private fields.
|
21
|
+
created_draft.update_private_body!(form.private_body) if form.private_body.present?
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
@@ -0,0 +1,27 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Decidim
|
4
|
+
module DecidimAwesome
|
5
|
+
module Proposals
|
6
|
+
##
|
7
|
+
# Decorate create_proposal to avoid
|
8
|
+
# private data to be in PaperTrail
|
9
|
+
module CreateProposalOverride
|
10
|
+
extend ActiveSupport::Concern
|
11
|
+
|
12
|
+
included do
|
13
|
+
private
|
14
|
+
|
15
|
+
alias_method :decidim_original_create_proposal, :create_proposal
|
16
|
+
|
17
|
+
def create_proposal
|
18
|
+
created_proposal = decidim_original_create_proposal
|
19
|
+
# Update the proposal with the private body, to
|
20
|
+
# avoid tracebility on private fields.
|
21
|
+
created_proposal.update_private_body!(form.private_body) if form.private_body.present?
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
data/app/commands/concerns/decidim/decidim_awesome/proposals/update_collaborative_draft_override.rb
ADDED
@@ -0,0 +1,27 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Decidim
|
4
|
+
module DecidimAwesome
|
5
|
+
module Proposals
|
6
|
+
##
|
7
|
+
# Decorates update draft and update proposal
|
8
|
+
# to avoid private field to be logged in PaperTrail.
|
9
|
+
module UpdateCollaborativeDraftOverride
|
10
|
+
extend ActiveSupport::Concern
|
11
|
+
|
12
|
+
included do
|
13
|
+
private
|
14
|
+
|
15
|
+
alias_method :decidim_original_update_collaborative_draft, :update_collaborative_draft
|
16
|
+
|
17
|
+
def update_collaborative_draft
|
18
|
+
decidim_original_update_collaborative_draft
|
19
|
+
# Update the proposal with the private body, to
|
20
|
+
# avoid tracebility on private fields.
|
21
|
+
@collaborative_draft.update_private_body!(form.private_body) if form.private_body.present?
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Decidim
|
4
|
+
module DecidimAwesome
|
5
|
+
module Proposals
|
6
|
+
##
|
7
|
+
# Decorates update draft and update proposal
|
8
|
+
# to avoid private field to be logged in PaperTrail.
|
9
|
+
module UpdateProposalOverride
|
10
|
+
extend ActiveSupport::Concern
|
11
|
+
include Admin::UpdateProposalOverride
|
12
|
+
|
13
|
+
included do
|
14
|
+
private
|
15
|
+
|
16
|
+
alias_method :decidim_original_update_draft, :update_draft
|
17
|
+
|
18
|
+
def update_proposal
|
19
|
+
decidim_original_update_proposal
|
20
|
+
update_private_field!
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
@@ -8,9 +8,10 @@ module Decidim
|
|
8
8
|
|
9
9
|
# Public: Initializes the command.
|
10
10
|
#
|
11
|
-
def initialize(organization)
|
11
|
+
def initialize(organization, config_var = :proposal_custom_fields)
|
12
12
|
@organization = organization
|
13
13
|
@ident = rand(36**8).to_s(36)
|
14
|
+
@config_var = config_var
|
14
15
|
end
|
15
16
|
|
16
17
|
# Executes the command. Broadcasts these events:
|
@@ -20,13 +21,13 @@ module Decidim
|
|
20
21
|
#
|
21
22
|
# Returns nothing.
|
22
23
|
def call
|
23
|
-
fields = AwesomeConfig.find_or_initialize_by(var:
|
24
|
+
fields = AwesomeConfig.find_or_initialize_by(var: @config_var, organization: @organization)
|
24
25
|
fields.value = {} unless fields.value.is_a? Hash
|
25
26
|
# TODO: prevent (unlikely) colisions with exisiting values
|
26
27
|
fields.value[@ident] = default_definition
|
27
28
|
fields.save!
|
28
29
|
|
29
|
-
create_constraint_never(:proposal_custom_field)
|
30
|
+
create_constraint_never(@config_var == :proposal_custom_fields ? :proposal_custom_field : :proposal_private_custom_field)
|
30
31
|
|
31
32
|
broadcast(:ok, @ident)
|
32
33
|
rescue StandardError => e
|
@@ -11,7 +11,7 @@ module Decidim
|
|
11
11
|
def initialize(item, organization)
|
12
12
|
@item = item
|
13
13
|
@organization = organization
|
14
|
-
@redirections = AwesomeConfig.find_by(var: :custom_redirects, organization:
|
14
|
+
@redirections = AwesomeConfig.find_by(var: :custom_redirects, organization:)
|
15
15
|
end
|
16
16
|
|
17
17
|
# Executes the command. Broadcasts these events:
|
@@ -11,7 +11,7 @@ module Decidim
|
|
11
11
|
def initialize(item, menu_name, organization)
|
12
12
|
@item = item
|
13
13
|
@organization = organization
|
14
|
-
@menu = AwesomeConfig.find_by(var: menu_name, organization:
|
14
|
+
@menu = AwesomeConfig.find_by(var: menu_name, organization:)
|
15
15
|
end
|
16
16
|
|
17
17
|
# Executes the command. Broadcasts these events:
|
@@ -8,9 +8,10 @@ module Decidim
|
|
8
8
|
#
|
9
9
|
# key - the key to destroy inise proposal_custom_fields
|
10
10
|
# organization
|
11
|
-
def initialize(key, organization)
|
11
|
+
def initialize(key, organization, config_var = :proposal_custom_fields)
|
12
12
|
@key = key
|
13
13
|
@organization = organization
|
14
|
+
@config_var = config_var
|
14
15
|
end
|
15
16
|
|
16
17
|
# Executes the command. Broadcasts these events:
|
@@ -20,14 +21,16 @@ module Decidim
|
|
20
21
|
#
|
21
22
|
# Returns nothing.
|
22
23
|
def call
|
23
|
-
fields = AwesomeConfig.find_by(var:
|
24
|
+
fields = AwesomeConfig.find_by(var: @config_var, organization: @organization)
|
24
25
|
return broadcast(:invalid, "Not a hash") unless fields&.value.is_a? Hash
|
25
26
|
return broadcast(:invalid, "#{key} key invalid") unless fields.value.has_key?(@key)
|
26
27
|
|
27
28
|
fields.value.except!(@key)
|
28
29
|
fields.save!
|
30
|
+
|
29
31
|
# remove constrains associated (a new config var is generated automatically, by removing it, it will trigger destroy on dependents)
|
30
|
-
constraint =
|
32
|
+
constraint = @config_var == :proposal_custom_fields ? :proposal_custom_field : :proposal_private_custom_field
|
33
|
+
constraint = AwesomeConfig.find_by(var: "#{constraint}_#{@key}", organization: @organization)
|
31
34
|
constraint.destroy! if constraint.present?
|
32
35
|
|
33
36
|
broadcast(:ok, @key)
|
@@ -38,8 +38,8 @@ module Decidim
|
|
38
38
|
delegate :to_params, to: :form
|
39
39
|
|
40
40
|
def url_exists?
|
41
|
-
return unless redirects
|
42
|
-
return unless redirects.value.is_a? Hash
|
41
|
+
return false unless redirects
|
42
|
+
return false unless redirects.value.is_a? Hash
|
43
43
|
|
44
44
|
redirects.value[item.origin].present?
|
45
45
|
end
|
@@ -2,13 +2,7 @@
|
|
2
2
|
|
3
3
|
module Decidim
|
4
4
|
module DecidimAwesome
|
5
|
-
|
6
|
-
if defined? ::Decidim::Command
|
7
|
-
class Command < ::Decidim::Command
|
8
|
-
end
|
9
|
-
else
|
10
|
-
class Command < ::Rectify::Command
|
11
|
-
end
|
5
|
+
class Command < ::Decidim::Command
|
12
6
|
end
|
13
7
|
end
|
14
8
|
end
|
@@ -0,0 +1,43 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Decidim
|
4
|
+
module DecidimAwesome
|
5
|
+
module Admin
|
6
|
+
module MaintenanceContext
|
7
|
+
extend ActiveSupport::Concern
|
8
|
+
|
9
|
+
included do
|
10
|
+
layout "decidim/decidim_awesome/admin/maintenance"
|
11
|
+
helper_method :current_view, :available_views, :present_private_data
|
12
|
+
|
13
|
+
private
|
14
|
+
|
15
|
+
def present_private_data(model)
|
16
|
+
PrivateDataPresenter.new(model)
|
17
|
+
end
|
18
|
+
|
19
|
+
def current_view
|
20
|
+
return params[:id] if available_views.include?(params[:id])
|
21
|
+
|
22
|
+
available_views.keys.first
|
23
|
+
end
|
24
|
+
|
25
|
+
def available_views
|
26
|
+
{
|
27
|
+
"private_data" => {
|
28
|
+
title: I18n.t("private_data", scope: "decidim.decidim_awesome.admin.menu.maintenance"),
|
29
|
+
icon: "spy-line",
|
30
|
+
path: decidim_admin_decidim_awesome.maintenance_path("private_data")
|
31
|
+
},
|
32
|
+
"checks" => {
|
33
|
+
title: I18n.t("checks", scope: "decidim.decidim_awesome.admin.menu.maintenance"),
|
34
|
+
icon: "pulse",
|
35
|
+
path: decidim_admin_decidim_awesome.checks_maintenance_index_path
|
36
|
+
}
|
37
|
+
}
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
@@ -18,7 +18,7 @@ module Decidim
|
|
18
18
|
concat "#{i18n_filter_label(:admin_role_type, filterable_i18n_scope_from_ctx(i18n_ctx))}: "
|
19
19
|
concat t("decidim.decidim_awesome.admin.admin_accountability.admin_roles.#{params[:admin_role_type]}", default: params[:admin_role_type])
|
20
20
|
concat icon_link_to(
|
21
|
-
"circle-
|
21
|
+
"close-circle-line",
|
22
22
|
url_for(export_params.except(:admin_role_type)),
|
23
23
|
t("decidim.admin.actions.cancel"),
|
24
24
|
class: "action-icon--remove"
|
@@ -0,0 +1,34 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Decidim
|
4
|
+
module DecidimAwesome
|
5
|
+
module ContentSecurityPolicy
|
6
|
+
extend ActiveSupport::Concern
|
7
|
+
|
8
|
+
included do
|
9
|
+
after_action :append_awesome_csp_directives
|
10
|
+
end
|
11
|
+
|
12
|
+
private
|
13
|
+
|
14
|
+
def append_awesome_csp_directives
|
15
|
+
# this is necessary for custom fields
|
16
|
+
content_security_policy.append_csp_directive("font-src", "data:") if DecidimAwesome.enabled?(:proposal_custom_fields)
|
17
|
+
append_awesome_intergram_directives
|
18
|
+
end
|
19
|
+
|
20
|
+
def append_awesome_intergram_directives
|
21
|
+
return unless DecidimAwesome.enabled?(:intergram_for_admins) || DecidimAwesome.enabled?(:intergram_for_public)
|
22
|
+
|
23
|
+
intergram = URI.parse(DecidimAwesome.intergram_url)
|
24
|
+
if intergram.host && intergram.scheme
|
25
|
+
content_security_policy.append_csp_directive("script-src", "#{intergram.scheme}://#{intergram.host}")
|
26
|
+
content_security_policy.append_csp_directive("frame-src", "#{intergram.scheme}://#{intergram.host}")
|
27
|
+
# this script is in the intergram code, but does not look necessary to work
|
28
|
+
# content_security_policy.append_csp_directive("frame-src", "http://www.loadmill.com")
|
29
|
+
# content_security_policy.append_csp_directive("frame-src", "http://app.loadmill.com")
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
@@ -0,0 +1,35 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Decidim
|
4
|
+
module DecidimAwesome
|
5
|
+
module LimitPendingAmendments
|
6
|
+
extend ActiveSupport::Concern
|
7
|
+
|
8
|
+
included do
|
9
|
+
# rubocop:disable Rails/LexicallyScopedActionFilter
|
10
|
+
before_action :limit_pending_amendments, only: [:new, :create]
|
11
|
+
# rubocop:enable Rails/LexicallyScopedActionFilter
|
12
|
+
|
13
|
+
private
|
14
|
+
|
15
|
+
def limit_pending_amendments
|
16
|
+
return unless amendable&.amendments && amendable&.component&.settings.try(:limit_pending_amendments)
|
17
|
+
return unless amendable.component.settings.try(:amendments_enabled)
|
18
|
+
return unless amendable.component.current_settings.try(:amendment_creation_enabled)
|
19
|
+
|
20
|
+
return unless existing_emendations.any?
|
21
|
+
|
22
|
+
flash[:alert] = t("pending_limit_reached", scope: "decidim.decidim_awesome.amendments", emendation: translated_attribute(existing_emendations.first.title))
|
23
|
+
redirect_back(fallback_location: Decidim::ResourceLocatorPresenter.new(amendable).path)
|
24
|
+
end
|
25
|
+
|
26
|
+
def existing_emendations
|
27
|
+
@existing_emendations ||= begin
|
28
|
+
existing = amendable.amendments.where(state: :evaluating)
|
29
|
+
existing.filter_map { |amendment| !amendment.emendation&.hidden? && amendment.emendation }
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
@@ -13,7 +13,7 @@ module Decidim
|
|
13
13
|
# rubocop:enable Rails/LexicallyScopedActionFilter
|
14
14
|
|
15
15
|
def create
|
16
|
-
enforce_permission_to
|
16
|
+
enforce_permission_to(:vote, :proposal, proposal:)
|
17
17
|
@from_proposals_list = params[:from_proposals_list] == "true"
|
18
18
|
|
19
19
|
Decidim::Proposals::VoteProposal.call(proposal, current_user) do
|
@@ -27,7 +27,7 @@ module Decidim
|
|
27
27
|
proposal: Decidim::Proposals::Proposal.where(component: current_component)
|
28
28
|
).map(&:proposal)
|
29
29
|
|
30
|
-
expose(proposals:
|
30
|
+
expose(proposals:)
|
31
31
|
render :update_buttons_and_counters
|
32
32
|
end
|
33
33
|
|
@@ -47,7 +47,7 @@ module Decidim
|
|
47
47
|
end
|
48
48
|
|
49
49
|
def current_vote
|
50
|
-
@current_vote ||= Decidim::Proposals::ProposalVote.find_by(author: current_user, proposal:
|
50
|
+
@current_vote ||= Decidim::Proposals::ProposalVote.find_by(author: current_user, proposal:)
|
51
51
|
end
|
52
52
|
|
53
53
|
def vote_manifest
|
@@ -9,6 +9,8 @@ module Decidim
|
|
9
9
|
# Note that it inherits from `Decidim::Admin::Components::BaseController`, which
|
10
10
|
# override its layout and provide all kinds of useful methods.
|
11
11
|
class ApplicationController < Decidim::Admin::ApplicationController
|
12
|
+
layout "decidim/decidim_awesome/admin/application"
|
13
|
+
|
12
14
|
def permission_class_chain
|
13
15
|
[::Decidim::DecidimAwesome::Admin::Permissions] + super
|
14
16
|
end
|