decidim-elections 0.26.10 → 0.27.0.rc1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/app/cells/decidim/votings/content_blocks/highlighted_votings/show.erb +2 -2
- data/app/cells/decidim/votings/content_blocks/highlighted_votings_cell.rb +4 -5
- data/app/cells/decidim/votings/content_blocks/landing_page/description/show.erb +1 -1
- data/app/cells/decidim/votings/content_blocks/landing_page/description_cell.rb +1 -1
- data/app/cells/decidim/votings/content_blocks/landing_page/header/show.erb +2 -2
- data/app/cells/decidim/votings/content_blocks/landing_page/header_cell.rb +1 -1
- data/app/commands/decidim/elections/admin/add_user_as_trustee.rb +1 -1
- data/app/commands/decidim/elections/admin/create_answer.rb +2 -2
- data/app/commands/decidim/elections/admin/create_election.rb +1 -1
- data/app/commands/decidim/elections/admin/create_question.rb +2 -2
- data/app/commands/decidim/elections/admin/destroy_answer.rb +2 -2
- data/app/commands/decidim/elections/admin/destroy_election.rb +2 -2
- data/app/commands/decidim/elections/admin/destroy_question.rb +2 -2
- data/app/commands/decidim/elections/admin/end_vote.rb +1 -1
- data/app/commands/decidim/elections/admin/import_proposals_to_elections.rb +3 -6
- data/app/commands/decidim/elections/admin/publish_election.rb +2 -2
- data/app/commands/decidim/elections/admin/publish_results.rb +1 -1
- data/app/commands/decidim/elections/admin/remove_trustee_from_participatory_space.rb +1 -1
- data/app/commands/decidim/elections/admin/report_missing_trustee.rb +1 -1
- data/app/commands/decidim/elections/admin/setup_election.rb +1 -1
- data/app/commands/decidim/elections/admin/start_key_ceremony.rb +1 -1
- data/app/commands/decidim/elections/admin/start_tally.rb +1 -1
- data/app/commands/decidim/elections/admin/start_vote.rb +1 -1
- data/app/commands/decidim/elections/admin/unpublish_election.rb +1 -1
- data/app/commands/decidim/elections/admin/update_action_status.rb +1 -1
- data/app/commands/decidim/elections/admin/update_answer.rb +2 -2
- data/app/commands/decidim/elections/admin/update_answer_selection.rb +1 -1
- data/app/commands/decidim/elections/admin/update_election.rb +1 -1
- data/app/commands/decidim/elections/admin/update_question.rb +2 -2
- data/app/commands/decidim/elections/admin/update_trustee_participatory_space.rb +1 -1
- data/app/commands/decidim/elections/trustee_zone/update_election_bulletin_board_status.rb +1 -1
- data/app/commands/decidim/elections/trustee_zone/update_trustee.rb +1 -1
- data/app/commands/decidim/elections/voter/cast_vote.rb +1 -1
- data/app/commands/decidim/elections/voter/update_vote_status.rb +2 -2
- data/app/commands/decidim/votings/admin/create_ballot_style.rb +1 -1
- data/app/commands/decidim/votings/admin/create_monitoring_committee_member.rb +1 -1
- data/app/commands/decidim/votings/admin/create_polling_officer.rb +1 -1
- data/app/commands/decidim/votings/admin/create_voting.rb +3 -2
- data/app/commands/decidim/votings/admin/destroy_ballot_style.rb +1 -1
- data/app/commands/decidim/votings/admin/destroy_monitoring_committee_member.rb +1 -1
- data/app/commands/decidim/votings/admin/destroy_polling_officer.rb +1 -1
- data/app/commands/decidim/votings/admin/destroy_polling_station.rb +1 -1
- data/app/commands/decidim/votings/admin/manage_polling_station.rb +2 -2
- data/app/commands/decidim/votings/admin/monitoring_committee_validate_polling_station_closure.rb +1 -1
- data/app/commands/decidim/votings/admin/publish_voting.rb +1 -1
- data/app/commands/decidim/votings/admin/unpublish_voting.rb +1 -1
- data/app/commands/decidim/votings/admin/update_ballot_style.rb +1 -1
- data/app/commands/decidim/votings/admin/update_voting.rb +3 -2
- data/app/commands/decidim/votings/census/admin/create_dataset.rb +22 -19
- data/app/commands/decidim/votings/census/admin/create_datum.rb +1 -1
- data/app/commands/decidim/votings/census/admin/destroy_dataset.rb +1 -1
- data/app/commands/decidim/votings/census/admin/increment_dataset_processed_rows.rb +1 -1
- data/app/commands/decidim/votings/census/admin/launch_access_codes_export.rb +1 -1
- data/app/commands/decidim/votings/census/admin/launch_access_codes_generation.rb +1 -1
- data/app/commands/decidim/votings/census/admin/update_dataset.rb +1 -1
- data/app/commands/decidim/votings/certify_polling_station_closure.rb +1 -1
- data/app/commands/decidim/votings/check_census.rb +1 -1
- data/app/commands/decidim/votings/create_polling_station_closure.rb +1 -1
- data/app/commands/decidim/votings/create_polling_station_results.rb +1 -1
- data/app/commands/decidim/votings/send_access_code.rb +1 -1
- data/app/commands/decidim/votings/sign_polling_station_closure.rb +1 -1
- data/app/commands/decidim/votings/voter/in_person_vote.rb +1 -1
- data/app/commands/decidim/votings/voter/update_in_person_vote_status.rb +1 -1
- data/app/controllers/decidim/elections/admin/steps_controller.rb +2 -2
- data/app/controllers/decidim/elections/admin/trustees_participatory_spaces_controller.rb +1 -1
- data/app/controllers/decidim/elections/elections_controller.rb +11 -13
- data/app/controllers/decidim/elections/trustee_zone/application_controller.rb +4 -6
- data/app/controllers/decidim/elections/trustee_zone/elections_controller.rb +1 -1
- data/app/controllers/decidim/votings/admin/votings_landing_page_content_blocks_controller.rb +1 -1
- data/app/controllers/decidim/votings/admin/votings_landing_page_controller.rb +1 -1
- data/app/controllers/decidim/votings/polling_officer_zone/closures_controller.rb +1 -5
- data/app/controllers/decidim/votings/polling_officer_zone/in_person_votes_controller.rb +1 -5
- data/app/controllers/decidim/votings/votings_controller.rb +12 -15
- data/app/forms/decidim/elections/admin/setup_form.rb +3 -46
- data/app/forms/decidim/elections/admin/vote_period_form.rb +2 -2
- data/app/forms/decidim/votings/admin/ballot_style_form.rb +1 -1
- data/app/forms/decidim/votings/admin/voting_form.rb +4 -3
- data/app/forms/decidim/votings/census/admin/dataset_form.rb +2 -5
- data/app/forms/decidim/votings/census/admin/datum_form.rb +1 -1
- data/app/helpers/decidim/elections/application_helper.rb +1 -1
- data/app/helpers/decidim/votings/votings_helper.rb +1 -1
- data/app/models/decidim/elections/answer.rb +1 -6
- data/app/models/decidim/elections/election.rb +15 -4
- data/app/models/decidim/elections/question.rb +1 -6
- data/app/models/decidim/votings/polling_station.rb +2 -3
- data/app/models/decidim/votings/voting.rb +15 -0
- data/app/packs/src/decidim/elections/admin/pending_action.js +0 -2
- data/app/packs/src/decidim/elections/admin/trustees_process.js +0 -2
- data/app/packs/src/decidim/elections/trustee/key_ceremony.js +0 -3
- data/app/packs/src/decidim/elections/trustee/tally.js +1 -4
- data/app/packs/src/decidim/elections/voter/casting-vote.js +0 -3
- data/app/packs/src/decidim/elections/voter/setup-vote.js +0 -2
- data/app/packs/src/decidim/votings/in-person-vote.js +0 -3
- data/app/permissions/decidim/elections/admin/permissions.rb +7 -1
- data/app/permissions/decidim/votings/admin/permissions.rb +3 -18
- data/app/permissions/decidim/votings/permissions.rb +1 -3
- data/app/presenters/decidim/votings/voting_stats_presenter.rb +4 -1
- data/app/queries/decidim/elections/admin/pending_actions.rb +1 -1
- data/app/queries/decidim/elections/admin/votes_for_statistics.rb +1 -1
- data/app/queries/decidim/elections/elections_finished_to_end.rb +1 -1
- data/app/queries/decidim/elections/elections_ready_to_start.rb +1 -1
- data/app/queries/decidim/elections/filtered_elections.rb +1 -1
- data/app/queries/decidim/elections/trustees/by_participatory_space.rb +1 -1
- data/app/queries/decidim/elections/trustees/by_participatory_space_trustee_ids.rb +1 -1
- data/app/queries/decidim/elections/votes/last_vote_for_voter.rb +1 -1
- data/app/queries/decidim/elections/votes/pending_votes.rb +1 -1
- data/app/queries/decidim/votings/admin/admin_users.rb +1 -1
- data/app/queries/decidim/votings/admin/ballot_style_by_voting_code.rb +1 -1
- data/app/queries/decidim/votings/admin/polling_officers_join_polling_stations.rb +1 -1
- data/app/queries/decidim/votings/admin/polling_officers_join_polling_stations_and_user.rb +2 -2
- data/app/queries/decidim/votings/admin/polling_officers_join_user.rb +1 -1
- data/app/queries/decidim/votings/organization_prioritized_votings.rb +2 -2
- data/app/queries/decidim/votings/organization_promoted_votings.rb +1 -1
- data/app/queries/decidim/votings/organization_published_votings.rb +2 -2
- data/app/queries/decidim/votings/organization_votings.rb +1 -1
- data/app/queries/decidim/votings/prioritized_votings.rb +1 -1
- data/app/queries/decidim/votings/published_votings.rb +1 -1
- data/app/queries/decidim/votings/votes/in_person_vote_for_voter.rb +1 -1
- data/app/queries/decidim/votings/votes/pending_in_person_votes.rb +1 -1
- data/app/services/decidim/votings/census_vote_flow.rb +1 -3
- data/app/views/decidim/elections/admin/elections/edit.html.erb +0 -1
- data/app/views/decidim/elections/admin/elections/index.html.erb +0 -1
- data/app/views/decidim/elections/admin/elections/new.html.erb +0 -1
- data/app/views/decidim/elections/admin/steps/_create_election.html.erb +1 -14
- data/app/views/decidim/elections/admin/steps/{_tally.html.erb → _tally_started.html.erb} +1 -1
- data/app/views/decidim/elections/admin/steps/index.html.erb +0 -2
- data/app/views/decidim/elections/admin/trustees_participatory_spaces/index.html.erb +0 -1
- data/app/views/decidim/elections/admin/trustees_participatory_spaces/new.html.erb +0 -1
- data/app/views/decidim/elections/elections/_filters.html.erb +2 -2
- data/app/views/decidim/elections/elections/election_log.html.erb +3 -1
- data/app/views/decidim/elections/elections/show.html.erb +1 -1
- data/app/views/decidim/elections/trustee_zone/elections/show.html.erb +3 -4
- data/app/views/decidim/elections/trustee_zone/trustees/show.html.erb +3 -1
- data/app/views/decidim/elections/votes/_onboarding_modal.html.erb +3 -1
- data/app/views/decidim/elections/votes/_show_casting.html.erb +3 -3
- data/app/views/decidim/elections/votes/new.html.erb +10 -7
- data/app/views/decidim/elections/votes/verify.html.erb +4 -1
- data/app/views/decidim/votings/admin/ballot_styles/edit.html.erb +0 -1
- data/app/views/decidim/votings/admin/ballot_styles/index.html.erb +0 -1
- data/app/views/decidim/votings/admin/ballot_styles/new.html.erb +0 -1
- data/app/views/decidim/votings/admin/votings/_form.html.erb +10 -1
- data/app/views/decidim/votings/admin/votings/edit.html.erb +0 -1
- data/app/views/decidim/votings/admin/votings/index.html.erb +0 -1
- data/app/views/decidim/votings/admin/votings/new.html.erb +1 -0
- data/app/views/decidim/votings/census/admin/census/show.html.erb +0 -1
- data/app/views/decidim/votings/polling_officer_zone/closures/_certify_form.html.erb +3 -1
- data/app/views/decidim/votings/polling_officer_zone/closures/_sign_form.html.erb +3 -1
- data/app/views/decidim/votings/polling_officer_zone/closures/edit.html.erb +3 -1
- data/app/views/decidim/votings/polling_officer_zone/closures/new.html.erb +3 -1
- data/app/views/decidim/votings/polling_officer_zone/in_person_votes/_complete_voting.html.erb +8 -2
- data/app/views/decidim/votings/polling_officer_zone/in_person_votes/new.html.erb +3 -3
- data/app/views/decidim/votings/polling_officer_zone/in_person_votes/show.html.erb +3 -3
- data/app/views/decidim/votings/votings/_filters.html.erb +2 -3
- data/app/views/decidim/votings/votings/_promoted_voting.html.erb +1 -1
- data/app/views/layouts/decidim/election_votes.html.erb +3 -1
- data/config/assets.rb +1 -1
- data/config/locales/am-ET.yml +1 -0
- data/config/locales/ar.yml +2 -41
- data/config/locales/bg.yml +1 -0
- data/config/locales/ca.yml +49 -69
- data/config/locales/cs.yml +46 -59
- data/config/locales/da.yml +1 -0
- data/config/locales/de.yml +24 -180
- data/config/locales/el.yml +2 -1090
- data/config/locales/en.yml +37 -56
- data/config/locales/eo.yml +1 -0
- data/config/locales/es-MX.yml +48 -68
- data/config/locales/es-PY.yml +48 -68
- data/config/locales/es.yml +50 -70
- data/config/locales/et.yml +1 -0
- data/config/locales/eu.yml +85 -201
- data/config/locales/fi-plain.yml +40 -57
- data/config/locales/fi.yml +45 -62
- data/config/locales/fr-CA.yml +38 -68
- data/config/locales/fr.yml +39 -69
- data/config/locales/ga-IE.yml +2 -19
- data/config/locales/gl.yml +30 -40
- data/config/locales/hr.yml +1 -0
- data/config/locales/hu.yml +25 -38
- data/config/locales/id-ID.yml +1 -0
- data/config/locales/is-IS.yml +2 -1
- data/config/locales/it.yml +42 -36
- data/config/locales/ja.yml +57 -83
- data/config/locales/ko.yml +1 -0
- data/config/locales/lb.yml +1 -0
- data/config/locales/lt.yml +1 -1443
- data/config/locales/lv.yml +5 -3
- data/config/locales/mt.yml +1 -0
- data/config/locales/nl.yml +43 -52
- data/config/locales/no.yml +18 -61
- data/config/locales/om-ET.yml +1 -0
- data/config/locales/pl.yml +50 -49
- data/config/locales/pt-BR.yml +40 -49
- data/config/locales/pt.yml +41 -35
- data/config/locales/ro-RO.yml +22 -71
- data/config/locales/ru.yml +1 -0
- data/config/locales/si-LK.yml +1 -0
- data/config/locales/sk.yml +1 -0
- data/config/locales/sl.yml +1 -0
- data/config/locales/so-SO.yml +1 -0
- data/config/locales/sr-CS.yml +1 -0
- data/config/locales/sv.yml +18 -80
- data/config/locales/sw-KE.yml +1 -0
- data/config/locales/ti-ER.yml +1 -0
- data/config/locales/tr-TR.yml +9 -68
- data/config/locales/uk.yml +1 -0
- data/config/locales/val-ES.yml +1 -0
- data/config/locales/vi.yml +1 -0
- data/config/locales/zh-CN.yml +7 -30
- data/config/locales/zh-TW.yml +1 -1386
- data/db/migrate/20220404112802_rename_bb_status_tally_to_tally_started.rb +19 -0
- data/db/migrate/20220424121541_add_show_check_census_to_votings.rb +7 -0
- data/db/migrate/20220615102642_remove_description_from_elections_questions.rb +1 -1
- data/lib/decidim/elections/component.rb +4 -4
- data/lib/decidim/elections/test/factories.rb +4 -5
- data/lib/decidim/elections/version.rb +1 -1
- data/lib/decidim/votings/admin_engine.rb +0 -4
- data/lib/decidim/votings/participatory_space.rb +3 -3
- data/lib/decidim/votings/test/factories.rb +2 -1
- data/lib/decidim/votings/voting_serializer.rb +2 -2
- metadata +27 -40
- data/app/controllers/decidim/votings/admin/exports_controller.rb +0 -14
- data/app/controllers/decidim/votings/admin/imports_controller.rb +0 -14
- data/app/controllers/decidim/votings/admin/reminders_controller.rb +0 -14
- data/app/packs/src/decidim/elections/broken_promises_handler.js +0 -11
- data/app/services/decidim/elections/election_search.rb +0 -35
- data/app/services/decidim/votings/voting_search.rb +0 -46
- data/app/views/decidim/elections/shared/_broken_promises_modal.html.erb +0 -33
- data/config/locales/fa-IR.yml +0 -1
- data/config/locales/gn-PY.yml +0 -1
- data/config/locales/ka-GE.yml +0 -1
- data/config/locales/kaa.yml +0 -1
- data/config/locales/lo-LA.yml +0 -1
- data/config/locales/oc-FR.yml +0 -1
- data/config/locales/sq-AL.yml +0 -1
- data/config/locales/th-TH.yml +0 -1
- /data/app/packs/entrypoints/{decidim_elections_trustee_tally.js → decidim_elections_trustee_tally_started.js} +0 -0
- /data/app/views/decidim/elections/trustee_zone/elections/{_tally_steps.html.erb → _tally_started_steps.html.erb} +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 11ba350fe95a17c5fdacb0d334da600c9661fefd43617ee0324655acc3a18bc8
|
4
|
+
data.tar.gz: 39b15243a85e5e7bc6d04bea37945c23e849a26e36ad421a855779ca2f681c8d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fac8953cc1dca3a079f3970efe597a3cf19c63cf60dde0443c0511060881bd4b424a434cab13f544a8a4d31a8d571ae2593c1f65c1ee465af81b87c599dac1f2
|
7
|
+
data.tar.gz: 180c6299a0f8a5e8a5451396865d82824e01e858431e570e2279240d4bd7026e1abdd97f887e05739db83aab32bcb204cfdd7b9a1e9b7e14b4feb00d7f52ba03
|
data/README.md
CHANGED
@@ -8,7 +8,7 @@ The Elections module adds elections to any participatory space.
|
|
8
8
|
|
9
9
|
Elections will be available as a Component for a Participatory Space.
|
10
10
|
|
11
|
-
In order to celebrate [End-to-end auditable votings](https://en.wikipedia.org/wiki/End-to-end_auditable_voting_systems) using the Elections module, you will need to connect your Decidim instance with an instance of the [Decidim Bulletin Board application](https://github.com/decidim/decidim-bulletin-board/). To create this connection, please check the [instructions](https://
|
11
|
+
In order to celebrate [End-to-end auditable votings](https://en.wikipedia.org/wiki/End-to-end_auditable_voting_systems) using the Elections module, you will need to connect your Decidim instance with an instance of the [Decidim Bulletin Board application](https://github.com/decidim/decidim-bulletin-board/). To create this connection, please check the [instructions](https://docs.decidim.org/en/services/elections_bulletin_board/).
|
12
12
|
|
13
13
|
## Installation
|
14
14
|
|
@@ -1,4 +1,4 @@
|
|
1
|
-
<section class="wrapper-home home-section">
|
1
|
+
<section id="highlighted_votings" class="wrapper-home home-section">
|
2
2
|
<div class="row" id="highlighted-votings">
|
3
3
|
<h3 class="section-heading"><%= t("active_votings", scope: i18n_scope) %></h3>
|
4
4
|
<div class="row collapse">
|
@@ -8,7 +8,7 @@
|
|
8
8
|
<div class="column">
|
9
9
|
<%= link_to decidim_votings.voting_path(voting), class: "card card--voting card--mini" do %>
|
10
10
|
<div aria-hidden="true" class="card__image-top"
|
11
|
-
style="background-image:url(
|
11
|
+
style="background-image:url(<%= voting.attached_uploader(:banner_image).path %>)"></div>
|
12
12
|
<div class="card__content">
|
13
13
|
<span class="card__title card__link"><%= translated_attribute voting.title %></span>
|
14
14
|
</div>
|
@@ -6,10 +6,6 @@ module Decidim
|
|
6
6
|
class HighlightedVotingsCell < Decidim::ViewModel
|
7
7
|
delegate :current_user, to: :controller
|
8
8
|
|
9
|
-
cache :show, expires_in: 10.minutes, if: :perform_caching? do
|
10
|
-
cache_hash
|
11
|
-
end
|
12
|
-
|
13
9
|
def show
|
14
10
|
render if highlighted_votings.any?
|
15
11
|
end
|
@@ -37,9 +33,12 @@ module Decidim
|
|
37
33
|
def cache_hash
|
38
34
|
hash = []
|
39
35
|
hash.push(I18n.locale)
|
40
|
-
hash.push(highlighted_votings.map(&:cache_key_with_version))
|
41
36
|
hash.join(Decidim.cache_key_separator)
|
42
37
|
end
|
38
|
+
|
39
|
+
def cache_expiry_time
|
40
|
+
10.minutes
|
41
|
+
end
|
43
42
|
end
|
44
43
|
end
|
45
44
|
end
|
@@ -1,4 +1,4 @@
|
|
1
|
-
<section class="extended hero" style="background-image:url(
|
1
|
+
<section class="extended hero" style="background-image:url(<%= current_participatory_space.attached_uploader(:banner_image).path %>);">
|
2
2
|
<div class="hero__container">
|
3
3
|
<div class="row">
|
4
4
|
<div class="columns large-10 text-left">
|
@@ -24,6 +24,6 @@
|
|
24
24
|
</div>
|
25
25
|
</section>
|
26
26
|
|
27
|
-
<section>
|
27
|
+
<section class="section">
|
28
28
|
<%= extended_navigation_bar(navigation_items) %>
|
29
29
|
</section>
|
@@ -74,7 +74,7 @@ module Decidim
|
|
74
74
|
url: decidim_votings.voting_path(current_participatory_space),
|
75
75
|
active: is_active_link?(decidim_votings.voting_path(current_participatory_space), :exclusive)
|
76
76
|
},
|
77
|
-
if current_participatory_space.
|
77
|
+
if current_participatory_space.check_census_enabled?
|
78
78
|
{
|
79
79
|
name: t("layouts.decidim.voting_navigation.check_census"),
|
80
80
|
url: decidim_votings.voting_check_census_path(current_participatory_space),
|
@@ -5,7 +5,7 @@ module Decidim
|
|
5
5
|
module Admin
|
6
6
|
# This command is executed when the admin user creates a trustee
|
7
7
|
# from the admin panel.
|
8
|
-
class AddUserAsTrustee <
|
8
|
+
class AddUserAsTrustee < Decidim::Command
|
9
9
|
# Public: Initializes the command.
|
10
10
|
#
|
11
11
|
# form - A form object with the params.
|
@@ -5,7 +5,7 @@ module Decidim
|
|
5
5
|
module Admin
|
6
6
|
# This command is executed when the user creates an Answer
|
7
7
|
# from the admin panel.
|
8
|
-
class CreateAnswer <
|
8
|
+
class CreateAnswer < Decidim::Command
|
9
9
|
include ::Decidim::AttachmentMethods
|
10
10
|
include ::Decidim::GalleryMethods
|
11
11
|
|
@@ -38,7 +38,7 @@ module Decidim
|
|
38
38
|
attr_reader :form, :answer, :gallery
|
39
39
|
|
40
40
|
def invalid?
|
41
|
-
form.election.
|
41
|
+
form.election.started? || form.invalid?
|
42
42
|
end
|
43
43
|
|
44
44
|
def create_answer
|
@@ -5,7 +5,7 @@ module Decidim
|
|
5
5
|
module Admin
|
6
6
|
# This command is executed when the user creates an Election
|
7
7
|
# from the admin panel.
|
8
|
-
class CreateElection <
|
8
|
+
class CreateElection < Decidim::Command
|
9
9
|
include ::Decidim::AttachmentMethods
|
10
10
|
include ::Decidim::GalleryMethods
|
11
11
|
|
@@ -5,7 +5,7 @@ module Decidim
|
|
5
5
|
module Admin
|
6
6
|
# This command is executed when the user creates a Question
|
7
7
|
# from the admin panel.
|
8
|
-
class CreateQuestion <
|
8
|
+
class CreateQuestion < Decidim::Command
|
9
9
|
def initialize(form)
|
10
10
|
@form = form
|
11
11
|
end
|
@@ -14,7 +14,7 @@ module Decidim
|
|
14
14
|
#
|
15
15
|
# Broadcasts :ok if successful, :invalid otherwise.
|
16
16
|
def call
|
17
|
-
return broadcast(:election_started) if form.election.
|
17
|
+
return broadcast(:election_started) if form.election.started?
|
18
18
|
return broadcast(:invalid) if form.invalid?
|
19
19
|
|
20
20
|
create_question!
|
@@ -5,7 +5,7 @@ module Decidim
|
|
5
5
|
module Admin
|
6
6
|
# This command is executed when the user destroys an Answer
|
7
7
|
# from the admin panel.
|
8
|
-
class DestroyAnswer <
|
8
|
+
class DestroyAnswer < Decidim::Command
|
9
9
|
include ::Decidim::AttachmentMethods
|
10
10
|
include ::Decidim::GalleryMethods
|
11
11
|
|
@@ -31,7 +31,7 @@ module Decidim
|
|
31
31
|
attr_reader :answer, :current_user
|
32
32
|
|
33
33
|
def invalid?
|
34
|
-
answer.question.election.
|
34
|
+
answer.question.election.started?
|
35
35
|
end
|
36
36
|
|
37
37
|
def destroy_answer
|
@@ -5,7 +5,7 @@ module Decidim
|
|
5
5
|
module Admin
|
6
6
|
# This command is executed when the user destroys an Election
|
7
7
|
# from the admin panel.
|
8
|
-
class DestroyElection <
|
8
|
+
class DestroyElection < Decidim::Command
|
9
9
|
include ::Decidim::AttachmentMethods
|
10
10
|
include ::Decidim::GalleryMethods
|
11
11
|
|
@@ -31,7 +31,7 @@ module Decidim
|
|
31
31
|
attr_reader :election, :current_user
|
32
32
|
|
33
33
|
def invalid?
|
34
|
-
election.
|
34
|
+
election.started?
|
35
35
|
end
|
36
36
|
|
37
37
|
def destroy_election!
|
@@ -5,7 +5,7 @@ module Decidim
|
|
5
5
|
module Admin
|
6
6
|
# This command is executed when the user destroys a Question
|
7
7
|
# from the admin panel.
|
8
|
-
class DestroyQuestion <
|
8
|
+
class DestroyQuestion < Decidim::Command
|
9
9
|
def initialize(question, current_user)
|
10
10
|
@question = question
|
11
11
|
@current_user = current_user
|
@@ -27,7 +27,7 @@ module Decidim
|
|
27
27
|
attr_reader :question, :current_user
|
28
28
|
|
29
29
|
def invalid?
|
30
|
-
question.election.
|
30
|
+
question.election.started?
|
31
31
|
end
|
32
32
|
|
33
33
|
def destroy_question!
|
@@ -4,7 +4,7 @@ module Decidim
|
|
4
4
|
module Elections
|
5
5
|
module Admin
|
6
6
|
# This command gets called to end the voting period in the Bulletin Board.
|
7
|
-
class EndVote <
|
7
|
+
class EndVote < Decidim::Command
|
8
8
|
# Public: Initializes the command.
|
9
9
|
#
|
10
10
|
# form - A VotePeriodForm object with the information needed to start or end the vote period
|
@@ -5,7 +5,7 @@ module Decidim
|
|
5
5
|
module Admin
|
6
6
|
# A command is executed when an admin imports proposals from
|
7
7
|
# one component to answers of elections component.
|
8
|
-
class ImportProposalsToElections <
|
8
|
+
class ImportProposalsToElections < Decidim::Command
|
9
9
|
# Public: Initializes the command.
|
10
10
|
#
|
11
11
|
# form - A form object with the params.
|
@@ -30,7 +30,7 @@ module Decidim
|
|
30
30
|
attr_reader :form, :answer
|
31
31
|
|
32
32
|
def invalid?
|
33
|
-
form.election.
|
33
|
+
form.election.started? || form.invalid?
|
34
34
|
end
|
35
35
|
|
36
36
|
def create_answers_from_accepted_proposals
|
@@ -77,10 +77,7 @@ module Decidim
|
|
77
77
|
end
|
78
78
|
|
79
79
|
def proposal_already_copied?(original_proposal)
|
80
|
-
|
81
|
-
# because otherwise duplicates could be created until the component is
|
82
|
-
# published.
|
83
|
-
original_proposal.linked_resources(:answers, "related_proposals", component_published: false).any? do |answer|
|
80
|
+
original_proposal.linked_resources(:answers, "related_proposals").any? do |answer|
|
84
81
|
answer.question == target_question
|
85
82
|
end
|
86
83
|
end
|
@@ -4,7 +4,7 @@ module Decidim
|
|
4
4
|
module Elections
|
5
5
|
module Admin
|
6
6
|
# This command gets called when a election is published from the admin panel.
|
7
|
-
class PublishElection <
|
7
|
+
class PublishElection < Decidim::Command
|
8
8
|
# Public: Initializes the command.
|
9
9
|
#
|
10
10
|
# election - The election to publish.
|
@@ -19,7 +19,7 @@ module Decidim
|
|
19
19
|
# Broadcasts :ok if published, :invalid otherwise.
|
20
20
|
def call
|
21
21
|
publish_election
|
22
|
-
publish_event
|
22
|
+
publish_event
|
23
23
|
|
24
24
|
broadcast(:ok, election)
|
25
25
|
end
|
@@ -4,7 +4,7 @@ module Decidim
|
|
4
4
|
module Elections
|
5
5
|
module Admin
|
6
6
|
# This command gets called to publish the election results in the Bulletin Board.
|
7
|
-
class PublishResults <
|
7
|
+
class PublishResults < Decidim::Command
|
8
8
|
# Public: Initializes the command.
|
9
9
|
#
|
10
10
|
# form - An ActionForm object with the information needed to publish the results
|
@@ -5,7 +5,7 @@ module Decidim
|
|
5
5
|
module Admin
|
6
6
|
# This command is executed when the admin user removes a trustee
|
7
7
|
# from a participatory space from the admin panel.
|
8
|
-
class RemoveTrusteeFromParticipatorySpace <
|
8
|
+
class RemoveTrusteeFromParticipatorySpace < Decidim::Command
|
9
9
|
# Public: Initializes the command.
|
10
10
|
#
|
11
11
|
# trustee_participatory_space - A trustee_participatory_space
|
@@ -4,7 +4,7 @@ module Decidim
|
|
4
4
|
module Elections
|
5
5
|
module Admin
|
6
6
|
# This command gets called to report a missing trustee during the tally process.
|
7
|
-
class ReportMissingTrustee <
|
7
|
+
class ReportMissingTrustee < Decidim::Command
|
8
8
|
# Public: Initializes the command.
|
9
9
|
#
|
10
10
|
# form - A ReportMissingTrusteeForm object with the information needed to report the missing trustee.
|
@@ -4,7 +4,7 @@ module Decidim
|
|
4
4
|
module Elections
|
5
5
|
module Admin
|
6
6
|
# This command gets called when a election is setup from the admin panel.
|
7
|
-
class SetupElection <
|
7
|
+
class SetupElection < Decidim::Command
|
8
8
|
# Public: Initializes the command.
|
9
9
|
#
|
10
10
|
# form - A SetupForm object with the information needed to setup the election
|
@@ -4,7 +4,7 @@ module Decidim
|
|
4
4
|
module Elections
|
5
5
|
module Admin
|
6
6
|
# This command gets called to start the key ceremony in the Bulletin Board.
|
7
|
-
class StartKeyCeremony <
|
7
|
+
class StartKeyCeremony < Decidim::Command
|
8
8
|
# Public: Initializes the command.
|
9
9
|
#
|
10
10
|
# form - An ActionForm object with the information needed to perform an action
|
@@ -4,7 +4,7 @@ module Decidim
|
|
4
4
|
module Elections
|
5
5
|
module Admin
|
6
6
|
# This command gets called to start the tally in the Bulletin Board.
|
7
|
-
class StartTally <
|
7
|
+
class StartTally < Decidim::Command
|
8
8
|
# Public: Initializes the command.
|
9
9
|
#
|
10
10
|
# form - An ActionForm object with the information needed to perform an action
|
@@ -4,7 +4,7 @@ module Decidim
|
|
4
4
|
module Elections
|
5
5
|
module Admin
|
6
6
|
# This command gets called to start the voting period in the Bulletin Board.
|
7
|
-
class StartVote <
|
7
|
+
class StartVote < Decidim::Command
|
8
8
|
# Public: Initializes the command.
|
9
9
|
#
|
10
10
|
# form - A VotePeriodForm object with the information needed to start or end the vote period
|
@@ -4,7 +4,7 @@ module Decidim
|
|
4
4
|
module Elections
|
5
5
|
module Admin
|
6
6
|
# This command gets called when a election is unpublished from the admin panel.
|
7
|
-
class UnpublishElection <
|
7
|
+
class UnpublishElection < Decidim::Command
|
8
8
|
# Public: Initializes the command.
|
9
9
|
#
|
10
10
|
# election - The election to unpublish.
|
@@ -4,7 +4,7 @@ module Decidim
|
|
4
4
|
module Elections
|
5
5
|
module Admin
|
6
6
|
# This command updates the status of the action and the election if it got changed
|
7
|
-
class UpdateActionStatus <
|
7
|
+
class UpdateActionStatus < Decidim::Command
|
8
8
|
# Public: Initializes the command.
|
9
9
|
#
|
10
10
|
# action - The pending action to be updated
|
@@ -5,7 +5,7 @@ module Decidim
|
|
5
5
|
module Admin
|
6
6
|
# This command is executed when the user updates an Answer
|
7
7
|
# from the admin panel.
|
8
|
-
class UpdateAnswer <
|
8
|
+
class UpdateAnswer < Decidim::Command
|
9
9
|
include ::Decidim::AttachmentMethods
|
10
10
|
include ::Decidim::GalleryMethods
|
11
11
|
|
@@ -41,7 +41,7 @@ module Decidim
|
|
41
41
|
attr_reader :form, :answer, :gallery
|
42
42
|
|
43
43
|
def invalid?
|
44
|
-
form.election.
|
44
|
+
form.election.started? || form.invalid?
|
45
45
|
end
|
46
46
|
|
47
47
|
def update_answer
|
@@ -5,7 +5,7 @@ module Decidim
|
|
5
5
|
module Admin
|
6
6
|
# This command is executed when an admin marks an answer
|
7
7
|
# as selected.
|
8
|
-
class UpdateAnswerSelection <
|
8
|
+
class UpdateAnswerSelection < Decidim::Command
|
9
9
|
def initialize(answer, selected)
|
10
10
|
@answer = answer
|
11
11
|
@selected = selected
|
@@ -5,7 +5,7 @@ module Decidim
|
|
5
5
|
module Admin
|
6
6
|
# This command is executed when the user updates an Election
|
7
7
|
# from the admin panel.
|
8
|
-
class UpdateElection <
|
8
|
+
class UpdateElection < Decidim::Command
|
9
9
|
include ::Decidim::AttachmentMethods
|
10
10
|
include ::Decidim::GalleryMethods
|
11
11
|
|
@@ -5,7 +5,7 @@ module Decidim
|
|
5
5
|
module Admin
|
6
6
|
# This command is executed when the user updates a Question
|
7
7
|
# from the admin panel.
|
8
|
-
class UpdateQuestion <
|
8
|
+
class UpdateQuestion < Decidim::Command
|
9
9
|
def initialize(form, question)
|
10
10
|
@form = form
|
11
11
|
@question = question
|
@@ -27,7 +27,7 @@ module Decidim
|
|
27
27
|
attr_reader :form, :question
|
28
28
|
|
29
29
|
def invalid?
|
30
|
-
question.election.
|
30
|
+
question.election.started? || form.invalid?
|
31
31
|
end
|
32
32
|
|
33
33
|
def update_question!
|
@@ -5,7 +5,7 @@ module Decidim
|
|
5
5
|
module Admin
|
6
6
|
# This command is executed when the user updates a trustee
|
7
7
|
# status from the admin panel.
|
8
|
-
class UpdateTrusteeParticipatorySpace <
|
8
|
+
class UpdateTrusteeParticipatorySpace < Decidim::Command
|
9
9
|
# Public: Initializes the command.
|
10
10
|
#
|
11
11
|
# trustee_participatory_space - A trustee_participatory_space
|
@@ -4,7 +4,7 @@ module Decidim
|
|
4
4
|
module Elections
|
5
5
|
module TrusteeZone
|
6
6
|
# This command updates the election status if it got changed
|
7
|
-
class UpdateElectionBulletinBoardStatus <
|
7
|
+
class UpdateElectionBulletinBoardStatus < Decidim::Command
|
8
8
|
# Public: Initializes the command.
|
9
9
|
#
|
10
10
|
# status - The actual election status
|
@@ -4,7 +4,7 @@ module Decidim
|
|
4
4
|
module Elections
|
5
5
|
module TrusteeZone
|
6
6
|
# This command allows the user to update their trustee information
|
7
|
-
class UpdateTrustee <
|
7
|
+
class UpdateTrustee < Decidim::Command
|
8
8
|
# Public: Initializes the command.
|
9
9
|
#
|
10
10
|
# form - A form with the new trustee information
|
@@ -4,7 +4,7 @@ module Decidim
|
|
4
4
|
module Elections
|
5
5
|
module Voter
|
6
6
|
# This command allows the user to store and cast their vote.
|
7
|
-
class CastVote <
|
7
|
+
class CastVote < Decidim::Command
|
8
8
|
# Public: Initializes the command.
|
9
9
|
#
|
10
10
|
# form - A form with necessary info to cast a vote.
|
@@ -4,7 +4,7 @@ module Decidim
|
|
4
4
|
module Elections
|
5
5
|
module Voter
|
6
6
|
# This command updates the vote status and sends a notification.
|
7
|
-
class UpdateVoteStatus <
|
7
|
+
class UpdateVoteStatus < Decidim::Command
|
8
8
|
# Public: Initializes the command.
|
9
9
|
#
|
10
10
|
# vote - the vote that has been updated
|
@@ -74,7 +74,7 @@ module Decidim
|
|
74
74
|
}
|
75
75
|
}
|
76
76
|
|
77
|
-
Decidim::EventsManager.publish(data)
|
77
|
+
Decidim::EventsManager.publish(**data)
|
78
78
|
end
|
79
79
|
|
80
80
|
def send_vote_email
|
@@ -4,7 +4,7 @@ module Decidim
|
|
4
4
|
module Votings
|
5
5
|
module Admin
|
6
6
|
# A command with the business logic to create a new monitoring committee member
|
7
|
-
class CreateMonitoringCommitteeMember <
|
7
|
+
class CreateMonitoringCommitteeMember < Decidim::Command
|
8
8
|
# Public: Initializes the command.
|
9
9
|
#
|
10
10
|
# form - A form object with the params
|
@@ -4,7 +4,7 @@ module Decidim
|
|
4
4
|
module Votings
|
5
5
|
module Admin
|
6
6
|
# A command with the business logic to create a new polling officer
|
7
|
-
class CreatePollingOfficer <
|
7
|
+
class CreatePollingOfficer < Decidim::Command
|
8
8
|
# Public: Initializes the command.
|
9
9
|
#
|
10
10
|
# form - A form object with the params
|
@@ -4,7 +4,7 @@ module Decidim
|
|
4
4
|
module Votings
|
5
5
|
module Admin
|
6
6
|
# A command with all the business logic when creating a new voting space
|
7
|
-
class CreateVoting <
|
7
|
+
class CreateVoting < Decidim::Command
|
8
8
|
# Public: Initializes the command.
|
9
9
|
#
|
10
10
|
# form - A form object with the params.
|
@@ -51,7 +51,8 @@ module Decidim
|
|
51
51
|
banner_image: form.banner_image,
|
52
52
|
introductory_image: form.introductory_image,
|
53
53
|
voting_type: form.voting_type,
|
54
|
-
census_contact_information: form.census_contact_information
|
54
|
+
census_contact_information: form.census_contact_information,
|
55
|
+
show_check_census: form.show_check_census
|
55
56
|
)
|
56
57
|
end
|
57
58
|
end
|
@@ -4,7 +4,7 @@ module Decidim
|
|
4
4
|
module Votings
|
5
5
|
module Admin
|
6
6
|
# A command with the business logic to delete the ballot style
|
7
|
-
class DestroyBallotStyle <
|
7
|
+
class DestroyBallotStyle < Decidim::Command
|
8
8
|
def initialize(ballot_style, current_user)
|
9
9
|
@ballot_style = ballot_style
|
10
10
|
@current_user = current_user
|
@@ -4,7 +4,7 @@ module Decidim
|
|
4
4
|
module Votings
|
5
5
|
module Admin
|
6
6
|
# A command with the business logic to destroy a monitoring committee member
|
7
|
-
class DestroyMonitoringCommitteeMember <
|
7
|
+
class DestroyMonitoringCommitteeMember < Decidim::Command
|
8
8
|
# Public: Initializes the command.
|
9
9
|
#
|
10
10
|
# monitoring_committee_member - the MonitoringCommitteeMember to destroy
|
@@ -4,7 +4,7 @@ module Decidim
|
|
4
4
|
module Votings
|
5
5
|
module Admin
|
6
6
|
# A command with the business logic to destroy a poling officer
|
7
|
-
class DestroyPollingOfficer <
|
7
|
+
class DestroyPollingOfficer < Decidim::Command
|
8
8
|
# Public: Initializes the command.
|
9
9
|
#
|
10
10
|
# polling_officer - the PollingOfficer to destroy
|
@@ -5,7 +5,7 @@ module Decidim
|
|
5
5
|
module Admin
|
6
6
|
# This command is executed when the user destroys a polling station
|
7
7
|
# from the admin panel.
|
8
|
-
class DestroyPollingStation <
|
8
|
+
class DestroyPollingStation < Decidim::Command
|
9
9
|
def initialize(polling_station, current_user)
|
10
10
|
@polling_station = polling_station
|
11
11
|
@current_user = current_user
|
@@ -4,7 +4,7 @@ module Decidim
|
|
4
4
|
module Votings
|
5
5
|
module Admin
|
6
6
|
# A command with the shared business logic to manage a polling station
|
7
|
-
class ManagePollingStation <
|
7
|
+
class ManagePollingStation < Decidim::Command
|
8
8
|
def manage_polling_officers(polling_station, president_id, managers_ids)
|
9
9
|
manage_president(polling_station, president_id)
|
10
10
|
manage_managers(polling_station, managers_ids)
|
@@ -14,7 +14,7 @@ module Decidim
|
|
14
14
|
|
15
15
|
def manage_president(polling_station, president_id)
|
16
16
|
unassign_president(polling_station)
|
17
|
-
return if president_id.
|
17
|
+
return if president_id.blank?
|
18
18
|
|
19
19
|
assign_president(president_id, polling_station)
|
20
20
|
notify_officer(president_id, polling_station.voting)
|
data/app/commands/decidim/votings/admin/monitoring_committee_validate_polling_station_closure.rb
CHANGED
@@ -4,7 +4,7 @@ module Decidim
|
|
4
4
|
module Votings
|
5
5
|
module Admin
|
6
6
|
# A command with all the business logic for a monitornig committee member to validate a polling station closure
|
7
|
-
class MonitoringCommitteeValidatePollingStationClosure <
|
7
|
+
class MonitoringCommitteeValidatePollingStationClosure < Decidim::Command
|
8
8
|
# Public: Initializes the command.
|
9
9
|
#
|
10
10
|
# form - A form object with the params.
|
@@ -4,7 +4,7 @@ module Decidim
|
|
4
4
|
module Votings
|
5
5
|
module Admin
|
6
6
|
# This command gets called when a voting is published from the admin panel.
|
7
|
-
class PublishVoting <
|
7
|
+
class PublishVoting < Decidim::Command
|
8
8
|
# Public: Initializes the command.
|
9
9
|
#
|
10
10
|
# voting - The voting to publish.
|
@@ -4,7 +4,7 @@ module Decidim
|
|
4
4
|
module Votings
|
5
5
|
module Admin
|
6
6
|
# This command gets called when a voting is unpublished from the admin panel.
|
7
|
-
class UnpublishVoting <
|
7
|
+
class UnpublishVoting < Decidim::Command
|
8
8
|
# Public: Initializes the command.
|
9
9
|
#
|
10
10
|
# voting - The voting to unpublish.
|