decidim-action_delegator 0.6.0 → 0.7.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +97 -36
- data/app/commands/{decidim → concerns/decidim}/action_delegator/consultations/vote_question_override.rb +9 -1
- data/app/commands/decidim/action_delegator/admin/create_delegation.rb +5 -1
- data/app/commands/decidim/action_delegator/admin/create_participant.rb +41 -0
- data/app/commands/decidim/action_delegator/admin/create_ponderation.rb +38 -0
- data/app/commands/decidim/action_delegator/admin/create_setting.rb +49 -0
- data/app/commands/decidim/action_delegator/admin/fix_resource_permissions.rb +46 -0
- data/app/commands/decidim/action_delegator/admin/update_participant.rb +42 -0
- data/app/commands/decidim/action_delegator/admin/update_ponderation.rb +41 -0
- data/app/commands/decidim/action_delegator/admin/update_setting.rb +66 -0
- data/app/controllers/concerns/decidim/action_delegator/consultations/consultations_controller_override.rb +16 -0
- data/app/controllers/{decidim → concerns/decidim}/action_delegator/consultations/question_multiple_votes_controller_override.rb +2 -1
- data/app/controllers/{decidim → concerns/decidim}/action_delegator/consultations/question_votes_controller_override.rb +2 -0
- data/app/controllers/concerns/decidim/action_delegator/consultations/questions_controller_override.rb +16 -0
- data/app/controllers/concerns/decidim/action_delegator/needs_consultation_styles.rb +24 -0
- data/app/controllers/decidim/action_delegator/admin/consultations_controller.rb +22 -8
- data/app/controllers/decidim/action_delegator/admin/delegations_controller.rb +9 -9
- data/app/controllers/decidim/action_delegator/admin/invite_participants_controller.rb +84 -0
- data/app/controllers/decidim/action_delegator/admin/manage_delegations_controller.rb +48 -0
- data/app/controllers/decidim/action_delegator/admin/manage_participants_controller.rb +59 -0
- data/app/controllers/decidim/action_delegator/admin/participants_controller.rb +102 -0
- data/app/controllers/decidim/action_delegator/admin/permissions_controller.rb +40 -0
- data/app/controllers/decidim/action_delegator/admin/ponderations_controller.rb +101 -0
- data/app/controllers/decidim/action_delegator/admin/settings_controller.rb +51 -12
- data/app/controllers/decidim/action_delegator/verifications/delegations_verifier/authorizations_controller.rb +108 -0
- data/app/forms/decidim/action_delegator/admin/delegation_form.rb +23 -4
- data/app/forms/decidim/action_delegator/admin/invitation_participant_form.rb +10 -0
- data/app/forms/decidim/action_delegator/admin/participant_form.rb +44 -0
- data/app/forms/decidim/action_delegator/admin/ponderation_form.rb +28 -0
- data/app/forms/decidim/action_delegator/admin/setting_form.rb +28 -0
- data/app/forms/decidim/action_delegator/verifications/delegations_verifier_form.rb +131 -0
- data/app/helpers/decidim/action_delegator/admin/delegation_helper.rb +40 -3
- data/app/helpers/decidim/action_delegator/delegation_helper.rb +13 -0
- data/app/jobs/decidim/action_delegator/admin/import_csv_job.rb +27 -0
- data/app/jobs/decidim/action_delegator/admin/invite_participants_job.rb +39 -0
- data/app/jobs/decidim/action_delegator/sync_participants_job.rb +27 -0
- data/app/mailers/decidim/action_delegator/import_mailer.rb +31 -0
- data/app/models/decidim/action_delegator/delegation.rb +11 -0
- data/app/models/decidim/action_delegator/participant.rb +106 -0
- data/app/models/decidim/action_delegator/ponderation.rb +28 -0
- data/app/models/decidim/action_delegator/setting.rb +50 -1
- data/app/overrides/decidim/consultations/consultations/_question/add_delegation_link.html.erb.deface +3 -0
- data/app/overrides/decidim/consultations/consultations/_regular_questions/remove_highlighted_scopes.html.erb.deface +4 -0
- data/app/overrides/decidim/consultations/question_multiple_votes/_form/add_delegation_notice.html.erb.deface +8 -0
- data/app/overrides/decidim/consultations/questions/_vote_button/add_delegations_link.html.erb.deface +3 -0
- data/app/overrides/decidim/consultations/questions/_vote_button/add_modal.html.erb.deface +3 -0
- data/app/overrides/decidim/consultations/questions/_vote_button/replace_delegation_to_multivote_link.html.erb.deface +8 -0
- data/app/overrides/decidim/consultations/questions/_vote_modal/add_delegation_callout.html.erb.deface +3 -0
- data/app/overrides/decidim/consultations/questions/_vote_modal_confirm/add_delegation_callout.html.erb.deface +3 -0
- data/app/overrides/decidim/consultations/questions/_vote_modal_confirm/add_hidden_field.html.erb.deface +3 -0
- data/app/overrides/layouts/decidim/admin/remove_deprecation.rb +10 -0
- data/app/packs/entrypoints/decidim_action_delegator_questions.js +2 -0
- data/app/packs/src/decidim/action_delegator/questions.js +27 -0
- data/app/packs/stylesheets/decidim/action_delegator/questions.scss +4 -3
- data/app/permissions/concerns/decidim/action_delegator/consultations/permissions_override.rb +35 -0
- data/app/permissions/decidim/action_delegator/permissions.rb +6 -2
- data/app/queries/decidim/action_delegator/delegated_votes_versions.rb +5 -11
- data/app/queries/decidim/action_delegator/organization_settings.rb +6 -0
- data/app/queries/decidim/action_delegator/responses_by_membership.rb +3 -20
- data/app/queries/decidim/action_delegator/sum_of_membership_weight.rb +1 -5
- data/app/queries/decidim/action_delegator/sum_of_weights.rb +1 -1
- data/app/queries/decidim/action_delegator/type_and_weight.rb +1 -1
- data/app/queries/decidim/action_delegator/voted_with_ponderations.rb +30 -0
- data/app/services/decidim/action_delegator/csv_importer.rb +86 -0
- data/app/services/decidim/action_delegator/delegations_csv_importer.rb +54 -0
- data/app/services/decidim/action_delegator/participants_csv_importer.rb +131 -0
- data/app/views/decidim/action_delegator/admin/consultations/results.html.erb +3 -3
- data/app/views/decidim/action_delegator/admin/{results/sum_of_weights/index.html.erb → consultations/weighted_results.html.erb} +3 -3
- data/app/views/decidim/action_delegator/admin/delegations/index.html.erb +8 -3
- data/app/views/decidim/action_delegator/admin/delegations/new.html.erb +15 -12
- data/app/views/decidim/action_delegator/admin/manage_delegations/new.html.erb +25 -0
- data/app/views/decidim/action_delegator/admin/manage_participants/new.html.erb +33 -0
- data/app/views/decidim/action_delegator/admin/participants/_form.html.erb +9 -0
- data/app/views/decidim/action_delegator/admin/participants/_missing_registered_check.html.erb +17 -0
- data/app/views/decidim/action_delegator/admin/participants/edit.html.erb +21 -0
- data/app/views/decidim/action_delegator/admin/participants/index.html.erb +72 -0
- data/app/views/decidim/action_delegator/admin/participants/new.html.erb +21 -0
- data/app/views/decidim/action_delegator/admin/ponderations/_form.html.erb +8 -0
- data/app/views/decidim/action_delegator/admin/ponderations/edit.html.erb +21 -0
- data/app/views/decidim/action_delegator/admin/ponderations/index.html.erb +40 -0
- data/app/views/decidim/action_delegator/admin/ponderations/new.html.erb +21 -0
- data/app/views/decidim/action_delegator/admin/settings/_check_verifier.html.erb +5 -0
- data/app/views/decidim/action_delegator/admin/settings/_form.html.erb +16 -0
- data/app/views/decidim/action_delegator/admin/settings/_participants_email_check.html.erb +7 -0
- data/app/views/decidim/action_delegator/admin/settings/_participants_sync_check.html.erb +11 -0
- data/app/views/decidim/action_delegator/admin/settings/_setting_checks.html.erb +81 -0
- data/app/views/decidim/action_delegator/admin/settings/edit.html.erb +18 -0
- data/app/views/decidim/action_delegator/admin/settings/index.html.erb +25 -5
- data/app/views/decidim/action_delegator/admin/settings/new.html.erb +14 -26
- data/app/views/decidim/action_delegator/consultations/_link_to_question.html.erb +11 -0
- data/app/views/decidim/action_delegator/consultations/questions/_delegations_modal.html.erb +36 -0
- data/app/views/decidim/action_delegator/consultations/questions/_link_to_delegations.html.erb +11 -0
- data/app/views/decidim/action_delegator/consultations/questions/_vote_delegated_active.html.erb +32 -0
- data/app/views/decidim/action_delegator/consultations/questions/_vote_delegated_finished.html.erb +9 -0
- data/app/views/decidim/action_delegator/consultations/questions/_vote_delegated_upcoming.html.erb +8 -0
- data/app/views/decidim/action_delegator/import_mailer/import.html.erb +11 -0
- data/app/views/decidim/{verifications/sms/authorizations/new.html.erb → action_delegator/verifications/delegations_verifier/authorizations/edit.html.erb} +12 -7
- data/app/views/decidim/action_delegator/verifications/delegations_verifier/authorizations/new.html.erb +49 -0
- data/config/assets.rb +1 -3
- data/config/i18n-tasks.yml +8 -0
- data/config/locales/ca.yml +287 -23
- data/config/locales/cs.yml +286 -18
- data/config/locales/en.yml +331 -24
- data/config/locales/es.yml +288 -24
- data/db/migrate/20230323101247_create_decidim_action_delegator_ponderations.rb +12 -0
- data/db/migrate/20230323210000_create_decidim_action_delegator_participants.rb +13 -0
- data/db/migrate/20230323223752_add_decidim_action_delegator_verification_method.rb +7 -0
- data/db/migrate/20230412105710_add_decidim_action_delegator_participants_user_id.rb +7 -0
- data/lib/decidim/action_delegator/admin_engine.rb +68 -6
- data/lib/decidim/action_delegator/engine.rb +25 -15
- data/lib/decidim/action_delegator/test/factories.rb +22 -7
- data/lib/decidim/action_delegator/verifications/delegations_authorizer.rb +85 -0
- data/lib/decidim/action_delegator/verifications/delegations_verifier/engine.rb +25 -0
- data/lib/decidim/action_delegator/verifications/delegations_verifier.rb +12 -0
- data/lib/decidim/action_delegator/version.rb +3 -3
- data/lib/decidim/action_delegator.rb +41 -0
- data/lib/tasks/import_direct_verification.rake +30 -0
- data/package.json +57 -0
- metadata +115 -50
- data/app/controllers/decidim/action_delegator/admin/results/sum_of_weights_controller.rb +0 -37
- data/app/controllers/decidim/action_delegator/verifications/sms/authorizations_controller_override.rb +0 -38
- data/app/packs/entrypoints/decidim_action_delegator_admin_action_delegator_js.js +0 -1
- data/app/packs/entrypoints/decidim_action_delegator_questions_js.js +0 -1
- data/app/packs/src/decidim/action_delegator/admin/action_delegator.js.es6 +0 -3
- data/app/packs/src/decidim/action_delegator/questions.js.es6 +0 -26
- data/app/permissions/decidim/action_delegator/consultations_permissions_extension.rb +0 -27
- data/app/presenters/decidim/action_delegator/admin/consultation_presenter.rb +0 -15
- data/app/presenters/decidim/action_delegator/admin/setting_presenter.rb +0 -13
- data/app/queries/decidim/action_delegator/decrypted_authorizations.rb +0 -112
- data/app/queries/decidim/action_delegator/json_build_object_query.rb +0 -45
- data/app/queries/decidim/action_delegator/voted_with_direct_verification.rb +0 -53
- data/app/views/decidim/action_delegator/_delegations_modal.html.erb +0 -93
- data/app/views/decidim/action_delegator/_link_to_delegations.html.erb +0 -5
- data/app/views/decidim/action_delegator/_link_to_question.html.erb +0 -5
- data/app/views/decidim/consultations/consultations/_question.html.erb +0 -41
- data/app/views/decidim/consultations/consultations/show.html.erb +0 -14
- data/app/views/decidim/consultations/question_multiple_votes/_form.html.erb +0 -25
- data/app/views/decidim/consultations/questions/_vote_button.html.erb +0 -106
- data/app/views/decidim/consultations/questions/_vote_modal.html.erb +0 -30
- data/app/views/decidim/consultations/questions/_vote_modal_confirm.html.erb +0 -38
- data/app/views/layouts/decidim/action_delegator/admin/_users_sidebar.html.erb +0 -56
- data/app/views/layouts/decidim/action_delegator/admin/delegations.html.erb +0 -13
- data/app/views/layouts/decidim/admin/consultation.html.erb +0 -56
- data/app/views/layouts/decidim/admin/question.html.erb +0 -98
- data/app/views/layouts/decidim/admin/users.html.erb +0 -7
- data/config/initializers/doorkeeper.rb +0 -492
- data/lib/json_key.rb +0 -10
- /data/app/commands/{decidim → concerns/decidim}/action_delegator/consultations/multiple_vote_question_override.rb +0 -0
- /data/app/controllers/decidim/action_delegator/admin/exports/{sum_of_weights_controller.rb → _sum_of_weights_controller.rb} +0 -0
- /data/app/forms/{decidim → concerns/decidim}/action_delegator/consultations/vote_form_override.rb +0 -0
- /data/app/models/{decidim → concerns/decidim}/action_delegator/consultations/vote_override.rb +0 -0
- /data/app/views/decidim/action_delegator/{_callout.html.erb → consultations/questions/_callout.html.erb} +0 -0
@@ -0,0 +1,7 @@
|
|
1
|
+
<% total_missing_emails = setting&.participants.where(email: "").count %>
|
2
|
+
<% i18n_scope = "decidim.action_delegator.admin.settings.setting_checks" %>
|
3
|
+
<% if Decidim::ActionDelegator.allow_to_invite_users && total_missing_emails.positive? %>
|
4
|
+
<div class="callout warning text-left">
|
5
|
+
<p><%= t("#{i18n_scope}.missing_emails", count: pluralize(total_missing_emails, t("#{i18n_scope}.participant"))) %></p>
|
6
|
+
</div>
|
7
|
+
<% end %>
|
@@ -0,0 +1,11 @@
|
|
1
|
+
<% missing_sync = missing_decidim_users(setting&.participants) %>
|
2
|
+
<% if setting.participants.any? && missing_sync.present? %>
|
3
|
+
<div class="callout alert text-left">
|
4
|
+
<ul class="happy-faces">
|
5
|
+
<li class="unhappy">
|
6
|
+
<%= t("users_need_sync_html", scope: "decidim.action_delegator.admin.settings.setting_checks", count: missing_sync.count) %><br>
|
7
|
+
<%= link_to t("click_to_fix", scope: "decidim.action_delegator.admin.settings.setting_checks"), decidim_admin_action_delegator.sync_setting_permissions_path(setting), method: :post %>
|
8
|
+
</li>
|
9
|
+
</ul>
|
10
|
+
</div>
|
11
|
+
<% end %>
|
@@ -0,0 +1,81 @@
|
|
1
|
+
<% missing_questions = missing_verifications_for(setting&.consultation&.questions, "vote") %>
|
2
|
+
<% missing_registered = missing_registered_users(setting&.participants) %>
|
3
|
+
<% total_missing_authorizations = total_missing_authorizations(setting&.participants) %>
|
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 %>
|
8
|
+
|
9
|
+
<%= render "decidim/action_delegator/admin/settings/participants_sync_check", setting: setting %>
|
10
|
+
|
11
|
+
<div class="callout <%= status_err ? "warning" : "success" %> text-left">
|
12
|
+
|
13
|
+
<ul class="happy-faces">
|
14
|
+
<% if setting.consultation %>
|
15
|
+
<% if missing_questions.present? %>
|
16
|
+
<li class="<%= status_err ? "unhappy" : "warning" %>">
|
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>
|
22
|
+
<% end %>
|
23
|
+
<% end %>
|
24
|
+
|
25
|
+
<% if setting.participants.any? %>
|
26
|
+
<% if missing_registered.present? %>
|
27
|
+
<li class="warning"><%= t(".missing_registered_users_html", count: missing_registered.count) %></li>
|
28
|
+
<% else %>
|
29
|
+
<li class="happy"><%= t(".all_users_registered_html") %></li>
|
30
|
+
<% end %>
|
31
|
+
<% if total_missing_authorizations.positive? %>
|
32
|
+
<li class="<%= status_err ? "unhappy" : "warning" %>"><%= t(".missing_authorizations_html", count: total_missing_authorizations) %></li>
|
33
|
+
<% else %>
|
34
|
+
<li class="happy"><%= t(".all_users_authorized_html") %></li>
|
35
|
+
<% end %>
|
36
|
+
<% else %>
|
37
|
+
<li class="warning"><%= t(".no_participants_html") %></li>
|
38
|
+
<% end %>
|
39
|
+
|
40
|
+
<% unless setting.ponderations.any? %>
|
41
|
+
<li class="warning"><%= t(".no_ponderations_html") %></li>
|
42
|
+
<% end %>
|
43
|
+
|
44
|
+
<% unless setting.delegations.any? %>
|
45
|
+
<li class="warning"><%= t(".no_delegations_html") %></li>
|
46
|
+
<% end %>
|
47
|
+
</ul>
|
48
|
+
</div>
|
49
|
+
<style>
|
50
|
+
ul.happy-faces {
|
51
|
+
list-style: none;
|
52
|
+
margin-left: 0;
|
53
|
+
padding-left: 1em;
|
54
|
+
text-indent: -1.5em;
|
55
|
+
}
|
56
|
+
li.warning:before {
|
57
|
+
content: '🧐 ';
|
58
|
+
color: red;
|
59
|
+
}
|
60
|
+
li.unhappy:before {
|
61
|
+
content: '⚠️ ';
|
62
|
+
color: red;
|
63
|
+
}
|
64
|
+
li.happy:before {
|
65
|
+
content: '👌 ';
|
66
|
+
color: green;
|
67
|
+
}
|
68
|
+
ul.happy-faces a {
|
69
|
+
text-decoration: underline;
|
70
|
+
position: relative;
|
71
|
+
margin-left: 1.4em;
|
72
|
+
}
|
73
|
+
ul.happy-faces a:before {
|
74
|
+
content: '👉';
|
75
|
+
padding-right: 5px;
|
76
|
+
position: absolute;
|
77
|
+
left: 0;
|
78
|
+
top: 0;
|
79
|
+
line-height: 1.4;
|
80
|
+
}
|
81
|
+
</style>
|
@@ -0,0 +1,18 @@
|
|
1
|
+
<div class="card">
|
2
|
+
<div class="card-divider">
|
3
|
+
<h2 class="card-title">
|
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>
|
8
|
+
|
9
|
+
<div class="card-section">
|
10
|
+
<%= form_for @form, url: { action: "update" }, html: { class: "form edit_setting" } do |f| %>
|
11
|
+
<%= render partial: "form", object: f %>
|
12
|
+
|
13
|
+
<div class="button--double form-general-submit">
|
14
|
+
<%= f.submit t(".save") %>
|
15
|
+
</div>
|
16
|
+
<% end %>
|
17
|
+
</div>
|
18
|
+
</div>
|
@@ -6,34 +6,54 @@
|
|
6
6
|
</h2>
|
7
7
|
</div>
|
8
8
|
<div class="card-section">
|
9
|
+
<p class="help-text"><%= t ".description_html" %></p>
|
10
|
+
<%= render "check_verifier" %>
|
9
11
|
<div class="table-scroll">
|
10
12
|
<table class="table-list">
|
11
13
|
<thead>
|
12
14
|
<tr>
|
13
15
|
<th><%= t(".consultation") %></th>
|
14
16
|
<th><%= t(".max_grants") %></th>
|
17
|
+
<th><%= t(".authorization_method") %></th>
|
15
18
|
<th><%= t(".delegations") %></th>
|
19
|
+
<th><%= t(".ponderations") %></th>
|
20
|
+
<th><%= t(".census") %></th>
|
16
21
|
<th><%= t(".created_at") %></th>
|
22
|
+
<th><%= t(".state") %></th>
|
17
23
|
<th> </th>
|
18
24
|
</tr>
|
19
25
|
</thead>
|
20
26
|
<tbody>
|
21
|
-
<%
|
27
|
+
<% settings.each do |setting| %>
|
22
28
|
<tr data-setting-id="<%= setting.id %>">
|
23
|
-
<td><%= link_to translated_attribute(setting.
|
29
|
+
<td><%= link_to translated_attribute(setting.title), decidim_consultations.consultation_path(setting.consultation), target: :blank %></td>
|
24
30
|
<td><%= setting.max_grants %></td>
|
31
|
+
<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>
|
25
32
|
<td><%= setting.delegations.count %></td>
|
33
|
+
<td><%= setting.ponderations.count %></td>
|
34
|
+
<td><%= setting.participants.count %></td>
|
26
35
|
<td><%= l setting.created_at, format: :short %></td>
|
36
|
+
<td class="text-<%= setting.ongoing? ? "warning" : (setting.editable? ? "success" : "alert") %>"><%= t setting.state, scope: "decidim.action_delegator.admin.settings.state" %></td>
|
27
37
|
|
28
38
|
<td class="table-list__actions">
|
29
|
-
<%= icon_link_to "
|
30
|
-
<%= icon_link_to "
|
31
|
-
<%= icon_link_to "
|
39
|
+
<%= icon_link_to "pencil", decidim_admin_action_delegator.edit_setting_path(setting), t("actions.edit", scope: "decidim.admin"), class: "action-icon--edit" %>
|
40
|
+
<%= icon_link_to "grid-two-up", decidim_admin_action_delegator.setting_ponderations_path(setting), t(".actions.ponderate"), class: "action-icon--edit" %>
|
41
|
+
<%= icon_link_to "people", decidim_admin_action_delegator.setting_participants_path(setting), t(".actions.census"), class: "action-icon--edit" %>
|
42
|
+
<%= icon_link_to "loop", decidim_admin_action_delegator.setting_delegations_path(setting), t(".actions.delegations"), class: "action-icon--edit" %>
|
43
|
+
<%= icon_link_to "circle-x", decidim_admin_action_delegator.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? %>
|
32
44
|
</td>
|
33
45
|
</tr>
|
46
|
+
<% if setting.editable? %>
|
47
|
+
<tr>
|
48
|
+
<td colspan="9">
|
49
|
+
<%= render "setting_checks", setting: setting %>
|
50
|
+
</td>
|
51
|
+
</tr>
|
52
|
+
<% end %>
|
34
53
|
<% end %>
|
35
54
|
</tbody>
|
36
55
|
</table>
|
37
56
|
</div>
|
57
|
+
<%= decidim_paginate settings %>
|
38
58
|
</div>
|
39
59
|
</div>
|
@@ -1,30 +1,18 @@
|
|
1
|
-
<
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
<%=
|
6
|
-
|
7
|
-
|
8
|
-
<h2 class="card-title"><%= t ".form.title" %></h2>
|
9
|
-
</div>
|
1
|
+
<div class="card">
|
2
|
+
<div class="card-divider">
|
3
|
+
<h2 class="card-title">
|
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>
|
10
8
|
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
options_from_collection_for_select(
|
15
|
-
consultations_for_select,
|
16
|
-
:id,
|
17
|
-
:translated_title
|
18
|
-
) %>
|
19
|
-
</div>
|
9
|
+
<div class="card-section">
|
10
|
+
<%= form_for @form, url: { action: "create" }, html: { class: "form new_setting" } do |f| %>
|
11
|
+
<%= render partial: "form", object: f %>
|
20
12
|
|
21
|
-
<div class="
|
22
|
-
<%= f.
|
13
|
+
<div class="button--double form-general-submit">
|
14
|
+
<%= f.submit t(".save") %>
|
23
15
|
</div>
|
24
|
-
|
25
|
-
</div>
|
26
|
-
|
27
|
-
<div class="button--double form-general-submit">
|
28
|
-
<%= f.submit t(".save") %>
|
16
|
+
<% end %>
|
29
17
|
</div>
|
30
|
-
|
18
|
+
</div>
|
@@ -0,0 +1,11 @@
|
|
1
|
+
<% if signed_in? && Decidim::ActionDelegator::Delegation.granted_to?(current_user, question.consultation) %>
|
2
|
+
<% if has_any_delegate_vote?(question) %>
|
3
|
+
<div class="delegations-notice">
|
4
|
+
<%= link_to t("action_delegator.delegations.has_delegations", scope: "decidim"), decidim_consultations.question_path(question) %>
|
5
|
+
</div>
|
6
|
+
<% else %>
|
7
|
+
<div class="delegations-notice">
|
8
|
+
<%= link_to t("action_delegator.delegations.link", scope: "decidim"), decidim_consultations.question_path(question) %>
|
9
|
+
</div>
|
10
|
+
<% end %>
|
11
|
+
<% end %>
|
@@ -0,0 +1,36 @@
|
|
1
|
+
<div class="reveal" data-reveal id="delegations-modal">
|
2
|
+
<div class="reveal__header">
|
3
|
+
<h3 class="reveal__title">
|
4
|
+
<%= t "action_delegator.delegations_modal.title", scope: "decidim" %>
|
5
|
+
</h3>
|
6
|
+
<button class="close-button" data-close aria-label="Close modal" type="button">
|
7
|
+
<span aria-hidden="true">×</span>
|
8
|
+
</button>
|
9
|
+
</div>
|
10
|
+
|
11
|
+
<p><%= t "action_delegator.delegations_modal.contextual_help", scope: "decidim" %></p>
|
12
|
+
<div class="card card--secondary">
|
13
|
+
<div class="card__content">
|
14
|
+
|
15
|
+
<% signed_in? && Decidim::ActionDelegator::GranteeDelegations.for(question.consultation, current_user).each do |delegation| %>
|
16
|
+
<div class="row">
|
17
|
+
<div class="columns medium-5 medium-offset-1">
|
18
|
+
<%= delegation.granter.name %>
|
19
|
+
</div>
|
20
|
+
<div class="columns medium-5 medium-offset-1">
|
21
|
+
<%# Copied from decidim-consultation's _vote_button.html.erb %>
|
22
|
+
<% if question.consultation.upcoming? %>
|
23
|
+
<%= render "decidim/action_delegator/consultations/questions/vote_delegated_upcoming", question: question %>
|
24
|
+
<% elsif question.consultation.finished? && question.voted_by?(delegation.granter) %>
|
25
|
+
<%= render "decidim/action_delegator/consultations/questions/vote_delegated_finished", question: question %>
|
26
|
+
<% elsif question.consultation.active? %>
|
27
|
+
<%= render "decidim/action_delegator/consultations/questions/vote_delegated_active", question: question, delegation: delegation %>
|
28
|
+
<% end %>
|
29
|
+
</div>
|
30
|
+
</div>
|
31
|
+
<% end %>
|
32
|
+
</div>
|
33
|
+
</div>
|
34
|
+
</div>
|
35
|
+
|
36
|
+
<%= javascript_pack_tag "decidim_action_delegator_questions" %>
|
@@ -0,0 +1,11 @@
|
|
1
|
+
<% if Decidim::ActionDelegator::Delegation.granted_to?(current_user, question.consultation) %>
|
2
|
+
<% if has_any_delegate_vote?(question) %>
|
3
|
+
<div class="delegations-notice flex--cc">
|
4
|
+
<%= link_to t("action_delegator.delegations.has_delegations", scope: "decidim"), "#", id: "delegations-button" %>
|
5
|
+
</div>
|
6
|
+
<% else %>
|
7
|
+
<div class="delegations-notice flex--cc">
|
8
|
+
<%= link_to t("action_delegator.delegations.link", scope: "decidim"), "#", id: "delegations-button" %>
|
9
|
+
</div>
|
10
|
+
<% end %>
|
11
|
+
<% end %>
|
data/app/views/decidim/action_delegator/consultations/questions/_vote_delegated_active.html.erb
ADDED
@@ -0,0 +1,32 @@
|
|
1
|
+
<% if allowed_to? :unvote_delegation, :question, { question: question, delegation: delegation }, [Decidim::ActionDelegator::Permissions, Decidim::Admin::Permissions, Decidim::Permissions] %>
|
2
|
+
<%= button_to decidim_consultations.question_question_votes_path(question),
|
3
|
+
method: :delete,
|
4
|
+
remote: true,
|
5
|
+
data: { disable: true },
|
6
|
+
class: "button expanded success delegation_unvote_button" do %>
|
7
|
+
<%= hidden_field_tag "decidim_consultations_delegation_id", delegation.id, id: "decidim_consultations_delegation_id_delete_#{delegation.id}" %>
|
8
|
+
<div class="vote-button-caption"
|
9
|
+
data-original="<%= t("questions.vote_button.already_voted", scope: "decidim") %>"
|
10
|
+
data-replace="<%= t("questions.vote_button.already_voted_hover", scope: "decidim") %>">
|
11
|
+
<%= t("questions.vote_button.already_voted", scope: "decidim") %>
|
12
|
+
</div>
|
13
|
+
<% end %>
|
14
|
+
<% elsif allowed_to? :vote_delegation, :question, { question: question, delegation: delegation }, [Decidim::ActionDelegator::Permissions, Decidim::Admin::Permissions, Decidim::Permissions] %>
|
15
|
+
<% if question.multiple? %>
|
16
|
+
<%= link_to decidim_consultations.question_question_multiple_votes_path(question, delegation: delegation.id),
|
17
|
+
class: "button expanded",
|
18
|
+
id: "multivote_button" do %>
|
19
|
+
<div class="vote-button-caption"><%= t "questions.vote_button.vote", scope: "decidim" %></div>
|
20
|
+
<% end %>
|
21
|
+
<% else %>
|
22
|
+
<%# This link is slightly modified from _vote_button to add stuff needed by delegations %>
|
23
|
+
<%= link_to "#", class: "button expanded delegation-vote-button", data: { "delegation-id" => delegation.id, "delegation-granter-name" => delegation.granter.name } do %>
|
24
|
+
<div class="vote-button-caption"><%= t "questions.vote_button.vote", scope: "decidim" %></div>
|
25
|
+
<% end %>
|
26
|
+
|
27
|
+
<% end %>
|
28
|
+
<% else %>
|
29
|
+
<%= authorized_vote_modal_button(question, remote: true, class: "button expanded light button--sc") do %>
|
30
|
+
<%= t("questions.vote_button.verification_required", scope: "decidim") %>
|
31
|
+
<% end %>
|
32
|
+
<% end %>
|
data/app/views/decidim/action_delegator/consultations/questions/_vote_delegated_finished.html.erb
ADDED
@@ -0,0 +1,9 @@
|
|
1
|
+
<%= button_to decidim_consultations.question_question_votes_path(question),
|
2
|
+
method: :delete,
|
3
|
+
remote: true,
|
4
|
+
data: { disable: true },
|
5
|
+
class: "button expanded success disabled delegation_unvote_button" do %>
|
6
|
+
<div class="vote-button-caption">
|
7
|
+
<%= t("questions.vote_button.already_voted", scope: "decidim") %>
|
8
|
+
</div>
|
9
|
+
<% end %>
|
data/app/views/decidim/action_delegator/consultations/questions/_vote_delegated_upcoming.html.erb
ADDED
@@ -0,0 +1,8 @@
|
|
1
|
+
<div class="button expanded disabled">
|
2
|
+
<div class="vote-button-caption"><%= t("questions.vote_button.vote", scope: "decidim") %></div>
|
3
|
+
<div>
|
4
|
+
<%= t "questions.vote_button.starting_from",
|
5
|
+
scope: "decidim",
|
6
|
+
date: l(question.start_voting_date) %>
|
7
|
+
</div>
|
8
|
+
</div>
|
@@ -0,0 +1,11 @@
|
|
1
|
+
<p class="email-greeting"><%= t(".greeting", name: @user.name) %></p>
|
2
|
+
<p><%= t(".result", rows_count: @import_summary[:imported_rows], total_rows_count: @import_summary[:total_rows]).html_safe %></p>
|
3
|
+
<% if @import_summary[:skipped_rows].present? %>
|
4
|
+
<p><%= t(".skipped_rows", skipped_rows: @import_summary[:skipped_rows].count).html_safe %></p>
|
5
|
+
<% end %>
|
6
|
+
<% if @import_summary[:error_rows].present? %>
|
7
|
+
<p><%= t(".errors_title", errors_count: @import_summary[:error_rows].size).html_safe %></p>
|
8
|
+
<% end %>
|
9
|
+
<% if @import_summary[:error_rows].present? || @import_summary[:skipped_rows].present? %>
|
10
|
+
<%= t(".instructions").html_safe %>
|
11
|
+
<% end %>
|
@@ -10,23 +10,28 @@
|
|
10
10
|
<div class="columns large-6 medium-centered">
|
11
11
|
<div class="card">
|
12
12
|
<div class="card__content">
|
13
|
-
<%= decidim_form_for(@form, url: authorization_path(redirect_url: redirect_url)) do |form| %>
|
13
|
+
<%= decidim_form_for(@form, url: authorization_path(redirect_url: redirect_url), method: :put) do |form| %>
|
14
14
|
<%= form_required_explanation %>
|
15
15
|
|
16
16
|
<div class="field">
|
17
|
-
<%= form.text_field :
|
18
|
-
</div>
|
19
|
-
|
20
|
-
<div class="callout announcement mb-sm warning cell-announcement">
|
21
|
-
<p><%= t("decidim.action_delegator.authorizations.new.phone_warning") %></p>
|
17
|
+
<%= form.text_field :verification_code %>
|
22
18
|
</div>
|
23
19
|
|
24
20
|
<div class="actions">
|
25
|
-
<%= form.submit t(".send"), class: "button expanded", "data-disable-with" => "#{t('.send')}..."
|
21
|
+
<%= form.submit t(".send"), class: "button expanded", "data-disable-with" => "#{t('.send')}..." %>
|
26
22
|
</div>
|
27
23
|
<% end %>
|
28
24
|
</div>
|
29
25
|
</div>
|
26
|
+
|
27
|
+
<div class="card">
|
28
|
+
<div class="card__content">
|
29
|
+
<div class="field">
|
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>
|
30
35
|
</div>
|
31
36
|
</div>
|
32
37
|
</div>
|
@@ -0,0 +1,49 @@
|
|
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
|
+
<% if setting&.email_required? %>
|
17
|
+
<% unless @form.participant.present? %>
|
18
|
+
<div class="callout announcement mb-sm alert cell-announcement">
|
19
|
+
<p><%= t(".not_in_census") %></p>
|
20
|
+
</div>
|
21
|
+
<% end %>
|
22
|
+
<div class="field">
|
23
|
+
<%= form.text_field :email, readonly: true %>
|
24
|
+
</div>
|
25
|
+
<% end %>
|
26
|
+
|
27
|
+
<% if setting&.phone_required? %>
|
28
|
+
<div class="field">
|
29
|
+
<%= form.text_field :phone, readonly: setting&.verify_with_both? %>
|
30
|
+
</div>
|
31
|
+
<% if setting&.verify_with_both? %>
|
32
|
+
<div class="callout announcement mb-sm warning cell-announcement">
|
33
|
+
<p><%= t(".phone_warning") %></p>
|
34
|
+
</div>
|
35
|
+
<% end %>
|
36
|
+
<% end %>
|
37
|
+
|
38
|
+
<p><%= t(".participate_in", consultations: "<b>#{translated_attribute(@form.setting.title)}</b>").html_safe %></p>
|
39
|
+
|
40
|
+
<div class="actions">
|
41
|
+
<%= form.submit t(setting&.phone_required? ? ".send_code": ".authorize"), class: "button expanded", "data-disable-with" => "#{t('.send_code')}...", disabled: (setting&.email_required? && (!@form.participant || (@form.phone.blank? && setting&.verify_with_both?))) %>
|
42
|
+
</div>
|
43
|
+
<% end %>
|
44
|
+
</div>
|
45
|
+
</div>
|
46
|
+
</div>
|
47
|
+
</div>
|
48
|
+
</div>
|
49
|
+
</div>
|
data/config/assets.rb
CHANGED
@@ -19,9 +19,7 @@ Decidim::Webpacker.register_path("#{base_path}/app/packs")
|
|
19
19
|
# SCSS files within the entrypoints, they become available for inclusion using
|
20
20
|
# `stylesheet_pack_tag`.
|
21
21
|
Decidim::Webpacker.register_entrypoints(
|
22
|
-
decidim_action_delegator_questions: "#{base_path}/app/packs/entrypoints/decidim_action_delegator_questions.js"
|
23
|
-
decidim_action_delegator_questions_js: "#{base_path}/app/packs/entrypoints/decidim_action_delegator_questions_js.js",
|
24
|
-
decidim_action_delegator_admin_action_delegator_js: "#{base_path}/app/packs/entrypoints/decidim_action_delegator_admin_action_delegator_js.js"
|
22
|
+
decidim_action_delegator_questions: "#{base_path}/app/packs/entrypoints/decidim_action_delegator_questions.js"
|
25
23
|
)
|
26
24
|
|
27
25
|
# If you want to import some extra SCSS files in the Decidim main SCSS file
|
data/config/i18n-tasks.yml
CHANGED
@@ -3,6 +3,14 @@
|
|
3
3
|
base_locale: en
|
4
4
|
locales: [en]
|
5
5
|
|
6
|
+
data:
|
7
|
+
external:
|
8
|
+
- "<%= %x[bundle info decidim-core --path].chomp %>/config/locales/%{locale}.yml"
|
9
|
+
- "<%= %x[bundle info decidim-admin --path].chomp %>/config/locales/%{locale}.yml"
|
10
|
+
- "<%= %x[bundle info decidim-participatory_processes --path].chomp %>/config/locales/%{locale}.yml"
|
11
|
+
- "<%= %x[bundle info decidim-consultations --path].chomp %>/config/locales/%{locale}.yml"
|
12
|
+
- "<%= %x[bundle info decidim-verifications --path].chomp %>/config/locales/%{locale}.yml"
|
13
|
+
|
6
14
|
ignore_unused:
|
7
15
|
- "decidim.components.action_delegator.name"
|
8
16
|
|