decidim-action_delegator 0.8.2 → 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +104 -58
- data/Rakefile +2 -2
- data/app/commands/decidim/action_delegator/admin/create_delegation.rb +1 -3
- data/app/commands/decidim/action_delegator/admin/create_setting.rb +5 -2
- data/app/commands/decidim/action_delegator/admin/update_setting.rb +4 -2
- data/app/controllers/concerns/decidim/action_delegator/devise/sessions_controller_override.rb +1 -1
- data/app/controllers/concerns/decidim/action_delegator/election_per_question_votes_controller_override.rb +65 -0
- data/app/controllers/concerns/decidim/action_delegator/election_votes_controller_override.rb +38 -0
- data/app/controllers/concerns/decidim/action_delegator/votes_controller_methods.rb +46 -0
- data/app/controllers/decidim/action_delegator/admin/application_controller.rb +11 -5
- data/app/controllers/decidim/action_delegator/admin/delegations_controller.rb +2 -10
- data/app/controllers/decidim/action_delegator/admin/invite_participants_controller.rb +0 -8
- data/app/controllers/decidim/action_delegator/admin/manage_delegations_controller.rb +13 -20
- data/app/controllers/decidim/action_delegator/admin/manage_participants_controller.rb +11 -19
- data/app/controllers/decidim/action_delegator/admin/participants_controller.rb +1 -9
- data/app/controllers/decidim/action_delegator/admin/permissions_controller.rb +1 -24
- data/app/controllers/decidim/action_delegator/admin/ponderations_controller.rb +0 -8
- data/app/controllers/decidim/action_delegator/admin/settings_controller.rb +12 -12
- data/app/controllers/decidim/action_delegator/application_controller.rb +3 -3
- data/app/controllers/decidim/action_delegator/elections/admin/results_controller.rb +58 -0
- data/app/controllers/decidim/action_delegator/elections/results_controller.rb +36 -0
- data/app/controllers/decidim/action_delegator/user_delegations_controller.rb +1 -1
- data/app/controllers/decidim/action_delegator/verifications/delegations_verifier/authorizations_controller.rb +14 -18
- data/app/forms/decidim/action_delegator/admin/action_delegator_census_form.rb +44 -0
- data/app/forms/decidim/action_delegator/admin/csv_import_form.rb +17 -0
- data/app/forms/decidim/action_delegator/admin/ponderation_form.rb +2 -1
- data/app/forms/decidim/action_delegator/admin/setting_form.rb +16 -10
- data/app/forms/decidim/action_delegator/censuses/internal_users_form.rb +32 -0
- data/app/forms/decidim/action_delegator/verifications/delegations_verifier_form.rb +41 -25
- data/app/helpers/decidim/action_delegator/admin/{delegation_helper.rb → settings_helper.rb} +3 -16
- data/app/helpers/decidim/action_delegator/settings_helper.rb +124 -0
- data/app/jobs/decidim/action_delegator/admin/invite_participants_job.rb +1 -1
- data/app/jobs/decidim/action_delegator/send_sms_job.rb +2 -2
- data/app/jobs/decidim/action_delegator/twilio_send_sms_job.rb +2 -2
- data/app/models/decidim/action_delegator/delegation.rb +15 -14
- data/app/models/decidim/action_delegator/participant.rb +7 -10
- data/app/models/decidim/action_delegator/ponderation.rb +0 -2
- data/app/models/decidim/action_delegator/setting.rb +14 -32
- data/app/overrides/decidim/elections/admin/dashboard/_results/_add_results_contents.html.erb.deface +10 -0
- data/app/overrides/decidim/elections/admin/dashboard/_results/_add_results_tabs.html.erb.deface +3 -0
- data/app/overrides/decidim/elections/elections/_election_aside/add_delegation_buttons.html.erb.deface +3 -0
- data/app/overrides/decidim/elections/elections/_vote_results/replace_results_div.html.erb.deface +8 -0
- data/app/overrides/decidim/elections/per_question_votes/show/add_delegation_hidden_input.html.erb.deface +3 -0
- data/app/overrides/decidim/elections/per_question_votes/show/add_delegation_id_to_links.html.erb.deface +3 -0
- data/app/overrides/decidim/elections/per_question_votes/waiting/add_delegation_buttons.html.erb.deface +3 -0
- data/app/overrides/decidim/elections/votes/receipt/add_delegation_buttons.html.erb.deface +3 -0
- data/app/packs/entrypoints/decidim_action_delegator_elections.js +1 -0
- data/app/packs/src/decidim/action_delegator/elections_live_results.js +160 -0
- data/app/permissions/decidim/action_delegator/admin/permissions.rb +29 -0
- data/app/permissions/decidim/action_delegator/permissions.rb +6 -30
- data/app/presenters/decidim/action_delegator/setting_presenter.rb +33 -0
- data/app/queries/decidim/action_delegator/action_delegator_census_users.rb +51 -0
- data/app/queries/decidim/action_delegator/authorized_resources.rb +28 -0
- data/app/queries/decidim/action_delegator/election_settings.rb +23 -0
- data/app/queries/decidim/action_delegator/{delegated_votes_versions.rb → elections_delegated_votes_versions.rb} +8 -8
- data/app/queries/decidim/action_delegator/elections_question_responses_by_type.rb +33 -0
- data/app/queries/decidim/action_delegator/elections_question_weighted_responses.rb +28 -0
- data/app/queries/decidim/action_delegator/elections_votes_with_ponderations.rb +62 -0
- data/app/services/decidim/action_delegator/participants_csv_importer.rb +1 -1
- data/app/services/decidim/action_delegator/sms_gateway.rb +2 -2
- data/app/views/decidim/action_delegator/admin/censuses/_action_delegator_census_form.html.erb +44 -0
- data/app/views/decidim/action_delegator/admin/censuses/_action_delegator_census_options_form.html.erb +25 -0
- data/app/views/decidim/action_delegator/admin/delegations/index.html.erb +12 -13
- data/app/views/decidim/action_delegator/admin/delegations/new.html.erb +29 -27
- data/app/views/decidim/action_delegator/admin/manage_delegations/new.html.erb +36 -24
- data/app/views/decidim/action_delegator/admin/manage_participants/new.html.erb +47 -33
- data/app/views/decidim/action_delegator/admin/participants/_form.html.erb +14 -8
- data/app/views/decidim/action_delegator/admin/participants/edit.html.erb +11 -13
- data/app/views/decidim/action_delegator/admin/participants/index.html.erb +20 -25
- data/app/views/decidim/action_delegator/admin/participants/new.html.erb +11 -13
- data/app/views/decidim/action_delegator/admin/ponderations/_form.html.erb +13 -7
- data/app/views/decidim/action_delegator/admin/ponderations/edit.html.erb +11 -13
- data/app/views/decidim/action_delegator/admin/ponderations/index.html.erb +8 -11
- data/app/views/decidim/action_delegator/admin/ponderations/new.html.erb +11 -13
- data/app/views/decidim/action_delegator/admin/settings/_form.html.erb +26 -12
- data/app/views/decidim/action_delegator/admin/settings/_participants_sync_check.html.erb +1 -1
- data/app/views/decidim/action_delegator/admin/settings/_setting_checks.html.erb +11 -16
- data/app/views/decidim/action_delegator/admin/settings/edit.html.erb +11 -12
- data/app/views/decidim/action_delegator/admin/settings/index.html.erb +22 -19
- data/app/views/decidim/action_delegator/admin/settings/new.html.erb +11 -12
- data/app/views/decidim/action_delegator/admin/shared/_tabs_menu.html.erb +15 -0
- data/app/views/decidim/action_delegator/censuses/_internal_users_form.html.erb +61 -0
- data/app/views/decidim/action_delegator/elections/_delegation_buttons.html.erb +10 -0
- data/app/views/decidim/action_delegator/elections/_normal_election_buttons.html.erb +13 -0
- data/app/views/decidim/action_delegator/elections/_per_question_buttons.html.erb +9 -0
- data/app/views/decidim/action_delegator/elections/_per_question_waiting_buttons.html.erb +19 -0
- data/app/views/decidim/action_delegator/elections/_vote_results.html.erb +10 -0
- data/app/views/decidim/action_delegator/elections/_vote_results_question.html.erb +13 -0
- data/app/views/decidim/action_delegator/elections/admin/dashboard/_by_type_and_weight.html.erb +45 -0
- data/app/views/decidim/action_delegator/elections/admin/dashboard/_results_tabs.html.erb +5 -0
- data/app/views/decidim/action_delegator/elections/admin/dashboard/_results_type_info.html.erb +4 -0
- data/app/views/decidim/action_delegator/elections/admin/dashboard/_sum_of_weights.html.erb +43 -0
- data/app/views/decidim/action_delegator/elections/admin/dashboard/_totals.html.erb +27 -0
- data/app/views/decidim/action_delegator/user_delegations/index.html.erb +13 -14
- data/app/views/decidim/action_delegator/verifications/delegations_verifier/authorizations/edit.html.erb +19 -29
- data/app/views/decidim/action_delegator/verifications/delegations_verifier/authorizations/new.html.erb +42 -40
- data/config/assets.rb +3 -36
- data/config/i18n-tasks.yml +27 -5
- data/config/locales/ca.yml +103 -146
- data/config/locales/cs.yml +161 -145
- data/config/locales/en.yml +110 -75
- data/config/locales/es.yml +108 -154
- data/db/migrate/20200824113801_create_settings.rb +1 -1
- data/db/migrate/20250729104037_add_title_to_action_delegator_settings.rb +31 -0
- data/lib/decidim/action_delegator/admin_engine.rb +72 -45
- data/lib/decidim/action_delegator/common_rake.rb +13 -0
- data/lib/decidim/action_delegator/engine.rb +48 -19
- data/lib/decidim/action_delegator/test/delegation_examples.rb +144 -0
- data/lib/decidim/action_delegator/test/factories.rb +11 -6
- data/lib/decidim/action_delegator/verifications/delegations_authorizer.rb +80 -47
- data/lib/decidim/action_delegator/version.rb +3 -3
- data/lib/decidim/action_delegator.rb +8 -26
- data/lib/tasks/migrate_consultations.rake +382 -0
- data/lib/tasks/upgrade_tasks.rake +5 -0
- data/package.json +10 -27
- metadata +72 -122
- data/app/commands/concerns/decidim/action_delegator/consultations/multiple_vote_question_override.rb +0 -31
- data/app/commands/concerns/decidim/action_delegator/consultations/vote_question_override.rb +0 -44
- data/app/commands/decidim/action_delegator/admin/fix_resource_permissions.rb +0 -46
- data/app/commands/decidim/action_delegator/vote_delegation.rb +0 -28
- data/app/controllers/concerns/decidim/action_delegator/consultations/consultations_controller_override.rb +0 -16
- data/app/controllers/concerns/decidim/action_delegator/consultations/question_multiple_votes_controller_override.rb +0 -29
- data/app/controllers/concerns/decidim/action_delegator/consultations/question_votes_controller_override.rb +0 -57
- data/app/controllers/concerns/decidim/action_delegator/consultations/questions_controller_override.rb +0 -16
- data/app/controllers/concerns/decidim/action_delegator/needs_consultation_styles.rb +0 -24
- data/app/controllers/decidim/action_delegator/admin/consultations/exports_controller.rb +0 -27
- data/app/controllers/decidim/action_delegator/admin/consultations_controller.rb +0 -47
- data/app/controllers/decidim/action_delegator/admin/exports/_sum_of_weights_controller.rb +0 -15
- data/app/controllers/decidim/action_delegator/questions_summary_controller.rb +0 -14
- data/app/forms/concerns/decidim/action_delegator/consultations/vote_form_override.rb +0 -15
- data/app/helpers/decidim/action_delegator/delegation_helper.rb +0 -13
- data/app/jobs/decidim/action_delegator/export_consultation_results_job.rb +0 -51
- data/app/models/concerns/decidim/action_delegator/consultations/question_override.rb +0 -36
- data/app/models/concerns/decidim/action_delegator/consultations/vote_override.rb +0 -15
- data/app/models/decidim/action_delegator/unversioned_vote.rb +0 -19
- data/app/models/decidim/action_delegator/whodunnit_vote.rb +0 -28
- data/app/overrides/decidim/consultations/admin/consultations/results/add_ongoing_warning.html.erb.deface +0 -3
- data/app/overrides/decidim/consultations/consultations/_question/add_delegation_link.html.erb.deface +0 -3
- data/app/overrides/decidim/consultations/consultations/_question/replace_vote_info.html.erb.deface +0 -4
- data/app/overrides/decidim/consultations/consultations/_regular_questions/prevent_empty_questions.html.erb.deface +0 -10
- data/app/overrides/decidim/consultations/consultations/_regular_questions/remove_highlighted_scopes.html.erb.deface +0 -5
- data/app/overrides/decidim/consultations/question_multiple_votes/_form/add_delegation_notice.html.erb.deface +0 -8
- data/app/overrides/decidim/consultations/questions/_results/replace_results.html.erb.deface +0 -3
- data/app/overrides/decidim/consultations/questions/_vote_button/add_delegations_link.html.erb.deface +0 -3
- data/app/overrides/decidim/consultations/questions/_vote_button/add_modal.html.erb.deface +0 -3
- data/app/overrides/decidim/consultations/questions/_vote_button/add_modal_javascript.html.erb.deface +0 -3
- data/app/overrides/decidim/consultations/questions/_vote_button/replace_delegation_to_multivote_link.html.erb.deface +0 -8
- data/app/overrides/decidim/consultations/questions/_vote_modal/add_delegation_callout.html.erb.deface +0 -3
- data/app/overrides/decidim/consultations/questions/_vote_modal_confirm/add_delegation_callout.html.erb.deface +0 -3
- data/app/overrides/decidim/consultations/questions/_vote_modal_confirm/add_hidden_field.html.erb.deface +0 -3
- data/app/overrides/layouts/decidim/_consultation_header/add_consultation_callout.html.erb.deface +0 -9
- data/app/overrides/layouts/decidim/_question_header/add_consultation_callout.html.erb.deface +0 -9
- data/app/overrides/layouts/decidim/admin/remove_deprecation.rb +0 -10
- data/app/packs/entrypoints/decidim_action_delegator.scss +0 -1
- data/app/packs/entrypoints/decidim_action_delegator_questions.js +0 -5
- data/app/packs/entrypoints/decidim_action_delegator_questions_summary.js +0 -1
- data/app/packs/src/decidim/action_delegator/questions.js +0 -33
- data/app/packs/src/decidim/action_delegator/summary.js +0 -24
- data/app/packs/stylesheets/decidim/action_delegator/questions.scss +0 -26
- data/app/permissions/concerns/decidim/action_delegator/consultations/permissions_override.rb +0 -35
- data/app/presenters/decidim/action_delegator/question_with_totals.rb +0 -24
- data/app/queries/decidim/action_delegator/consultation_delegations.rb +0 -25
- data/app/queries/decidim/action_delegator/delegates_votes_by_consultation.rb +0 -24
- data/app/queries/decidim/action_delegator/delegates_votes_by_question.rb +0 -26
- data/app/queries/decidim/action_delegator/delegation_votes.rb +0 -30
- data/app/queries/decidim/action_delegator/grantee_delegations.rb +0 -24
- data/app/queries/decidim/action_delegator/organization_delegations.rb +0 -26
- data/app/queries/decidim/action_delegator/organization_settings.rb +0 -31
- data/app/queries/decidim/action_delegator/responses.rb +0 -24
- data/app/queries/decidim/action_delegator/responses_by_membership.rb +0 -58
- data/app/queries/decidim/action_delegator/scrutiny.rb +0 -87
- data/app/queries/decidim/action_delegator/setting_delegations.rb +0 -19
- data/app/queries/decidim/action_delegator/sum_of_membership_weight.rb +0 -44
- data/app/queries/decidim/action_delegator/sum_of_weights.rb +0 -25
- data/app/queries/decidim/action_delegator/type_and_weight.rb +0 -26
- data/app/queries/decidim/action_delegator/voted_with_ponderations.rb +0 -30
- data/app/queries/decidim/action_delegator/votes_count_aggregation.rb +0 -34
- data/app/serializers/decidim/action_delegator/consultation_results_serializer.rb +0 -19
- data/app/views/decidim/action_delegator/admin/consultations/_ongoing_consultation_warning.html.erb +0 -3
- data/app/views/decidim/action_delegator/admin/consultations/results.html.erb +0 -65
- data/app/views/decidim/action_delegator/admin/consultations/weighted_results.html.erb +0 -66
- data/app/views/decidim/action_delegator/consultations/_link_to_question.html.erb +0 -11
- data/app/views/decidim/action_delegator/consultations/_link_with_results.html.erb +0 -11
- data/app/views/decidim/action_delegator/consultations/questions/_callout.html.erb +0 -5
- data/app/views/decidim/action_delegator/consultations/questions/_delegations_modal.html.erb +0 -34
- data/app/views/decidim/action_delegator/consultations/questions/_link_to_delegations.html.erb +0 -15
- data/app/views/decidim/action_delegator/consultations/questions/_vote_delegated_active.html.erb +0 -32
- data/app/views/decidim/action_delegator/consultations/questions/_vote_delegated_finished.html.erb +0 -9
- data/app/views/decidim/action_delegator/consultations/questions/_vote_delegated_upcoming.html.erb +0 -8
- data/app/views/decidim/action_delegator/consultations/questions/_weight_results.html.erb +0 -8
- data/app/views/decidim/consultations/question_votes/_callout.html.erb +0 -47
- data/app/views/decidim/consultations/question_votes/update_vote_button.js.erb +0 -82
- data/lib/tasks/import_direct_verification.rake +0 -30
metadata
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: decidim-action_delegator
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.9.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Pau Pérez Fabregat
|
8
8
|
- Ivan Vergés
|
9
|
-
autorequire:
|
9
|
+
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2025-10-09 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: decidim-admin
|
@@ -17,60 +17,60 @@ dependencies:
|
|
17
17
|
requirements:
|
18
18
|
- - ">="
|
19
19
|
- !ruby/object:Gem::Version
|
20
|
-
version: 0.
|
20
|
+
version: 0.31.0.dev
|
21
21
|
- - "<"
|
22
22
|
- !ruby/object:Gem::Version
|
23
|
-
version: '0.
|
23
|
+
version: '0.32'
|
24
24
|
type: :runtime
|
25
25
|
prerelease: false
|
26
26
|
version_requirements: !ruby/object:Gem::Requirement
|
27
27
|
requirements:
|
28
28
|
- - ">="
|
29
29
|
- !ruby/object:Gem::Version
|
30
|
-
version: 0.
|
30
|
+
version: 0.31.0.dev
|
31
31
|
- - "<"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: '0.
|
33
|
+
version: '0.32'
|
34
34
|
- !ruby/object:Gem::Dependency
|
35
|
-
name: decidim-
|
35
|
+
name: decidim-core
|
36
36
|
requirement: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: 0.
|
40
|
+
version: 0.31.0.dev
|
41
41
|
- - "<"
|
42
42
|
- !ruby/object:Gem::Version
|
43
|
-
version: '0.
|
43
|
+
version: '0.32'
|
44
44
|
type: :runtime
|
45
45
|
prerelease: false
|
46
46
|
version_requirements: !ruby/object:Gem::Requirement
|
47
47
|
requirements:
|
48
48
|
- - ">="
|
49
49
|
- !ruby/object:Gem::Version
|
50
|
-
version: 0.
|
50
|
+
version: 0.31.0.dev
|
51
51
|
- - "<"
|
52
52
|
- !ruby/object:Gem::Version
|
53
|
-
version: '0.
|
53
|
+
version: '0.32'
|
54
54
|
- !ruby/object:Gem::Dependency
|
55
|
-
name: decidim-
|
55
|
+
name: decidim-elections
|
56
56
|
requirement: !ruby/object:Gem::Requirement
|
57
57
|
requirements:
|
58
58
|
- - ">="
|
59
59
|
- !ruby/object:Gem::Version
|
60
|
-
version: 0.
|
60
|
+
version: 0.31.0.dev
|
61
61
|
- - "<"
|
62
62
|
- !ruby/object:Gem::Version
|
63
|
-
version: '0.
|
63
|
+
version: '0.32'
|
64
64
|
type: :runtime
|
65
65
|
prerelease: false
|
66
66
|
version_requirements: !ruby/object:Gem::Requirement
|
67
67
|
requirements:
|
68
68
|
- - ">="
|
69
69
|
- !ruby/object:Gem::Version
|
70
|
-
version: 0.
|
70
|
+
version: 0.31.0.dev
|
71
71
|
- - "<"
|
72
72
|
- !ruby/object:Gem::Version
|
73
|
-
version: '0.
|
73
|
+
version: '0.32'
|
74
74
|
- !ruby/object:Gem::Dependency
|
75
75
|
name: deface
|
76
76
|
requirement: !ruby/object:Gem::Requirement
|
@@ -113,26 +113,6 @@ dependencies:
|
|
113
113
|
- - ">="
|
114
114
|
- !ruby/object:Gem::Version
|
115
115
|
version: '0'
|
116
|
-
- !ruby/object:Gem::Dependency
|
117
|
-
name: decidim-dev
|
118
|
-
requirement: !ruby/object:Gem::Requirement
|
119
|
-
requirements:
|
120
|
-
- - ">="
|
121
|
-
- !ruby/object:Gem::Version
|
122
|
-
version: 0.27.0
|
123
|
-
- - "<"
|
124
|
-
- !ruby/object:Gem::Version
|
125
|
-
version: '0.28'
|
126
|
-
type: :development
|
127
|
-
prerelease: false
|
128
|
-
version_requirements: !ruby/object:Gem::Requirement
|
129
|
-
requirements:
|
130
|
-
- - ">="
|
131
|
-
- !ruby/object:Gem::Version
|
132
|
-
version: 0.27.0
|
133
|
-
- - "<"
|
134
|
-
- !ruby/object:Gem::Version
|
135
|
-
version: '0.28'
|
136
116
|
description: A tool for Decidim that provides extended functionalities for cooperatives
|
137
117
|
and allows delegated voting.
|
138
118
|
email:
|
@@ -145,29 +125,20 @@ files:
|
|
145
125
|
- LICENSE-AGPLv3.txt
|
146
126
|
- README.md
|
147
127
|
- Rakefile
|
148
|
-
- app/commands/concerns/decidim/action_delegator/consultations/multiple_vote_question_override.rb
|
149
|
-
- app/commands/concerns/decidim/action_delegator/consultations/vote_question_override.rb
|
150
128
|
- app/commands/decidim/action_delegator/admin/create_delegation.rb
|
151
129
|
- app/commands/decidim/action_delegator/admin/create_participant.rb
|
152
130
|
- app/commands/decidim/action_delegator/admin/create_ponderation.rb
|
153
131
|
- app/commands/decidim/action_delegator/admin/create_setting.rb
|
154
|
-
- app/commands/decidim/action_delegator/admin/fix_resource_permissions.rb
|
155
132
|
- app/commands/decidim/action_delegator/admin/update_participant.rb
|
156
133
|
- app/commands/decidim/action_delegator/admin/update_ponderation.rb
|
157
134
|
- app/commands/decidim/action_delegator/admin/update_setting.rb
|
158
|
-
- app/commands/decidim/action_delegator/vote_delegation.rb
|
159
135
|
- app/controllers/concerns/decidim/action_delegator/admin/filterable.rb
|
160
|
-
- app/controllers/concerns/decidim/action_delegator/consultations/consultations_controller_override.rb
|
161
|
-
- app/controllers/concerns/decidim/action_delegator/consultations/question_multiple_votes_controller_override.rb
|
162
|
-
- app/controllers/concerns/decidim/action_delegator/consultations/question_votes_controller_override.rb
|
163
|
-
- app/controllers/concerns/decidim/action_delegator/consultations/questions_controller_override.rb
|
164
136
|
- app/controllers/concerns/decidim/action_delegator/devise/sessions_controller_override.rb
|
165
|
-
- app/controllers/concerns/decidim/action_delegator/
|
137
|
+
- app/controllers/concerns/decidim/action_delegator/election_per_question_votes_controller_override.rb
|
138
|
+
- app/controllers/concerns/decidim/action_delegator/election_votes_controller_override.rb
|
139
|
+
- app/controllers/concerns/decidim/action_delegator/votes_controller_methods.rb
|
166
140
|
- app/controllers/decidim/action_delegator/admin/application_controller.rb
|
167
|
-
- app/controllers/decidim/action_delegator/admin/consultations/exports_controller.rb
|
168
|
-
- app/controllers/decidim/action_delegator/admin/consultations_controller.rb
|
169
141
|
- app/controllers/decidim/action_delegator/admin/delegations_controller.rb
|
170
|
-
- app/controllers/decidim/action_delegator/admin/exports/_sum_of_weights_controller.rb
|
171
142
|
- app/controllers/decidim/action_delegator/admin/invite_participants_controller.rb
|
172
143
|
- app/controllers/decidim/action_delegator/admin/manage_delegations_controller.rb
|
173
144
|
- app/controllers/decidim/action_delegator/admin/manage_participants_controller.rb
|
@@ -176,88 +147,61 @@ files:
|
|
176
147
|
- app/controllers/decidim/action_delegator/admin/ponderations_controller.rb
|
177
148
|
- app/controllers/decidim/action_delegator/admin/settings_controller.rb
|
178
149
|
- app/controllers/decidim/action_delegator/application_controller.rb
|
179
|
-
- app/controllers/decidim/action_delegator/
|
150
|
+
- app/controllers/decidim/action_delegator/elections/admin/results_controller.rb
|
151
|
+
- app/controllers/decidim/action_delegator/elections/results_controller.rb
|
180
152
|
- app/controllers/decidim/action_delegator/user_delegations_controller.rb
|
181
153
|
- app/controllers/decidim/action_delegator/verifications/delegations_verifier/authorizations_controller.rb
|
182
|
-
- app/forms/
|
154
|
+
- app/forms/decidim/action_delegator/admin/action_delegator_census_form.rb
|
155
|
+
- app/forms/decidim/action_delegator/admin/csv_import_form.rb
|
183
156
|
- app/forms/decidim/action_delegator/admin/delegation_form.rb
|
184
157
|
- app/forms/decidim/action_delegator/admin/invitation_participant_form.rb
|
185
158
|
- app/forms/decidim/action_delegator/admin/participant_form.rb
|
186
159
|
- app/forms/decidim/action_delegator/admin/ponderation_form.rb
|
187
160
|
- app/forms/decidim/action_delegator/admin/setting_form.rb
|
161
|
+
- app/forms/decidim/action_delegator/censuses/internal_users_form.rb
|
188
162
|
- app/forms/decidim/action_delegator/verifications/delegations_verifier_form.rb
|
189
|
-
- app/helpers/decidim/action_delegator/admin/
|
163
|
+
- app/helpers/decidim/action_delegator/admin/settings_helper.rb
|
190
164
|
- app/helpers/decidim/action_delegator/application_helper.rb
|
191
|
-
- app/helpers/decidim/action_delegator/
|
165
|
+
- app/helpers/decidim/action_delegator/settings_helper.rb
|
192
166
|
- app/jobs/decidim/action_delegator/admin/import_csv_job.rb
|
193
167
|
- app/jobs/decidim/action_delegator/admin/invite_participants_job.rb
|
194
|
-
- app/jobs/decidim/action_delegator/export_consultation_results_job.rb
|
195
168
|
- app/jobs/decidim/action_delegator/send_sms_job.rb
|
196
169
|
- app/jobs/decidim/action_delegator/sync_participants_job.rb
|
197
170
|
- app/jobs/decidim/action_delegator/twilio_send_sms_job.rb
|
198
171
|
- app/mailers/decidim/action_delegator/import_mailer.rb
|
199
|
-
- app/models/concerns/decidim/action_delegator/consultations/question_override.rb
|
200
|
-
- app/models/concerns/decidim/action_delegator/consultations/vote_override.rb
|
201
172
|
- app/models/decidim/action_delegator/application_record.rb
|
202
173
|
- app/models/decidim/action_delegator/delegation.rb
|
203
174
|
- app/models/decidim/action_delegator/participant.rb
|
204
175
|
- app/models/decidim/action_delegator/ponderation.rb
|
205
176
|
- app/models/decidim/action_delegator/setting.rb
|
206
|
-
- app/
|
207
|
-
- app/
|
208
|
-
- app/overrides/decidim/
|
209
|
-
- app/overrides/decidim/
|
210
|
-
- app/overrides/decidim/
|
211
|
-
- app/overrides/decidim/
|
212
|
-
- app/overrides/decidim/
|
213
|
-
- app/overrides/decidim/
|
214
|
-
- app/
|
215
|
-
- app/overrides/decidim/consultations/questions/_vote_button/add_delegations_link.html.erb.deface
|
216
|
-
- app/overrides/decidim/consultations/questions/_vote_button/add_modal.html.erb.deface
|
217
|
-
- app/overrides/decidim/consultations/questions/_vote_button/add_modal_javascript.html.erb.deface
|
218
|
-
- app/overrides/decidim/consultations/questions/_vote_button/replace_delegation_to_multivote_link.html.erb.deface
|
219
|
-
- app/overrides/decidim/consultations/questions/_vote_modal/add_delegation_callout.html.erb.deface
|
220
|
-
- app/overrides/decidim/consultations/questions/_vote_modal_confirm/add_delegation_callout.html.erb.deface
|
221
|
-
- app/overrides/decidim/consultations/questions/_vote_modal_confirm/add_hidden_field.html.erb.deface
|
222
|
-
- app/overrides/layouts/decidim/_consultation_header/add_consultation_callout.html.erb.deface
|
223
|
-
- app/overrides/layouts/decidim/_question_header/add_consultation_callout.html.erb.deface
|
224
|
-
- app/overrides/layouts/decidim/admin/remove_deprecation.rb
|
225
|
-
- app/packs/entrypoints/decidim_action_delegator.scss
|
226
|
-
- app/packs/entrypoints/decidim_action_delegator_questions.js
|
227
|
-
- app/packs/entrypoints/decidim_action_delegator_questions_summary.js
|
177
|
+
- app/overrides/decidim/elections/admin/dashboard/_results/_add_results_contents.html.erb.deface
|
178
|
+
- app/overrides/decidim/elections/admin/dashboard/_results/_add_results_tabs.html.erb.deface
|
179
|
+
- app/overrides/decidim/elections/elections/_election_aside/add_delegation_buttons.html.erb.deface
|
180
|
+
- app/overrides/decidim/elections/elections/_vote_results/replace_results_div.html.erb.deface
|
181
|
+
- app/overrides/decidim/elections/per_question_votes/show/add_delegation_hidden_input.html.erb.deface
|
182
|
+
- app/overrides/decidim/elections/per_question_votes/show/add_delegation_id_to_links.html.erb.deface
|
183
|
+
- app/overrides/decidim/elections/per_question_votes/waiting/add_delegation_buttons.html.erb.deface
|
184
|
+
- app/overrides/decidim/elections/votes/receipt/add_delegation_buttons.html.erb.deface
|
185
|
+
- app/packs/entrypoints/decidim_action_delegator_elections.js
|
228
186
|
- app/packs/images/logo-pokecode.png
|
229
|
-
- app/packs/src/decidim/action_delegator/
|
230
|
-
- app/
|
231
|
-
- app/packs/stylesheets/decidim/action_delegator/questions.scss
|
232
|
-
- app/permissions/concerns/decidim/action_delegator/consultations/permissions_override.rb
|
187
|
+
- app/packs/src/decidim/action_delegator/elections_live_results.js
|
188
|
+
- app/permissions/decidim/action_delegator/admin/permissions.rb
|
233
189
|
- app/permissions/decidim/action_delegator/permissions.rb
|
234
|
-
- app/presenters/decidim/action_delegator/
|
235
|
-
- app/queries/decidim/action_delegator/
|
236
|
-
- app/queries/decidim/action_delegator/
|
237
|
-
- app/queries/decidim/action_delegator/
|
238
|
-
- app/queries/decidim/action_delegator/
|
239
|
-
- app/queries/decidim/action_delegator/
|
240
|
-
- app/queries/decidim/action_delegator/
|
241
|
-
- app/queries/decidim/action_delegator/
|
242
|
-
- app/queries/decidim/action_delegator/organization_settings.rb
|
243
|
-
- app/queries/decidim/action_delegator/responses.rb
|
244
|
-
- app/queries/decidim/action_delegator/responses_by_membership.rb
|
245
|
-
- app/queries/decidim/action_delegator/scrutiny.rb
|
246
|
-
- app/queries/decidim/action_delegator/setting_delegations.rb
|
247
|
-
- app/queries/decidim/action_delegator/sum_of_membership_weight.rb
|
248
|
-
- app/queries/decidim/action_delegator/sum_of_weights.rb
|
249
|
-
- app/queries/decidim/action_delegator/type_and_weight.rb
|
250
|
-
- app/queries/decidim/action_delegator/voted_with_ponderations.rb
|
251
|
-
- app/queries/decidim/action_delegator/votes_count_aggregation.rb
|
252
|
-
- app/serializers/decidim/action_delegator/consultation_results_serializer.rb
|
190
|
+
- app/presenters/decidim/action_delegator/setting_presenter.rb
|
191
|
+
- app/queries/decidim/action_delegator/action_delegator_census_users.rb
|
192
|
+
- app/queries/decidim/action_delegator/authorized_resources.rb
|
193
|
+
- app/queries/decidim/action_delegator/election_settings.rb
|
194
|
+
- app/queries/decidim/action_delegator/elections_delegated_votes_versions.rb
|
195
|
+
- app/queries/decidim/action_delegator/elections_question_responses_by_type.rb
|
196
|
+
- app/queries/decidim/action_delegator/elections_question_weighted_responses.rb
|
197
|
+
- app/queries/decidim/action_delegator/elections_votes_with_ponderations.rb
|
253
198
|
- app/serializers/decidim/action_delegator/sum_of_weights_serializer.rb
|
254
199
|
- app/services/decidim/action_delegator/csv_importer.rb
|
255
200
|
- app/services/decidim/action_delegator/delegations_csv_importer.rb
|
256
201
|
- app/services/decidim/action_delegator/participants_csv_importer.rb
|
257
202
|
- app/services/decidim/action_delegator/sms_gateway.rb
|
258
|
-
- app/views/decidim/action_delegator/admin/
|
259
|
-
- app/views/decidim/action_delegator/admin/
|
260
|
-
- app/views/decidim/action_delegator/admin/consultations/weighted_results.html.erb
|
203
|
+
- app/views/decidim/action_delegator/admin/censuses/_action_delegator_census_form.html.erb
|
204
|
+
- app/views/decidim/action_delegator/admin/censuses/_action_delegator_census_options_form.html.erb
|
261
205
|
- app/views/decidim/action_delegator/admin/delegations/index.html.erb
|
262
206
|
- app/views/decidim/action_delegator/admin/delegations/new.html.erb
|
263
207
|
- app/views/decidim/action_delegator/admin/manage_delegations/new.html.erb
|
@@ -279,21 +223,23 @@ files:
|
|
279
223
|
- app/views/decidim/action_delegator/admin/settings/edit.html.erb
|
280
224
|
- app/views/decidim/action_delegator/admin/settings/index.html.erb
|
281
225
|
- app/views/decidim/action_delegator/admin/settings/new.html.erb
|
282
|
-
- app/views/decidim/action_delegator/
|
283
|
-
- app/views/decidim/action_delegator/
|
284
|
-
- app/views/decidim/action_delegator/
|
285
|
-
- app/views/decidim/action_delegator/
|
286
|
-
- app/views/decidim/action_delegator/
|
287
|
-
- app/views/decidim/action_delegator/
|
288
|
-
- app/views/decidim/action_delegator/
|
289
|
-
- app/views/decidim/action_delegator/
|
290
|
-
- app/views/decidim/action_delegator/
|
226
|
+
- app/views/decidim/action_delegator/admin/shared/_tabs_menu.html.erb
|
227
|
+
- app/views/decidim/action_delegator/censuses/_internal_users_form.html.erb
|
228
|
+
- app/views/decidim/action_delegator/elections/_delegation_buttons.html.erb
|
229
|
+
- app/views/decidim/action_delegator/elections/_normal_election_buttons.html.erb
|
230
|
+
- app/views/decidim/action_delegator/elections/_per_question_buttons.html.erb
|
231
|
+
- app/views/decidim/action_delegator/elections/_per_question_waiting_buttons.html.erb
|
232
|
+
- app/views/decidim/action_delegator/elections/_vote_results.html.erb
|
233
|
+
- app/views/decidim/action_delegator/elections/_vote_results_question.html.erb
|
234
|
+
- app/views/decidim/action_delegator/elections/admin/dashboard/_by_type_and_weight.html.erb
|
235
|
+
- app/views/decidim/action_delegator/elections/admin/dashboard/_results_tabs.html.erb
|
236
|
+
- app/views/decidim/action_delegator/elections/admin/dashboard/_results_type_info.html.erb
|
237
|
+
- app/views/decidim/action_delegator/elections/admin/dashboard/_sum_of_weights.html.erb
|
238
|
+
- app/views/decidim/action_delegator/elections/admin/dashboard/_totals.html.erb
|
291
239
|
- app/views/decidim/action_delegator/import_mailer/import.html.erb
|
292
240
|
- app/views/decidim/action_delegator/user_delegations/index.html.erb
|
293
241
|
- app/views/decidim/action_delegator/verifications/delegations_verifier/authorizations/edit.html.erb
|
294
242
|
- app/views/decidim/action_delegator/verifications/delegations_verifier/authorizations/new.html.erb
|
295
|
-
- app/views/decidim/consultations/question_votes/_callout.html.erb
|
296
|
-
- app/views/decidim/consultations/question_votes/update_vote_button.js.erb
|
297
243
|
- config/assets.rb
|
298
244
|
- config/i18n-tasks.yml
|
299
245
|
- config/locales/ca.yml
|
@@ -312,40 +258,44 @@ files:
|
|
312
258
|
- db/migrate/20230323210000_create_decidim_action_delegator_participants.rb
|
313
259
|
- db/migrate/20230323223752_add_decidim_action_delegator_verification_method.rb
|
314
260
|
- db/migrate/20230412105710_add_decidim_action_delegator_participants_user_id.rb
|
261
|
+
- db/migrate/20250729104037_add_title_to_action_delegator_settings.rb
|
315
262
|
- db/seeds.rb
|
316
263
|
- lib/decidim/action_delegator.rb
|
317
264
|
- lib/decidim/action_delegator/admin.rb
|
318
265
|
- lib/decidim/action_delegator/admin_engine.rb
|
266
|
+
- lib/decidim/action_delegator/common_rake.rb
|
319
267
|
- lib/decidim/action_delegator/engine.rb
|
268
|
+
- lib/decidim/action_delegator/test/delegation_examples.rb
|
320
269
|
- lib/decidim/action_delegator/test/factories.rb
|
321
270
|
- lib/decidim/action_delegator/verifications/delegations_authorizer.rb
|
322
271
|
- lib/decidim/action_delegator/verifications/delegations_verifier.rb
|
323
272
|
- lib/decidim/action_delegator/verifications/delegations_verifier/engine.rb
|
324
273
|
- lib/decidim/action_delegator/version.rb
|
325
|
-
- lib/tasks/
|
274
|
+
- lib/tasks/migrate_consultations.rake
|
275
|
+
- lib/tasks/upgrade_tasks.rake
|
326
276
|
- package.json
|
327
|
-
homepage: https://github.com/
|
277
|
+
homepage: https://github.com/Openpoke/decidim-module-action_delegator
|
328
278
|
licenses:
|
329
279
|
- AGPL-3.0
|
330
280
|
metadata:
|
331
281
|
rubygems_mfa_required: 'true'
|
332
|
-
post_install_message:
|
282
|
+
post_install_message:
|
333
283
|
rdoc_options: []
|
334
284
|
require_paths:
|
335
285
|
- lib
|
336
286
|
required_ruby_version: !ruby/object:Gem::Requirement
|
337
287
|
requirements:
|
338
|
-
- - "
|
288
|
+
- - "~>"
|
339
289
|
- !ruby/object:Gem::Version
|
340
|
-
version:
|
290
|
+
version: 3.3.0
|
341
291
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
342
292
|
requirements:
|
343
293
|
- - ">="
|
344
294
|
- !ruby/object:Gem::Version
|
345
295
|
version: '0'
|
346
296
|
requirements: []
|
347
|
-
rubygems_version: 3.
|
348
|
-
signing_key:
|
297
|
+
rubygems_version: 3.5.11
|
298
|
+
signing_key:
|
349
299
|
specification_version: 4
|
350
300
|
summary: A Decidim ActionDelegator module
|
351
301
|
test_files: []
|
data/app/commands/concerns/decidim/action_delegator/consultations/multiple_vote_question_override.rb
DELETED
@@ -1,31 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
# Recreate validations to take into account custom fields and ignore the length limit in proposals
|
4
|
-
module Decidim
|
5
|
-
module ActionDelegator
|
6
|
-
module Consultations
|
7
|
-
module MultipleVoteQuestionOverride
|
8
|
-
extend ActiveSupport::Concern
|
9
|
-
include VoteQuestionOverride
|
10
|
-
|
11
|
-
included do
|
12
|
-
private
|
13
|
-
|
14
|
-
def create_vote!(vote_form)
|
15
|
-
vote = if delegation
|
16
|
-
form.context.delegation = delegation
|
17
|
-
Decidim::ActionDelegator::VoteDelegation.new(vote_form.response, form.context).call
|
18
|
-
else
|
19
|
-
normal_vote = form.context.current_question.votes.build(
|
20
|
-
author: @current_user,
|
21
|
-
response: vote_form.response
|
22
|
-
)
|
23
|
-
Decidim::ActionDelegator::UnversionedVote.new(normal_vote)
|
24
|
-
end
|
25
|
-
vote.save!
|
26
|
-
end
|
27
|
-
end
|
28
|
-
end
|
29
|
-
end
|
30
|
-
end
|
31
|
-
end
|
@@ -1,44 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
# Recreate validations to take into account custom fields and ignore the length limit in proposals
|
4
|
-
module Decidim
|
5
|
-
module ActionDelegator
|
6
|
-
module Consultations
|
7
|
-
module VoteQuestionOverride
|
8
|
-
extend ActiveSupport::Concern
|
9
|
-
|
10
|
-
included do
|
11
|
-
private
|
12
|
-
|
13
|
-
def build_vote
|
14
|
-
if delegation
|
15
|
-
form.context.delegation = delegation
|
16
|
-
Decidim::ActionDelegator::VoteDelegation.new(form.response, form.context).call
|
17
|
-
else
|
18
|
-
vote = form.context.current_question.votes.build(
|
19
|
-
author: form.context.current_user,
|
20
|
-
response: form.response
|
21
|
-
)
|
22
|
-
Decidim::ActionDelegator::UnversionedVote.new(vote)
|
23
|
-
end
|
24
|
-
end
|
25
|
-
|
26
|
-
def delegation
|
27
|
-
@delegation ||= Decidim::ActionDelegator::GranteeDelegations.for(
|
28
|
-
form.context.current_question.consultation,
|
29
|
-
form.context.current_user
|
30
|
-
).find_by(id: delegation_id)
|
31
|
-
end
|
32
|
-
|
33
|
-
def delegation
|
34
|
-
@delegation ||= Decidim::ActionDelegator::Delegation.find_by(id: delegation_id)
|
35
|
-
end
|
36
|
-
|
37
|
-
def delegation_id
|
38
|
-
@delegation_id ||= form.decidim_consultations_delegation_id
|
39
|
-
end
|
40
|
-
end
|
41
|
-
end
|
42
|
-
end
|
43
|
-
end
|
44
|
-
end
|
@@ -1,46 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Decidim
|
4
|
-
module ActionDelegator
|
5
|
-
module Admin
|
6
|
-
class FixResourcePermissions < Decidim::Command
|
7
|
-
def initialize(resources)
|
8
|
-
@resources = resources
|
9
|
-
@errors = []
|
10
|
-
end
|
11
|
-
|
12
|
-
# Executes the command. Broadcasts these events:
|
13
|
-
#
|
14
|
-
# - :ok when everything is valid.
|
15
|
-
# - :invalid if the form wasn't valid and we couldn't proceed.
|
16
|
-
#
|
17
|
-
# Returns nothing.
|
18
|
-
def call
|
19
|
-
return broadcast(:invalid) if resources.blank?
|
20
|
-
|
21
|
-
update_permissions
|
22
|
-
|
23
|
-
return broadcast(:invalid) if errors.any?
|
24
|
-
|
25
|
-
broadcast(:ok)
|
26
|
-
end
|
27
|
-
|
28
|
-
private
|
29
|
-
|
30
|
-
attr_reader :resources, :errors
|
31
|
-
|
32
|
-
def update_permissions
|
33
|
-
resources.each do |resource|
|
34
|
-
resource.resource_manifest.actions.each do |action|
|
35
|
-
resource_permission ||= resource.resource_permission || resource.build_resource_permission
|
36
|
-
next unless resource_permission.permissions.dig(action, "authorization_handlers", "delegations_verifier").nil?
|
37
|
-
|
38
|
-
resource_permission.permissions.deep_merge!({ action => { "authorization_handlers" => { "delegations_verifier" => {} } } })
|
39
|
-
@errors << resource unless resource_permission.save
|
40
|
-
end
|
41
|
-
end
|
42
|
-
end
|
43
|
-
end
|
44
|
-
end
|
45
|
-
end
|
46
|
-
end
|
@@ -1,28 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Decidim
|
4
|
-
module ActionDelegator
|
5
|
-
class VoteDelegation
|
6
|
-
def initialize(response, context)
|
7
|
-
@response = response
|
8
|
-
@context = context
|
9
|
-
end
|
10
|
-
|
11
|
-
def call
|
12
|
-
PaperTrail.request.controller_info = { decidim_action_delegator_delegation_id: context.delegation.id }
|
13
|
-
WhodunnitVote.new(build_vote, context.current_user)
|
14
|
-
end
|
15
|
-
|
16
|
-
private
|
17
|
-
|
18
|
-
attr_reader :context, :response
|
19
|
-
|
20
|
-
def build_vote
|
21
|
-
context.current_question.votes.build(
|
22
|
-
author: context.delegation.granter,
|
23
|
-
response: response
|
24
|
-
)
|
25
|
-
end
|
26
|
-
end
|
27
|
-
end
|
28
|
-
end
|
@@ -1,16 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Decidim
|
4
|
-
module ActionDelegator
|
5
|
-
module Consultations
|
6
|
-
module ConsultationsControllerOverride
|
7
|
-
extend ActiveSupport::Concern
|
8
|
-
include ::Decidim::ActionDelegator::NeedsConsultationStyles
|
9
|
-
|
10
|
-
included do
|
11
|
-
helper ::Decidim::ActionDelegator::DelegationHelper
|
12
|
-
end
|
13
|
-
end
|
14
|
-
end
|
15
|
-
end
|
16
|
-
end
|
@@ -1,29 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Decidim
|
4
|
-
module ActionDelegator
|
5
|
-
module Consultations
|
6
|
-
module QuestionMultipleVotesControllerOverride
|
7
|
-
extend ActiveSupport::Concern
|
8
|
-
|
9
|
-
included do
|
10
|
-
helper ::Decidim::ActionDelegator::DelegationHelper
|
11
|
-
helper_method :delegation
|
12
|
-
before_action do
|
13
|
-
session[:delegation_id] = delegation.id if delegation
|
14
|
-
end
|
15
|
-
|
16
|
-
private
|
17
|
-
|
18
|
-
def delegation
|
19
|
-
@delegation ||= Decidim::ActionDelegator::Delegation.find_by(id: delegation_id)
|
20
|
-
end
|
21
|
-
|
22
|
-
def delegation_id
|
23
|
-
@delegation_id ||= params[:decidim_consultations_delegation_id] || params[:delegation] || session[:delegation_id]
|
24
|
-
end
|
25
|
-
end
|
26
|
-
end
|
27
|
-
end
|
28
|
-
end
|
29
|
-
end
|
@@ -1,57 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Decidim
|
4
|
-
module ActionDelegator
|
5
|
-
module Consultations
|
6
|
-
module QuestionVotesControllerOverride
|
7
|
-
extend ActiveSupport::Concern
|
8
|
-
|
9
|
-
included do
|
10
|
-
helper ::Decidim::ActionDelegator::DelegationHelper
|
11
|
-
|
12
|
-
def destroy
|
13
|
-
enforce_permission_to_unvote
|
14
|
-
|
15
|
-
user = delegation.blank? ? current_user : delegation.granter
|
16
|
-
|
17
|
-
PaperTrail.request(enabled: delegation.present?, whodunnit: current_user.id) do
|
18
|
-
Decidim::Consultations::UnvoteQuestion.call(current_question, user) do
|
19
|
-
on(:ok) do
|
20
|
-
current_question.reload
|
21
|
-
render :update_vote_button
|
22
|
-
end
|
23
|
-
end
|
24
|
-
end
|
25
|
-
end
|
26
|
-
|
27
|
-
private
|
28
|
-
|
29
|
-
def info_for_paper_trail
|
30
|
-
if delegation.present?
|
31
|
-
{ decidim_action_delegator_delegation_id: delegation.id }
|
32
|
-
else
|
33
|
-
{}
|
34
|
-
end
|
35
|
-
end
|
36
|
-
|
37
|
-
def delegation
|
38
|
-
@delegation ||= Decidim::ActionDelegator::Delegation.find_by(id: params[:decidim_consultations_delegation_id])
|
39
|
-
end
|
40
|
-
|
41
|
-
def enforce_permission_to_unvote
|
42
|
-
if delegation.blank?
|
43
|
-
enforce_permission_to :unvote, :question, question: current_question
|
44
|
-
else
|
45
|
-
raise Decidim::ActionForbidden unless allowed_to?(
|
46
|
-
:unvote_delegation,
|
47
|
-
:question,
|
48
|
-
{ question: current_question, delegation: delegation },
|
49
|
-
[Decidim::ActionDelegator::Permissions, Decidim::Admin::Permissions, Decidim::Permissions]
|
50
|
-
)
|
51
|
-
end
|
52
|
-
end
|
53
|
-
end
|
54
|
-
end
|
55
|
-
end
|
56
|
-
end
|
57
|
-
end
|
@@ -1,16 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Decidim
|
4
|
-
module ActionDelegator
|
5
|
-
module Consultations
|
6
|
-
module QuestionsControllerOverride
|
7
|
-
extend ActiveSupport::Concern
|
8
|
-
include ::Decidim::ActionDelegator::NeedsConsultationStyles
|
9
|
-
|
10
|
-
included do
|
11
|
-
helper ::Decidim::ActionDelegator::DelegationHelper
|
12
|
-
end
|
13
|
-
end
|
14
|
-
end
|
15
|
-
end
|
16
|
-
end
|
@@ -1,24 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Decidim
|
4
|
-
module ActionDelegator
|
5
|
-
module NeedsConsultationStyles
|
6
|
-
extend ActiveSupport::Concern
|
7
|
-
|
8
|
-
included do
|
9
|
-
helper_method :snippets
|
10
|
-
end
|
11
|
-
|
12
|
-
def snippets
|
13
|
-
@snippets ||= Decidim::Snippets.new
|
14
|
-
|
15
|
-
unless @snippets.any?(:action_delegator_consultation_questions)
|
16
|
-
@snippets.add(:action_delegator_consultation_questions, ActionController::Base.helpers.stylesheet_pack_tag("decidim_action_delegator_questions"))
|
17
|
-
@snippets.add(:head, @snippets.for(:action_delegator_consultation_questions))
|
18
|
-
end
|
19
|
-
|
20
|
-
@snippets
|
21
|
-
end
|
22
|
-
end
|
23
|
-
end
|
24
|
-
end
|