decidim-action_delegator 0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/LICENSE-AGPLv3.txt +661 -0
- data/README.md +225 -0
- data/Rakefile +41 -0
- data/app/assets/config/admin/decidim_action_delegator_manifest.css +0 -0
- data/app/assets/config/admin/decidim_action_delegator_manifest.js +1 -0
- data/app/assets/config/decidim_action_delegator_manifest.css +3 -0
- data/app/assets/config/decidim_action_delegator_manifest.js +2 -0
- data/app/assets/images/decidim/action_delegator/icon.svg +1 -0
- data/app/assets/javascripts/decidim/action_delegator/admin/action_delegator.js.es6 +3 -0
- data/app/assets/javascripts/decidim/action_delegator/questions.js.es6 +26 -0
- data/app/assets/stylesheets/decidim/action_delegator/questions.scss +25 -0
- data/app/commands/decidim/action_delegator/admin/create_delegation.rb +62 -0
- data/app/commands/decidim/action_delegator/consultations/multiple_vote_question_override.rb +31 -0
- data/app/commands/decidim/action_delegator/consultations/vote_question_override.rb +36 -0
- data/app/commands/decidim/action_delegator/vote_delegation.rb +28 -0
- data/app/controllers/concerns/decidim/action_delegator/admin/filterable.rb +23 -0
- data/app/controllers/decidim/action_delegator/admin/application_controller.rb +19 -0
- data/app/controllers/decidim/action_delegator/admin/consultations/exports_controller.rb +27 -0
- data/app/controllers/decidim/action_delegator/admin/consultations_controller.rb +33 -0
- data/app/controllers/decidim/action_delegator/admin/delegations_controller.rb +79 -0
- data/app/controllers/decidim/action_delegator/admin/exports/sum_of_weights_controller.rb +15 -0
- data/app/controllers/decidim/action_delegator/admin/results/sum_of_weights_controller.rb +37 -0
- data/app/controllers/decidim/action_delegator/admin/settings_controller.rb +71 -0
- data/app/controllers/decidim/action_delegator/application_controller.rb +14 -0
- data/app/controllers/decidim/action_delegator/consultations/question_multiple_votes_controller_override.rb +28 -0
- data/app/controllers/decidim/action_delegator/consultations/question_votes_controller_override.rb +55 -0
- data/app/controllers/decidim/action_delegator/user_delegations_controller.rb +22 -0
- data/app/controllers/decidim/action_delegator/verifications/sms/authorizations_controller_override.rb +38 -0
- data/app/forms/decidim/action_delegator/admin/delegation_form.rb +25 -0
- data/app/forms/decidim/action_delegator/consultations/vote_form_override.rb +15 -0
- data/app/helpers/decidim/action_delegator/admin/delegation_helper.rb +27 -0
- data/app/helpers/decidim/action_delegator/application_helper.rb +10 -0
- data/app/jobs/decidim/action_delegator/export_consultation_results_job.rb +51 -0
- data/app/jobs/decidim/action_delegator/send_sms_job.rb +60 -0
- data/app/jobs/decidim/action_delegator/twilio_send_sms_job.rb +43 -0
- data/app/models/decidim/action_delegator/application_record.rb +10 -0
- data/app/models/decidim/action_delegator/consultations/vote_override.rb +15 -0
- data/app/models/decidim/action_delegator/delegation.rb +26 -0
- data/app/models/decidim/action_delegator/setting.rb +22 -0
- data/app/models/decidim/action_delegator/unversioned_vote.rb +19 -0
- data/app/models/decidim/action_delegator/whodunnit_vote.rb +28 -0
- data/app/permissions/decidim/action_delegator/consultations_permissions_extension.rb +27 -0
- data/app/permissions/decidim/action_delegator/permissions.rb +74 -0
- data/app/presenters/decidim/action_delegator/admin/consultation_presenter.rb +15 -0
- data/app/presenters/decidim/action_delegator/admin/setting_presenter.rb +13 -0
- data/app/presenters/decidim/action_delegator/question_with_totals.rb +24 -0
- data/app/queries/decidim/action_delegator/consultation_delegations.rb +25 -0
- data/app/queries/decidim/action_delegator/decrypted_authorizations.rb +112 -0
- data/app/queries/decidim/action_delegator/delegated_votes_versions.rb +31 -0
- data/app/queries/decidim/action_delegator/delegates_votes_by_consultation.rb +24 -0
- data/app/queries/decidim/action_delegator/delegates_votes_by_question.rb +26 -0
- data/app/queries/decidim/action_delegator/delegation_votes.rb +30 -0
- data/app/queries/decidim/action_delegator/grantee_delegations.rb +24 -0
- data/app/queries/decidim/action_delegator/json_build_object_query.rb +45 -0
- data/app/queries/decidim/action_delegator/organization_delegations.rb +26 -0
- data/app/queries/decidim/action_delegator/organization_settings.rb +25 -0
- data/app/queries/decidim/action_delegator/published_responses.rb +25 -0
- data/app/queries/decidim/action_delegator/responses_by_membership.rb +75 -0
- data/app/queries/decidim/action_delegator/scrutiny.rb +87 -0
- data/app/queries/decidim/action_delegator/setting_delegations.rb +19 -0
- data/app/queries/decidim/action_delegator/sum_of_membership_weight.rb +48 -0
- data/app/queries/decidim/action_delegator/sum_of_weights.rb +25 -0
- data/app/queries/decidim/action_delegator/type_and_weight.rb +26 -0
- data/app/queries/decidim/action_delegator/voted_with_direct_verification.rb +53 -0
- data/app/queries/decidim/action_delegator/votes_count_aggregation.rb +34 -0
- data/app/serializers/decidim/action_delegator/consultation_results_serializer.rb +19 -0
- data/app/serializers/decidim/action_delegator/sum_of_weights_serializer.rb +17 -0
- data/app/services/decidim/action_delegator/sms_gateway.rb +51 -0
- data/app/views/decidim/action_delegator/_callout.html.erb +5 -0
- data/app/views/decidim/action_delegator/_delegations_modal.html.erb +93 -0
- data/app/views/decidim/action_delegator/_link_to_delegations.html.erb +5 -0
- data/app/views/decidim/action_delegator/_link_to_question.html.erb +5 -0
- data/app/views/decidim/action_delegator/admin/consultations/results.html.erb +62 -0
- data/app/views/decidim/action_delegator/admin/delegations/index.html.erb +36 -0
- data/app/views/decidim/action_delegator/admin/delegations/new.html.erb +30 -0
- data/app/views/decidim/action_delegator/admin/results/sum_of_weights/index.html.erb +63 -0
- data/app/views/decidim/action_delegator/admin/settings/index.html.erb +39 -0
- data/app/views/decidim/action_delegator/admin/settings/new.html.erb +30 -0
- data/app/views/decidim/action_delegator/user_delegations/index.html.erb +19 -0
- data/app/views/decidim/consultations/consultations/_question.html.erb +41 -0
- data/app/views/decidim/consultations/consultations/show.html.erb +14 -0
- data/app/views/decidim/consultations/question_multiple_votes/_form.html.erb +25 -0
- data/app/views/decidim/consultations/question_votes/update_vote_button.js.erb +32 -0
- data/app/views/decidim/consultations/questions/_vote_button.html.erb +107 -0
- data/app/views/decidim/consultations/questions/_vote_modal.html.erb +30 -0
- data/app/views/decidim/consultations/questions/_vote_modal_confirm.html.erb +38 -0
- data/app/views/decidim/verifications/sms/authorizations/new.html.erb +33 -0
- data/app/views/layouts/decidim/action_delegator/admin/_users_sidebar.html.erb +56 -0
- data/app/views/layouts/decidim/action_delegator/admin/delegations.html.erb +13 -0
- data/app/views/layouts/decidim/admin/consultation.html.erb +56 -0
- data/app/views/layouts/decidim/admin/question.html.erb +98 -0
- data/app/views/layouts/decidim/admin/users.html.erb +7 -0
- data/config/i18n-tasks.yml +10 -0
- data/config/locales/ca.yml +101 -0
- data/config/locales/cs.yml +101 -0
- data/config/locales/en.yml +109 -0
- data/config/locales/es.yml +101 -0
- data/db/migrate/20200729194540_create_decidim_action_delegator_delegations.rb +12 -0
- data/db/migrate/20200824113801_create_settings.rb +13 -0
- data/db/migrate/20200828113755_add_setting_id_to_delegations.rb +11 -0
- data/db/migrate/20200831141540_make_granter_id_and_grantee_id_non_nullable.rb +8 -0
- data/db/migrate/20201001172345_remove_expires_at_from_delegations.rb +7 -0
- data/db/migrate/20201005203554_add_setting_granter_unique_index_to_delegations.rb +10 -0
- data/db/migrate/20201006084522_remove_setting_id_index_from_delegations.rb +7 -0
- data/db/migrate/20201030164808_add_delegation_id_to_versions.rb +8 -0
- data/db/seeds.rb +7 -0
- data/lib/decidim/action_delegator/admin.rb +10 -0
- data/lib/decidim/action_delegator/admin_engine.rb +42 -0
- data/lib/decidim/action_delegator/engine.rb +53 -0
- data/lib/decidim/action_delegator/test/factories.rb +25 -0
- data/lib/decidim/action_delegator/version.rb +10 -0
- data/lib/decidim/action_delegator.rb +29 -0
- data/lib/json_key.rb +10 -0
- metadata +267 -0
@@ -0,0 +1,30 @@
|
|
1
|
+
<h2 class="card-title process-title-summary">
|
2
|
+
<%= t ".title" %>
|
3
|
+
</h2>
|
4
|
+
|
5
|
+
<%= form_for @setting, url: { action: "create" }, html: { class: "form new_setting" } do |f| %>
|
6
|
+
<div class="card">
|
7
|
+
<div class="card-divider">
|
8
|
+
<h2 class="card-title"><%= t ".form.title" %></h2>
|
9
|
+
</div>
|
10
|
+
|
11
|
+
<div class="card-section">
|
12
|
+
<div class="row column">
|
13
|
+
<%= f.select :decidim_consultation_id,
|
14
|
+
options_from_collection_for_select(
|
15
|
+
consultations_for_select,
|
16
|
+
:id,
|
17
|
+
:translated_title
|
18
|
+
) %>
|
19
|
+
</div>
|
20
|
+
|
21
|
+
<div class="row column">
|
22
|
+
<%= f.number_field :max_grants, min: 1, autofocus: true %>
|
23
|
+
</div>
|
24
|
+
</div>
|
25
|
+
</div>
|
26
|
+
|
27
|
+
<div class="button--double form-general-submit">
|
28
|
+
<%= f.submit t(".save") %>
|
29
|
+
</div>
|
30
|
+
<% end %>
|
@@ -0,0 +1,19 @@
|
|
1
|
+
<div class="row column voluntary-work-list">
|
2
|
+
<section class="section">
|
3
|
+
<div class="card card--list">
|
4
|
+
<% delegations.each do |delegation| %>
|
5
|
+
<div class="card--list__item">
|
6
|
+
<div class="card--list__text">
|
7
|
+
<div>
|
8
|
+
<h5 class="card--list__heading">
|
9
|
+
<%= link_to translated_attribute(delegation.consultation.title), decidim_consultations.consultation_path(delegation.consultation) %>
|
10
|
+
</h5>
|
11
|
+
<span class="text-small">
|
12
|
+
<%= t(".vote_delegated", name: "<strong>#{delegation.granter.name}</strong>").html_safe %>
|
13
|
+
</span>
|
14
|
+
</div>
|
15
|
+
</div>
|
16
|
+
</div>
|
17
|
+
<% end %>
|
18
|
+
</section>
|
19
|
+
</div>
|
@@ -0,0 +1,41 @@
|
|
1
|
+
<div class="card consultations-card">
|
2
|
+
<div class="row collapse card--process__row">
|
3
|
+
<div class="columns mediumlarge-8 large-9 card--process__column">
|
4
|
+
<div class="card__content">
|
5
|
+
<%= link_to decidim_consultations.question_path(question), class: "card__link" do %>
|
6
|
+
<h2 class="heading5"><%= decidim_sanitize translated_attribute question.title %></h2>
|
7
|
+
<% end %>
|
8
|
+
<p><%= translated_attribute question.subtitle %></p>
|
9
|
+
</div>
|
10
|
+
</div>
|
11
|
+
|
12
|
+
<div class="columns mediumlarge-8 large-3 card--process__column">
|
13
|
+
<div class="card--full__image consultations-card__image"
|
14
|
+
style="background-image: url(<%= question.banner_image_url %>)">
|
15
|
+
<div class="card__content row collapse">
|
16
|
+
<div class="columns large-10 large-push-1">
|
17
|
+
<% if question.results_published? %>
|
18
|
+
<%= link_to decidim_consultations.question_path(question),
|
19
|
+
class: "button expanded button--sc" do %>
|
20
|
+
<%= t "consultations.question.view_results", scope: "decidim" %>
|
21
|
+
<% if question.most_voted_response.present? %>
|
22
|
+
<span class="button__info"><%= translated_attribute question.most_voted_response.title %></span>
|
23
|
+
<span class="button__info">
|
24
|
+
<%= question.most_voted_response.votes_count %>
|
25
|
+
<%= t "consultations.question.votes_out_of", scope: "decidim", count: question.most_voted_response.votes_count %>
|
26
|
+
<%= question.total_votes %>
|
27
|
+
</span>
|
28
|
+
<% end %>
|
29
|
+
<% end %>
|
30
|
+
<% else %>
|
31
|
+
<%= display_take_part_button_for(question) %>
|
32
|
+
|
33
|
+
<%= render partial: "decidim/action_delegator/link_to_question", locals: { question: question } %>
|
34
|
+
|
35
|
+
<% end %>
|
36
|
+
</div>
|
37
|
+
</div>
|
38
|
+
</div>
|
39
|
+
</div>
|
40
|
+
</div>
|
41
|
+
</div>
|
@@ -0,0 +1,14 @@
|
|
1
|
+
<%
|
2
|
+
edit_link(
|
3
|
+
resource_locator(current_consultation).edit,
|
4
|
+
:update,
|
5
|
+
:consultation,
|
6
|
+
consultation: current_consultation
|
7
|
+
)
|
8
|
+
%>
|
9
|
+
|
10
|
+
<%= stylesheet_link_tag "decidim/action_delegator/questions" %>
|
11
|
+
|
12
|
+
<%= render partial: "consultation_details", locals: { consultation: current_consultation } %>
|
13
|
+
<%= render partial: "highlighted_questions", locals: { consultation: current_consultation } %>
|
14
|
+
<%= render partial: "regular_questions", locals: { consultation: current_consultation } %>
|
@@ -0,0 +1,25 @@
|
|
1
|
+
<div class="card">
|
2
|
+
<% if group %>
|
3
|
+
<div class="card__top">
|
4
|
+
<div class="card__content">
|
5
|
+
<h5 class="card__title"><%= translated_attribute group.title %></h5>
|
6
|
+
</div>
|
7
|
+
</div>
|
8
|
+
<% end %>
|
9
|
+
|
10
|
+
<% if delegation %>
|
11
|
+
<div class="delegation-callout callout warning">
|
12
|
+
<p><%= t "action_delegator.delegations_modal.callout", scope: "decidim" %> <strong><%= delegation.granter.name %></strong></p>
|
13
|
+
</div>
|
14
|
+
<% end %>
|
15
|
+
|
16
|
+
<div class="card__content multiple_votes_form">
|
17
|
+
<% responses.each do |response| %>
|
18
|
+
<div>
|
19
|
+
<%= check_box_tag "responses[]", response.id, false, id: "vote_id_#{response.id}" %>
|
20
|
+
<%= form.label :id, translated_attribute(response.title), for: "vote_id_#{response.id}" %>
|
21
|
+
</div>
|
22
|
+
<% end %>
|
23
|
+
<%= hidden_field_tag :decidim_consultations_delegation_id, delegation.id if delegation %>
|
24
|
+
</div>
|
25
|
+
</div>
|
@@ -0,0 +1,32 @@
|
|
1
|
+
(function () {
|
2
|
+
'use strict';
|
3
|
+
|
4
|
+
$("#delegations-modal").foundation("close");
|
5
|
+
$("#delegations-modal").remove();
|
6
|
+
|
7
|
+
$('#question-vote-modal').foundation("close");
|
8
|
+
$('#question-vote-confirm-modal').foundation("close");
|
9
|
+
$('#question-vote-modal, #question-vote-confirm-modal').remove()
|
10
|
+
var voteButton = $('#question-<%= current_question.id %>-vote-button');
|
11
|
+
voteButton.html('<%= j(render partial: "decidim/consultations/questions/vote_button", locals: { question: current_question }) %>');
|
12
|
+
|
13
|
+
$('#question-vote-modal').foundation();
|
14
|
+
$('#question-vote-confirm-modal').foundation();
|
15
|
+
|
16
|
+
<% if signed_in? && current_question.voted_by?(current_user) %>
|
17
|
+
$('#vote-result-callout').addClass('warning').removeClass('hide danger');
|
18
|
+
$('#vote-result-callout .callout-title').text($('#vote-result-callout').data('title-ok'));
|
19
|
+
$('#vote-result-callout .callout-message').text($('#vote-result-callout').data('message-ok'));
|
20
|
+
$('#confirm-vote-form-loader').addClass('hide');
|
21
|
+
$('#confirm-vote-form').removeClass('hide');
|
22
|
+
<% end %>
|
23
|
+
|
24
|
+
const delegationsButton = $("#delegations-button"),
|
25
|
+
delegationDialog = $("#delegations-modal");
|
26
|
+
|
27
|
+
delegationDialog.foundation();
|
28
|
+
|
29
|
+
delegationsButton.click(function () {
|
30
|
+
delegationDialog.foundation("open");
|
31
|
+
});
|
32
|
+
}());
|
@@ -0,0 +1,107 @@
|
|
1
|
+
<%= stylesheet_link_tag "decidim/action_delegator/questions" %>
|
2
|
+
<%= javascript_include_tag "decidim/action_delegator/questions" %>
|
3
|
+
|
4
|
+
<div class="row column">
|
5
|
+
<div class="callout hide" id="vote-result-callout" data-closable data-title-ok="<%= t("question_votes.create.title_success", scope: "decidim.consultations") %>" data-message-ok="<%= t("question_votes.create.success", scope: "decidim.consultations") %>" data-title-ko="<%= t("question_votes.create.title_error", scope: "decidim.consultations") %>" data-message-ko="<%= t("question_votes.create.error", scope: "decidim.consultations") %>">
|
6
|
+
<h5 class="callout-title"></h5>
|
7
|
+
<p class="callout-message"></p>
|
8
|
+
<button class="close-button" aria-label="Dismiss alert" type="button" data-close>
|
9
|
+
<span aria-hidden="true">×</span>
|
10
|
+
</button>
|
11
|
+
</div>
|
12
|
+
</div>
|
13
|
+
|
14
|
+
<%# Check if controller has questions_helper %>
|
15
|
+
<% if defined? display_next_previous_button %>
|
16
|
+
<div class="row column question-vote-cabin">
|
17
|
+
<div class="columns mediumlarge-4 show-for-mediumlarge previous-question">
|
18
|
+
<%= display_next_previous_button(:previous, "float-left") %>
|
19
|
+
</div>
|
20
|
+
<div class="columns mediumlarge-4">
|
21
|
+
<% if question.consultation.upcoming? %>
|
22
|
+
<div class="card__button button expanded disabled">
|
23
|
+
<div class="vote-button-caption"><%= t("questions.vote_button.vote", scope: "decidim") %></div>
|
24
|
+
<div>
|
25
|
+
<%= t "questions.vote_button.starting_from",
|
26
|
+
scope: "decidim",
|
27
|
+
date: l(question.start_voting_date) %>
|
28
|
+
</div>
|
29
|
+
</div>
|
30
|
+
<% elsif question.consultation.finished? && signed_in? && question.voted_by?(current_user) %>
|
31
|
+
<%= button_to decidim_consultations.question_question_votes_path(question),
|
32
|
+
method: :delete,
|
33
|
+
remote: true,
|
34
|
+
data: { disable: true },
|
35
|
+
class: "card__button button expanded success disabled",
|
36
|
+
id: "unvote_button" do %>
|
37
|
+
<div class="vote-button-caption">
|
38
|
+
<%= t("questions.vote_button.already_voted", scope: "decidim") %>
|
39
|
+
</div>
|
40
|
+
<% end %>
|
41
|
+
<% elsif signed_in? && question.consultation.active? %>
|
42
|
+
<% if allowed_to? :unvote, :question, question: question %>
|
43
|
+
<%= button_to decidim_consultations.question_question_votes_path(question),
|
44
|
+
method: :delete,
|
45
|
+
remote: true,
|
46
|
+
data: { disable: true },
|
47
|
+
class: "card__button button expanded success",
|
48
|
+
id: "unvote_button" do %>
|
49
|
+
<div class="vote-button-caption"
|
50
|
+
data-original="<%= t("questions.vote_button.already_voted", scope: "decidim") %>"
|
51
|
+
data-replace="<%= t("questions.vote_button.already_voted_hover", scope: "decidim") %>">
|
52
|
+
<%= t("questions.vote_button.already_voted", scope: "decidim") %>
|
53
|
+
</div>
|
54
|
+
<% end %>
|
55
|
+
<% elsif allowed_to? :vote, :question, question: question %>
|
56
|
+
<% if question.multiple? %>
|
57
|
+
<%= link_to decidim_consultations.question_question_multiple_votes_path(question, delegation: 0),
|
58
|
+
class: "card__button button expanded",
|
59
|
+
id: "multivote_button" do %>
|
60
|
+
<div class="vote-button-caption"><%= t "questions.vote_button.vote", scope: "decidim" %></div>
|
61
|
+
<% end %>
|
62
|
+
<% else %>
|
63
|
+
<%= link_to "#", class: "card__button button expanded", id: "vote_button" do %>
|
64
|
+
<div class="vote-button-caption"><%= t "questions.vote_button.vote", scope: "decidim" %></div>
|
65
|
+
<% end %>
|
66
|
+
<% end %>
|
67
|
+
<% else %>
|
68
|
+
<%= authorized_vote_modal_button(question, remote: true, class: "button expanded light button--sc") do %>
|
69
|
+
<%= t("questions.vote_button.verification_required", scope: "decidim") %>
|
70
|
+
<% end %>
|
71
|
+
<% end %>
|
72
|
+
|
73
|
+
<%= render partial: "decidim/action_delegator/link_to_delegations", locals: { consultation: question.consultation } %>
|
74
|
+
|
75
|
+
<% elsif question.consultation.active? %>
|
76
|
+
<%= logged_button_to decidim_consultations.question_question_votes_path(question),
|
77
|
+
class: "card__button button expanded",
|
78
|
+
data: { disable: true },
|
79
|
+
id: "vote_button" do %>
|
80
|
+
<div class="vote-button-caption">
|
81
|
+
<%= t("questions.vote_button.vote", scope: "decidim") %>
|
82
|
+
</div>
|
83
|
+
<% end %>
|
84
|
+
<% end %>
|
85
|
+
</div>
|
86
|
+
<div class="columns mediumlarge-4 show-for-mediumlarge next-question">
|
87
|
+
<%= display_next_previous_button(:next, "float-right") %>
|
88
|
+
</div>
|
89
|
+
</div>
|
90
|
+
|
91
|
+
<div class="row column section hide-for-mediumlarge">
|
92
|
+
<div class="small-buttons">
|
93
|
+
<div class="columns small-6 previous-question">
|
94
|
+
<%= display_next_previous_button(:previous, "expanded") %>
|
95
|
+
</div>
|
96
|
+
<div class="columns small-6 next-question">
|
97
|
+
<%= display_next_previous_button(:next, "expanded") %>
|
98
|
+
</div>
|
99
|
+
</div>
|
100
|
+
</div>
|
101
|
+
<% end %>
|
102
|
+
|
103
|
+
<%= render partial: "decidim/consultations/questions/vote_modal", locals: { question: question } %>
|
104
|
+
<%= render partial: "decidim/consultations/questions/vote_modal_confirm", locals: { question: question } %>
|
105
|
+
<%= render partial: "decidim/action_delegator/delegations_modal", locals: { question: question } %>
|
106
|
+
<%= javascript_include_tag "decidim/consultations/utils" %>
|
107
|
+
<%= javascript_include_tag "decidim/consultations/vote_dialog" %>
|
@@ -0,0 +1,30 @@
|
|
1
|
+
<div class="reveal" data-reveal id="question-vote-modal">
|
2
|
+
<div class="reveal__header">
|
3
|
+
<h3 class="reveal__title">
|
4
|
+
<%= t "questions.vote_modal.title", scope: "decidim" %>
|
5
|
+
</h3>
|
6
|
+
<button class="close-button" data-close aria-label="<%= t "questions.vote_modal.close_modal", scope: "decidim" %>" type="button">
|
7
|
+
<span aria-hidden="true">×</span>
|
8
|
+
</button>
|
9
|
+
</div>
|
10
|
+
|
11
|
+
<%= render partial: "decidim/action_delegator/callout", locals: { consultation: question.consultation } %>
|
12
|
+
|
13
|
+
<p><%= t "questions.vote_modal.contextual_help", scope: "decidim" %></p>
|
14
|
+
<div class="card card--secondary">
|
15
|
+
<div class="card__content">
|
16
|
+
<h4 class="heading5 text-center"><%= translated_attribute(question.title).html_safe %></h4>
|
17
|
+
</div>
|
18
|
+
</div>
|
19
|
+
|
20
|
+
<% question.responses.each do |response| %>
|
21
|
+
<div class="row">
|
22
|
+
<div class="columns medium-8 medium-offset-2">
|
23
|
+
<button class="button hollow expanded response-title"
|
24
|
+
data-response-id="<%= response.id %>">
|
25
|
+
<%= translated_attribute response.title %>
|
26
|
+
</button>
|
27
|
+
</div>
|
28
|
+
</div>
|
29
|
+
<% end %>
|
30
|
+
</div>
|
@@ -0,0 +1,38 @@
|
|
1
|
+
<div class="reveal" data-reveal id="question-vote-confirm-modal">
|
2
|
+
<div class="reveal__header">
|
3
|
+
<h3 class="reveal__title">
|
4
|
+
<%= t "questions.vote_modal_confirm.title", scope: "decidim" %>
|
5
|
+
</h3>
|
6
|
+
<button class="close-button" data-close aria-label="<%= t("questions.vote_modal_confirm.close_modal", scope: "decidim") %>" type="button">
|
7
|
+
<span aria-hidden="true">×</span>
|
8
|
+
</button>
|
9
|
+
</div>
|
10
|
+
|
11
|
+
<%= render partial: "decidim/action_delegator/callout", locals: { consultation: question.consultation } %>
|
12
|
+
|
13
|
+
<p><%= t "questions.vote_modal_confirm.contextual_help", scope: "decidim" %></p>
|
14
|
+
<div class="card card--secondary">
|
15
|
+
<div class="card__content">
|
16
|
+
<h4 class="heading5 text-center"><%= translated_attribute(question.title).html_safe %></h4>
|
17
|
+
<h5 class="heading6 text-center" id="question-vote-confirm-modal-question-title"></h5>
|
18
|
+
</div>
|
19
|
+
</div>
|
20
|
+
<div class="row">
|
21
|
+
<div class="columns medium-8 medium-offset-2">
|
22
|
+
<%= form_with url: decidim_consultations.question_question_votes_path(question),
|
23
|
+
id: "confirm-vote-form" do |form| %>
|
24
|
+
<%= form.hidden_field :decidim_consultations_response_id, id: "decidim_consultations_response_id" %>
|
25
|
+
<%= form.submit t("questions.vote_modal_confirm.confirm", scope: "decidim"),
|
26
|
+
class: "button expanded",
|
27
|
+
data: { disable: true } %>
|
28
|
+
<%= hidden_field_tag :decidim_consultations_delegation_id, nil, id: "decidim_consultations_delegation_id" %>
|
29
|
+
<% end %>
|
30
|
+
<div id="confirm-vote-form-loader" class="loading-spinner hide"></div>
|
31
|
+
</div>
|
32
|
+
</div>
|
33
|
+
<div class="text-center">
|
34
|
+
<button class="link" id="question-vote-confirm-modal-button-change">
|
35
|
+
<%= t "questions.vote_modal_confirm.change", scope: "decidim" %>
|
36
|
+
</button>
|
37
|
+
</div>
|
38
|
+
</div>
|
@@ -0,0 +1,33 @@
|
|
1
|
+
<div class="wrapper">
|
2
|
+
<div class="row collapse">
|
3
|
+
<div class="row collapse">
|
4
|
+
<div class="columns large-8 large-centered text-center page-title">
|
5
|
+
<h1><%= t(".title") %></h1>
|
6
|
+
</div>
|
7
|
+
</div>
|
8
|
+
|
9
|
+
<div class="row">
|
10
|
+
<div class="columns large-6 medium-centered">
|
11
|
+
<div class="card">
|
12
|
+
<div class="card__content">
|
13
|
+
<%= decidim_form_for(@form, url: authorization_path(redirect_url: redirect_url)) do |form| %>
|
14
|
+
<%= form_required_explanation %>
|
15
|
+
|
16
|
+
<div class="field">
|
17
|
+
<%= form.text_field :mobile_phone_number, readonly: true %>
|
18
|
+
</div>
|
19
|
+
|
20
|
+
<div class="callout announcement mb-sm warning cell-announcement">
|
21
|
+
<p><%= t("decidim.action_delegator.authorizations.new.phone_warning") %></p>
|
22
|
+
</div>
|
23
|
+
|
24
|
+
<div class="actions">
|
25
|
+
<%= form.submit t(".send"), class: "button expanded", "data-disable-with" => "#{t('.send')}...", disabled: @form.mobile_phone_number.blank? %>
|
26
|
+
</div>
|
27
|
+
<% end %>
|
28
|
+
</div>
|
29
|
+
</div>
|
30
|
+
</div>
|
31
|
+
</div>
|
32
|
+
</div>
|
33
|
+
</div>
|
@@ -0,0 +1,56 @@
|
|
1
|
+
<div class="secondary-nav">
|
2
|
+
<div class="secondary-nav__title">
|
3
|
+
<%= t("users.title", scope: "layouts.decidim.admin") %>
|
4
|
+
</div>
|
5
|
+
<ul>
|
6
|
+
<% if allowed_to? :read, :admin_user %>
|
7
|
+
<li <% if is_active_link?(decidim_admin.users_path) %> class="is-active" <% end %>>
|
8
|
+
<%= link_to t("menu.admins", scope: "decidim.admin"), decidim_admin.users_path %>
|
9
|
+
</li>
|
10
|
+
<% end %>
|
11
|
+
<% if current_organization.user_groups_enabled? && allowed_to?(:index, :user_group) %>
|
12
|
+
<li <% if is_active_link?(decidim_admin.user_groups_path) %> class="is-active" <% end %>>
|
13
|
+
<%= link_to t("menu.user_groups", scope: "decidim.admin"), decidim_admin.user_groups_path %>
|
14
|
+
</li>
|
15
|
+
<% end %>
|
16
|
+
<% if allowed_to? :index, :officialization %>
|
17
|
+
<li <% if is_active_link?(decidim_admin.officializations_path) %> class="is-active" <% end %>>
|
18
|
+
<%= link_to t("menu.participants", scope: "decidim.admin"), decidim_admin.officializations_path %>
|
19
|
+
</li>
|
20
|
+
<% end %>
|
21
|
+
<% if allowed_to? :index, :impersonatable_user %>
|
22
|
+
<li <% if is_active_link?(decidim_admin.impersonatable_users_path) %> class="is-active" <% end %>>
|
23
|
+
<%= link_to t("menu.impersonations", scope: "decidim.admin"), decidim_admin.impersonatable_users_path %>
|
24
|
+
<ul>
|
25
|
+
<li <% if is_active_link?(decidim_admin.conflicts_path) %> class="is-active" <% end %>>
|
26
|
+
<%= %>
|
27
|
+
<%= link_to link_to t("title", scope: "decidim.admin.conflicts"), decidim_admin.conflicts_path %>
|
28
|
+
</li>
|
29
|
+
</ul>
|
30
|
+
</li>
|
31
|
+
<% end %>
|
32
|
+
<% if allowed_to? :index, :moderate_users %>
|
33
|
+
<li <% if is_active_link?(decidim_admin.moderated_users_path) %> class="is-active" <% end %>>
|
34
|
+
<%= link_to t("menu.reported_users", scope: "decidim.admin"), decidim_admin.moderated_users_path %>
|
35
|
+
</li>
|
36
|
+
<% end %>
|
37
|
+
<li <% if is_active_link?(decidim_admin.authorization_workflows_path) %> class="is-active" <% end %>>
|
38
|
+
<%= link_to t("menu.authorization_workflows", scope: "decidim.admin"), decidim_admin.authorization_workflows_path %>
|
39
|
+
<ul>
|
40
|
+
<% Decidim::Verifications.admin_workflows.each do |manifest| %>
|
41
|
+
<% next unless current_organization.available_authorizations.include?(manifest.name.to_s) %>
|
42
|
+
<% workflow = Decidim::Verifications::Adapter.new(manifest) %>
|
43
|
+
|
44
|
+
<li <% if is_active_link?(workflow.admin_root_path) %> class="is-active" <% end %>>
|
45
|
+
<%= link_to workflow.fullname, workflow.admin_root_path %>
|
46
|
+
</li>
|
47
|
+
<% end %>
|
48
|
+
</ul>
|
49
|
+
</li>
|
50
|
+
<% if allowed_to? :index, :impersonatable_user %>
|
51
|
+
<li <% if is_active_link?(decidim_admin_action_delegator.settings_path) %> class="is-active" <% end %>>
|
52
|
+
<%= link_to t("menu.delegations", scope: "decidim.action_delegator.admin"), decidim_admin_action_delegator.settings_path %>
|
53
|
+
</li>
|
54
|
+
<% end %>
|
55
|
+
</ul>
|
56
|
+
</div>
|
@@ -0,0 +1,13 @@
|
|
1
|
+
<% content_for :secondary_nav do %>
|
2
|
+
<%= render "layouts/decidim/action_delegator/admin/users_sidebar" %>
|
3
|
+
<% end %>
|
4
|
+
|
5
|
+
<%= render "layouts/decidim/admin/application" do %>
|
6
|
+
<div class="process-title">
|
7
|
+
<div class="process-title-content">
|
8
|
+
<%= translated_attribute(current_setting.consultation.title) %>
|
9
|
+
</div>
|
10
|
+
</div>
|
11
|
+
|
12
|
+
<%= yield %>
|
13
|
+
<% end %>
|
@@ -0,0 +1,56 @@
|
|
1
|
+
<% content_for :secondary_nav do %>
|
2
|
+
<div class="secondary-nav secondary-nav--subnav">
|
3
|
+
<ul>
|
4
|
+
<%= public_page_link decidim_consultations.consultation_path(current_consultation) %>
|
5
|
+
<% if allowed_to? :update, :consultation, consultation: current_consultation %>
|
6
|
+
<li <% if is_active_link?(decidim_admin_consultations.edit_consultation_path(current_consultation)) %> class="is-active" <% end %>>
|
7
|
+
<%= aria_selected_link_to t("info", scope: "decidim.admin.menu.consultations_submenu"),
|
8
|
+
decidim_admin_consultations.edit_consultation_path(current_consultation) %>
|
9
|
+
</li>
|
10
|
+
<% end %>
|
11
|
+
|
12
|
+
<% if allowed_to? :read, :question %>
|
13
|
+
<li <% if is_active_link?(decidim_admin_consultations.consultation_questions_path(current_consultation)) %> class="is-active" <% end %>>
|
14
|
+
<%= aria_selected_link_to t("questions", scope: "decidim.admin.menu.consultations_submenu"),
|
15
|
+
decidim_admin_consultations.consultation_questions_path(current_consultation) %>
|
16
|
+
</li>
|
17
|
+
|
18
|
+
<li <% if is_active_link?(decidim_admin_consultations.results_consultation_path(current_consultation), /\/results/) %> class="is-active" <% end %>>
|
19
|
+
<%= aria_selected_link_to t("results", scope: "decidim.admin.menu.consultations_submenu"),
|
20
|
+
decidim_admin_consultations.results_consultation_path(current_consultation) %>
|
21
|
+
<ul class="results-nav">
|
22
|
+
<li <% if is_active_link?(decidim_admin_consultations.results_consultation_path(current_consultation)) %> class="is-active" <% end %>>
|
23
|
+
<%= aria_selected_link_to t("by_answer", scope: "decidim.action_delegator.admin.menu.consultations_submenu"),
|
24
|
+
decidim_admin_consultations.results_consultation_path(current_consultation) %>
|
25
|
+
</li>
|
26
|
+
<li <% if is_active_link?(decidim_admin_action_delegator.results_consultation_path(current_consultation), :exact) %> class="is-active" <% end %>>
|
27
|
+
<%= aria_selected_link_to t("by_type_and_weight", scope: "decidim.action_delegator.admin.menu.consultations_submenu"),
|
28
|
+
decidim_admin_action_delegator.results_consultation_path(current_consultation) %>
|
29
|
+
</li>
|
30
|
+
<li <% if is_active_link?(decidim_admin_action_delegator.consultation_results_sum_of_weights_path(current_consultation), :exact) %> class="is-active" <% end %>>
|
31
|
+
<%= aria_selected_link_to t("sum_of_weights", scope: "decidim.action_delegator.admin.menu.consultations_submenu"),
|
32
|
+
decidim_admin_action_delegator.consultation_results_sum_of_weights_path(current_consultation) %>
|
33
|
+
</li>
|
34
|
+
</ul>
|
35
|
+
</li>
|
36
|
+
|
37
|
+
<% end %>
|
38
|
+
</ul>
|
39
|
+
</div>
|
40
|
+
<% end %>
|
41
|
+
|
42
|
+
<%= render "layouts/decidim/admin/application" do %>
|
43
|
+
<div class="process-title">
|
44
|
+
<div class="process-title-content">
|
45
|
+
<%= link_to translated_attribute(current_consultation.title), decidim_consultations.consultation_path(current_consultation), target: "_blank" %>
|
46
|
+
</div>
|
47
|
+
</div>
|
48
|
+
|
49
|
+
<div class="process-content">
|
50
|
+
<div class="callout warning">
|
51
|
+
<%= icon "warning" %>
|
52
|
+
<span class="callout-text"><%= t("decidim.admin.consultations.deprecation_warning") %></span>
|
53
|
+
</div>
|
54
|
+
<%= yield %>
|
55
|
+
</div>
|
56
|
+
<% end %>
|
@@ -0,0 +1,98 @@
|
|
1
|
+
<% content_for :secondary_nav do %>
|
2
|
+
<div class="secondary-nav secondary-nav--subnav">
|
3
|
+
<ul>
|
4
|
+
<%= public_page_link decidim_consultations.consultation_path(current_participatory_space.consultation) %>
|
5
|
+
<% if allowed_to?(:update, :consultation, consultation: current_participatory_space.consultation) %>
|
6
|
+
<li <% if is_active_link?(decidim_admin_consultations.edit_consultation_path(current_participatory_space.consultation)) %> class="is-active" <% end %>>
|
7
|
+
<%= aria_selected_link_to t("consultation", scope: "decidim.admin.menu.questions_submenu"),
|
8
|
+
decidim_admin_consultations.edit_consultation_path(current_participatory_space.consultation) %>
|
9
|
+
</li>
|
10
|
+
<% end %>
|
11
|
+
|
12
|
+
<li <% if is_active_link?(decidim_admin_consultations.consultation_questions_path(current_participatory_space.consultation)) %> class="is-active" <% end %>>
|
13
|
+
<%= aria_selected_link_to t("questions", scope: "decidim.admin.menu.consultations_submenu"),
|
14
|
+
decidim_admin_consultations.consultation_questions_path(current_participatory_space.consultation) %>
|
15
|
+
|
16
|
+
<ul>
|
17
|
+
<% if allowed_to?(:update, :question, question: current_participatory_space) %>
|
18
|
+
<li <% if is_active_link?(decidim_admin_consultations.edit_question_path(current_participatory_space)) %> class="is-active" <% end %>>
|
19
|
+
<%= aria_selected_link_to t("info", scope: "decidim.admin.menu.questions_submenu"),
|
20
|
+
decidim_admin_consultations.edit_question_path(current_participatory_space) %>
|
21
|
+
</li>
|
22
|
+
<% end %>
|
23
|
+
|
24
|
+
<% if allowed_to?(:configure, :question, question: current_participatory_space) %>
|
25
|
+
<li <% if is_active_link?(decidim_admin_consultations.edit_question_configuration_path(current_participatory_space)) %> class="is-active" <% end %>>
|
26
|
+
<%= aria_selected_link_to t("configuration", scope: "decidim.admin.menu.questions_submenu"),
|
27
|
+
decidim_admin_consultations.edit_question_configuration_path(current_participatory_space) %>
|
28
|
+
</li>
|
29
|
+
<% end %>
|
30
|
+
|
31
|
+
<% if allowed_to? :read, :response %>
|
32
|
+
<li <% if is_active_link?(decidim_admin_consultations.responses_path(current_participatory_space)) || is_active_link?(decidim_admin_consultations.response_groups_path(current_participatory_space)) %> class="is-active" <% end %>>
|
33
|
+
<%= aria_selected_link_to t("responses", scope: "decidim.admin.menu.questions_submenu"),
|
34
|
+
decidim_admin_consultations.responses_path(current_participatory_space) %>
|
35
|
+
</li>
|
36
|
+
<% end %>
|
37
|
+
|
38
|
+
<% if allowed_to? :read, :component %>
|
39
|
+
<li <% if is_active_link?(decidim_admin_consultations.components_path(current_participatory_space)) %> class="is-active" <% end %>>
|
40
|
+
<%= aria_selected_link_to t("components", scope: "decidim.admin.menu.questions_submenu"),
|
41
|
+
decidim_admin_consultations.components_path(current_participatory_space) %>
|
42
|
+
<ul>
|
43
|
+
<% current_participatory_space.components.each do |component| %>
|
44
|
+
<% if component.manifest.admin_engine %>
|
45
|
+
<li <% if is_active_link?(manage_component_path(component)) || is_active_link?(decidim_admin_consultations.edit_component_path(current_participatory_space, component)) || is_active_link?(decidim_admin_consultations.edit_component_permissions_path(current_participatory_space, component)) %> class="is-active" <% end %>>
|
46
|
+
<%= link_to manage_component_path(component) do %>
|
47
|
+
<%= translated_attribute component.name %>
|
48
|
+
<% if component.primary_stat.present? %>
|
49
|
+
<span class="component-counter <%= "component-counter--off" if component.primary_stat.zero? %>">
|
50
|
+
<%= component.primary_stat %>
|
51
|
+
</span>
|
52
|
+
<% end %>
|
53
|
+
<% end %>
|
54
|
+
</li>
|
55
|
+
<% end %>
|
56
|
+
<% end %>
|
57
|
+
</ul>
|
58
|
+
</li>
|
59
|
+
<% end %>
|
60
|
+
|
61
|
+
<% if allowed_to? :read, :category %>
|
62
|
+
<li <% if is_active_link?(decidim_admin_consultations.categories_path(current_participatory_space)) %> class="is-active" <% end %>>
|
63
|
+
<%= aria_selected_link_to t(".categories"),
|
64
|
+
decidim_admin_consultations.categories_path(current_participatory_space) %>
|
65
|
+
</li>
|
66
|
+
<% end %>
|
67
|
+
|
68
|
+
<% if allowed_to? :read, :attachment %>
|
69
|
+
<li <% if is_active_link?(decidim_admin_consultations.question_attachments_path(current_participatory_space)) %> class="is-active" <% end %>>
|
70
|
+
<%= aria_selected_link_to t(".attachments"),
|
71
|
+
decidim_admin_consultations.question_attachments_path(current_participatory_space) %>
|
72
|
+
</li>
|
73
|
+
<% end %>
|
74
|
+
</ul>
|
75
|
+
</li>
|
76
|
+
|
77
|
+
<li <% if is_active_link?(decidim_admin_consultations.results_consultation_path(current_participatory_space.consultation)) %> class="is-active" <% end %>>
|
78
|
+
<%= aria_selected_link_to t("results", scope: "decidim.admin.menu.consultations_submenu"),
|
79
|
+
decidim_admin_action_delegator.results_consultation_path(current_participatory_space.consultation) %>
|
80
|
+
</li>
|
81
|
+
|
82
|
+
</ul>
|
83
|
+
</div>
|
84
|
+
<% end %>
|
85
|
+
|
86
|
+
<%= render "layouts/decidim/admin/application" do %>
|
87
|
+
<div class="process-title">
|
88
|
+
<div class="process-title-content">
|
89
|
+
<%= link_to translated_attribute(current_participatory_space.consultation.title), decidim_consultations.consultation_path(current_participatory_space.consultation), target: "_blank" %>
|
90
|
+
>
|
91
|
+
<%= strip_tags translated_attribute(current_participatory_space.title) %>
|
92
|
+
</div>
|
93
|
+
</div>
|
94
|
+
|
95
|
+
<div class="process-content">
|
96
|
+
<%= yield %>
|
97
|
+
</div>
|
98
|
+
<% end %>
|