decidim-action_delegator 0.6.0 → 0.7.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +97 -36
- data/app/commands/{decidim → concerns/decidim}/action_delegator/consultations/vote_question_override.rb +9 -1
- data/app/commands/decidim/action_delegator/admin/create_delegation.rb +5 -1
- data/app/commands/decidim/action_delegator/admin/create_participant.rb +41 -0
- data/app/commands/decidim/action_delegator/admin/create_ponderation.rb +38 -0
- data/app/commands/decidim/action_delegator/admin/create_setting.rb +49 -0
- data/app/commands/decidim/action_delegator/admin/fix_resource_permissions.rb +46 -0
- data/app/commands/decidim/action_delegator/admin/update_participant.rb +42 -0
- data/app/commands/decidim/action_delegator/admin/update_ponderation.rb +41 -0
- data/app/commands/decidim/action_delegator/admin/update_setting.rb +66 -0
- data/app/controllers/concerns/decidim/action_delegator/consultations/consultations_controller_override.rb +16 -0
- data/app/controllers/{decidim → concerns/decidim}/action_delegator/consultations/question_multiple_votes_controller_override.rb +2 -1
- data/app/controllers/{decidim → concerns/decidim}/action_delegator/consultations/question_votes_controller_override.rb +2 -0
- data/app/controllers/concerns/decidim/action_delegator/consultations/questions_controller_override.rb +16 -0
- data/app/controllers/concerns/decidim/action_delegator/needs_consultation_styles.rb +24 -0
- data/app/controllers/decidim/action_delegator/admin/consultations_controller.rb +22 -8
- data/app/controllers/decidim/action_delegator/admin/delegations_controller.rb +9 -9
- data/app/controllers/decidim/action_delegator/admin/invite_participants_controller.rb +84 -0
- data/app/controllers/decidim/action_delegator/admin/manage_delegations_controller.rb +48 -0
- data/app/controllers/decidim/action_delegator/admin/manage_participants_controller.rb +59 -0
- data/app/controllers/decidim/action_delegator/admin/participants_controller.rb +102 -0
- data/app/controllers/decidim/action_delegator/admin/permissions_controller.rb +40 -0
- data/app/controllers/decidim/action_delegator/admin/ponderations_controller.rb +101 -0
- data/app/controllers/decidim/action_delegator/admin/settings_controller.rb +51 -12
- data/app/controllers/decidim/action_delegator/verifications/delegations_verifier/authorizations_controller.rb +108 -0
- data/app/forms/decidim/action_delegator/admin/delegation_form.rb +23 -4
- data/app/forms/decidim/action_delegator/admin/invitation_participant_form.rb +10 -0
- data/app/forms/decidim/action_delegator/admin/participant_form.rb +44 -0
- data/app/forms/decidim/action_delegator/admin/ponderation_form.rb +28 -0
- data/app/forms/decidim/action_delegator/admin/setting_form.rb +28 -0
- data/app/forms/decidim/action_delegator/verifications/delegations_verifier_form.rb +131 -0
- data/app/helpers/decidim/action_delegator/admin/delegation_helper.rb +40 -3
- data/app/helpers/decidim/action_delegator/delegation_helper.rb +13 -0
- data/app/jobs/decidim/action_delegator/admin/import_csv_job.rb +27 -0
- data/app/jobs/decidim/action_delegator/admin/invite_participants_job.rb +39 -0
- data/app/jobs/decidim/action_delegator/sync_participants_job.rb +27 -0
- data/app/mailers/decidim/action_delegator/import_mailer.rb +31 -0
- data/app/models/decidim/action_delegator/delegation.rb +11 -0
- data/app/models/decidim/action_delegator/participant.rb +106 -0
- data/app/models/decidim/action_delegator/ponderation.rb +28 -0
- data/app/models/decidim/action_delegator/setting.rb +50 -1
- data/app/overrides/decidim/consultations/consultations/_question/add_delegation_link.html.erb.deface +3 -0
- data/app/overrides/decidim/consultations/consultations/_regular_questions/remove_highlighted_scopes.html.erb.deface +4 -0
- data/app/overrides/decidim/consultations/question_multiple_votes/_form/add_delegation_notice.html.erb.deface +8 -0
- data/app/overrides/decidim/consultations/questions/_vote_button/add_delegations_link.html.erb.deface +3 -0
- data/app/overrides/decidim/consultations/questions/_vote_button/add_modal.html.erb.deface +3 -0
- data/app/overrides/decidim/consultations/questions/_vote_button/replace_delegation_to_multivote_link.html.erb.deface +8 -0
- data/app/overrides/decidim/consultations/questions/_vote_modal/add_delegation_callout.html.erb.deface +3 -0
- data/app/overrides/decidim/consultations/questions/_vote_modal_confirm/add_delegation_callout.html.erb.deface +3 -0
- data/app/overrides/decidim/consultations/questions/_vote_modal_confirm/add_hidden_field.html.erb.deface +3 -0
- data/app/overrides/layouts/decidim/admin/remove_deprecation.rb +10 -0
- data/app/packs/entrypoints/decidim_action_delegator_questions.js +2 -0
- data/app/packs/src/decidim/action_delegator/questions.js +27 -0
- data/app/packs/stylesheets/decidim/action_delegator/questions.scss +4 -3
- data/app/permissions/concerns/decidim/action_delegator/consultations/permissions_override.rb +35 -0
- data/app/permissions/decidim/action_delegator/permissions.rb +6 -2
- data/app/queries/decidim/action_delegator/delegated_votes_versions.rb +5 -11
- data/app/queries/decidim/action_delegator/organization_settings.rb +6 -0
- data/app/queries/decidim/action_delegator/responses_by_membership.rb +3 -20
- data/app/queries/decidim/action_delegator/sum_of_membership_weight.rb +1 -5
- data/app/queries/decidim/action_delegator/sum_of_weights.rb +1 -1
- data/app/queries/decidim/action_delegator/type_and_weight.rb +1 -1
- data/app/queries/decidim/action_delegator/voted_with_ponderations.rb +30 -0
- data/app/services/decidim/action_delegator/csv_importer.rb +86 -0
- data/app/services/decidim/action_delegator/delegations_csv_importer.rb +54 -0
- data/app/services/decidim/action_delegator/participants_csv_importer.rb +131 -0
- data/app/views/decidim/action_delegator/admin/consultations/results.html.erb +3 -3
- data/app/views/decidim/action_delegator/admin/{results/sum_of_weights/index.html.erb → consultations/weighted_results.html.erb} +3 -3
- data/app/views/decidim/action_delegator/admin/delegations/index.html.erb +8 -3
- data/app/views/decidim/action_delegator/admin/delegations/new.html.erb +15 -12
- data/app/views/decidim/action_delegator/admin/manage_delegations/new.html.erb +25 -0
- data/app/views/decidim/action_delegator/admin/manage_participants/new.html.erb +33 -0
- data/app/views/decidim/action_delegator/admin/participants/_form.html.erb +9 -0
- data/app/views/decidim/action_delegator/admin/participants/_missing_registered_check.html.erb +17 -0
- data/app/views/decidim/action_delegator/admin/participants/edit.html.erb +21 -0
- data/app/views/decidim/action_delegator/admin/participants/index.html.erb +72 -0
- data/app/views/decidim/action_delegator/admin/participants/new.html.erb +21 -0
- data/app/views/decidim/action_delegator/admin/ponderations/_form.html.erb +8 -0
- data/app/views/decidim/action_delegator/admin/ponderations/edit.html.erb +21 -0
- data/app/views/decidim/action_delegator/admin/ponderations/index.html.erb +40 -0
- data/app/views/decidim/action_delegator/admin/ponderations/new.html.erb +21 -0
- data/app/views/decidim/action_delegator/admin/settings/_check_verifier.html.erb +5 -0
- data/app/views/decidim/action_delegator/admin/settings/_form.html.erb +16 -0
- data/app/views/decidim/action_delegator/admin/settings/_participants_email_check.html.erb +7 -0
- data/app/views/decidim/action_delegator/admin/settings/_participants_sync_check.html.erb +11 -0
- data/app/views/decidim/action_delegator/admin/settings/_setting_checks.html.erb +81 -0
- data/app/views/decidim/action_delegator/admin/settings/edit.html.erb +18 -0
- data/app/views/decidim/action_delegator/admin/settings/index.html.erb +25 -5
- data/app/views/decidim/action_delegator/admin/settings/new.html.erb +14 -26
- data/app/views/decidim/action_delegator/consultations/_link_to_question.html.erb +11 -0
- data/app/views/decidim/action_delegator/consultations/questions/_delegations_modal.html.erb +36 -0
- data/app/views/decidim/action_delegator/consultations/questions/_link_to_delegations.html.erb +11 -0
- data/app/views/decidim/action_delegator/consultations/questions/_vote_delegated_active.html.erb +32 -0
- data/app/views/decidim/action_delegator/consultations/questions/_vote_delegated_finished.html.erb +9 -0
- data/app/views/decidim/action_delegator/consultations/questions/_vote_delegated_upcoming.html.erb +8 -0
- data/app/views/decidim/action_delegator/import_mailer/import.html.erb +11 -0
- data/app/views/decidim/{verifications/sms/authorizations/new.html.erb → action_delegator/verifications/delegations_verifier/authorizations/edit.html.erb} +12 -7
- data/app/views/decidim/action_delegator/verifications/delegations_verifier/authorizations/new.html.erb +49 -0
- data/config/assets.rb +1 -3
- data/config/i18n-tasks.yml +8 -0
- data/config/locales/ca.yml +287 -23
- data/config/locales/cs.yml +286 -18
- data/config/locales/en.yml +331 -24
- data/config/locales/es.yml +288 -24
- data/db/migrate/20230323101247_create_decidim_action_delegator_ponderations.rb +12 -0
- data/db/migrate/20230323210000_create_decidim_action_delegator_participants.rb +13 -0
- data/db/migrate/20230323223752_add_decidim_action_delegator_verification_method.rb +7 -0
- data/db/migrate/20230412105710_add_decidim_action_delegator_participants_user_id.rb +7 -0
- data/lib/decidim/action_delegator/admin_engine.rb +68 -6
- data/lib/decidim/action_delegator/engine.rb +25 -15
- data/lib/decidim/action_delegator/test/factories.rb +22 -7
- data/lib/decidim/action_delegator/verifications/delegations_authorizer.rb +85 -0
- data/lib/decidim/action_delegator/verifications/delegations_verifier/engine.rb +25 -0
- data/lib/decidim/action_delegator/verifications/delegations_verifier.rb +12 -0
- data/lib/decidim/action_delegator/version.rb +3 -3
- data/lib/decidim/action_delegator.rb +41 -0
- data/lib/tasks/import_direct_verification.rake +30 -0
- data/package.json +57 -0
- metadata +115 -50
- data/app/controllers/decidim/action_delegator/admin/results/sum_of_weights_controller.rb +0 -37
- data/app/controllers/decidim/action_delegator/verifications/sms/authorizations_controller_override.rb +0 -38
- data/app/packs/entrypoints/decidim_action_delegator_admin_action_delegator_js.js +0 -1
- data/app/packs/entrypoints/decidim_action_delegator_questions_js.js +0 -1
- data/app/packs/src/decidim/action_delegator/admin/action_delegator.js.es6 +0 -3
- data/app/packs/src/decidim/action_delegator/questions.js.es6 +0 -26
- data/app/permissions/decidim/action_delegator/consultations_permissions_extension.rb +0 -27
- data/app/presenters/decidim/action_delegator/admin/consultation_presenter.rb +0 -15
- data/app/presenters/decidim/action_delegator/admin/setting_presenter.rb +0 -13
- data/app/queries/decidim/action_delegator/decrypted_authorizations.rb +0 -112
- data/app/queries/decidim/action_delegator/json_build_object_query.rb +0 -45
- data/app/queries/decidim/action_delegator/voted_with_direct_verification.rb +0 -53
- data/app/views/decidim/action_delegator/_delegations_modal.html.erb +0 -93
- data/app/views/decidim/action_delegator/_link_to_delegations.html.erb +0 -5
- data/app/views/decidim/action_delegator/_link_to_question.html.erb +0 -5
- data/app/views/decidim/consultations/consultations/_question.html.erb +0 -41
- data/app/views/decidim/consultations/consultations/show.html.erb +0 -14
- data/app/views/decidim/consultations/question_multiple_votes/_form.html.erb +0 -25
- data/app/views/decidim/consultations/questions/_vote_button.html.erb +0 -106
- data/app/views/decidim/consultations/questions/_vote_modal.html.erb +0 -30
- data/app/views/decidim/consultations/questions/_vote_modal_confirm.html.erb +0 -38
- data/app/views/layouts/decidim/action_delegator/admin/_users_sidebar.html.erb +0 -56
- data/app/views/layouts/decidim/action_delegator/admin/delegations.html.erb +0 -13
- data/app/views/layouts/decidim/admin/consultation.html.erb +0 -56
- data/app/views/layouts/decidim/admin/question.html.erb +0 -98
- data/app/views/layouts/decidim/admin/users.html.erb +0 -7
- data/config/initializers/doorkeeper.rb +0 -492
- data/lib/json_key.rb +0 -10
- /data/app/commands/{decidim → concerns/decidim}/action_delegator/consultations/multiple_vote_question_override.rb +0 -0
- /data/app/controllers/decidim/action_delegator/admin/exports/{sum_of_weights_controller.rb → _sum_of_weights_controller.rb} +0 -0
- /data/app/forms/{decidim → concerns/decidim}/action_delegator/consultations/vote_form_override.rb +0 -0
- /data/app/models/{decidim → concerns/decidim}/action_delegator/consultations/vote_override.rb +0 -0
- /data/app/views/decidim/action_delegator/{_callout.html.erb → consultations/questions/_callout.html.erb} +0 -0
@@ -0,0 +1,85 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Decidim
|
4
|
+
module ActionDelegator
|
5
|
+
module Verifications
|
6
|
+
class DelegationsAuthorizer < Decidim::Verifications::DefaultActionAuthorizer
|
7
|
+
def authorize
|
8
|
+
status = super
|
9
|
+
return status unless status == [:ok, {}]
|
10
|
+
|
11
|
+
# if used outside a consultation, allow all
|
12
|
+
return [:ok, {}] if consultation.blank?
|
13
|
+
return [:ok, {}] if belongs_to_consultation? && user_in_census?
|
14
|
+
|
15
|
+
[:unauthorized, { extra_explanation: extra_explanations }]
|
16
|
+
end
|
17
|
+
|
18
|
+
private
|
19
|
+
|
20
|
+
def belongs_to_consultation?
|
21
|
+
return unless setting&.consultation
|
22
|
+
|
23
|
+
setting.consultation == consultation
|
24
|
+
end
|
25
|
+
|
26
|
+
def user_in_census?
|
27
|
+
return unless setting&.participants
|
28
|
+
|
29
|
+
setting.participants.exists?(decidim_user: authorization.user) || setting.participants.exists?(census_params)
|
30
|
+
end
|
31
|
+
|
32
|
+
def census_params
|
33
|
+
return @census_params if @census_params
|
34
|
+
|
35
|
+
@census_params = { email: authorization.user.email }
|
36
|
+
@census_params[:phone] = authorization.metadata["phone"] if setting.phone_required?
|
37
|
+
@census_params
|
38
|
+
end
|
39
|
+
|
40
|
+
def extra_explanations
|
41
|
+
return @extra_explanations if @extra_explanations
|
42
|
+
|
43
|
+
unless setting
|
44
|
+
return [{
|
45
|
+
key: "no_setting",
|
46
|
+
params: { scope: "decidim.action_delegator.delegations_authorizer" }
|
47
|
+
}]
|
48
|
+
end
|
49
|
+
|
50
|
+
@extra_explanations = [{
|
51
|
+
key: "not_in_census",
|
52
|
+
params: { scope: "decidim.action_delegator.delegations_authorizer" }
|
53
|
+
}]
|
54
|
+
|
55
|
+
@extra_explanations << {
|
56
|
+
key: "email",
|
57
|
+
params: { scope: "decidim.action_delegator.delegations_authorizer", email: authorization.user.email }
|
58
|
+
}
|
59
|
+
|
60
|
+
if setting.phone_required?
|
61
|
+
@extra_explanations << {
|
62
|
+
key: "phone",
|
63
|
+
params: { scope: "decidim.action_delegator.delegations_authorizer", phone: authorization.metadata["phone"] || "---" }
|
64
|
+
}
|
65
|
+
end
|
66
|
+
@extra_explanations
|
67
|
+
end
|
68
|
+
|
69
|
+
def setting
|
70
|
+
@setting ||= Decidim::ActionDelegator::Setting.find_by(consultation: consultation)
|
71
|
+
end
|
72
|
+
|
73
|
+
def consultation
|
74
|
+
@consultation ||= begin
|
75
|
+
component.participatory_space if component&.participatory_space.is_a?(Decidim::Consultation)
|
76
|
+
end
|
77
|
+
end
|
78
|
+
|
79
|
+
def manifest
|
80
|
+
@manifest ||= Decidim::Verifications.find_workflow_manifest(authorization&.name)
|
81
|
+
end
|
82
|
+
end
|
83
|
+
end
|
84
|
+
end
|
85
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Decidim
|
4
|
+
module ActionDelegator
|
5
|
+
module Verifications
|
6
|
+
module DelegationsVerifier
|
7
|
+
# This is an engine that authorizes users by sending them a code through an SMS.
|
8
|
+
class Engine < ::Rails::Engine
|
9
|
+
isolate_namespace Decidim::ActionDelegator::Verifications::DelegationsVerifier
|
10
|
+
|
11
|
+
paths["db/migrate"] = nil
|
12
|
+
paths["lib/tasks"] = nil
|
13
|
+
|
14
|
+
routes do
|
15
|
+
resource :authorizations, only: [:new, :create, :edit, :update, :destroy], as: :authorization do
|
16
|
+
get :renew, on: :collection
|
17
|
+
end
|
18
|
+
|
19
|
+
root to: "authorizations#new"
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
@@ -3,8 +3,8 @@
|
|
3
3
|
module Decidim
|
4
4
|
# This holds the decidim-action_delegator version.
|
5
5
|
module ActionDelegator
|
6
|
-
|
7
|
-
|
8
|
-
|
6
|
+
VERSION = "0.7.0"
|
7
|
+
DECIDIM_VERSION = "0.26.5"
|
8
|
+
COMPAT_DECIDIM_VERSION = [">= 0.26.0", "< 0.27"].freeze
|
9
9
|
end
|
10
10
|
end
|
@@ -1,5 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
+
require "decidim/action_delegator/verifications/delegations_authorizer"
|
4
|
+
require "decidim/action_delegator/verifications/delegations_verifier"
|
3
5
|
require "decidim/action_delegator/admin"
|
4
6
|
require "decidim/action_delegator/admin_engine"
|
5
7
|
require "decidim/action_delegator/engine"
|
@@ -7,6 +9,45 @@ require "decidim/action_delegator/engine"
|
|
7
9
|
module Decidim
|
8
10
|
# This namespace holds the logic of the `ActionDelegator` module
|
9
11
|
module ActionDelegator
|
12
|
+
include ActiveSupport::Configurable
|
13
|
+
|
14
|
+
# this is the SmsGateway provided by this module
|
15
|
+
# Note that it will be ignored if you provide your own SmsGateway in Decidm.sms_gateway_service
|
16
|
+
config_accessor :sms_gateway_service do
|
17
|
+
"Decidim::ActionDelegator::SmsGateway"
|
18
|
+
end
|
19
|
+
|
20
|
+
# The default expiration time for the integrated authorization
|
21
|
+
# if zero, the authorization won't be registered
|
22
|
+
config_accessor :authorization_expiration_time do
|
23
|
+
3.months
|
24
|
+
end
|
25
|
+
|
26
|
+
# Put this to false if you don't want to allow administrators to invite users not registered
|
27
|
+
# in the platform when uploading a census (inviting users without permission can be a GDPR offense).
|
28
|
+
config_accessor :allow_to_invite_users do
|
29
|
+
true
|
30
|
+
end
|
31
|
+
|
32
|
+
# used for comparing phone numbers from a census list and the ones introduced by the user
|
33
|
+
# the phone number will be normalized before comparing it so, for instance,
|
34
|
+
# if you have a census list with +34 666 666 666 and the user introduces 0034666666666 or 666666666, they will be considered the same
|
35
|
+
# can be empty or null if yo don't want to check different combinations of prefixes
|
36
|
+
config_accessor :phone_prefixes do
|
37
|
+
%w(+34 0034 34)
|
38
|
+
end
|
39
|
+
|
40
|
+
# The regex for validating phone numbers
|
41
|
+
config_accessor :phone_regex do
|
42
|
+
/^\d{6,15}$/ # 6 to 15 digits
|
43
|
+
end
|
44
|
+
|
45
|
+
# Consultations has an annoying and totally useless deprecation warning
|
46
|
+
# This plugin removes it by default.
|
47
|
+
# If you want to keep it, you can set this config to false
|
48
|
+
config_accessor :remove_consultation_deprecation_warning do
|
49
|
+
true
|
50
|
+
end
|
10
51
|
end
|
11
52
|
end
|
12
53
|
|
@@ -0,0 +1,30 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
namespace :action_delegator do
|
4
|
+
desc "Imports direct_verification existing authorizations into the participants table"
|
5
|
+
task import_direct_verifications: :environment do
|
6
|
+
Decidim::Organization.order(:id).find_each do |organization|
|
7
|
+
puts "Processing organization [#{organization.name}]"
|
8
|
+
settings = Decidim::ActionDelegator::OrganizationSettings.new(organization).query
|
9
|
+
authorizations = Decidim::Authorization.where(name: "direct_verifications", user: organization.users)
|
10
|
+
puts "Found #{authorizations.count} authorizations"
|
11
|
+
count = 0
|
12
|
+
authorizations.order(:id).each do |authorization|
|
13
|
+
weight = authorization.metadata["membership_weight"] || 1
|
14
|
+
type = authorization.metadata["membership_type"]
|
15
|
+
settings.find_each do |setting|
|
16
|
+
participant = setting.participants.find_or_initialize_by(email: authorization.user.email)
|
17
|
+
next unless participant.new_record?
|
18
|
+
|
19
|
+
participant.phone = authorization.metadata["membership_phone"]
|
20
|
+
participant.ponderation = setting.ponderations.find_or_initialize_by(weight: weight, name: (type.presence || "weight-#{weight}"))
|
21
|
+
if participant.save
|
22
|
+
puts "Imported authorization [#{authorization.id}] into participant [#{participant.email}] with ponderation [#{participant.ponderation.title}]"
|
23
|
+
count += 1
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
puts "Imported #{count} authorizations"
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
data/package.json
ADDED
@@ -0,0 +1,57 @@
|
|
1
|
+
{
|
2
|
+
"name": "decidim-action_delegator",
|
3
|
+
"version": "0.6.0",
|
4
|
+
"description": "Delgation actions (votes) for Decidim",
|
5
|
+
"main": "index.js",
|
6
|
+
"directories": {
|
7
|
+
"example": "examples",
|
8
|
+
"lib": "lib"
|
9
|
+
},
|
10
|
+
"scripts": {
|
11
|
+
"test": "echo \"Error: no test specified\" && exit 1",
|
12
|
+
"lint": "eslint -c .eslintrc.json --ext .js app/packs/",
|
13
|
+
"lint-fix": "eslint -c .eslintrc.json --ext .js app/packs/ --fix",
|
14
|
+
"stylelint": "stylelint **/*.scss",
|
15
|
+
"stylelint-fix": "stylelint **/*.scss --fix"
|
16
|
+
},
|
17
|
+
"repository": {
|
18
|
+
"type": "git",
|
19
|
+
"url": "git+https://github.com/coopdevs/decidim-module-action_delegator.git"
|
20
|
+
},
|
21
|
+
"keywords": [
|
22
|
+
"decidim"
|
23
|
+
],
|
24
|
+
"author": "ivan@pokecode.net",
|
25
|
+
"license": "AGPL-3.0-or-later",
|
26
|
+
"bugs": {
|
27
|
+
"url": "https://github.com/coopdevs/decidim-module-action_delegator/issues"
|
28
|
+
},
|
29
|
+
"homepage": "https://github.com/coopdevs/decidim-module-action_delegator#readme",
|
30
|
+
"stylelint": {
|
31
|
+
"extends": "@decidim/stylelint-config",
|
32
|
+
"rules" : {
|
33
|
+
"block-opening-brace-space-before": "always"
|
34
|
+
}
|
35
|
+
},
|
36
|
+
"devDependencies": {
|
37
|
+
"@babel/eslint-parser": "^7.19.1",
|
38
|
+
"@babel/plugin-proposal-class-properties": "^7.18.6",
|
39
|
+
"@babel/plugin-proposal-private-methods": "^7.18.6",
|
40
|
+
"@babel/plugin-proposal-private-property-in-object": "^7.20.5",
|
41
|
+
"@babel/plugin-transform-classes": "^7.20.7",
|
42
|
+
"@babel/plugin-transform-regenerator": "^7.20.5",
|
43
|
+
"@babel/plugin-transform-runtime": "^7.19.6",
|
44
|
+
"@babel/preset-env": "^7.20.2",
|
45
|
+
"@babel/preset-react": "^7.18.6",
|
46
|
+
"@decidim/dev": "0.27.1",
|
47
|
+
"@decidim/eslint-config": "0.27.1",
|
48
|
+
"@decidim/stylelint-config": "0.27.1",
|
49
|
+
"eslint-config-prettier": "^8.2.0",
|
50
|
+
"eslint-config-standard": "^11.0.0",
|
51
|
+
"eslint-plugin-import": "^2.22.0",
|
52
|
+
"eslint-plugin-standard": "^3.1.0",
|
53
|
+
"sass-embedded": "~1.57.1"
|
54
|
+
},
|
55
|
+
"dependencies": {
|
56
|
+
}
|
57
|
+
}
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
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.7.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Pau Pérez Fabregat
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2023-05-17 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: decidim-admin
|
@@ -20,7 +20,7 @@ dependencies:
|
|
20
20
|
version: 0.26.0
|
21
21
|
- - "<"
|
22
22
|
- !ruby/object:Gem::Version
|
23
|
-
version: 0.27
|
23
|
+
version: '0.27'
|
24
24
|
type: :runtime
|
25
25
|
prerelease: false
|
26
26
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -30,7 +30,7 @@ dependencies:
|
|
30
30
|
version: 0.26.0
|
31
31
|
- - "<"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 0.27
|
33
|
+
version: '0.27'
|
34
34
|
- !ruby/object:Gem::Dependency
|
35
35
|
name: decidim-consultations
|
36
36
|
requirement: !ruby/object:Gem::Requirement
|
@@ -40,7 +40,7 @@ dependencies:
|
|
40
40
|
version: 0.26.0
|
41
41
|
- - "<"
|
42
42
|
- !ruby/object:Gem::Version
|
43
|
-
version: 0.27
|
43
|
+
version: '0.27'
|
44
44
|
type: :runtime
|
45
45
|
prerelease: false
|
46
46
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -50,7 +50,7 @@ dependencies:
|
|
50
50
|
version: 0.26.0
|
51
51
|
- - "<"
|
52
52
|
- !ruby/object:Gem::Version
|
53
|
-
version: 0.27
|
53
|
+
version: '0.27'
|
54
54
|
- !ruby/object:Gem::Dependency
|
55
55
|
name: decidim-core
|
56
56
|
requirement: !ruby/object:Gem::Requirement
|
@@ -60,7 +60,7 @@ dependencies:
|
|
60
60
|
version: 0.26.0
|
61
61
|
- - "<"
|
62
62
|
- !ruby/object:Gem::Version
|
63
|
-
version: 0.27
|
63
|
+
version: '0.27'
|
64
64
|
type: :runtime
|
65
65
|
prerelease: false
|
66
66
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -70,7 +70,21 @@ dependencies:
|
|
70
70
|
version: 0.26.0
|
71
71
|
- - "<"
|
72
72
|
- !ruby/object:Gem::Version
|
73
|
-
version: 0.27
|
73
|
+
version: '0.27'
|
74
|
+
- !ruby/object:Gem::Dependency
|
75
|
+
name: deface
|
76
|
+
requirement: !ruby/object:Gem::Requirement
|
77
|
+
requirements:
|
78
|
+
- - ">="
|
79
|
+
- !ruby/object:Gem::Version
|
80
|
+
version: '1.9'
|
81
|
+
type: :runtime
|
82
|
+
prerelease: false
|
83
|
+
version_requirements: !ruby/object:Gem::Requirement
|
84
|
+
requirements:
|
85
|
+
- - ">="
|
86
|
+
- !ruby/object:Gem::Version
|
87
|
+
version: '1.9'
|
74
88
|
- !ruby/object:Gem::Dependency
|
75
89
|
name: savon
|
76
90
|
requirement: !ruby/object:Gem::Requirement
|
@@ -108,7 +122,7 @@ dependencies:
|
|
108
122
|
version: 0.26.0
|
109
123
|
- - "<"
|
110
124
|
- !ruby/object:Gem::Version
|
111
|
-
version: 0.27
|
125
|
+
version: '0.27'
|
112
126
|
type: :development
|
113
127
|
prerelease: false
|
114
128
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -118,12 +132,12 @@ dependencies:
|
|
118
132
|
version: 0.26.0
|
119
133
|
- - "<"
|
120
134
|
- !ruby/object:Gem::Version
|
121
|
-
version: 0.27
|
135
|
+
version: '0.27'
|
122
136
|
description: A tool for Decidim that provides extended functionalities for cooperatives
|
123
137
|
and allows delegated voting.
|
124
138
|
email:
|
125
139
|
- saulopefa@gmail.com
|
126
|
-
- ivan@
|
140
|
+
- ivan@pokecode.net
|
127
141
|
executables: []
|
128
142
|
extensions: []
|
129
143
|
extra_rdoc_files: []
|
@@ -131,56 +145,86 @@ files:
|
|
131
145
|
- LICENSE-AGPLv3.txt
|
132
146
|
- README.md
|
133
147
|
- 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
|
134
150
|
- app/commands/decidim/action_delegator/admin/create_delegation.rb
|
135
|
-
- app/commands/decidim/action_delegator/
|
136
|
-
- app/commands/decidim/action_delegator/
|
151
|
+
- app/commands/decidim/action_delegator/admin/create_participant.rb
|
152
|
+
- app/commands/decidim/action_delegator/admin/create_ponderation.rb
|
153
|
+
- app/commands/decidim/action_delegator/admin/create_setting.rb
|
154
|
+
- app/commands/decidim/action_delegator/admin/fix_resource_permissions.rb
|
155
|
+
- app/commands/decidim/action_delegator/admin/update_participant.rb
|
156
|
+
- app/commands/decidim/action_delegator/admin/update_ponderation.rb
|
157
|
+
- app/commands/decidim/action_delegator/admin/update_setting.rb
|
137
158
|
- app/commands/decidim/action_delegator/vote_delegation.rb
|
138
159
|
- 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
|
+
- app/controllers/concerns/decidim/action_delegator/needs_consultation_styles.rb
|
139
165
|
- app/controllers/decidim/action_delegator/admin/application_controller.rb
|
140
166
|
- app/controllers/decidim/action_delegator/admin/consultations/exports_controller.rb
|
141
167
|
- app/controllers/decidim/action_delegator/admin/consultations_controller.rb
|
142
168
|
- app/controllers/decidim/action_delegator/admin/delegations_controller.rb
|
143
|
-
- app/controllers/decidim/action_delegator/admin/exports/
|
144
|
-
- app/controllers/decidim/action_delegator/admin/
|
169
|
+
- app/controllers/decidim/action_delegator/admin/exports/_sum_of_weights_controller.rb
|
170
|
+
- app/controllers/decidim/action_delegator/admin/invite_participants_controller.rb
|
171
|
+
- app/controllers/decidim/action_delegator/admin/manage_delegations_controller.rb
|
172
|
+
- app/controllers/decidim/action_delegator/admin/manage_participants_controller.rb
|
173
|
+
- app/controllers/decidim/action_delegator/admin/participants_controller.rb
|
174
|
+
- app/controllers/decidim/action_delegator/admin/permissions_controller.rb
|
175
|
+
- app/controllers/decidim/action_delegator/admin/ponderations_controller.rb
|
145
176
|
- app/controllers/decidim/action_delegator/admin/settings_controller.rb
|
146
177
|
- app/controllers/decidim/action_delegator/application_controller.rb
|
147
|
-
- app/controllers/decidim/action_delegator/consultations/question_multiple_votes_controller_override.rb
|
148
|
-
- app/controllers/decidim/action_delegator/consultations/question_votes_controller_override.rb
|
149
178
|
- app/controllers/decidim/action_delegator/user_delegations_controller.rb
|
150
|
-
- app/controllers/decidim/action_delegator/verifications/
|
179
|
+
- app/controllers/decidim/action_delegator/verifications/delegations_verifier/authorizations_controller.rb
|
180
|
+
- app/forms/concerns/decidim/action_delegator/consultations/vote_form_override.rb
|
151
181
|
- app/forms/decidim/action_delegator/admin/delegation_form.rb
|
152
|
-
- app/forms/decidim/action_delegator/
|
182
|
+
- app/forms/decidim/action_delegator/admin/invitation_participant_form.rb
|
183
|
+
- app/forms/decidim/action_delegator/admin/participant_form.rb
|
184
|
+
- app/forms/decidim/action_delegator/admin/ponderation_form.rb
|
185
|
+
- app/forms/decidim/action_delegator/admin/setting_form.rb
|
186
|
+
- app/forms/decidim/action_delegator/verifications/delegations_verifier_form.rb
|
153
187
|
- app/helpers/decidim/action_delegator/admin/delegation_helper.rb
|
154
188
|
- app/helpers/decidim/action_delegator/application_helper.rb
|
189
|
+
- app/helpers/decidim/action_delegator/delegation_helper.rb
|
190
|
+
- app/jobs/decidim/action_delegator/admin/import_csv_job.rb
|
191
|
+
- app/jobs/decidim/action_delegator/admin/invite_participants_job.rb
|
155
192
|
- app/jobs/decidim/action_delegator/export_consultation_results_job.rb
|
156
193
|
- app/jobs/decidim/action_delegator/send_sms_job.rb
|
194
|
+
- app/jobs/decidim/action_delegator/sync_participants_job.rb
|
157
195
|
- app/jobs/decidim/action_delegator/twilio_send_sms_job.rb
|
196
|
+
- app/mailers/decidim/action_delegator/import_mailer.rb
|
197
|
+
- app/models/concerns/decidim/action_delegator/consultations/vote_override.rb
|
158
198
|
- app/models/decidim/action_delegator/application_record.rb
|
159
|
-
- app/models/decidim/action_delegator/consultations/vote_override.rb
|
160
199
|
- app/models/decidim/action_delegator/delegation.rb
|
200
|
+
- app/models/decidim/action_delegator/participant.rb
|
201
|
+
- app/models/decidim/action_delegator/ponderation.rb
|
161
202
|
- app/models/decidim/action_delegator/setting.rb
|
162
203
|
- app/models/decidim/action_delegator/unversioned_vote.rb
|
163
204
|
- app/models/decidim/action_delegator/whodunnit_vote.rb
|
205
|
+
- app/overrides/decidim/consultations/consultations/_question/add_delegation_link.html.erb.deface
|
206
|
+
- app/overrides/decidim/consultations/consultations/_regular_questions/remove_highlighted_scopes.html.erb.deface
|
207
|
+
- app/overrides/decidim/consultations/question_multiple_votes/_form/add_delegation_notice.html.erb.deface
|
208
|
+
- app/overrides/decidim/consultations/questions/_vote_button/add_delegations_link.html.erb.deface
|
209
|
+
- app/overrides/decidim/consultations/questions/_vote_button/add_modal.html.erb.deface
|
210
|
+
- app/overrides/decidim/consultations/questions/_vote_button/replace_delegation_to_multivote_link.html.erb.deface
|
211
|
+
- app/overrides/decidim/consultations/questions/_vote_modal/add_delegation_callout.html.erb.deface
|
212
|
+
- app/overrides/decidim/consultations/questions/_vote_modal_confirm/add_delegation_callout.html.erb.deface
|
213
|
+
- app/overrides/decidim/consultations/questions/_vote_modal_confirm/add_hidden_field.html.erb.deface
|
214
|
+
- app/overrides/layouts/decidim/admin/remove_deprecation.rb
|
164
215
|
- app/packs/entrypoints/decidim_action_delegator.scss
|
165
|
-
- app/packs/entrypoints/decidim_action_delegator_admin_action_delegator_js.js
|
166
216
|
- app/packs/entrypoints/decidim_action_delegator_questions.js
|
167
|
-
- app/packs/
|
168
|
-
- app/packs/src/decidim/action_delegator/admin/action_delegator.js.es6
|
169
|
-
- app/packs/src/decidim/action_delegator/questions.js.es6
|
217
|
+
- app/packs/src/decidim/action_delegator/questions.js
|
170
218
|
- app/packs/stylesheets/decidim/action_delegator/questions.scss
|
171
|
-
- app/permissions/decidim/action_delegator/
|
219
|
+
- app/permissions/concerns/decidim/action_delegator/consultations/permissions_override.rb
|
172
220
|
- app/permissions/decidim/action_delegator/permissions.rb
|
173
|
-
- app/presenters/decidim/action_delegator/admin/consultation_presenter.rb
|
174
|
-
- app/presenters/decidim/action_delegator/admin/setting_presenter.rb
|
175
221
|
- app/presenters/decidim/action_delegator/question_with_totals.rb
|
176
222
|
- app/queries/decidim/action_delegator/consultation_delegations.rb
|
177
|
-
- app/queries/decidim/action_delegator/decrypted_authorizations.rb
|
178
223
|
- app/queries/decidim/action_delegator/delegated_votes_versions.rb
|
179
224
|
- app/queries/decidim/action_delegator/delegates_votes_by_consultation.rb
|
180
225
|
- app/queries/decidim/action_delegator/delegates_votes_by_question.rb
|
181
226
|
- app/queries/decidim/action_delegator/delegation_votes.rb
|
182
227
|
- app/queries/decidim/action_delegator/grantee_delegations.rb
|
183
|
-
- app/queries/decidim/action_delegator/json_build_object_query.rb
|
184
228
|
- app/queries/decidim/action_delegator/organization_delegations.rb
|
185
229
|
- app/queries/decidim/action_delegator/organization_settings.rb
|
186
230
|
- app/queries/decidim/action_delegator/published_responses.rb
|
@@ -190,38 +234,51 @@ files:
|
|
190
234
|
- app/queries/decidim/action_delegator/sum_of_membership_weight.rb
|
191
235
|
- app/queries/decidim/action_delegator/sum_of_weights.rb
|
192
236
|
- app/queries/decidim/action_delegator/type_and_weight.rb
|
193
|
-
- app/queries/decidim/action_delegator/
|
237
|
+
- app/queries/decidim/action_delegator/voted_with_ponderations.rb
|
194
238
|
- app/queries/decidim/action_delegator/votes_count_aggregation.rb
|
195
239
|
- app/serializers/decidim/action_delegator/consultation_results_serializer.rb
|
196
240
|
- app/serializers/decidim/action_delegator/sum_of_weights_serializer.rb
|
241
|
+
- app/services/decidim/action_delegator/csv_importer.rb
|
242
|
+
- app/services/decidim/action_delegator/delegations_csv_importer.rb
|
243
|
+
- app/services/decidim/action_delegator/participants_csv_importer.rb
|
197
244
|
- app/services/decidim/action_delegator/sms_gateway.rb
|
198
|
-
- app/views/decidim/action_delegator/_callout.html.erb
|
199
|
-
- app/views/decidim/action_delegator/_delegations_modal.html.erb
|
200
|
-
- app/views/decidim/action_delegator/_link_to_delegations.html.erb
|
201
|
-
- app/views/decidim/action_delegator/_link_to_question.html.erb
|
202
245
|
- app/views/decidim/action_delegator/admin/consultations/results.html.erb
|
246
|
+
- app/views/decidim/action_delegator/admin/consultations/weighted_results.html.erb
|
203
247
|
- app/views/decidim/action_delegator/admin/delegations/index.html.erb
|
204
248
|
- app/views/decidim/action_delegator/admin/delegations/new.html.erb
|
205
|
-
- app/views/decidim/action_delegator/admin/
|
249
|
+
- app/views/decidim/action_delegator/admin/manage_delegations/new.html.erb
|
250
|
+
- app/views/decidim/action_delegator/admin/manage_participants/new.html.erb
|
251
|
+
- app/views/decidim/action_delegator/admin/participants/_form.html.erb
|
252
|
+
- app/views/decidim/action_delegator/admin/participants/_missing_registered_check.html.erb
|
253
|
+
- app/views/decidim/action_delegator/admin/participants/edit.html.erb
|
254
|
+
- app/views/decidim/action_delegator/admin/participants/index.html.erb
|
255
|
+
- app/views/decidim/action_delegator/admin/participants/new.html.erb
|
256
|
+
- app/views/decidim/action_delegator/admin/ponderations/_form.html.erb
|
257
|
+
- app/views/decidim/action_delegator/admin/ponderations/edit.html.erb
|
258
|
+
- app/views/decidim/action_delegator/admin/ponderations/index.html.erb
|
259
|
+
- app/views/decidim/action_delegator/admin/ponderations/new.html.erb
|
260
|
+
- app/views/decidim/action_delegator/admin/settings/_check_verifier.html.erb
|
261
|
+
- app/views/decidim/action_delegator/admin/settings/_form.html.erb
|
262
|
+
- app/views/decidim/action_delegator/admin/settings/_participants_email_check.html.erb
|
263
|
+
- app/views/decidim/action_delegator/admin/settings/_participants_sync_check.html.erb
|
264
|
+
- app/views/decidim/action_delegator/admin/settings/_setting_checks.html.erb
|
265
|
+
- app/views/decidim/action_delegator/admin/settings/edit.html.erb
|
206
266
|
- app/views/decidim/action_delegator/admin/settings/index.html.erb
|
207
267
|
- app/views/decidim/action_delegator/admin/settings/new.html.erb
|
268
|
+
- app/views/decidim/action_delegator/consultations/_link_to_question.html.erb
|
269
|
+
- app/views/decidim/action_delegator/consultations/questions/_callout.html.erb
|
270
|
+
- app/views/decidim/action_delegator/consultations/questions/_delegations_modal.html.erb
|
271
|
+
- app/views/decidim/action_delegator/consultations/questions/_link_to_delegations.html.erb
|
272
|
+
- app/views/decidim/action_delegator/consultations/questions/_vote_delegated_active.html.erb
|
273
|
+
- app/views/decidim/action_delegator/consultations/questions/_vote_delegated_finished.html.erb
|
274
|
+
- app/views/decidim/action_delegator/consultations/questions/_vote_delegated_upcoming.html.erb
|
275
|
+
- app/views/decidim/action_delegator/import_mailer/import.html.erb
|
208
276
|
- app/views/decidim/action_delegator/user_delegations/index.html.erb
|
209
|
-
- app/views/decidim/
|
210
|
-
- app/views/decidim/
|
211
|
-
- app/views/decidim/consultations/question_multiple_votes/_form.html.erb
|
277
|
+
- app/views/decidim/action_delegator/verifications/delegations_verifier/authorizations/edit.html.erb
|
278
|
+
- app/views/decidim/action_delegator/verifications/delegations_verifier/authorizations/new.html.erb
|
212
279
|
- app/views/decidim/consultations/question_votes/update_vote_button.js.erb
|
213
|
-
- app/views/decidim/consultations/questions/_vote_button.html.erb
|
214
|
-
- app/views/decidim/consultations/questions/_vote_modal.html.erb
|
215
|
-
- app/views/decidim/consultations/questions/_vote_modal_confirm.html.erb
|
216
|
-
- app/views/decidim/verifications/sms/authorizations/new.html.erb
|
217
|
-
- app/views/layouts/decidim/action_delegator/admin/_users_sidebar.html.erb
|
218
|
-
- app/views/layouts/decidim/action_delegator/admin/delegations.html.erb
|
219
|
-
- app/views/layouts/decidim/admin/consultation.html.erb
|
220
|
-
- app/views/layouts/decidim/admin/question.html.erb
|
221
|
-
- app/views/layouts/decidim/admin/users.html.erb
|
222
280
|
- config/assets.rb
|
223
281
|
- config/i18n-tasks.yml
|
224
|
-
- config/initializers/doorkeeper.rb
|
225
282
|
- config/locales/ca.yml
|
226
283
|
- config/locales/cs.yml
|
227
284
|
- config/locales/en.yml
|
@@ -234,14 +291,22 @@ files:
|
|
234
291
|
- db/migrate/20201005203554_add_setting_granter_unique_index_to_delegations.rb
|
235
292
|
- db/migrate/20201006084522_remove_setting_id_index_from_delegations.rb
|
236
293
|
- db/migrate/20201030164808_add_delegation_id_to_versions.rb
|
294
|
+
- db/migrate/20230323101247_create_decidim_action_delegator_ponderations.rb
|
295
|
+
- db/migrate/20230323210000_create_decidim_action_delegator_participants.rb
|
296
|
+
- db/migrate/20230323223752_add_decidim_action_delegator_verification_method.rb
|
297
|
+
- db/migrate/20230412105710_add_decidim_action_delegator_participants_user_id.rb
|
237
298
|
- db/seeds.rb
|
238
299
|
- lib/decidim/action_delegator.rb
|
239
300
|
- lib/decidim/action_delegator/admin.rb
|
240
301
|
- lib/decidim/action_delegator/admin_engine.rb
|
241
302
|
- lib/decidim/action_delegator/engine.rb
|
242
303
|
- lib/decidim/action_delegator/test/factories.rb
|
304
|
+
- lib/decidim/action_delegator/verifications/delegations_authorizer.rb
|
305
|
+
- lib/decidim/action_delegator/verifications/delegations_verifier.rb
|
306
|
+
- lib/decidim/action_delegator/verifications/delegations_verifier/engine.rb
|
243
307
|
- lib/decidim/action_delegator/version.rb
|
244
|
-
- lib/
|
308
|
+
- lib/tasks/import_direct_verification.rake
|
309
|
+
- package.json
|
245
310
|
homepage: https://github.com/coopdevs/decidim-module-action_delegator
|
246
311
|
licenses:
|
247
312
|
- AGPL-3.0
|
@@ -254,7 +319,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
254
319
|
requirements:
|
255
320
|
- - ">="
|
256
321
|
- !ruby/object:Gem::Version
|
257
|
-
version: 2.7
|
322
|
+
version: '2.7'
|
258
323
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
259
324
|
requirements:
|
260
325
|
- - ">="
|
@@ -1,37 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Decidim
|
4
|
-
module ActionDelegator
|
5
|
-
module Admin
|
6
|
-
module Results
|
7
|
-
class SumOfWeightsController < Decidim::Consultations::Admin::ConsultationsController
|
8
|
-
def index
|
9
|
-
params[:slug] = params[:consultation_slug]
|
10
|
-
|
11
|
-
enforce_permission_to :read, :consultation, consultation: current_consultation
|
12
|
-
|
13
|
-
@questions = Scrutiny.new(current_consultation).questions
|
14
|
-
@responses = responses.group_by(&:question_id)
|
15
|
-
@total_delegates = DelegatesVotesByConsultation.new(current_consultation).query
|
16
|
-
|
17
|
-
render layout: "decidim/admin/consultation"
|
18
|
-
end
|
19
|
-
|
20
|
-
private
|
21
|
-
|
22
|
-
def permission_class_chain
|
23
|
-
Decidim.permissions_registry.chain_for(ActionDelegator::Admin::ApplicationController)
|
24
|
-
end
|
25
|
-
|
26
|
-
def questions
|
27
|
-
current_consultation.questions.published.includes(:responses)
|
28
|
-
end
|
29
|
-
|
30
|
-
def responses
|
31
|
-
SumOfWeights.new(current_consultation).query
|
32
|
-
end
|
33
|
-
end
|
34
|
-
end
|
35
|
-
end
|
36
|
-
end
|
37
|
-
end
|