decidim-action_delegator 0.8.1 → 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +104 -58
- data/Rakefile +2 -2
- data/app/commands/decidim/action_delegator/admin/create_delegation.rb +1 -3
- data/app/commands/decidim/action_delegator/admin/create_setting.rb +5 -2
- data/app/commands/decidim/action_delegator/admin/update_setting.rb +4 -2
- data/app/controllers/concerns/decidim/action_delegator/devise/sessions_controller_override.rb +1 -1
- data/app/controllers/concerns/decidim/action_delegator/election_per_question_votes_controller_override.rb +65 -0
- data/app/controllers/concerns/decidim/action_delegator/election_votes_controller_override.rb +38 -0
- data/app/controllers/concerns/decidim/action_delegator/votes_controller_methods.rb +46 -0
- data/app/controllers/decidim/action_delegator/admin/application_controller.rb +11 -5
- data/app/controllers/decidim/action_delegator/admin/delegations_controller.rb +3 -11
- data/app/controllers/decidim/action_delegator/admin/invite_participants_controller.rb +0 -8
- data/app/controllers/decidim/action_delegator/admin/manage_delegations_controller.rb +13 -21
- data/app/controllers/decidim/action_delegator/admin/manage_participants_controller.rb +11 -20
- data/app/controllers/decidim/action_delegator/admin/participants_controller.rb +1 -9
- data/app/controllers/decidim/action_delegator/admin/permissions_controller.rb +1 -24
- data/app/controllers/decidim/action_delegator/admin/ponderations_controller.rb +0 -8
- data/app/controllers/decidim/action_delegator/admin/settings_controller.rb +12 -12
- data/app/controllers/decidim/action_delegator/application_controller.rb +3 -3
- data/app/controllers/decidim/action_delegator/elections/admin/results_controller.rb +58 -0
- data/app/controllers/decidim/action_delegator/elections/results_controller.rb +36 -0
- data/app/controllers/decidim/action_delegator/user_delegations_controller.rb +1 -1
- data/app/controllers/decidim/action_delegator/verifications/delegations_verifier/authorizations_controller.rb +14 -18
- data/app/forms/decidim/action_delegator/admin/action_delegator_census_form.rb +44 -0
- data/app/forms/decidim/action_delegator/admin/csv_import_form.rb +17 -0
- data/app/forms/decidim/action_delegator/admin/delegation_form.rb +6 -2
- data/app/forms/decidim/action_delegator/admin/ponderation_form.rb +2 -1
- data/app/forms/decidim/action_delegator/admin/setting_form.rb +16 -10
- data/app/forms/decidim/action_delegator/censuses/internal_users_form.rb +32 -0
- data/app/forms/decidim/action_delegator/verifications/delegations_verifier_form.rb +41 -25
- data/app/helpers/decidim/action_delegator/admin/{delegation_helper.rb → settings_helper.rb} +3 -16
- data/app/helpers/decidim/action_delegator/settings_helper.rb +124 -0
- data/app/jobs/decidim/action_delegator/admin/invite_participants_job.rb +1 -1
- data/app/jobs/decidim/action_delegator/send_sms_job.rb +2 -2
- data/app/jobs/decidim/action_delegator/twilio_send_sms_job.rb +2 -2
- data/app/models/decidim/action_delegator/delegation.rb +35 -9
- data/app/models/decidim/action_delegator/participant.rb +15 -9
- data/app/models/decidim/action_delegator/ponderation.rb +0 -2
- data/app/models/decidim/action_delegator/setting.rb +14 -32
- data/app/overrides/decidim/elections/admin/dashboard/_results/_add_results_contents.html.erb.deface +10 -0
- data/app/overrides/decidim/elections/admin/dashboard/_results/_add_results_tabs.html.erb.deface +3 -0
- data/app/overrides/decidim/elections/elections/_election_aside/add_delegation_buttons.html.erb.deface +3 -0
- data/app/overrides/decidim/elections/elections/_vote_results/replace_results_div.html.erb.deface +8 -0
- data/app/overrides/decidim/elections/per_question_votes/show/add_delegation_hidden_input.html.erb.deface +3 -0
- data/app/overrides/decidim/elections/per_question_votes/show/add_delegation_id_to_links.html.erb.deface +3 -0
- data/app/overrides/decidim/elections/per_question_votes/waiting/add_delegation_buttons.html.erb.deface +3 -0
- data/app/overrides/decidim/elections/votes/receipt/add_delegation_buttons.html.erb.deface +3 -0
- data/app/packs/entrypoints/decidim_action_delegator_elections.js +1 -0
- data/app/packs/src/decidim/action_delegator/elections_live_results.js +160 -0
- data/app/permissions/decidim/action_delegator/admin/permissions.rb +29 -0
- data/app/permissions/decidim/action_delegator/permissions.rb +6 -30
- data/app/presenters/decidim/action_delegator/setting_presenter.rb +33 -0
- data/app/queries/decidim/action_delegator/action_delegator_census_users.rb +51 -0
- data/app/queries/decidim/action_delegator/authorized_resources.rb +28 -0
- data/app/queries/decidim/action_delegator/election_settings.rb +23 -0
- data/app/queries/decidim/action_delegator/{delegated_votes_versions.rb → elections_delegated_votes_versions.rb} +8 -8
- data/app/queries/decidim/action_delegator/elections_question_responses_by_type.rb +33 -0
- data/app/queries/decidim/action_delegator/elections_question_weighted_responses.rb +28 -0
- data/app/queries/decidim/action_delegator/elections_votes_with_ponderations.rb +62 -0
- data/app/services/decidim/action_delegator/delegations_csv_importer.rb +3 -3
- data/app/services/decidim/action_delegator/participants_csv_importer.rb +1 -1
- data/app/services/decidim/action_delegator/sms_gateway.rb +2 -2
- data/app/views/decidim/action_delegator/admin/censuses/_action_delegator_census_form.html.erb +44 -0
- data/app/views/decidim/action_delegator/admin/censuses/_action_delegator_census_options_form.html.erb +25 -0
- data/app/views/decidim/action_delegator/admin/delegations/index.html.erb +12 -13
- data/app/views/decidim/action_delegator/admin/delegations/new.html.erb +29 -27
- data/app/views/decidim/action_delegator/admin/manage_delegations/new.html.erb +36 -24
- data/app/views/decidim/action_delegator/admin/manage_participants/new.html.erb +47 -33
- data/app/views/decidim/action_delegator/admin/participants/_form.html.erb +14 -8
- data/app/views/decidim/action_delegator/admin/participants/edit.html.erb +11 -13
- data/app/views/decidim/action_delegator/admin/participants/index.html.erb +20 -25
- data/app/views/decidim/action_delegator/admin/participants/new.html.erb +11 -13
- data/app/views/decidim/action_delegator/admin/ponderations/_form.html.erb +13 -7
- data/app/views/decidim/action_delegator/admin/ponderations/edit.html.erb +11 -13
- data/app/views/decidim/action_delegator/admin/ponderations/index.html.erb +8 -11
- data/app/views/decidim/action_delegator/admin/ponderations/new.html.erb +11 -13
- data/app/views/decidim/action_delegator/admin/settings/_form.html.erb +26 -12
- data/app/views/decidim/action_delegator/admin/settings/_participants_sync_check.html.erb +1 -1
- data/app/views/decidim/action_delegator/admin/settings/_setting_checks.html.erb +11 -16
- data/app/views/decidim/action_delegator/admin/settings/edit.html.erb +11 -12
- data/app/views/decidim/action_delegator/admin/settings/index.html.erb +22 -19
- data/app/views/decidim/action_delegator/admin/settings/new.html.erb +11 -12
- data/app/views/decidim/action_delegator/admin/shared/_tabs_menu.html.erb +15 -0
- data/app/views/decidim/action_delegator/censuses/_internal_users_form.html.erb +61 -0
- data/app/views/decidim/action_delegator/elections/_delegation_buttons.html.erb +10 -0
- data/app/views/decidim/action_delegator/elections/_normal_election_buttons.html.erb +13 -0
- data/app/views/decidim/action_delegator/elections/_per_question_buttons.html.erb +9 -0
- data/app/views/decidim/action_delegator/elections/_per_question_waiting_buttons.html.erb +19 -0
- data/app/views/decidim/action_delegator/elections/_vote_results.html.erb +10 -0
- data/app/views/decidim/action_delegator/elections/_vote_results_question.html.erb +13 -0
- data/app/views/decidim/action_delegator/elections/admin/dashboard/_by_type_and_weight.html.erb +45 -0
- data/app/views/decidim/action_delegator/elections/admin/dashboard/_results_tabs.html.erb +5 -0
- data/app/views/decidim/action_delegator/elections/admin/dashboard/_results_type_info.html.erb +4 -0
- data/app/views/decidim/action_delegator/elections/admin/dashboard/_sum_of_weights.html.erb +43 -0
- data/app/views/decidim/action_delegator/elections/admin/dashboard/_totals.html.erb +27 -0
- data/app/views/decidim/action_delegator/user_delegations/index.html.erb +13 -14
- data/app/views/decidim/action_delegator/verifications/delegations_verifier/authorizations/edit.html.erb +19 -29
- data/app/views/decidim/action_delegator/verifications/delegations_verifier/authorizations/new.html.erb +42 -40
- data/config/assets.rb +3 -35
- data/config/i18n-tasks.yml +27 -5
- data/config/locales/ca.yml +70 -56
- data/config/locales/cs.yml +161 -145
- data/config/locales/en.yml +110 -67
- data/config/locales/es.yml +70 -56
- data/db/migrate/20200824113801_create_settings.rb +1 -1
- data/db/migrate/20250729104037_add_title_to_action_delegator_settings.rb +31 -0
- data/lib/decidim/action_delegator/admin_engine.rb +72 -45
- data/lib/decidim/action_delegator/common_rake.rb +13 -0
- data/lib/decidim/action_delegator/engine.rb +49 -19
- data/lib/decidim/action_delegator/test/delegation_examples.rb +144 -0
- data/lib/decidim/action_delegator/test/factories.rb +11 -6
- data/lib/decidim/action_delegator/verifications/delegations_authorizer.rb +80 -47
- data/lib/decidim/action_delegator/version.rb +3 -3
- data/lib/decidim/action_delegator.rb +8 -26
- data/lib/tasks/migrate_consultations.rake +382 -0
- data/lib/tasks/upgrade_tasks.rake +5 -0
- data/package.json +10 -27
- metadata +72 -112
- data/app/commands/concerns/decidim/action_delegator/consultations/multiple_vote_question_override.rb +0 -31
- data/app/commands/concerns/decidim/action_delegator/consultations/vote_question_override.rb +0 -44
- data/app/commands/decidim/action_delegator/admin/fix_resource_permissions.rb +0 -46
- data/app/commands/decidim/action_delegator/vote_delegation.rb +0 -28
- data/app/controllers/concerns/decidim/action_delegator/consultations/consultations_controller_override.rb +0 -16
- data/app/controllers/concerns/decidim/action_delegator/consultations/question_multiple_votes_controller_override.rb +0 -29
- data/app/controllers/concerns/decidim/action_delegator/consultations/question_votes_controller_override.rb +0 -57
- data/app/controllers/concerns/decidim/action_delegator/consultations/questions_controller_override.rb +0 -16
- data/app/controllers/concerns/decidim/action_delegator/needs_consultation_styles.rb +0 -24
- data/app/controllers/decidim/action_delegator/admin/consultations/exports_controller.rb +0 -27
- data/app/controllers/decidim/action_delegator/admin/consultations_controller.rb +0 -47
- data/app/controllers/decidim/action_delegator/admin/exports/_sum_of_weights_controller.rb +0 -15
- data/app/forms/concerns/decidim/action_delegator/consultations/vote_form_override.rb +0 -15
- data/app/helpers/decidim/action_delegator/delegation_helper.rb +0 -13
- data/app/jobs/decidim/action_delegator/export_consultation_results_job.rb +0 -51
- data/app/models/concerns/decidim/action_delegator/consultations/question_override.rb +0 -18
- data/app/models/concerns/decidim/action_delegator/consultations/vote_override.rb +0 -15
- data/app/models/decidim/action_delegator/unversioned_vote.rb +0 -19
- data/app/models/decidim/action_delegator/whodunnit_vote.rb +0 -28
- data/app/overrides/decidim/consultations/admin/consultations/results/add_ongoing_warning.html.erb.deface +0 -3
- data/app/overrides/decidim/consultations/consultations/_question/add_delegation_link.html.erb.deface +0 -3
- data/app/overrides/decidim/consultations/consultations/_regular_questions/prevent_empty_questions.html.erb.deface +0 -10
- data/app/overrides/decidim/consultations/consultations/_regular_questions/remove_highlighted_scopes.html.erb.deface +0 -5
- data/app/overrides/decidim/consultations/question_multiple_votes/_form/add_delegation_notice.html.erb.deface +0 -8
- data/app/overrides/decidim/consultations/questions/_vote_button/add_delegations_link.html.erb.deface +0 -3
- data/app/overrides/decidim/consultations/questions/_vote_button/add_modal.html.erb.deface +0 -3
- data/app/overrides/decidim/consultations/questions/_vote_button/add_modal_javascript.html.erb.deface +0 -4
- data/app/overrides/decidim/consultations/questions/_vote_button/replace_delegation_to_multivote_link.html.erb.deface +0 -8
- data/app/overrides/decidim/consultations/questions/_vote_modal/add_delegation_callout.html.erb.deface +0 -3
- data/app/overrides/decidim/consultations/questions/_vote_modal_confirm/add_delegation_callout.html.erb.deface +0 -3
- data/app/overrides/decidim/consultations/questions/_vote_modal_confirm/add_hidden_field.html.erb.deface +0 -3
- data/app/overrides/layouts/decidim/admin/remove_deprecation.rb +0 -10
- data/app/packs/entrypoints/decidim_action_delegator.scss +0 -1
- data/app/packs/entrypoints/decidim_action_delegator_questions.js +0 -5
- data/app/packs/src/decidim/action_delegator/questions.js +0 -33
- data/app/packs/stylesheets/decidim/action_delegator/questions.scss +0 -26
- data/app/permissions/concerns/decidim/action_delegator/consultations/permissions_override.rb +0 -35
- data/app/presenters/decidim/action_delegator/question_with_totals.rb +0 -24
- data/app/queries/decidim/action_delegator/consultation_delegations.rb +0 -25
- data/app/queries/decidim/action_delegator/delegates_votes_by_consultation.rb +0 -24
- data/app/queries/decidim/action_delegator/delegates_votes_by_question.rb +0 -26
- data/app/queries/decidim/action_delegator/delegation_votes.rb +0 -30
- data/app/queries/decidim/action_delegator/grantee_delegations.rb +0 -24
- data/app/queries/decidim/action_delegator/organization_delegations.rb +0 -26
- data/app/queries/decidim/action_delegator/organization_settings.rb +0 -31
- data/app/queries/decidim/action_delegator/responses.rb +0 -24
- data/app/queries/decidim/action_delegator/responses_by_membership.rb +0 -58
- data/app/queries/decidim/action_delegator/scrutiny.rb +0 -87
- data/app/queries/decidim/action_delegator/setting_delegations.rb +0 -19
- data/app/queries/decidim/action_delegator/sum_of_membership_weight.rb +0 -44
- data/app/queries/decidim/action_delegator/sum_of_weights.rb +0 -25
- data/app/queries/decidim/action_delegator/type_and_weight.rb +0 -26
- data/app/queries/decidim/action_delegator/voted_with_ponderations.rb +0 -30
- data/app/queries/decidim/action_delegator/votes_count_aggregation.rb +0 -34
- data/app/serializers/decidim/action_delegator/consultation_results_serializer.rb +0 -19
- data/app/views/decidim/action_delegator/admin/consultations/_ongoing_consultation_warning.html.erb +0 -3
- data/app/views/decidim/action_delegator/admin/consultations/results.html.erb +0 -65
- data/app/views/decidim/action_delegator/admin/consultations/weighted_results.html.erb +0 -66
- data/app/views/decidim/action_delegator/consultations/_link_to_question.html.erb +0 -11
- data/app/views/decidim/action_delegator/consultations/questions/_callout.html.erb +0 -5
- data/app/views/decidim/action_delegator/consultations/questions/_delegations_modal.html.erb +0 -34
- data/app/views/decidim/action_delegator/consultations/questions/_link_to_delegations.html.erb +0 -11
- data/app/views/decidim/action_delegator/consultations/questions/_vote_delegated_active.html.erb +0 -32
- data/app/views/decidim/action_delegator/consultations/questions/_vote_delegated_finished.html.erb +0 -9
- data/app/views/decidim/action_delegator/consultations/questions/_vote_delegated_upcoming.html.erb +0 -8
- data/app/views/decidim/consultations/question_votes/update_vote_button.js.erb +0 -82
- data/lib/tasks/import_direct_verification.rake +0 -30
@@ -1,27 +1,22 @@
|
|
1
|
-
<%
|
2
|
-
<%
|
3
|
-
<%
|
4
|
-
<% status_err = (missing_questions.present? || missing_registered.present? || setting.participants.blank? || total_missing_authorizations.positive?)
|
5
|
-
if setting&.consultation&.questions&.count == missing_questions.count
|
6
|
-
status_err = false
|
7
|
-
end %>
|
1
|
+
<% missing_registered = missing_registered_users(setting&.participants) %>
|
2
|
+
<% total_missing_authorizations = total_missing_authorizations(setting&.participants) %>
|
3
|
+
<% status_err = (missing_registered.present? || setting.participants.blank? || total_missing_authorizations.positive?) %>
|
8
4
|
|
9
5
|
<%= render "decidim/action_delegator/admin/settings/participants_sync_check", setting: setting %>
|
10
6
|
|
11
7
|
<div class="callout <%= status_err ? "warning" : "success" %> text-left">
|
12
|
-
|
8
|
+
<p class="font-bold"><%= t(".applies_to") %></p>
|
13
9
|
<ul class="happy-faces">
|
14
|
-
<% if setting.
|
15
|
-
<%
|
16
|
-
<li
|
17
|
-
<%= t(".consultation_questions_missing_verifier_html", count: missing_questions.count) %><br>
|
18
|
-
<%= link_to t(".click_to_fix"), decidim_admin_action_delegator.setting_permissions_path(setting), method: :post %>
|
19
|
-
</li>
|
20
|
-
<% else %>
|
21
|
-
<li class="happy"><%= t(".consultation_questions_all_verified_html") %></li>
|
10
|
+
<% if setting.presenter.translated_resources_list.any? %>
|
11
|
+
<% setting.presenter.translated_resources_list.each do |resource| %>
|
12
|
+
<li><%= link_to resource.title, setting.presenter.path_for(resource), target: "_blank", data: { "external-link": false } %></li>
|
22
13
|
<% end %>
|
14
|
+
<% else %>
|
15
|
+
<li class="unhappy text-alert"><%= t(".no_resources_found") %></li>
|
23
16
|
<% end %>
|
17
|
+
</ul>
|
24
18
|
|
19
|
+
<ul class="happy-faces mt-4">
|
25
20
|
<% if setting.participants.any? %>
|
26
21
|
<% if missing_registered.present? %>
|
27
22
|
<li class="warning"><%= t(".missing_registered_users_html", count: missing_registered.count) %></li>
|
@@ -1,17 +1,16 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
<%= link_to t("title", scope: "decidim.action_delegator.admin.settings.index"), decidim_admin_action_delegator.settings_path %> >
|
5
|
-
<%= t ".title" %>
|
6
|
-
</h2>
|
7
|
-
</div>
|
1
|
+
<%= render "decidim/action_delegator/admin/shared/tabs_menu" do %>
|
2
|
+
<%= button_tag t("decidim.action_delegator.admin.settings.edit.save"), class: "main-tabs-menu__cta-button", form: "main-setting-form-edit" %>
|
3
|
+
<% end %>
|
8
4
|
|
9
|
-
|
10
|
-
|
11
|
-
|
5
|
+
<div class="item__edit item__edit-1col">
|
6
|
+
<div class="item__edit-form">
|
7
|
+
<%= decidim_form_for(@form, html: { id: "main-setting-form-edit", class: "form-defaults form edit_setting setting_form_admin" }) do |form| %>
|
8
|
+
<%= render partial: "form", object: form %>
|
12
9
|
|
13
|
-
<div class="
|
14
|
-
|
10
|
+
<div class="item__edit-sticky">
|
11
|
+
<div class="item__edit-sticky-container">
|
12
|
+
<%= form.submit t(".save"), class: "button button__sm button__secondary" %>
|
13
|
+
</div>
|
15
14
|
</div>
|
16
15
|
<% end %>
|
17
16
|
</div>
|
@@ -1,46 +1,49 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
</
|
1
|
+
<% add_decidim_page_title(t(".title")) %>
|
2
|
+
|
3
|
+
<div class="item_show__header">
|
4
|
+
<h1 class="item_show__header-title">
|
5
|
+
<%= t ".title" %>
|
6
|
+
<%= link_to t(".actions.new_setting"), decidim_admin_action_delegator.new_setting_path, class: "button button__sm button__secondary" %>
|
7
|
+
</h1>
|
8
|
+
</div>
|
9
|
+
|
10
|
+
<div class="card" id='user-groups'>
|
8
11
|
<div class="card-section">
|
9
|
-
<
|
12
|
+
<div class="help-text my-4"><%= t ".description_html" %></div>
|
13
|
+
|
10
14
|
<%= render "check_verifier" %>
|
11
|
-
<div class="table-
|
15
|
+
<div class="table-stacked">
|
12
16
|
<table class="table-list">
|
13
17
|
<thead>
|
14
18
|
<tr>
|
15
|
-
<th><%= t(".
|
19
|
+
<th><%= t(".name") %></th>
|
16
20
|
<th><%= t(".max_grants") %></th>
|
17
21
|
<th><%= t(".authorization_method") %></th>
|
18
22
|
<th><%= t(".delegations") %></th>
|
19
23
|
<th><%= t(".ponderations") %></th>
|
20
24
|
<th><%= t(".census") %></th>
|
21
25
|
<th><%= t(".created_at") %></th>
|
22
|
-
<th><%= t(".
|
26
|
+
<th><%= t(".active") %></th>
|
23
27
|
<th> </th>
|
24
28
|
</tr>
|
25
29
|
</thead>
|
26
30
|
<tbody>
|
27
31
|
<% settings.each do |setting| %>
|
28
32
|
<tr data-setting-id="<%= setting.id %>">
|
29
|
-
<td><%= link_to translated_attribute(setting.title),
|
33
|
+
<td><%= link_to translated_attribute(setting.title), edit_setting_path(setting) %></td>
|
30
34
|
<td><%= setting.max_grants %></td>
|
31
35
|
<td class="text-<%= setting.phone_required? ? (setting.verify_with_both? ? "success" : "secondary") : "warning" %>"><%= t setting.authorization_method, scope: "decidim.action_delegator.admin.settings.authorization_method" %></td>
|
32
36
|
<td><%= setting.delegations.count %></td>
|
33
37
|
<td><%= setting.ponderations.count %></td>
|
34
38
|
<td><%= setting.participants.count %></td>
|
35
39
|
<td><%= l setting.created_at, format: :short %></td>
|
36
|
-
<td class="text-<%= setting.
|
37
|
-
|
40
|
+
<td class="text-<%= setting.active? ? "success" : "alert" %>"><%= t "booleans.#{setting.active}" %></td>
|
38
41
|
<td class="table-list__actions">
|
39
|
-
<%= icon_link_to "pencil",
|
40
|
-
<%= icon_link_to "
|
41
|
-
<%= icon_link_to "
|
42
|
-
<%= icon_link_to "
|
43
|
-
<%= icon_link_to "
|
42
|
+
<%= icon_link_to "pencil-line", edit_setting_path(setting), t("actions.edit", scope: "decidim.admin"), class: "action-icon--edit" %>
|
43
|
+
<%= icon_link_to "scales-line", setting_ponderations_path(setting), t(".actions.ponderate"), class: "action-icon--edit" %>
|
44
|
+
<%= icon_link_to "group-line", setting_participants_path(setting), t(".actions.census"), class: "action-icon--edit" %>
|
45
|
+
<%= icon_link_to "user-shared-line", setting_delegations_path(setting), t(".actions.delegations"), class: "action-icon--edit" %>
|
46
|
+
<%= icon_link_to "delete-bin-line", setting_path(setting), t("actions.destroy", scope: "decidim.admin"), class: "action-icon--remove", method: :delete, data: { confirm: t("actions.confirm_destroy", scope: "decidim.admin") } if setting.destroyable? %>
|
44
47
|
</td>
|
45
48
|
</tr>
|
46
49
|
<% if setting.editable? %>
|
@@ -1,17 +1,16 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
<%= link_to t("title", scope: "decidim.action_delegator.admin.settings.index"), decidim_admin_action_delegator.settings_path %> >
|
5
|
-
<%= t ".title" %>
|
6
|
-
</h2>
|
7
|
-
</div>
|
1
|
+
<%= render "decidim/action_delegator/admin/shared/tabs_menu" do %>
|
2
|
+
<%= button_tag t("decidim.action_delegator.admin.settings.edit.save"), class: "main-tabs-menu__cta-button", form: "main-setting-form-edit" %>
|
3
|
+
<% end %>
|
8
4
|
|
9
|
-
|
10
|
-
|
11
|
-
|
5
|
+
<div class="item__edit item__edit-1col">
|
6
|
+
<div class="item__edit-form">
|
7
|
+
<%= decidim_form_for(@form, html: { id: "main-setting-form-edit", class: "form-defaults form new_setting setting_form_admin" }) do |form| %>
|
8
|
+
<%= render partial: "form", object: form %>
|
12
9
|
|
13
|
-
<div class="
|
14
|
-
|
10
|
+
<div class="item__edit-sticky">
|
11
|
+
<div class="item__edit-sticky-container">
|
12
|
+
<%= form.submit t(".save"), class: "button button__sm button__secondary" %>
|
13
|
+
</div>
|
15
14
|
</div>
|
16
15
|
<% end %>
|
17
16
|
</div>
|
@@ -0,0 +1,15 @@
|
|
1
|
+
<div class="item_show__header">
|
2
|
+
<h1 class="item_show__header-title">
|
3
|
+
<%= current_setting ? translated_attribute(current_setting.title) : t("decidim.action_delegator.admin.settings.new.title") %>
|
4
|
+
</h1>
|
5
|
+
</div>
|
6
|
+
|
7
|
+
<div class="main-tabs-menu">
|
8
|
+
<div class="main-tabs-menu__tabs">
|
9
|
+
<%= admin_tabs(:admin_action_delegator_menu).render %>
|
10
|
+
</div>
|
11
|
+
|
12
|
+
<div class="main-tabs-menu__buttons">
|
13
|
+
<%= yield if block_given? %>
|
14
|
+
</div>
|
15
|
+
</div>
|
@@ -0,0 +1,61 @@
|
|
1
|
+
<% if current_user %>
|
2
|
+
<% if @form.in_census? && @form.invalid? %>
|
3
|
+
<%= cell "decidim/announcement", title: t("decidim.elections.censuses.internal_users_form.invalid"), body: t("decidim.elections.censuses.internal_users_form.authorization_options_invalid"), callout_class: "alert" %>
|
4
|
+
<% cell("decidim/authorization_modal", @form.authorization_status).verifications.each do |verification| %>
|
5
|
+
<div class="authorization-modal__verification">
|
6
|
+
<% verification[:messages].each do |msg| %>
|
7
|
+
<p><%= msg %></p>
|
8
|
+
<% end %>
|
9
|
+
|
10
|
+
<% if verification[:fields].present? %>
|
11
|
+
<ul>
|
12
|
+
<% verification[:fields].each do |field| %>
|
13
|
+
<li><%= field %></li>
|
14
|
+
<% end %>
|
15
|
+
</ul>
|
16
|
+
<% end %>
|
17
|
+
</div>
|
18
|
+
<% end %>
|
19
|
+
<%= link_to t("decidim.elections.censuses.internal_users_form.exit_button"), exit_path, class: "button button__secondary button__lg w-full mt-12" %>
|
20
|
+
<%= render "decidim/elections/censuses/submit_button", form: form, disabled: true %>
|
21
|
+
<% else %>
|
22
|
+
<% redirect_url = new_election_vote_path(election) %>
|
23
|
+
<div class="verification__container">
|
24
|
+
<% @form.authorizations.each do |adapter, authorization| %>
|
25
|
+
<% if authorization %>
|
26
|
+
<% if authorization.granted? %>
|
27
|
+
<div class="verification verification__no_clickable">
|
28
|
+
<%= icon "checkbox-circle-line", class: "verification__icon is-granted" %>
|
29
|
+
<div class="verification__text">
|
30
|
+
<h2 class="h5 text-secondary">
|
31
|
+
<%= adapter.fullname %>
|
32
|
+
</h2>
|
33
|
+
</div>
|
34
|
+
</div>
|
35
|
+
<% else %>
|
36
|
+
<%= link_to adapter.resume_authorization_path(redirect_url:), class: "verification" do %>
|
37
|
+
<%= icon "time-line", class: "verification__icon" %>
|
38
|
+
<div class="verification__text">
|
39
|
+
<h2 class="h5 text-secondary">
|
40
|
+
<%= t("decidim.elections.censuses.internal_users_form.resume_with_method", name: adapter.fullname) %>
|
41
|
+
</h2>
|
42
|
+
</div>
|
43
|
+
<% end %>
|
44
|
+
<% end %>
|
45
|
+
<% else %>
|
46
|
+
<%= link_to adapter.root_path(redirect_url:), class: "verification" do %>
|
47
|
+
<%= icon(adapter.icon || "login-circle-line", class: "verification__icon") %>
|
48
|
+
<div class="verification__text">
|
49
|
+
<h2 class="h5 text-secondary">
|
50
|
+
<%= t("decidim.elections.censuses.internal_users_form.verify_with_method", name: adapter.fullname) %>
|
51
|
+
</h2>
|
52
|
+
</div>
|
53
|
+
<% end %>
|
54
|
+
<% end %>
|
55
|
+
<% end %>
|
56
|
+
</div>
|
57
|
+
<%= render "decidim/elections/censuses/submit_button", form: form %>
|
58
|
+
<% end %>
|
59
|
+
<% else %>
|
60
|
+
<%= render partial: "decidim/devise/shared/login_boxes", locals: { scope: "decidim.elections.censuses.internal_users" } %>
|
61
|
+
<% end %>
|
@@ -0,0 +1,10 @@
|
|
1
|
+
<% delegations = delegations_for(election, current_user) %>
|
2
|
+
<% if delegations.any? %>
|
3
|
+
<div class="election__aside-voted mt-6 hidden lg:block">
|
4
|
+
<% if election.per_question? %>
|
5
|
+
<%= render "decidim/action_delegator/elections/per_question_buttons", delegations: %>
|
6
|
+
<% else %>
|
7
|
+
<%= render "decidim/action_delegator/elections/normal_election_buttons", delegations: %>
|
8
|
+
<% end %>
|
9
|
+
</div>
|
10
|
+
<% end %>
|
@@ -0,0 +1,13 @@
|
|
1
|
+
<h4 class="h6 mb-4"><%= t("decidim.action_delegator.elections.delegation_buttons.delegations_active") %></h4>
|
2
|
+
|
3
|
+
<% delegations.each do |delegation| %>
|
4
|
+
<% if participant_voted?(election, delegation.granter) %>
|
5
|
+
<%= link_to new_election_vote_path(election, delegation: delegation.id), class: "button button__secondary button__lg" do %>
|
6
|
+
✔ <%= t("decidim.action_delegator.elections.delegation_buttons.vote_for", name: delegation.granter.name) %>
|
7
|
+
<% end %>
|
8
|
+
<% else %>
|
9
|
+
<%= link_to new_election_vote_path(election, delegation: delegation.id), class: "button button__primary button__lg" do %>
|
10
|
+
👉 <%= t("decidim.action_delegator.elections.delegation_buttons.vote_for", name: delegation.granter.name) %>
|
11
|
+
<% end %>
|
12
|
+
<% end %>
|
13
|
+
<% end %>
|
@@ -0,0 +1,9 @@
|
|
1
|
+
<h4 class="h6 mb-4"><%= t("decidim.action_delegator.elections.delegation_buttons.delegations_active") %></h4>
|
2
|
+
<p><%= t("decidim.action_delegator.elections.delegation_buttons.per_question_delegations") %></p>
|
3
|
+
<ul class="mt-4 space-y-2">
|
4
|
+
<% delegations.each do |delegation| %>
|
5
|
+
<li class="flex items-center space-x-2">
|
6
|
+
<%= participant_voted?(election, delegation.granter) ? "✔" : "👉" %> <%= delegation.granter.name %>
|
7
|
+
</li>
|
8
|
+
<% end %>
|
9
|
+
</ul>
|
@@ -0,0 +1,19 @@
|
|
1
|
+
<% if delegations.any? %>
|
2
|
+
<div class="waiting-buttons w-full mt-8 border p-6 rounded-lg bg-gray-3">
|
3
|
+
<h4 class="h4 mb-4"><%= t("decidim.action_delegator.elections.delegation_buttons.delegations_active") %></h4>
|
4
|
+
<% delegations.each do |delegation| %>
|
5
|
+
<% pending = pending_questions_for(delegation.granter) %>
|
6
|
+
<% if pending.any? %>
|
7
|
+
<%= link_to url_for(action: :show, id: pending.first, delegation: delegation.id), class: "button button__secondary button__lg" do %>
|
8
|
+
<%= icon "arrow-right-line", class: "fill-current mr-2" %>
|
9
|
+
<%= t("decidim.action_delegator.elections.votes.waiting_for", name: delegation.granter.name) %>
|
10
|
+
<% end %>
|
11
|
+
<% elsif question.sibling_questions.any? %>
|
12
|
+
<%= link_to url_for(action: :show, id: question.sibling_questions.first, delegation: delegation.id), class: "button button__transparent-secondary button__lg" do %>
|
13
|
+
<%= icon "edit-line", class: "fill-current mr-2" %>
|
14
|
+
<%= t("decidim.action_delegator.elections.votes.edit_vote_for", name: delegation.granter.name) %>
|
15
|
+
<% end %>
|
16
|
+
<% end %>
|
17
|
+
<% end %>
|
18
|
+
</div>
|
19
|
+
<% end %>
|
@@ -0,0 +1,10 @@
|
|
1
|
+
<div data-weight-results-live-update="<%= decidim_action_delegator.elections_results_sum_of_weights_path(election) %>">
|
2
|
+
<div data-questions-container>
|
3
|
+
<% questions.each do |question| %>
|
4
|
+
<%= render "decidim/action_delegator/elections/vote_results_question", question: %>
|
5
|
+
<% end %>
|
6
|
+
</div>
|
7
|
+
|
8
|
+
<%= render "decidim/action_delegator/elections/vote_results_question", question: OpenStruct.new(id: 0, body: {}, response_options: []) %>
|
9
|
+
<%= render "decidim/elections/elections/vote_results_option", option: OpenStruct.new(id: 0, body: {}, votes_count: 0, votes_percent: 0) %>
|
10
|
+
</div>
|
@@ -0,0 +1,13 @@
|
|
1
|
+
<div class="card-accordion card-accordion-election-results<%= " hidden" if question.id.zero? %>" data-controller="accordion" id="question-<%= question.id %>">
|
2
|
+
<div class="card-accordion-divider">
|
3
|
+
<button class="card-accordion-divider-button" data-open="true" data-controls="panel-results-<%= question.id %>">
|
4
|
+
<%= question_title(question, data: { "question-body" => true }) %>
|
5
|
+
<%= icon "arrow-down-s-line" %>
|
6
|
+
</button>
|
7
|
+
</div>
|
8
|
+
<div id="panel-results-<%= question.id %>" class="card-accordion-section" aria-hidden="false" data-options-container>
|
9
|
+
<% question.response_options.any? && elections_question_weighted_responses(question).each do |option| %>
|
10
|
+
<%= render "decidim/elections/elections/vote_results_option", option: OpenStruct.new(**option) %>
|
11
|
+
<% end %>
|
12
|
+
</div>
|
13
|
+
</div>
|
data/app/views/decidim/action_delegator/elections/admin/dashboard/_by_type_and_weight.html.erb
ADDED
@@ -0,0 +1,45 @@
|
|
1
|
+
<div data-weight-results-live-update="<%= decidim_action_delegator.elections_admin_results_by_type_and_weight_path(election) %>">
|
2
|
+
<% election_questions.each do |question| %>
|
3
|
+
<div class="card mb-4" id="question_<%= question.id %>">
|
4
|
+
<div class="card-divider">
|
5
|
+
<h3 class="h6 my-2 flex items-center justify-between">
|
6
|
+
<div>
|
7
|
+
<%= translated_attribute(question.body) %>
|
8
|
+
<small class="font-normal ml-4"><%= t("decidim.forms.question_types.#{question.question_type}") %></small>
|
9
|
+
</div>
|
10
|
+
|
11
|
+
<% if election.per_question? %>
|
12
|
+
<div class="flex gap-4 items-center justify-between">
|
13
|
+
<%= enable_question_voting_button(question) %>
|
14
|
+
<%= publish_question_button(question) %>
|
15
|
+
</div>
|
16
|
+
<% end %>
|
17
|
+
</h3>
|
18
|
+
</div>
|
19
|
+
<div class="row column">
|
20
|
+
<div class="table-scroll mb-4">
|
21
|
+
<table class="table-list">
|
22
|
+
<thead>
|
23
|
+
<tr>
|
24
|
+
<th><%= t("decidim.elections.admin.dashboard.questions_table.answer") %></th>
|
25
|
+
<th><%= t("decidim.action_delegator.elections.admin.dashboard.questions_table.weight") %></th>
|
26
|
+
<th><%= t("decidim.elections.admin.dashboard.questions_table.votes") %></th>
|
27
|
+
<th><%= t("decidim.elections.admin.dashboard.questions_table.percentage") %></th>
|
28
|
+
</tr>
|
29
|
+
</thead>
|
30
|
+
<tbody>
|
31
|
+
<% elections_question_responses_by_type(question).each do |option| %>
|
32
|
+
<tr>
|
33
|
+
<td><%= option[:body] %></td>
|
34
|
+
<td data-option-votes-weight-text="<%= question.id %>,<%= option[:id] %>,<%= option[:ponderation_id] %>"><%= option[:ponderation_title] %></td>
|
35
|
+
<td data-option-votes-count-text="<%= question.id %>,<%= option[:id] %>,<%= option[:ponderation_id] %>"><%= option[:votes_count_text] %></td>
|
36
|
+
<td data-option-votes-percent-text="<%= question.id %>,<%= option[:id] %>,<%= option[:ponderation_id] %>"><%= option[:votes_percent_text] %></td>
|
37
|
+
</tr>
|
38
|
+
<% end %>
|
39
|
+
</tbody>
|
40
|
+
</table>
|
41
|
+
</div>
|
42
|
+
</div>
|
43
|
+
</div>
|
44
|
+
<% end %>
|
45
|
+
</div>
|
@@ -0,0 +1,4 @@
|
|
1
|
+
<div class="callout callout-info mb-4">
|
2
|
+
<h5 class="h5"><%= t("title", scope: "decidim.action_delegator.elections.admin.dashboard.results_type_info") %></h5>
|
3
|
+
<p><%= t("#{params[:results]}_html", scope: "decidim.action_delegator.elections.admin.dashboard.results_type_info", default: t("normal_count_html", scope: "decidim.action_delegator.elections.admin.dashboard.results_type_info")) %></p>
|
4
|
+
</div>
|
@@ -0,0 +1,43 @@
|
|
1
|
+
<div data-weight-results-live-update="<%= decidim_action_delegator.elections_admin_results_sum_of_weights_path(election) %>">
|
2
|
+
<% election_questions.each do |question| %>
|
3
|
+
<div class="card mb-4" id="question_<%= question.id %>">
|
4
|
+
<div class="card-divider">
|
5
|
+
<h3 class="h6 my-2 flex items-center justify-between">
|
6
|
+
<div>
|
7
|
+
<%= translated_attribute(question.body) %>
|
8
|
+
<small class="font-normal ml-4"><%= t("decidim.forms.question_types.#{question.question_type}") %></small>
|
9
|
+
</div>
|
10
|
+
|
11
|
+
<% if election.per_question? %>
|
12
|
+
<div class="flex gap-4 items-center justify-between">
|
13
|
+
<%= enable_question_voting_button(question) %>
|
14
|
+
<%= publish_question_button(question) %>
|
15
|
+
</div>
|
16
|
+
<% end %>
|
17
|
+
</h3>
|
18
|
+
</div>
|
19
|
+
<div class="row column">
|
20
|
+
<div class="table-scroll mb-4">
|
21
|
+
<table class="table-list">
|
22
|
+
<thead>
|
23
|
+
<tr>
|
24
|
+
<th><%= t("decidim.elections.admin.dashboard.questions_table.answer") %></th>
|
25
|
+
<th><%= t("decidim.elections.admin.dashboard.questions_table.votes") %></th>
|
26
|
+
<th><%= t("decidim.elections.admin.dashboard.questions_table.percentage") %></th>
|
27
|
+
</tr>
|
28
|
+
</thead>
|
29
|
+
<tbody>
|
30
|
+
<% elections_question_weighted_responses(question).each do |option| %>
|
31
|
+
<tr>
|
32
|
+
<td><%= translated_attribute option[:body] %></td>
|
33
|
+
<td data-option-votes-count-text="<%= question.id %>,<%= option[:id] %>"><%= option[:votes_count_text] %></td>
|
34
|
+
<td data-option-votes-percent-text="<%= question.id %>,<%= option[:id] %>"><%= option[:votes_percent_text] %></td>
|
35
|
+
</tr>
|
36
|
+
<% end %>
|
37
|
+
</tbody>
|
38
|
+
</table>
|
39
|
+
</div>
|
40
|
+
</div>
|
41
|
+
</div>
|
42
|
+
<% end %>
|
43
|
+
</div>
|
@@ -0,0 +1,27 @@
|
|
1
|
+
<div data-weight-results-live-update="<%= decidim_action_delegator.elections_admin_results_totals_path(election) %>">
|
2
|
+
<div class="table-scroll my-4">
|
3
|
+
<table class="table-list">
|
4
|
+
<thead>
|
5
|
+
<tr>
|
6
|
+
<th><%= t("decidim.elections.admin.dashboard.questions_table.answer") %></th>
|
7
|
+
<th><%= t("decidim.action_delegator.elections.admin.dashboard.questions_table.unweighted_votes") %></th>
|
8
|
+
<th><%= t("decidim.action_delegator.elections.admin.dashboard.questions_table.weighted_votes") %></th>
|
9
|
+
<th><%= t("decidim.action_delegator.elections.admin.dashboard.questions_table.delegated_votes") %></th>
|
10
|
+
<th><%= t("decidim.action_delegator.elections.admin.dashboard.questions_table.participants") %></th>
|
11
|
+
</tr>
|
12
|
+
</thead>
|
13
|
+
<tbody>
|
14
|
+
<% election_questions.each do |question| %>
|
15
|
+
<% question_stats = elections_question_stats(question) %>
|
16
|
+
<tr>
|
17
|
+
<td><%= translated_attribute(question.body) %> <small class="font-normal ml-4"><%= t("decidim.forms.question_types.#{question.question_type}") %></small></td>
|
18
|
+
<td data-question-unweighted-count-text="<%= question.id %>"><%= question_stats[:unweighted_votes_text] %></td>
|
19
|
+
<td data-question-weighted-count-text="<%= question.id %>"><%= question_stats[:weighted_votes_text] %></td>
|
20
|
+
<td data-question-delegated-count-text="<%= question.id %>"><%= question_stats[:delegated_votes_text] %></td>
|
21
|
+
<td data-question-participants-count-text="<%= question.id %>"><%= question_stats[:participants_text] %></td>
|
22
|
+
</tr>
|
23
|
+
<% end %>
|
24
|
+
</tbody>
|
25
|
+
</table>
|
26
|
+
</div>
|
27
|
+
</div>
|
@@ -1,19 +1,18 @@
|
|
1
|
-
|
2
|
-
<
|
3
|
-
<div class="
|
1
|
+
<%= render layout: "layouts/decidim/shared/layout_user_profile" do %>
|
2
|
+
<div class="row column voluntary-work-list">
|
3
|
+
<div class="card__list-list">
|
4
4
|
<% delegations.each do |delegation| %>
|
5
|
-
<div class="
|
6
|
-
<div class="
|
7
|
-
<
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
<%= t(".vote_delegated", name: "<strong>#{delegation.granter.name}</strong>").html_safe %>
|
13
|
-
</span>
|
5
|
+
<div class="card__list">
|
6
|
+
<div class="card__list-content">
|
7
|
+
<h5 class="card__list-title">
|
8
|
+
<%= link_to translated_attribute(delegation.resource.title), Decidim::EngineRouter.main_proxy(delegation.resource.component).election_path(delegation.resource) %>
|
9
|
+
</h5>
|
10
|
+
<div class="card__list-text">
|
11
|
+
<%= t("vote_delegated", scope: "decidim.action_delegator.user_delegations.index", name: "<strong>#{delegation.granter.name}</strong>").html_safe %>
|
14
12
|
</div>
|
15
13
|
</div>
|
16
14
|
</div>
|
17
15
|
<% end %>
|
18
|
-
|
19
|
-
</div>
|
16
|
+
</div>
|
17
|
+
</div>
|
18
|
+
<% end %>
|
@@ -1,38 +1,28 @@
|
|
1
|
-
|
2
|
-
<div class="
|
3
|
-
<
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
</div>
|
1
|
+
<%= render layout: "layouts/decidim/shared/layout_center" do %>
|
2
|
+
<div class="text-center py-12">
|
3
|
+
<h1 class="h1 decorator inline-block text-left">
|
4
|
+
<%= t("title", scope: "decidim.action_delegator.verifications.delegations_verifier.authorizations.edit") %>
|
5
|
+
</h1>
|
6
|
+
</div>
|
8
7
|
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
<%= form_required_explanation %>
|
8
|
+
<div class="page__container page__container-open_data">
|
9
|
+
<div class="editor-content">
|
10
|
+
<%= decidim_form_for(@form, url: authorization_path(redirect_url: redirect_url), method: :put, html: { class: "form" }) do |form| %>
|
11
|
+
<div class="form__wrapper">
|
12
|
+
<%= form_required_explanation %>
|
15
13
|
|
16
|
-
|
17
|
-
<%= form.text_field :verification_code %>
|
18
|
-
</div>
|
14
|
+
<%= form.text_field :verification_code %>
|
19
15
|
|
20
|
-
|
21
|
-
|
22
|
-
</div>
|
23
|
-
<% end %>
|
16
|
+
<div class="form__wrapper-block">
|
17
|
+
<%= form.submit t("send", scope: "decidim.action_delegator.verifications.delegations_verifier.authorizations.edit"), :class => "button button__lg button__secondary", "data-disable-with" => "#{t("send", scope: "decidim.action_delegator.verifications.delegations_verifier.authorizations.edit")}..." %>
|
24
18
|
</div>
|
25
19
|
</div>
|
20
|
+
<% end %>
|
26
21
|
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
<p><%= t(".resend") %></p>
|
31
|
-
<%= link_to t(".destroy"), decidim_delegations_verifier.authorization_path, method: :delete, data: { confirm: t(".confirm_destroy") } %>
|
32
|
-
</div>
|
33
|
-
</div>
|
34
|
-
</div>
|
22
|
+
<div class="form__wrapper mt-6">
|
23
|
+
<p><%= t("resend", scope: "decidim.action_delegator.verifications.delegations_verifier.authorizations.edit") %></p>
|
24
|
+
<%= link_to t("destroy", scope: "decidim.action_delegator.verifications.delegations_verifier.authorizations.edit"), decidim_delegations_verifier.authorization_path, method: :delete, data: { confirm: t("confirm_destroy", scope: "decidim.action_delegator.verifications.delegations_verifier.authorizations.edit") }, class: "button button__sm button__ghost mt-2" %>
|
35
25
|
</div>
|
36
26
|
</div>
|
37
27
|
</div>
|
38
|
-
|
28
|
+
<% end %>
|