decidim-action_delegator 0.7.2 → 0.8.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +43 -13
- data/app/commands/decidim/action_delegator/admin/create_delegation.rb +1 -1
- data/app/commands/decidim/action_delegator/admin/create_participant.rb +1 -1
- data/app/commands/decidim/action_delegator/admin/create_ponderation.rb +1 -1
- data/app/commands/decidim/action_delegator/admin/create_setting.rb +1 -1
- data/app/commands/decidim/action_delegator/admin/fix_resource_permissions.rb +1 -1
- data/app/commands/decidim/action_delegator/admin/update_participant.rb +1 -1
- data/app/commands/decidim/action_delegator/admin/update_ponderation.rb +1 -1
- data/app/commands/decidim/action_delegator/admin/update_setting.rb +1 -1
- data/app/controllers/concerns/decidim/action_delegator/devise/sessions_controller_override.rb +48 -0
- data/app/controllers/decidim/action_delegator/admin/consultations_controller.rb +1 -1
- data/app/controllers/decidim/action_delegator/admin/delegations_controller.rb +1 -1
- data/app/controllers/decidim/action_delegator/admin/manage_delegations_controller.rb +3 -4
- data/app/controllers/decidim/action_delegator/admin/manage_participants_controller.rb +2 -3
- data/app/controllers/decidim/action_delegator/admin/settings_controller.rb +1 -1
- data/app/controllers/decidim/action_delegator/questions_summary_controller.rb +14 -0
- data/app/controllers/decidim/action_delegator/verifications/delegations_verifier/authorizations_controller.rb +38 -15
- data/app/forms/decidim/action_delegator/admin/delegation_form.rb +6 -2
- data/app/forms/decidim/action_delegator/verifications/delegations_verifier_form.rb +7 -5
- data/app/helpers/decidim/action_delegator/admin/delegation_helper.rb +1 -1
- data/app/jobs/decidim/action_delegator/send_sms_job.rb +1 -0
- data/app/models/concerns/decidim/action_delegator/consultations/question_override.rb +36 -0
- data/app/models/decidim/action_delegator/delegation.rb +25 -0
- data/app/models/decidim/action_delegator/participant.rb +15 -11
- data/app/overrides/decidim/consultations/admin/consultations/results/add_ongoing_warning.html.erb.deface +3 -0
- data/app/overrides/decidim/consultations/consultations/_question/replace_vote_info.html.erb.deface +4 -0
- data/app/overrides/decidim/consultations/questions/_results/replace_results.html.erb.deface +3 -0
- data/app/overrides/decidim/consultations/questions/_vote_button/add_modal.html.erb.deface +1 -1
- data/app/overrides/decidim/consultations/questions/_vote_button/add_modal_javascript.html.erb.deface +3 -0
- data/app/overrides/layouts/decidim/_consultation_header/add_consultation_callout.html.erb.deface +9 -0
- data/app/overrides/layouts/decidim/_question_header/add_consultation_callout.html.erb.deface +9 -0
- data/app/packs/entrypoints/decidim_action_delegator_questions_summary.js +1 -0
- data/app/packs/src/decidim/action_delegator/questions.js +6 -0
- data/app/packs/src/decidim/action_delegator/summary.js +24 -0
- data/app/packs/stylesheets/decidim/action_delegator/questions.scss +1 -1
- data/app/queries/decidim/action_delegator/consultation_delegations.rb +1 -1
- data/app/queries/decidim/action_delegator/delegates_votes_by_consultation.rb +1 -1
- data/app/queries/decidim/action_delegator/delegates_votes_by_question.rb +1 -1
- data/app/queries/decidim/action_delegator/delegation_votes.rb +1 -1
- data/app/queries/decidim/action_delegator/organization_delegations.rb +1 -1
- data/app/queries/decidim/action_delegator/organization_settings.rb +1 -1
- data/app/queries/decidim/action_delegator/{published_responses.rb → responses.rb} +1 -2
- data/app/queries/decidim/action_delegator/responses_by_membership.rb +1 -1
- data/app/queries/decidim/action_delegator/setting_delegations.rb +1 -1
- data/app/queries/decidim/action_delegator/sum_of_membership_weight.rb +1 -1
- data/app/queries/decidim/action_delegator/sum_of_weights.rb +2 -2
- data/app/queries/decidim/action_delegator/type_and_weight.rb +2 -2
- data/app/queries/decidim/action_delegator/voted_with_ponderations.rb +1 -1
- data/app/services/decidim/action_delegator/delegations_csv_importer.rb +3 -3
- data/app/views/decidim/action_delegator/admin/consultations/_ongoing_consultation_warning.html.erb +3 -0
- data/app/views/decidim/action_delegator/admin/consultations/results.html.erb +3 -0
- data/app/views/decidim/action_delegator/admin/consultations/weighted_results.html.erb +3 -0
- data/app/views/decidim/action_delegator/admin/delegations/new.html.erb +24 -26
- data/app/views/decidim/action_delegator/admin/manage_delegations/new.html.erb +27 -22
- data/app/views/decidim/action_delegator/admin/manage_participants/new.html.erb +3 -1
- data/app/views/decidim/action_delegator/admin/participants/edit.html.erb +14 -16
- data/app/views/decidim/action_delegator/admin/participants/new.html.erb +14 -16
- data/app/views/decidim/action_delegator/admin/ponderations/edit.html.erb +14 -16
- data/app/views/decidim/action_delegator/admin/ponderations/new.html.erb +14 -16
- data/app/views/decidim/action_delegator/consultations/_link_with_results.html.erb +11 -0
- data/app/views/decidim/action_delegator/consultations/questions/_delegations_modal.html.erb +0 -2
- data/app/views/decidim/action_delegator/consultations/questions/_link_to_delegations.html.erb +9 -5
- data/app/views/decidim/action_delegator/consultations/questions/_weight_results.html.erb +8 -0
- data/app/views/decidim/consultations/question_votes/_callout.html.erb +47 -0
- data/app/views/decidim/consultations/question_votes/update_vote_button.js.erb +55 -5
- data/config/assets.rb +2 -1
- data/config/locales/ca.yml +97 -40
- data/config/locales/en.yml +13 -1
- data/config/locales/es.yml +106 -46
- data/lib/decidim/action_delegator/admin_engine.rb +15 -1
- data/lib/decidim/action_delegator/engine.rb +4 -1
- data/lib/decidim/action_delegator/verifications/delegations_authorizer.rb +1 -3
- data/lib/decidim/action_delegator/version.rb +3 -3
- data/lib/decidim/action_delegator.rb +12 -1
- metadata +38 -22
@@ -4,6 +4,7 @@ $(() => {
|
|
4
4
|
delegationCalloutsMessage = $(".delegation-callout-message"),
|
5
5
|
delegationDialog = $("#delegations-modal"),
|
6
6
|
delegationField = $("#decidim_consultations_delegation_id"),
|
7
|
+
delegationUnVoteButtons = $(".delegation_unvote_button"),
|
7
8
|
delegationVoteButtons = $(".delegation-vote-button"),
|
8
9
|
delegationsButton = $("#delegations-button"),
|
9
10
|
voteButton = $("#vote_button"),
|
@@ -21,6 +22,11 @@ $(() => {
|
|
21
22
|
delegationCallouts.removeClass("is-hidden");
|
22
23
|
});
|
23
24
|
|
25
|
+
delegationUnVoteButtons.click(() => {
|
26
|
+
delegationDialog.foundation("close");
|
27
|
+
delegationCallouts.addClass("is-hidden");
|
28
|
+
});
|
29
|
+
|
24
30
|
voteButton.click(() => {
|
25
31
|
delegationCallouts.addClass("is-hidden");
|
26
32
|
});
|
@@ -0,0 +1,24 @@
|
|
1
|
+
$(() => {
|
2
|
+
const $usersAnswers = $("#user-answers-summary");
|
3
|
+
const path = $usersAnswers.data("summaryPath");
|
4
|
+
let $button = $("#consultations-questions-summary-button");
|
5
|
+
let $modal = $("#consultations-questions-summary-modal");
|
6
|
+
const $div = $(".question-vote-cabin").parent();
|
7
|
+
const openModal = (evt) => {
|
8
|
+
evt.preventDefault();
|
9
|
+
$modal.foundation("open");
|
10
|
+
};
|
11
|
+
|
12
|
+
$button.on("click", openModal);
|
13
|
+
|
14
|
+
$div.bind("DOMSubtreeModified", function() {
|
15
|
+
// console.log("tree changed", path);
|
16
|
+
$usersAnswers.load(path, () => {
|
17
|
+
$button = $usersAnswers.find("#consultations-questions-summary-button");
|
18
|
+
$modal = $usersAnswers.find("#consultations-questions-summary-modal");
|
19
|
+
// console.log("usersanswer loaded")
|
20
|
+
$usersAnswers.foundation();
|
21
|
+
$button.on("click", openModal);
|
22
|
+
});
|
23
|
+
});
|
24
|
+
});
|
@@ -5,7 +5,7 @@ module Decidim
|
|
5
5
|
# This query object replaces the ActiveRecord association we would have between the Vote and
|
6
6
|
# Delegation models. Unfortunately we can't use custom foreign keys on both ends of the
|
7
7
|
# association so this aims to replace `delegation.votes`.
|
8
|
-
class DelegationVotes <
|
8
|
+
class DelegationVotes < Decidim::Query
|
9
9
|
def query
|
10
10
|
Delegation.joins(
|
11
11
|
delegations.join(votes).on(vote_author_eq_granter).join_sources
|
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
module Decidim
|
4
4
|
module ActionDelegator
|
5
|
-
class
|
5
|
+
class Responses < Decidim::Query
|
6
6
|
def initialize(consultation)
|
7
7
|
@consultation = consultation
|
8
8
|
end
|
@@ -12,7 +12,6 @@ module Decidim
|
|
12
12
|
def query
|
13
13
|
Decidim::Consultations::Response
|
14
14
|
.joins(question: :consultation)
|
15
|
-
.merge(Consultation.finished)
|
16
15
|
.where(decidim_consultations_questions: { decidim_consultation_id: consultation.id })
|
17
16
|
.where.not(decidim_consultations_questions: { published_at: nil })
|
18
17
|
end
|
@@ -3,7 +3,7 @@
|
|
3
3
|
module Decidim
|
4
4
|
module ActionDelegator
|
5
5
|
# Returns total votes of each response by memberships' type and weight.
|
6
|
-
class ResponsesByMembership <
|
6
|
+
class ResponsesByMembership < Decidim::Query
|
7
7
|
DEFAULT_METADATA = I18n.t("decidim.admin.consultations.results.default_metadata")
|
8
8
|
|
9
9
|
def initialize(relation)
|
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
module Decidim
|
4
4
|
module ActionDelegator
|
5
|
-
class SumOfWeights <
|
5
|
+
class SumOfWeights < Decidim::Query
|
6
6
|
def initialize(consultation)
|
7
7
|
@consultation = consultation
|
8
8
|
end
|
@@ -17,7 +17,7 @@ module Decidim
|
|
17
17
|
|
18
18
|
def published_questions_responses
|
19
19
|
VotedWithPonderations.new(
|
20
|
-
|
20
|
+
Responses.new(consultation).query
|
21
21
|
).query
|
22
22
|
end
|
23
23
|
end
|
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
module Decidim
|
4
4
|
module ActionDelegator
|
5
|
-
class TypeAndWeight <
|
5
|
+
class TypeAndWeight < Decidim::Query
|
6
6
|
def initialize(consultation)
|
7
7
|
@consultation = consultation
|
8
8
|
end
|
@@ -19,7 +19,7 @@ module Decidim
|
|
19
19
|
# Returns the published questions' responses of the given consultation as an ActiveRecord
|
20
20
|
# Relation. Note this enables us to the chain it with other AR Relation objects.
|
21
21
|
def published_questions_responses
|
22
|
-
|
22
|
+
Responses.new(consultation).query
|
23
23
|
end
|
24
24
|
end
|
25
25
|
end
|
@@ -23,7 +23,7 @@ module Decidim
|
|
23
23
|
grantee_email: row["to"].to_s.strip.downcase
|
24
24
|
}
|
25
25
|
|
26
|
-
@form = form(Decidim::ActionDelegator::Admin::DelegationForm).from_params(params, setting: @current_setting)
|
26
|
+
@form = form(Decidim::ActionDelegator::Admin::DelegationForm).from_params(params, setting: @current_setting, current_organization: @current_setting.organization)
|
27
27
|
|
28
28
|
{
|
29
29
|
granter_id: @form.granter&.id,
|
@@ -31,8 +31,8 @@ module Decidim
|
|
31
31
|
}
|
32
32
|
end
|
33
33
|
|
34
|
-
def delegation_exists?(
|
35
|
-
@delegation = Delegation.find_by(
|
34
|
+
def delegation_exists?(_params)
|
35
|
+
@delegation = Delegation.find_by(granter: @form.granter, grantee: @form.grantee)
|
36
36
|
|
37
37
|
@delegation.present?
|
38
38
|
end
|
@@ -24,6 +24,9 @@
|
|
24
24
|
</h2>
|
25
25
|
</div>
|
26
26
|
<div class="card-section">
|
27
|
+
|
28
|
+
<%= render "ongoing_consultation_warning", consultation: current_consultation %>
|
29
|
+
|
27
30
|
<table id="results" class="table-list">
|
28
31
|
<% questions.each do |question| %>
|
29
32
|
<% unless question.external_voting %>
|
@@ -1,33 +1,31 @@
|
|
1
1
|
<div class="card">
|
2
|
-
<div class="card-
|
3
|
-
<
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
</div>
|
10
|
-
|
11
|
-
<div class="card-section">
|
12
|
-
<%= decidim_form_for @form, url: { action: "create" }, html: { class: "form new_delegation" } do |f| %>
|
13
|
-
<% prompt_options = { url: decidim_admin.users_organization_url, placeholder: t(".select_member") } %>
|
2
|
+
<div class="card-divider">
|
3
|
+
<h2 class="card-title">
|
4
|
+
<%= link_to translated_attribute(current_setting.title), decidim_admin_action_delegator.settings_path %> >
|
5
|
+
<%= link_to t("title", scope: "decidim.action_delegator.admin.delegations.index"), decidim_admin_action_delegator.setting_delegations_path(current_setting) %> >
|
6
|
+
<%= t ".title" %>
|
7
|
+
</h2>
|
8
|
+
</div>
|
14
9
|
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
end %>
|
19
|
-
</div>
|
20
|
-
<div class="row column">
|
21
|
-
<%= f.autocomplete_select(:grantee_id, @form.grantee, { multiple: false, label: t(".grantee") }, prompt_options) do |user|
|
22
|
-
{ value: user.id, label: "#{user.name} (@#{user.nickname})" }
|
23
|
-
end %>
|
24
|
-
</div>
|
10
|
+
<div class="card-section">
|
11
|
+
<%= decidim_form_for @form, url: { action: "create" }, html: { class: "form new_delegation" } do |f| %>
|
12
|
+
<% prompt_options = { url: decidim_admin.users_organization_url, placeholder: t(".select_member") } %>
|
25
13
|
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
14
|
+
<div class="row column">
|
15
|
+
<%= f.autocomplete_select(:granter_id, @form.granter, { multiple: false, label: t(".granter") }, prompt_options) do |user|
|
16
|
+
{ value: user.id, label: "#{user.name} (@#{user.nickname})" }
|
17
|
+
end %>
|
18
|
+
</div>
|
19
|
+
<div class="row column">
|
20
|
+
<%= f.autocomplete_select(:grantee_id, @form.grantee, { multiple: false, label: t(".grantee") }, prompt_options) do |user|
|
21
|
+
{ value: user.id, label: "#{user.name} (@#{user.nickname})" }
|
22
|
+
end %>
|
23
|
+
</div>
|
30
24
|
|
25
|
+
<div class="button--double form-general-submit">
|
26
|
+
<%= f.submit t(".save") %>
|
31
27
|
</div>
|
28
|
+
<% end %>
|
29
|
+
|
32
30
|
</div>
|
33
31
|
</div>
|
@@ -1,25 +1,30 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
</div>
|
9
|
-
</div>
|
10
|
-
<p><%= t(".upload_instructions") %></p>
|
11
|
-
<p><%= t(".required_fields") %></p>
|
12
|
-
<p><%= t(".title_example") %></p>
|
13
|
-
<pre class="code-block">
|
14
|
-
from,to
|
15
|
-
user_1@example.org,user_2@example.org
|
16
|
-
user_3@example.org,user_4@example.org
|
17
|
-
...</pre>
|
18
|
-
<div class="row column">
|
19
|
-
<%= file_field_tag :csv_file %>
|
1
|
+
<div class="card">
|
2
|
+
<div class="card-divider">
|
3
|
+
<h2 class="card-title">
|
4
|
+
<%= link_to translated_attribute(current_setting.title), decidim_admin_action_delegator.settings_path %> >
|
5
|
+
<%= link_to t("title", scope: "decidim.action_delegator.admin.delegations.index"), decidim_admin_action_delegator.setting_delegations_path(current_setting) %> >
|
6
|
+
<%= t ".title" %>
|
7
|
+
</h2>
|
20
8
|
</div>
|
21
9
|
|
22
|
-
<div class="
|
23
|
-
<%=
|
10
|
+
<div class="card-section">
|
11
|
+
<%= form_tag(setting_manage_delegations_path, multipart: true, class: "form new_import") do %>
|
12
|
+
<%= hidden_field_tag :setting_id, current_setting.id %>
|
13
|
+
<p><%= t(".upload_instructions") %></p>
|
14
|
+
<p><%= t(".required_fields") %></p>
|
15
|
+
<p><%= t(".title_example") %></p>
|
16
|
+
<pre class="code-block">
|
17
|
+
from,to
|
18
|
+
user_1@example.org,user_2@example.org
|
19
|
+
user_3@example.org,user_4@example.org
|
20
|
+
...</pre>
|
21
|
+
<div class="row column">
|
22
|
+
<%= file_field_tag :csv_file %>
|
23
|
+
</div>
|
24
|
+
|
25
|
+
<div class="button--double form-general-submit">
|
26
|
+
<%= submit_tag t(".import"), class: "button" %>
|
27
|
+
</div>
|
28
|
+
<% end %>
|
24
29
|
</div>
|
25
|
-
|
30
|
+
</div>
|
@@ -3,7 +3,9 @@
|
|
3
3
|
<div class="card">
|
4
4
|
<div class="card-divider">
|
5
5
|
<h2 class="card-title">
|
6
|
-
<%=
|
6
|
+
<%= link_to translated_attribute(current_setting.title), decidim_admin_action_delegator.settings_path %> >
|
7
|
+
<%= link_to t("title", scope: "decidim.action_delegator.admin.participants.index"), decidim_admin_action_delegator.setting_participants_path(current_setting) %> >
|
8
|
+
<%= t ".title" %>
|
7
9
|
</h2>
|
8
10
|
</div>
|
9
11
|
</div>
|
@@ -1,21 +1,19 @@
|
|
1
1
|
<div class="card">
|
2
|
-
<div class="card-
|
3
|
-
<
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
</div>
|
2
|
+
<div class="card-divider">
|
3
|
+
<h2 class="card-title">
|
4
|
+
<%= link_to translated_attribute(current_setting.title), decidim_admin_action_delegator.settings_path %> >
|
5
|
+
<%= link_to t("title", scope: "decidim.action_delegator.admin.participants.index"), decidim_admin_action_delegator.setting_participants_path(current_setting) %> >
|
6
|
+
<%= t ".title" %>
|
7
|
+
</h2>
|
8
|
+
</div>
|
10
9
|
|
11
|
-
|
12
|
-
|
13
|
-
|
10
|
+
<div class="card-section">
|
11
|
+
<%= decidim_form_for @form, url: { action: "update" }, html: { class: "form edit_ponderation" } do |f| %>
|
12
|
+
<%= render partial: "form", object: f %>
|
14
13
|
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
</div>
|
14
|
+
<div class="button--double form-general-submit">
|
15
|
+
<%= f.submit t(".save") %>
|
16
|
+
</div>
|
17
|
+
<% end %>
|
20
18
|
</div>
|
21
19
|
</div>
|
@@ -1,21 +1,19 @@
|
|
1
1
|
<div class="card">
|
2
|
-
<div class="card-
|
3
|
-
<
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
</div>
|
2
|
+
<div class="card-divider">
|
3
|
+
<h2 class="card-title">
|
4
|
+
<%= link_to translated_attribute(current_setting.title), decidim_admin_action_delegator.settings_path %> >
|
5
|
+
<%= link_to t("title", scope: "decidim.action_delegator.admin.participants.index"), decidim_admin_action_delegator.setting_participants_path(current_setting) %> >
|
6
|
+
<%= t ".title" %>
|
7
|
+
</h2>
|
8
|
+
</div>
|
10
9
|
|
11
|
-
|
12
|
-
|
13
|
-
|
10
|
+
<div class="card-section">
|
11
|
+
<%= decidim_form_for @form, url: { action: "create" }, html: { class: "form new_participant" } do |f| %>
|
12
|
+
<%= render partial: "form", object: f %>
|
14
13
|
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
</div>
|
14
|
+
<div class="button--double form-general-submit">
|
15
|
+
<%= f.submit t(".save") %>
|
16
|
+
</div>
|
17
|
+
<% end %>
|
20
18
|
</div>
|
21
19
|
</div>
|
@@ -1,21 +1,19 @@
|
|
1
1
|
<div class="card">
|
2
|
-
<div class="card-
|
3
|
-
<
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
</div>
|
2
|
+
<div class="card-divider">
|
3
|
+
<h2 class="card-title">
|
4
|
+
<%= link_to translated_attribute(current_setting.title), decidim_admin_action_delegator.settings_path %> >
|
5
|
+
<%= link_to t("title", scope: "decidim.action_delegator.admin.ponderations.index"), decidim_admin_action_delegator.setting_ponderations_path(current_setting) %> >
|
6
|
+
<%= t ".title" %>
|
7
|
+
</h2>
|
8
|
+
</div>
|
10
9
|
|
11
|
-
|
12
|
-
|
13
|
-
|
10
|
+
<div class="card-section">
|
11
|
+
<%= decidim_form_for @form, url: { action: "update" }, html: { class: "form edit_ponderation" } do |f| %>
|
12
|
+
<%= render partial: "form", object: f %>
|
14
13
|
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
</div>
|
14
|
+
<div class="button--double form-general-submit">
|
15
|
+
<%= f.submit t(".save") %>
|
16
|
+
</div>
|
17
|
+
<% end %>
|
20
18
|
</div>
|
21
19
|
</div>
|
@@ -1,21 +1,19 @@
|
|
1
1
|
<div class="card">
|
2
|
-
<div class="card-
|
3
|
-
<
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
</div>
|
2
|
+
<div class="card-divider">
|
3
|
+
<h2 class="card-title">
|
4
|
+
<%= link_to translated_attribute(current_setting.title), decidim_admin_action_delegator.settings_path %> >
|
5
|
+
<%= link_to t("title", scope: "decidim.action_delegator.admin.ponderations.index"), decidim_admin_action_delegator.setting_ponderations_path(current_setting) %> >
|
6
|
+
<%= t ".title" %>
|
7
|
+
</h2>
|
8
|
+
</div>
|
10
9
|
|
11
|
-
|
12
|
-
|
13
|
-
|
10
|
+
<div class="card-section">
|
11
|
+
<%= decidim_form_for @form, url: { action: "create" }, html: { class: "form new_ponderation" } do |f| %>
|
12
|
+
<%= render partial: "form", object: f %>
|
14
13
|
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
</div>
|
14
|
+
<div class="button--double form-general-submit">
|
15
|
+
<%= f.submit t(".save") %>
|
16
|
+
</div>
|
17
|
+
<% end %>
|
20
18
|
</div>
|
21
19
|
</div>
|
@@ -0,0 +1,11 @@
|
|
1
|
+
<%= link_to decidim_consultations.question_path(question), class: "button expanded button--sc" do %>
|
2
|
+
<%= t "consultations.question.view_results", scope: "decidim" %>
|
3
|
+
<% if question.most_weighted_voted_response.present? %>
|
4
|
+
<span class="button__info"><%= translated_attribute question.most_weighted_voted_response.title %></span>
|
5
|
+
<span class="button__info">
|
6
|
+
<%= question.most_weighted_voted_response.votes_count %>
|
7
|
+
<%= t "consultations.question.votes_out_of", scope: "decidim", count: question.most_weighted_voted_response.votes_count %>
|
8
|
+
<%= question.total_weighted_votes %>
|
9
|
+
</span>
|
10
|
+
<% end %>
|
11
|
+
<% end %>
|
data/app/views/decidim/action_delegator/consultations/questions/_link_to_delegations.html.erb
CHANGED
@@ -1,11 +1,15 @@
|
|
1
1
|
<% if Decidim::ActionDelegator::Delegation.granted_to?(current_user, question.consultation) %>
|
2
2
|
<% if has_any_delegate_vote?(question) %>
|
3
|
-
<div class="delegations-notice flex--cc">
|
4
|
-
|
3
|
+
<div class="delegations-notice flex--cc" style="margin-top:1rem;">
|
4
|
+
<button id="delegations-button" class="card__button hollow button small expanded text-white">
|
5
|
+
<%= t("action_delegator.delegations.has_delegations", scope: "decidim") %>
|
6
|
+
</button>
|
5
7
|
</div>
|
6
8
|
<% else %>
|
7
|
-
<div class="delegations-notice flex--cc">
|
8
|
-
|
9
|
-
|
9
|
+
<div class="delegations-notice flex--cc" style="margin-top:1rem; width: 100%;">
|
10
|
+
<button id="delegations-button" class="card__button button small expanded secondary hollow">
|
11
|
+
<%= t("action_delegator.delegations.link", scope: "decidim") %>
|
12
|
+
</button>
|
13
|
+
</div>
|
10
14
|
<% end %>
|
11
15
|
<% end %>
|
@@ -0,0 +1,8 @@
|
|
1
|
+
<% question.responses_sorted_by_weighted_votes[question.id].each do |response| %>
|
2
|
+
<div class=card--list__item>
|
3
|
+
<div class="card--list__text"><%= translated_attribute response.title %></div>
|
4
|
+
<div class="card--list__data">
|
5
|
+
<span class="card--list__data__number"><%= response.votes_count %></span>
|
6
|
+
</div>
|
7
|
+
</div>
|
8
|
+
<% end %>
|