decidim-elections 0.28.5 → 0.31.0.rc1
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 +4 -86
- data/app/cells/decidim/elections/election_card_metadata_cell.rb +56 -0
- data/app/cells/decidim/elections/election_cell.rb +3 -4
- data/app/cells/decidim/elections/election_g_cell.rb +11 -9
- data/app/cells/decidim/elections/election_l_cell.rb +39 -0
- data/app/cells/decidim/elections/election_s_cell.rb +11 -0
- data/app/commands/decidim/elections/admin/censuses/token_csv.rb +41 -0
- data/app/commands/decidim/elections/admin/create_election.rb +31 -42
- data/app/commands/decidim/elections/admin/process_census.rb +32 -0
- data/app/commands/decidim/elections/admin/publish_election.rb +14 -18
- data/app/commands/decidim/elections/admin/unpublish_election.rb +18 -16
- data/app/commands/decidim/elections/admin/update_election.rb +35 -35
- data/app/commands/decidim/elections/admin/update_election_status.rb +43 -0
- data/app/commands/decidim/elections/admin/update_question_status.rb +41 -0
- data/app/commands/decidim/elections/admin/update_questions.rb +91 -0
- data/app/commands/decidim/elections/cast_votes.rb +54 -0
- data/app/controllers/concerns/decidim/{votings → elections}/admin/filterable.rb +5 -6
- data/app/controllers/concerns/decidim/elections/orderable.rb +14 -3
- data/app/controllers/concerns/decidim/elections/uses_votes_booth.rb +115 -0
- data/app/controllers/decidim/elections/admin/application_controller.rb +1 -1
- data/app/controllers/decidim/elections/admin/census_controller.rb +52 -0
- data/app/controllers/decidim/elections/admin/elections_controller.rb +85 -32
- data/app/controllers/decidim/elections/admin/questions_controller.rb +40 -48
- data/app/controllers/decidim/elections/application_controller.rb +1 -2
- data/app/controllers/decidim/elections/elections_controller.rb +26 -57
- data/app/controllers/decidim/elections/per_question_votes_controller.rb +89 -0
- data/app/controllers/decidim/elections/votes_controller.rb +30 -139
- data/app/forms/decidim/elections/admin/censuses/internal_users_form.rb +79 -0
- data/app/forms/decidim/elections/admin/censuses/token_csv_form.rb +37 -0
- data/app/forms/decidim/elections/admin/election_form.rb +30 -20
- data/app/forms/decidim/elections/admin/question_form.rb +21 -8
- data/app/forms/decidim/elections/admin/questions_form.rb +27 -0
- data/app/forms/decidim/elections/admin/response_option_form.rb +23 -0
- data/app/forms/decidim/elections/censuses/internal_users_form.rb +64 -0
- data/app/forms/decidim/elections/censuses/token_csv_form.rb +38 -0
- data/app/helpers/decidim/elections/admin/elections_helper.rb +96 -0
- data/app/helpers/decidim/elections/application_helper.rb +35 -9
- data/app/models/decidim/elections/csv_census/data.rb +43 -0
- data/app/models/decidim/elections/election.rb +126 -96
- data/app/models/decidim/elections/question.rb +71 -30
- data/app/models/decidim/elections/response_option.rb +26 -0
- data/app/models/decidim/elections/vote.rb +35 -6
- data/app/models/decidim/elections/voter.rb +26 -0
- data/app/packs/entrypoints/decidim_elections.js +3 -10
- data/app/packs/entrypoints/decidim_elections.scss +3 -0
- data/app/packs/entrypoints/decidim_elections_admin.js +6 -5
- data/app/packs/entrypoints/decidim_elections_admin.scss +2 -0
- data/app/packs/images/decidim/elections/elections.svg +1 -0
- data/app/packs/src/decidim/elections/admin/census_form.js +13 -0
- data/app/packs/src/decidim/elections/admin/election_form.js +38 -0
- data/app/packs/src/decidim/elections/live_results_update.js +119 -0
- data/app/packs/src/decidim/elections/waiting_room.js +32 -0
- data/app/packs/stylesheets/decidim/elections/elections.scss +49 -160
- data/app/packs/stylesheets/decidim/elections/labels.scss +13 -0
- data/app/packs/stylesheets/decidim/elections/live_results_update.scss +25 -0
- data/app/permissions/decidim/elections/admin/permissions.rb +35 -61
- data/app/permissions/decidim/elections/permissions.rb +17 -29
- data/app/presenters/decidim/elections/admin_log/election_presenter.rb +8 -35
- data/app/presenters/decidim/elections/admin_log/question_presenter.rb +37 -0
- data/app/presenters/decidim/elections/censuses/user_presenter.rb +37 -0
- data/app/presenters/decidim/elections/election_presenter.rb +48 -12
- data/app/{events/decidim/elections/election_published_event.rb → presenters/decidim/elections/question_presenter.rb} +1 -1
- data/app/presenters/decidim/elections/response_option_presenter.rb +8 -0
- data/app/views/decidim/elections/admin/census/_preview.html.erb +24 -0
- data/app/views/decidim/elections/admin/census/edit.html.erb +33 -0
- data/app/views/decidim/elections/admin/censuses/_internal_users_form.html.erb +34 -0
- data/app/views/decidim/elections/admin/censuses/_internal_users_options_form.html.erb +21 -0
- data/app/views/decidim/elections/admin/censuses/_token_csv_form.html.erb +16 -0
- data/app/views/decidim/elections/admin/dashboard/_calendar.html.erb +32 -0
- data/app/views/decidim/elections/admin/dashboard/_census.html.erb +17 -0
- data/app/views/decidim/elections/admin/dashboard/_main.html.erb +40 -0
- data/app/views/decidim/elections/admin/dashboard/_photos.html.erb +12 -0
- data/app/views/decidim/elections/admin/dashboard/_questions.html.erb +38 -0
- data/app/views/decidim/elections/admin/dashboard/_questions_with_results.html.erb +43 -0
- data/app/views/decidim/elections/admin/dashboard/_results.html.erb +20 -0
- data/app/views/decidim/elections/admin/dashboard/_status.html.erb +21 -0
- data/app/views/decidim/elections/admin/elections/_actions.html.erb +91 -0
- data/app/views/decidim/elections/admin/elections/_election-tr.html.erb +30 -0
- data/app/views/decidim/elections/admin/elections/_elections-thead.html.erb +10 -0
- data/app/views/decidim/elections/admin/elections/_form.html.erb +90 -15
- data/app/views/decidim/elections/admin/elections/_tabs_menu.html.erb +9 -0
- data/app/views/decidim/elections/admin/elections/dashboard.html.erb +39 -0
- data/app/views/decidim/elections/admin/elections/edit.html.erb +9 -11
- data/app/views/decidim/elections/admin/elections/index.html.erb +21 -77
- data/app/views/decidim/elections/admin/elections/manage_trash.html.erb +23 -0
- data/app/views/decidim/elections/admin/elections/new.html.erb +10 -7
- data/app/views/decidim/elections/admin/questions/_form.html.erb +35 -21
- data/app/views/decidim/elections/admin/questions/_question.html.erb +107 -0
- data/app/views/decidim/elections/admin/questions/_response_option.html.erb +37 -0
- data/app/views/decidim/elections/admin/questions/_response_option_template.html.erb +7 -0
- data/app/views/decidim/elections/admin/questions/edit_questions.html.erb +23 -0
- data/app/views/decidim/elections/censuses/_internal_users_form.html.erb +46 -0
- data/app/views/decidim/elections/censuses/_submit_button.html.erb +5 -0
- data/app/views/decidim/elections/censuses/_token_csv_form.html.erb +4 -0
- data/app/views/decidim/elections/elections/_election.html.erb +1 -0
- data/app/views/decidim/elections/elections/_election_aside.html.erb +13 -0
- data/app/views/decidim/elections/elections/_election_top.html.erb +15 -0
- data/app/views/decidim/elections/elections/_elections.html.erb +10 -14
- data/app/views/decidim/elections/elections/_questions.html.erb +23 -0
- data/app/views/decidim/elections/elections/_vote_results.html.erb +16 -0
- data/app/views/decidim/elections/elections/_vote_results_option.html.erb +14 -0
- data/app/views/decidim/elections/elections/_vote_results_question.html.erb +13 -0
- data/app/views/decidim/elections/elections/index.html.erb +10 -5
- data/app/views/decidim/elections/elections/show.html.erb +27 -65
- data/app/views/decidim/elections/per_question_votes/show.html.erb +27 -0
- data/app/views/decidim/elections/per_question_votes/waiting.html.erb +21 -0
- data/app/views/decidim/elections/votes/confirm.html.erb +34 -0
- data/app/views/decidim/elections/votes/new.html.erb +7 -86
- data/app/views/decidim/elections/votes/receipt.html.erb +8 -0
- data/app/views/decidim/elections/votes/responses/_multiple_option.html.erb +4 -0
- data/app/views/decidim/elections/votes/responses/_single_option.html.erb +4 -0
- data/app/views/decidim/elections/votes/show.html.erb +25 -10
- data/app/views/layouts/decidim/_election_votes_header.html.erb +14 -0
- data/app/views/layouts/decidim/election_booth.html.erb +35 -0
- data/config/assets.rb +3 -5
- data/config/locales/ar.yml +8 -83
- data/config/locales/bg.yml +60 -1336
- data/config/locales/ca-IT.yml +320 -0
- data/config/locales/ca.yml +260 -1324
- data/config/locales/cs.yml +119 -1351
- data/config/locales/de.yml +78 -1336
- data/config/locales/el.yml +59 -1261
- data/config/locales/en.yml +262 -1327
- data/config/locales/es-MX.yml +261 -1325
- data/config/locales/es-PY.yml +261 -1325
- data/config/locales/es.yml +261 -1325
- data/config/locales/eu.yml +267 -1330
- data/config/locales/fi-plain.yml +259 -1322
- data/config/locales/fi.yml +259 -1322
- data/config/locales/fr-CA.yml +197 -1323
- data/config/locales/fr.yml +196 -1322
- data/config/locales/ga-IE.yml +45 -297
- data/config/locales/gl.yml +41 -519
- data/config/locales/hu.yml +21 -215
- data/config/locales/it.yml +58 -1005
- data/config/locales/ja.yml +189 -1307
- data/config/locales/lb.yml +0 -25
- data/config/locales/lt.yml +59 -1335
- data/config/locales/lv.yml +18 -76
- data/config/locales/nl.yml +49 -896
- data/config/locales/no.yml +38 -407
- data/config/locales/pl.yml +60 -1355
- data/config/locales/pt-BR.yml +59 -1283
- data/config/locales/pt.yml +58 -1008
- data/config/locales/ro-RO.yml +45 -580
- data/config/locales/ru.yml +0 -5
- data/config/locales/sk.yml +0 -5
- data/config/locales/sl.yml +7 -4
- data/config/locales/sv.yml +200 -683
- data/config/locales/tr-TR.yml +39 -291
- data/config/locales/uk.yml +0 -5
- data/config/locales/zh-CN.yml +34 -144
- data/config/locales/zh-TW.yml +60 -1263
- data/db/migrate/20250422110900_create_decidim_elections_elections.rb +19 -0
- data/db/migrate/20250513090151_create_decidim_elections_questions_and_response_options.rb +24 -0
- data/db/migrate/20250521101318_add_census_fields_to_decidim_elections_elections.rb +11 -0
- data/db/migrate/20250523100636_create_decidim_elections_voters.rb +12 -0
- data/db/migrate/20250616145355_add_published_fields_to_elections_and_questions.rb +9 -0
- data/db/migrate/20250703090427_create_decidim_elections_votes.rb +20 -0
- data/decidim-elections.gemspec +8 -12
- data/lib/decidim/elections/admin.rb +2 -2
- data/lib/decidim/elections/admin_engine.rb +48 -35
- data/lib/decidim/elections/census_manifest.rb +144 -0
- data/lib/decidim/elections/component.rb +9 -46
- data/lib/decidim/elections/engine.rb +40 -32
- data/lib/decidim/elections/seeds.rb +61 -386
- data/lib/decidim/elections/test/factories.rb +81 -299
- data/lib/decidim/elections/test/per_question_vote_examples.rb +164 -0
- data/lib/decidim/elections/test/vote_controller_examples.rb +107 -0
- data/lib/decidim/elections/test/vote_examples.rb +215 -0
- data/lib/decidim/elections/version.rb +1 -2
- data/lib/decidim/elections.rb +5 -36
- metadata +115 -572
- data/app/cells/decidim/elections/content_blocks/related_elections_cell.rb +0 -13
- data/app/cells/decidim/elections/election_metadata_cell.rb +0 -57
- data/app/cells/decidim/elections/election_preview/show.erb +0 -28
- data/app/cells/decidim/elections/election_preview_cell.rb +0 -13
- data/app/cells/decidim/elections/election_results/progress_bar.erb +0 -15
- data/app/cells/decidim/elections/election_results/show.erb +0 -43
- data/app/cells/decidim/elections/election_results_cell.rb +0 -13
- data/app/cells/decidim/elections/election_vote_cta/show.erb +0 -23
- data/app/cells/decidim/elections/election_vote_cta_cell.rb +0 -79
- data/app/cells/decidim/elections/highlighted_elections_for_component/show.erb +0 -18
- data/app/cells/decidim/elections/highlighted_elections_for_component_cell.rb +0 -50
- data/app/cells/decidim/elections/remaining_time_callout/show.erb +0 -3
- data/app/cells/decidim/elections/remaining_time_callout_cell.rb +0 -28
- data/app/cells/decidim/elections/voting_step_navigation/show.erb +0 -25
- data/app/cells/decidim/elections/voting_step_navigation_cell.rb +0 -42
- data/app/cells/decidim/votings/content_block_cell.rb +0 -21
- data/app/cells/decidim/votings/content_blocks/hero_cell.rb +0 -41
- data/app/cells/decidim/votings/content_blocks/hero_settings_form/show.erb +0 -4
- data/app/cells/decidim/votings/content_blocks/hero_settings_form_cell.rb +0 -15
- data/app/cells/decidim/votings/content_blocks/highlighted_votings_cell.rb +0 -33
- data/app/cells/decidim/votings/content_blocks/highlighted_votings_settings_form/show.erb +0 -3
- data/app/cells/decidim/votings/content_blocks/highlighted_votings_settings_form_cell.rb +0 -19
- data/app/cells/decidim/votings/content_blocks/main_data_cell.rb +0 -34
- data/app/cells/decidim/votings/content_blocks/metrics_cell.rb +0 -17
- data/app/cells/decidim/votings/content_blocks/polling_stations/show.erb +0 -21
- data/app/cells/decidim/votings/content_blocks/polling_stations_cell.rb +0 -31
- data/app/cells/decidim/votings/content_blocks/statistics_cell.rb +0 -18
- data/app/cells/decidim/votings/polling_officers/polling_officers_picker/show.erb +0 -15
- data/app/cells/decidim/votings/polling_officers/polling_officers_picker_cell.rb +0 -76
- data/app/cells/decidim/votings/polling_station_closure_certificate/show.erb +0 -7
- data/app/cells/decidim/votings/polling_station_closure_certificate_cell.rb +0 -12
- data/app/cells/decidim/votings/polling_station_closure_recount/show.erb +0 -70
- data/app/cells/decidim/votings/polling_station_closure_recount_cell.rb +0 -9
- data/app/cells/decidim/votings/voting_cell.rb +0 -24
- data/app/cells/decidim/votings/voting_dropdown_metadata_cell.rb +0 -19
- data/app/cells/decidim/votings/voting_g_cell.rb +0 -19
- data/app/cells/decidim/votings/voting_map/show.erb +0 -16
- data/app/cells/decidim/votings/voting_map_cell.rb +0 -28
- data/app/cells/decidim/votings/voting_metadata_cell.rb +0 -66
- data/app/cells/decidim/votings/voting_s_cell.rb +0 -10
- data/app/commands/decidim/elections/admin/add_user_as_trustee.rb +0 -92
- data/app/commands/decidim/elections/admin/create_answer.rb +0 -70
- data/app/commands/decidim/elections/admin/create_question.rb +0 -49
- data/app/commands/decidim/elections/admin/destroy_answer.rb +0 -49
- data/app/commands/decidim/elections/admin/destroy_election.rb +0 -49
- data/app/commands/decidim/elections/admin/destroy_question.rb +0 -46
- data/app/commands/decidim/elections/admin/end_vote.rb +0 -63
- data/app/commands/decidim/elections/admin/import_proposals_to_elections.rb +0 -90
- data/app/commands/decidim/elections/admin/publish_results.rb +0 -63
- data/app/commands/decidim/elections/admin/remove_trustee_from_participatory_space.rb +0 -37
- data/app/commands/decidim/elections/admin/report_missing_trustee.rb +0 -68
- data/app/commands/decidim/elections/admin/setup_election.rb +0 -168
- data/app/commands/decidim/elections/admin/start_key_ceremony.rb +0 -63
- data/app/commands/decidim/elections/admin/start_tally.rb +0 -63
- data/app/commands/decidim/elections/admin/start_vote.rb +0 -63
- data/app/commands/decidim/elections/admin/update_action_status.rb +0 -47
- data/app/commands/decidim/elections/admin/update_answer.rb +0 -72
- data/app/commands/decidim/elections/admin/update_answer_selection.rb +0 -41
- data/app/commands/decidim/elections/admin/update_question.rb +0 -52
- data/app/commands/decidim/elections/admin/update_trustee_participatory_space.rb +0 -40
- data/app/commands/decidim/elections/trustee_zone/update_election_bulletin_board_status.rb +0 -98
- data/app/commands/decidim/elections/trustee_zone/update_trustee.rb +0 -44
- data/app/commands/decidim/elections/voter/cast_vote.rb +0 -56
- data/app/commands/decidim/elections/voter/update_vote_status.rb +0 -86
- data/app/commands/decidim/votings/admin/create_ballot_style.rb +0 -61
- data/app/commands/decidim/votings/admin/create_monitoring_committee_member.rb +0 -99
- data/app/commands/decidim/votings/admin/create_polling_officer.rb +0 -99
- data/app/commands/decidim/votings/admin/create_polling_station.rb +0 -59
- data/app/commands/decidim/votings/admin/create_voting.rb +0 -61
- data/app/commands/decidim/votings/admin/destroy_ballot_style.rb +0 -41
- data/app/commands/decidim/votings/admin/destroy_monitoring_committee_member.rb +0 -51
- data/app/commands/decidim/votings/admin/destroy_polling_officer.rb +0 -52
- data/app/commands/decidim/votings/admin/destroy_polling_station.rb +0 -40
- data/app/commands/decidim/votings/admin/manage_polling_station.rb +0 -64
- data/app/commands/decidim/votings/admin/monitoring_committee_validate_polling_station_closure.rb +0 -37
- data/app/commands/decidim/votings/admin/update_ballot_style.rb +0 -75
- data/app/commands/decidim/votings/admin/update_polling_station.rb +0 -50
- data/app/commands/decidim/votings/admin/update_voting.rb +0 -77
- data/app/commands/decidim/votings/census/admin/create_dataset.rb +0 -101
- data/app/commands/decidim/votings/census/admin/create_datum.rb +0 -55
- data/app/commands/decidim/votings/census/admin/destroy_dataset.rb +0 -45
- data/app/commands/decidim/votings/census/admin/increment_dataset_processed_rows.rb +0 -43
- data/app/commands/decidim/votings/census/admin/launch_access_codes_export.rb +0 -40
- data/app/commands/decidim/votings/census/admin/launch_access_codes_generation.rb +0 -44
- data/app/commands/decidim/votings/census/admin/update_dataset.rb +0 -51
- data/app/commands/decidim/votings/certify_polling_station_closure.rb +0 -45
- data/app/commands/decidim/votings/check_census.rb +0 -35
- data/app/commands/decidim/votings/create_polling_station_closure.rb +0 -53
- data/app/commands/decidim/votings/create_polling_station_results.rb +0 -83
- data/app/commands/decidim/votings/send_access_code.rb +0 -52
- data/app/commands/decidim/votings/sign_polling_station_closure.rb +0 -41
- data/app/commands/decidim/votings/voter/in_person_vote.rb +0 -55
- data/app/commands/decidim/votings/voter/update_in_person_vote_status.rb +0 -52
- data/app/constraints/decidim/votings/current_component.rb +0 -28
- data/app/constraints/decidim/votings/current_voting.rb +0 -43
- data/app/controllers/concerns/decidim/elections/content_security_policy.rb +0 -23
- data/app/controllers/concerns/decidim/elections/has_vote_flow.rb +0 -43
- data/app/controllers/concerns/decidim/monitoring_committee_polling_station_closures/admin/filterable.rb +0 -72
- data/app/controllers/concerns/decidim/polling_officers/admin/filterable.rb +0 -58
- data/app/controllers/concerns/decidim/polling_stations/admin/filterable.rb +0 -57
- data/app/controllers/concerns/decidim/votings/admin/voting_admin.rb +0 -49
- data/app/controllers/concerns/decidim/votings/needs_voting.rb +0 -44
- data/app/controllers/concerns/decidim/votings/orderable.rb +0 -32
- data/app/controllers/decidim/elections/admin/answers_controller.rb +0 -131
- data/app/controllers/decidim/elections/admin/feedback_forms_controller.rb +0 -55
- data/app/controllers/decidim/elections/admin/proposals_imports_controller.rb +0 -53
- data/app/controllers/decidim/elections/admin/steps_controller.rb +0 -118
- data/app/controllers/decidim/elections/admin/trustees_participatory_spaces_controller.rb +0 -89
- data/app/controllers/decidim/elections/feedbacks_controller.rb +0 -72
- data/app/controllers/decidim/elections/trustee_zone/application_controller.rb +0 -48
- data/app/controllers/decidim/elections/trustee_zone/elections_controller.rb +0 -49
- data/app/controllers/decidim/elections/trustee_zone/trustees_controller.rb +0 -36
- data/app/controllers/decidim/votings/admin/application_controller.rb +0 -26
- data/app/controllers/decidim/votings/admin/ballot_styles_controller.rb +0 -93
- data/app/controllers/decidim/votings/admin/component_permissions_controller.rb +0 -13
- data/app/controllers/decidim/votings/admin/components_controller.rb +0 -15
- 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/monitoring_committee_election_results_controller.rb +0 -77
- data/app/controllers/decidim/votings/admin/monitoring_committee_members_controller.rb +0 -81
- data/app/controllers/decidim/votings/admin/monitoring_committee_polling_station_closures_controller.rb +0 -73
- data/app/controllers/decidim/votings/admin/monitoring_committee_verify_elections_controller.rb +0 -24
- data/app/controllers/decidim/votings/admin/polling_officers_controller.rb +0 -66
- data/app/controllers/decidim/votings/admin/polling_stations_controller.rb +0 -95
- data/app/controllers/decidim/votings/admin/reminders_controller.rb +0 -14
- data/app/controllers/decidim/votings/admin/voting_attachment_collections_controller.rb +0 -27
- data/app/controllers/decidim/votings/admin/voting_attachments_controller.rb +0 -26
- data/app/controllers/decidim/votings/admin/voting_publications_controller.rb +0 -25
- data/app/controllers/decidim/votings/admin/votings_controller.rb +0 -100
- data/app/controllers/decidim/votings/admin/votings_landing_page_content_blocks_controller.rb +0 -40
- data/app/controllers/decidim/votings/admin/votings_landing_page_controller.rb +0 -46
- data/app/controllers/decidim/votings/application_controller.rb +0 -26
- data/app/controllers/decidim/votings/census/admin/application_controller.rb +0 -19
- data/app/controllers/decidim/votings/census/admin/census_controller.rb +0 -195
- data/app/controllers/decidim/votings/polling_officer_zone/application_controller.rb +0 -33
- data/app/controllers/decidim/votings/polling_officer_zone/closures_controller.rb +0 -134
- data/app/controllers/decidim/votings/polling_officer_zone/in_person_votes_controller.rb +0 -159
- data/app/controllers/decidim/votings/polling_officer_zone/polling_officers_controller.rb +0 -25
- data/app/controllers/decidim/votings/votings_controller.rb +0 -182
- data/app/events/decidim/elections/trustees/notify_new_trustee_event.rb +0 -28
- data/app/events/decidim/elections/trustees/notify_trustee_new_election_event.rb +0 -14
- data/app/events/decidim/elections/votes/vote_accepted_event.rb +0 -24
- data/app/events/decidim/votings/polling_officers/polling_station_assigned_event.rb +0 -44
- data/app/forms/decidim/elections/admin/action_form.rb +0 -43
- data/app/forms/decidim/elections/admin/answer_form.rb +0 -54
- data/app/forms/decidim/elections/admin/answer_import_proposals_form.rb +0 -41
- data/app/forms/decidim/elections/admin/report_missing_trustee_form.rb +0 -22
- data/app/forms/decidim/elections/admin/setup_form.rb +0 -127
- data/app/forms/decidim/elections/admin/trustees_participatory_space_form.rb +0 -22
- data/app/forms/decidim/elections/admin/vote_period_form.rb +0 -37
- data/app/forms/decidim/elections/trustee_zone/trustee_form.rb +0 -26
- data/app/forms/decidim/elections/voter/verify_vote_form.rb +0 -25
- data/app/forms/decidim/elections/voter/vote_form.rb +0 -50
- data/app/forms/decidim/votings/admin/ballot_style_form.rb +0 -19
- data/app/forms/decidim/votings/admin/monitoring_committee_polling_station_closure_form.rb +0 -11
- data/app/forms/decidim/votings/admin/polling_station_form.rb +0 -58
- data/app/forms/decidim/votings/admin/publish_results_form.rb +0 -64
- data/app/forms/decidim/votings/admin/voting_form.rb +0 -73
- data/app/forms/decidim/votings/admin/voting_user_role_form.rb +0 -27
- data/app/forms/decidim/votings/answer_result_form.rb +0 -24
- data/app/forms/decidim/votings/ballot_result_form.rb +0 -28
- data/app/forms/decidim/votings/census/admin/dataset_form.rb +0 -22
- data/app/forms/decidim/votings/census/admin/datum_form.rb +0 -34
- data/app/forms/decidim/votings/census/check_fields.rb +0 -28
- data/app/forms/decidim/votings/census/check_form.rb +0 -13
- data/app/forms/decidim/votings/census/frontend_fields.rb +0 -42
- data/app/forms/decidim/votings/census/in_person_fields.rb +0 -52
- data/app/forms/decidim/votings/census/in_person_form.rb +0 -13
- data/app/forms/decidim/votings/census/login_form.rb +0 -13
- data/app/forms/decidim/votings/census/online_fields.rb +0 -28
- data/app/forms/decidim/votings/closure_certify_form.rb +0 -20
- data/app/forms/decidim/votings/closure_result_form.rb +0 -37
- data/app/forms/decidim/votings/closure_sign_form.rb +0 -11
- data/app/forms/decidim/votings/envelopes_result_form.rb +0 -34
- data/app/forms/decidim/votings/question_result_form.rb +0 -24
- data/app/forms/decidim/votings/voter/in_person_vote_form.rb +0 -40
- data/app/helpers/decidim/elections/admin/answers_helper.rb +0 -19
- data/app/helpers/decidim/elections/admin/steps_helper.rb +0 -23
- data/app/helpers/decidim/elections/admin/trustees_participatory_spaces_helper.rb +0 -33
- data/app/helpers/decidim/elections/election_cells_helper.rb +0 -12
- data/app/helpers/decidim/elections/votes_helper.rb +0 -23
- data/app/helpers/decidim/votings/map_helper.rb +0 -22
- data/app/helpers/decidim/votings/votings_helper.rb +0 -53
- data/app/jobs/decidim/votings/census/admin/create_datum_job.rb +0 -41
- data/app/jobs/decidim/votings/census/admin/export_access_codes_job.rb +0 -39
- data/app/jobs/decidim/votings/census/admin/generate_access_codes_job.rb +0 -44
- data/app/mailers/decidim/elections/trustee_mailer.rb +0 -28
- data/app/mailers/decidim/elections/vote_accepted_mailer.rb +0 -29
- data/app/mailers/decidim/votings/access_code_mailer.rb +0 -34
- data/app/mailers/decidim/votings/census/export_mailer.rb +0 -44
- data/app/models/decidim/elections/action.rb +0 -13
- data/app/models/decidim/elections/answer.rb +0 -46
- data/app/models/decidim/elections/bulletin_board_closure.rb +0 -19
- data/app/models/decidim/elections/elections_trustee.rb +0 -11
- data/app/models/decidim/elections/result.rb +0 -22
- data/app/models/decidim/elections/trustee.rb +0 -39
- data/app/models/decidim/elections/trustees_participatory_space.rb +0 -13
- data/app/models/decidim/votings/ballot_style.rb +0 -35
- data/app/models/decidim/votings/ballot_style_question.rb +0 -11
- data/app/models/decidim/votings/census/dataset.rb +0 -34
- data/app/models/decidim/votings/census/datum.rb +0 -34
- data/app/models/decidim/votings/in_person_vote.rb +0 -22
- data/app/models/decidim/votings/monitoring_committee_member.rb +0 -30
- data/app/models/decidim/votings/polling_officer.rb +0 -81
- data/app/models/decidim/votings/polling_station.rb +0 -86
- data/app/models/decidim/votings/polling_station_closure.rb +0 -43
- data/app/models/decidim/votings/voting.rb +0 -176
- data/app/packs/entrypoints/decidim_votings.js +0 -11
- data/app/packs/entrypoints/decidim_votings_admin.js +0 -10
- data/app/packs/images/decidim/elections/decidim_elections.svg +0 -1
- data/app/packs/images/decidim/votings/decidim_votings.svg +0 -1
- data/app/packs/src/decidim/elections/admin/pending_action.js +0 -19
- data/app/packs/src/decidim/elections/admin/trustees_process.js +0 -130
- data/app/packs/src/decidim/elections/admin/vote_statistics.js +0 -14
- data/app/packs/src/decidim/elections/broken_promises_handler.js +0 -13
- data/app/packs/src/decidim/elections/election_log.js +0 -159
- data/app/packs/src/decidim/elections/trustee/key_ceremony.js +0 -165
- data/app/packs/src/decidim/elections/trustee/tally.js +0 -147
- data/app/packs/src/decidim/elections/trustee/trustee_zone.js +0 -64
- data/app/packs/src/decidim/elections/voter/casting-vote.js +0 -19
- data/app/packs/src/decidim/elections/voter/new-vote.js +0 -104
- data/app/packs/src/decidim/elections/voter/setup-preview.js +0 -75
- data/app/packs/src/decidim/elections/voter/setup-vote.js +0 -49
- data/app/packs/src/decidim/elections/voter/verify-vote.js +0 -77
- data/app/packs/src/decidim/elections/voter/vote_questions.component.js +0 -170
- data/app/packs/src/decidim/votings/admin/polling_officers_picker.js +0 -20
- data/app/packs/src/decidim/votings/admin/polling_stations_form.js +0 -9
- data/app/packs/src/decidim/votings/admin/update_census_dataset_status.js +0 -13
- data/app/packs/src/decidim/votings/admin/voting_user_role_form.js +0 -35
- data/app/packs/src/decidim/votings/in-person-vote.js +0 -23
- data/app/packs/src/decidim/votings/polling_officer_zone/edit-closure.js +0 -26
- data/app/packs/src/decidim/votings/polling_officer_zone/in-person-vote.js +0 -5
- data/app/packs/src/decidim/votings/polling_officer_zone/new-closure.js +0 -33
- data/app/packs/src/decidim/votings/polling_officer_zone/sign-closure.js +0 -13
- data/app/packs/stylesheets/decidim/votings/admin/votings/_ballot-styles.scss +0 -16
- data/app/packs/stylesheets/decidim/votings/admin/votings/_monitoring-committee-polling-station-closures.scss +0 -9
- data/app/packs/stylesheets/decidim/votings/admin/votings/_results.scss +0 -3
- data/app/packs/stylesheets/decidim/votings/admin/votings.scss +0 -23
- data/app/packs/stylesheets/decidim/votings/votings.scss +0 -53
- data/app/permissions/decidim/elections/trustee_zone/permissions.rb +0 -32
- data/app/permissions/decidim/votings/admin/permissions.rb +0 -180
- data/app/permissions/decidim/votings/permissions.rb +0 -42
- data/app/permissions/decidim/votings/polling_officer_zone/permissions.rb +0 -38
- data/app/presenters/decidim/elections/admin_log/trustee_presenter.rb +0 -50
- data/app/presenters/decidim/elections/trustee_presenter.rb +0 -28
- data/app/presenters/decidim/votings/admin_log/ballot_style_presenter.rb +0 -39
- data/app/presenters/decidim/votings/admin_log/monitoring_committee_member_presenter.rb +0 -50
- data/app/presenters/decidim/votings/admin_log/polling_officer_presenter.rb +0 -50
- data/app/presenters/decidim/votings/admin_log/polling_station_presenter.rb +0 -29
- data/app/presenters/decidim/votings/admin_log/voting_presenter.rb +0 -45
- data/app/presenters/decidim/votings/census/admin_log/dataset_presenter.rb +0 -31
- data/app/presenters/decidim/votings/polling_station_presenter.rb +0 -27
- data/app/presenters/decidim/votings/voting_presenter.rb +0 -27
- data/app/presenters/decidim/votings/voting_stats_presenter.rb +0 -16
- data/app/queries/decidim/elections/admin/pending_actions.rb +0 -20
- data/app/queries/decidim/elections/admin/votes_for_statistics.rb +0 -24
- data/app/queries/decidim/elections/elections_finished_to_end.rb +0 -19
- data/app/queries/decidim/elections/elections_ready_to_start.rb +0 -25
- data/app/queries/decidim/elections/filtered_elections.rb +0 -37
- data/app/queries/decidim/elections/trustees/by_participatory_space.rb +0 -24
- data/app/queries/decidim/elections/trustees/by_participatory_space_trustee_ids.rb +0 -24
- data/app/queries/decidim/elections/votes/last_vote_for_voter.rb +0 -29
- data/app/queries/decidim/elections/votes/pending_votes.rb +0 -20
- data/app/queries/decidim/votings/admin/admin_users.rb +0 -44
- data/app/queries/decidim/votings/admin/ballot_style_by_voting_code.rb +0 -31
- data/app/queries/decidim/votings/admin/polling_officers_join_polling_stations.rb +0 -33
- data/app/queries/decidim/votings/admin/polling_officers_join_polling_stations_and_user.rb +0 -34
- data/app/queries/decidim/votings/admin/polling_officers_join_user.rb +0 -32
- data/app/queries/decidim/votings/organization_prioritized_votings.rb +0 -21
- data/app/queries/decidim/votings/organization_promoted_votings.rb +0 -16
- data/app/queries/decidim/votings/organization_published_votings.rb +0 -19
- data/app/queries/decidim/votings/organization_votings.rb +0 -16
- data/app/queries/decidim/votings/prioritized_votings.rb +0 -13
- data/app/queries/decidim/votings/published_votings.rb +0 -12
- data/app/queries/decidim/votings/votes/in_person_vote_for_voter.rb +0 -27
- data/app/queries/decidim/votings/votes/pending_in_person_votes.rb +0 -20
- data/app/serializers/decidim/votings/census/datum_serializer.rb +0 -29
- data/app/services/decidim/elections/current_user_vote_flow.rb +0 -68
- data/app/services/decidim/elections/vote_flow.rb +0 -109
- data/app/services/decidim/votings/census/access_codes_exporter.rb +0 -52
- data/app/services/decidim/votings/census_vote_flow.rb +0 -104
- data/app/uploaders/decidim/cw/votings/census/voting_census_uploader.rb +0 -19
- data/app/views/decidim/elections/admin/answers/_form.html.erb +0 -23
- data/app/views/decidim/elections/admin/answers/edit.html.erb +0 -23
- data/app/views/decidim/elections/admin/answers/index.html.erb +0 -93
- data/app/views/decidim/elections/admin/answers/new.html.erb +0 -23
- data/app/views/decidim/elections/admin/proposals_imports/new.html.erb +0 -39
- data/app/views/decidim/elections/admin/questions/edit.html.erb +0 -21
- data/app/views/decidim/elections/admin/questions/index.html.erb +0 -60
- data/app/views/decidim/elections/admin/questions/new.html.erb +0 -22
- data/app/views/decidim/elections/admin/shared/_trustees_secondary_nav.html.erb +0 -3
- data/app/views/decidim/elections/admin/steps/_create_election.html.erb +0 -56
- data/app/views/decidim/elections/admin/steps/_created.html.erb +0 -16
- data/app/views/decidim/elections/admin/steps/_key_ceremony.html.erb +0 -51
- data/app/views/decidim/elections/admin/steps/_key_ceremony_ended.html.erb +0 -15
- data/app/views/decidim/elections/admin/steps/_results_published.html.erb +0 -62
- data/app/views/decidim/elections/admin/steps/_tally_ended.html.erb +0 -55
- data/app/views/decidim/elections/admin/steps/_tally_started.html.erb +0 -67
- data/app/views/decidim/elections/admin/steps/_vote.html.erb +0 -21
- data/app/views/decidim/elections/admin/steps/_vote_ended.html.erb +0 -19
- data/app/views/decidim/elections/admin/steps/_vote_stats.html.erb +0 -31
- data/app/views/decidim/elections/admin/steps/index.html.erb +0 -54
- data/app/views/decidim/elections/admin/trustees_participatory_spaces/_form.html.erb +0 -15
- data/app/views/decidim/elections/admin/trustees_participatory_spaces/index.html.erb +0 -66
- data/app/views/decidim/elections/admin/trustees_participatory_spaces/new.html.erb +0 -19
- data/app/views/decidim/elections/elections/election_log.html.erb +0 -176
- data/app/views/decidim/elections/shared/_broken_promises_modal.html.erb +0 -24
- data/app/views/decidim/elections/trustee_mailer/notification.html.erb +0 -5
- data/app/views/decidim/elections/trustee_zone/elections/_backup_modal.html.erb +0 -14
- data/app/views/decidim/elections/trustee_zone/elections/_key_ceremony_steps.html.erb +0 -51
- data/app/views/decidim/elections/trustee_zone/elections/_restore_modal.html.erb +0 -15
- data/app/views/decidim/elections/trustee_zone/elections/_tally_started_steps.html.erb +0 -48
- data/app/views/decidim/elections/trustee_zone/elections/show.html.erb +0 -24
- data/app/views/decidim/elections/trustee_zone/elections/update.js.erb +0 -5
- data/app/views/decidim/elections/trustee_zone/trustees/_no_public_keys.html.erb +0 -30
- data/app/views/decidim/elections/trustee_zone/trustees/_public_keys.html.erb +0 -17
- data/app/views/decidim/elections/trustee_zone/trustees/_table.html.erb +0 -28
- data/app/views/decidim/elections/trustee_zone/trustees/show.html.erb +0 -29
- data/app/views/decidim/elections/vote_accepted_mailer/notification.html.erb +0 -3
- data/app/views/decidim/elections/votes/_new_ballot_decision_step.html.erb +0 -26
- data/app/views/decidim/elections/votes/_new_confirm_step.html.erb +0 -65
- data/app/views/decidim/elections/votes/_new_encrypting_step.html.erb +0 -9
- data/app/views/decidim/elections/votes/_new_question.html.erb +0 -33
- data/app/views/decidim/elections/votes/_new_question_modal.html.erb +0 -43
- data/app/views/decidim/elections/votes/_onboarding_modal.html.erb +0 -17
- data/app/views/decidim/elections/votes/_show_casted.html.erb +0 -34
- data/app/views/decidim/elections/votes/_show_casting.html.erb +0 -22
- data/app/views/decidim/elections/votes/_show_failed.html.erb +0 -26
- data/app/views/decidim/elections/votes/verify.html.erb +0 -57
- data/app/views/decidim/votings/access_code_mailer/send_access_code.html.erb +0 -5
- data/app/views/decidim/votings/admin/ballot_styles/_form.html.erb +0 -24
- data/app/views/decidim/votings/admin/ballot_styles/edit.html.erb +0 -18
- data/app/views/decidim/votings/admin/ballot_styles/index.html.erb +0 -65
- data/app/views/decidim/votings/admin/ballot_styles/new.html.erb +0 -18
- data/app/views/decidim/votings/admin/monitoring_committee_election_results/_results.html.erb +0 -50
- data/app/views/decidim/votings/admin/monitoring_committee_election_results/index.html.erb +0 -30
- data/app/views/decidim/votings/admin/monitoring_committee_election_results/show.html.erb +0 -24
- data/app/views/decidim/votings/admin/monitoring_committee_members/_form.html.erb +0 -26
- data/app/views/decidim/votings/admin/monitoring_committee_members/index.html.erb +0 -39
- data/app/views/decidim/votings/admin/monitoring_committee_members/new.html.erb +0 -18
- data/app/views/decidim/votings/admin/monitoring_committee_polling_station_closures/_closure_certificate_results.erb +0 -9
- data/app/views/decidim/votings/admin/monitoring_committee_polling_station_closures/_closures.html.erb +0 -68
- data/app/views/decidim/votings/admin/monitoring_committee_polling_station_closures/_elections.html.erb +0 -29
- data/app/views/decidim/votings/admin/monitoring_committee_polling_station_closures/edit.html.erb +0 -30
- data/app/views/decidim/votings/admin/monitoring_committee_polling_station_closures/index.html.erb +0 -5
- data/app/views/decidim/votings/admin/monitoring_committee_polling_station_closures/show.html.erb +0 -10
- data/app/views/decidim/votings/admin/monitoring_committee_verify_elections/index.html.erb +0 -57
- data/app/views/decidim/votings/admin/polling_officers/_form.html.erb +0 -26
- data/app/views/decidim/votings/admin/polling_officers/index.html.erb +0 -49
- data/app/views/decidim/votings/admin/polling_officers/new.html.erb +0 -18
- data/app/views/decidim/votings/admin/polling_stations/_form.html.erb +0 -34
- data/app/views/decidim/votings/admin/polling_stations/edit.html.erb +0 -18
- data/app/views/decidim/votings/admin/polling_stations/index.html.erb +0 -54
- data/app/views/decidim/votings/admin/polling_stations/new.html.erb +0 -18
- data/app/views/decidim/votings/admin/votings/_form.html.erb +0 -76
- data/app/views/decidim/votings/admin/votings/edit.html.erb +0 -39
- data/app/views/decidim/votings/admin/votings/index.html.erb +0 -65
- data/app/views/decidim/votings/admin/votings/new.html.erb +0 -19
- data/app/views/decidim/votings/census/admin/census/_creating_data.html.erb +0 -10
- data/app/views/decidim/votings/census/admin/census/_export_codes.html.erb +0 -8
- data/app/views/decidim/votings/census/admin/census/_exporting_codes.html.erb +0 -3
- data/app/views/decidim/votings/census/admin/census/_freeze.html.erb +0 -5
- data/app/views/decidim/votings/census/admin/census/_generate_codes.html.erb +0 -35
- data/app/views/decidim/votings/census/admin/census/_generating_codes.html.erb +0 -3
- data/app/views/decidim/votings/census/admin/census/_new_census.html.erb +0 -23
- data/app/views/decidim/votings/census/admin/census/_upload_info.html.erb +0 -17
- data/app/views/decidim/votings/census/admin/census/show.html.erb +0 -24
- data/app/views/decidim/votings/census/admin/census/status.js.erb +0 -1
- data/app/views/decidim/votings/census/export_mailer/access_codes_export.erb +0 -7
- data/app/views/decidim/votings/polling_officer_zone/closures/_answer_results_form_fields.html.erb +0 -11
- data/app/views/decidim/votings/polling_officer_zone/closures/_ballot_results_form_fields.html.erb +0 -29
- data/app/views/decidim/votings/polling_officer_zone/closures/_certify_form.html.erb +0 -13
- data/app/views/decidim/votings/polling_officer_zone/closures/_modal_ballots_count_error.html.erb +0 -47
- data/app/views/decidim/votings/polling_officer_zone/closures/_modal_ballots_results_count_error.html.erb +0 -20
- data/app/views/decidim/votings/polling_officer_zone/closures/_question_results_form_fields.html.erb +0 -17
- data/app/views/decidim/votings/polling_officer_zone/closures/_sign_form.html.erb +0 -43
- data/app/views/decidim/votings/polling_officer_zone/closures/edit.html.erb +0 -63
- data/app/views/decidim/votings/polling_officer_zone/closures/new.html.erb +0 -70
- data/app/views/decidim/votings/polling_officer_zone/closures/show.html.erb +0 -45
- data/app/views/decidim/votings/polling_officer_zone/in_person_votes/_complete_voting.html.erb +0 -48
- data/app/views/decidim/votings/polling_officer_zone/in_person_votes/_in_person_form.html.erb +0 -37
- data/app/views/decidim/votings/polling_officer_zone/in_person_votes/_verify_document.html.erb +0 -20
- data/app/views/decidim/votings/polling_officer_zone/in_person_votes/new.html.erb +0 -25
- data/app/views/decidim/votings/polling_officer_zone/in_person_votes/show.html.erb +0 -30
- data/app/views/decidim/votings/polling_officer_zone/polling_officers/_polling_station.html.erb +0 -53
- data/app/views/decidim/votings/polling_officer_zone/polling_officers/index.html.erb +0 -19
- data/app/views/decidim/votings/votings/_access_code_modal.html.erb +0 -28
- data/app/views/decidim/votings/votings/_check_fields.html.erb +0 -20
- data/app/views/decidim/votings/votings/_polling_officers_picker.html.erb +0 -4
- data/app/views/decidim/votings/votings/_votings.html.erb +0 -19
- data/app/views/decidim/votings/votings/check_census.html.erb +0 -68
- data/app/views/decidim/votings/votings/elections_log.html.erb +0 -37
- data/app/views/decidim/votings/votings/index.html.erb +0 -39
- data/app/views/decidim/votings/votings/index.js.erb +0 -5
- data/app/views/decidim/votings/votings/login.html.erb +0 -57
- data/app/views/decidim/votings/votings/show.html.erb +0 -18
- data/app/views/layouts/decidim/admin/voting.html.erb +0 -23
- data/app/views/layouts/decidim/admin/votings.html.erb +0 -16
- data/app/views/layouts/decidim/votings.html.erb +0 -14
- data/config/initializers/decidim_bulletin_board.rb +0 -29
- data/config/initializers/rack_attack.rb +0 -15
- data/config/locales/bg-BG.yml +0 -7
- data/config/locales/da-DK.yml +0 -1
- data/config/locales/eo-UY.yml +0 -1
- data/config/locales/et-EE.yml +0 -1
- data/config/locales/fr-LU.yml +0 -890
- data/config/locales/hr-HR.yml +0 -1
- data/config/locales/is.yml +0 -1
- data/config/locales/ko-KR.yml +0 -1
- data/config/locales/lb-LU.yml +0 -25
- data/config/locales/lt-LT.yml +0 -1
- data/config/locales/mt-MT.yml +0 -1
- data/config/locales/vi-VN.yml +0 -1
- data/db/migrate/20200430083618_create_decidim_elections_elections.rb +0 -15
- data/db/migrate/20200518082327_create_decidim_elections_questions.rb +0 -14
- data/db/migrate/20200518084144_create_decidim_elections_answers.rb +0 -12
- data/db/migrate/20200601141412_add_published_at_to_elections.rb +0 -7
- data/db/migrate/20200807125040_remove_subtitle_from_decidim_elections.rb +0 -7
- data/db/migrate/20200910103648_add_min_selections_to_decidim_elections_questions.rb +0 -7
- data/db/migrate/20200915142713_add_questionnaire_to_existing_elections.rb +0 -29
- data/db/migrate/20200918153813_create_decidim_elections_trustees_participatory_spaces.rb +0 -13
- data/db/migrate/20200918153824_create_decidim_elections_elections_trustees.rb +0 -10
- data/db/migrate/20200918153835_create_decidim_elections_trustees.rb +0 -12
- data/db/migrate/20201026163334_add_blocked_at_and_bb_status_to_elections.rb +0 -8
- data/db/migrate/20201028090110_add_votes_to_decidim_elections_answers.rb +0 -7
- data/db/migrate/20201028135614_add_selected_to_decidim_elections_answers.rb +0 -7
- data/db/migrate/20201209110653_create_decidim_elections_votes.rb +0 -14
- data/db/migrate/20201216091123_add_name_to_trustees.rb +0 -7
- data/db/migrate/20210113113818_add_message_id_to_decidim_elections_votes.rb +0 -7
- data/db/migrate/20210113120115_create_decidim_elections_votings.rb +0 -20
- data/db/migrate/20210114100749_add_published_at_to_decidim_votings_votings.rb +0 -7
- data/db/migrate/20210114111850_add_user_to_decidim_elections_votes.rb +0 -7
- data/db/migrate/20210120164634_add_promoted_to_voting.rb +0 -7
- data/db/migrate/20210125124801_add_voting_type_to_voting_voting.rb +0 -7
- data/db/migrate/20210129124956_create_decidim_elections_actions.rb +0 -14
- data/db/migrate/20210204132111_add_votings_polling_stations.rb +0 -19
- data/db/migrate/20210208090441_add_polling_officers_to_votings.rb +0 -12
- data/db/migrate/20210210090738_add_votings_polling_station_references_to_votings_polling_officer.rb +0 -8
- data/db/migrate/20210216074707_add_monitoring_committee_member.rb +0 -12
- data/db/migrate/20210308104024_add_decidim_votings_census_datasets.rb +0 -17
- data/db/migrate/20210308104154_add_decidim_votings_census_data.rb +0 -23
- data/db/migrate/20210310120708_add_followable_counter_cache_to_votings.rb +0 -20
- data/db/migrate/20210326090435_create_elections_results.rb +0 -16
- data/db/migrate/20210330102348_remove_votes_count_from_answer.rb +0 -7
- data/db/migrate/20210330123606_add_voting_ballot_style.rb +0 -19
- data/db/migrate/20210330183204_add_email_to_votes.rb +0 -10
- data/db/migrate/20210331152729_add_census_contact_information_to_votings.rb +0 -7
- data/db/migrate/20210401095507_add_organization_to_decidim_elections_trustee.rb +0 -11
- data/db/migrate/20210402102215_add_ballot_style_to_decidim_votings_census_data.rb +0 -7
- data/db/migrate/20210402140402_add_salt_to_elections.rb +0 -22
- data/db/migrate/20210412144721_change_elections_results.rb +0 -24
- data/db/migrate/20210412144740_create_elections_bulletin_board_closures.rb +0 -13
- data/db/migrate/20210412144741_create_votings_polling_station_closures.rb +0 -22
- data/db/migrate/20210420112721_create_decidim_votings_in_person_votes.rb +0 -21
- data/db/migrate/20210422124826_add_verifiable_results_to_decidim_elections_election.rb +0 -8
- data/db/migrate/20210426072845_add_signed_at_to_polling_station_closure.rb +0 -7
- data/db/migrate/20210427131742_add_validated_at_to_votings_polling_station_closures.rb +0 -8
- data/db/migrate/20220404112802_rename_bb_status_tally_to_tally_started.rb +0 -19
- data/db/migrate/20220424121541_add_show_check_census_to_votings.rb +0 -7
- data/db/migrate/20220615102642_remove_description_from_elections_questions.rb +0 -7
- data/db/migrate/20220711112802_rename_dataset_file_to_filename.rb +0 -7
- data/lib/decidim/api/bulletin_board_closure_type.rb +0 -16
- data/lib/decidim/api/election_answer_type.rb +0 -24
- data/lib/decidim/api/election_question_type.rb +0 -21
- data/lib/decidim/api/election_result_type.rb +0 -19
- data/lib/decidim/api/election_type.rb +0 -27
- data/lib/decidim/api/elections_type.rb +0 -32
- data/lib/decidim/api/polling_station_closure_type.rb +0 -19
- data/lib/decidim/api/polling_station_type.rb +0 -24
- data/lib/decidim/api/trustee_type.rb +0 -16
- data/lib/decidim/api/voting_type.rb +0 -20
- data/lib/decidim/elections/answer_serializer.rb +0 -49
- data/lib/decidim/elections/api.rb +0 -13
- data/lib/decidim/elections/menu.rb +0 -39
- data/lib/decidim/elections/trustee_zone.rb +0 -10
- data/lib/decidim/elections/trustee_zone_engine.rb +0 -32
- data/lib/decidim/votings/admin.rb +0 -10
- data/lib/decidim/votings/admin_engine.rb +0 -83
- data/lib/decidim/votings/api.rb +0 -9
- data/lib/decidim/votings/census.rb +0 -16
- data/lib/decidim/votings/census_admin.rb +0 -12
- data/lib/decidim/votings/census_admin_engine.rb +0 -18
- data/lib/decidim/votings/census_engine.rb +0 -19
- data/lib/decidim/votings/census_menu.rb +0 -18
- data/lib/decidim/votings/content_blocks/registry_manager.rb +0 -95
- data/lib/decidim/votings/engine.rb +0 -76
- data/lib/decidim/votings/menu.rb +0 -161
- data/lib/decidim/votings/participatory_space.rb +0 -55
- data/lib/decidim/votings/polling_officer_zone.rb +0 -10
- data/lib/decidim/votings/polling_officer_zone_engine.rb +0 -38
- data/lib/decidim/votings/polling_officer_zone_menu.rb +0 -17
- data/lib/decidim/votings/query_extensions.rb +0 -43
- data/lib/decidim/votings/seeds.rb +0 -197
- data/lib/decidim/votings/test/factories.rb +0 -263
- data/lib/decidim/votings/voting_serializer.rb +0 -55
- data/lib/decidim/votings.rb +0 -33
- data/lib/tasks/decidim_elections.rake +0 -79
- data/lib/tasks/decidim_voting_census.rake +0 -26
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 964c1cb8bdbc697caa2249a77c682922a0f86c40991fdb82764a87aab5571e5d
|
|
4
|
+
data.tar.gz: 3c70711e52d4da42332d93dc788169af7da4c7c8881fe00745a9510320a8a590
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 10695624537f8c405989c17ded7f678af45980ee351bacf122e642a8bcad349927be80af7beb03908d363c9652b946722c2314e8419d35797dd45e7bedf1809d
|
|
7
|
+
data.tar.gz: ee3232a438080cc45f64b6c563f5121d8495812f9cad611fde725429ac8a67e7a239edace584bce7fc03c3ad26a552b37b1f91b7cdd8afbb1984dbac5db8bee9
|
data/README.md
CHANGED
|
@@ -1,97 +1,15 @@
|
|
|
1
1
|
# Decidim::Elections
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
The Elections module adds elections to any participatory space.
|
|
6
|
-
|
|
7
|
-
## Usage
|
|
8
|
-
|
|
9
|
-
Elections will be available as a Component for a Participatory Space.
|
|
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://docs.decidim.org/en/services/elections_bulletin_board/).
|
|
12
|
-
|
|
13
|
-
## Development
|
|
14
|
-
|
|
15
|
-
In the case that you only want to use this module for local development or testing purposes, you have an example docker-compose configuration in `docs/`. Mind that this setup is not recommended for production environments. It works with default seeds and configurations for a Decidim installation, so you should not do anything.
|
|
16
|
-
|
|
17
|
-
```bash
|
|
18
|
-
cd docs/docker/bulletin_board
|
|
19
|
-
docker-compose up
|
|
20
|
-
```
|
|
21
|
-
|
|
22
|
-
One important caveat is that as the Trustees' key generation functionality uses the IndexedDB API, and at least in Firefox there is unsupported in the Private Browsing mode (see ticket [#1639542 in Mozilla's Bugzilla](https://bugzilla.mozilla.org/show_bug.cgi?id=1639542)). As a workaround there is the [Firefox Multi-Account Containers addon](https://addons.mozilla.org/es/firefox/addon/multi-account-containers/).
|
|
23
|
-
|
|
24
|
-
## Testing
|
|
25
|
-
|
|
26
|
-
Besides the [set-up typical for Decidim](https://docs.decidim.org/en/develop/develop/testing), for some of the specs a Bulletin Board installation is needed, running in port 5017 by default with the `DATABASE_CLEANER_ALLOW_REMOTE_DATABASE_URL` environment variable set up with the "true" string. There is a working configuration on `docs`.
|
|
27
|
-
|
|
28
|
-
```bash
|
|
29
|
-
cd docs/docker/bulletin_board_test
|
|
30
|
-
docker-compose up
|
|
31
|
-
```
|
|
32
|
-
|
|
33
|
-
As the Bulletin Board service is a necessary dependency for this module to work, if it is not running while executing the specs, the following exception will be shown.
|
|
34
|
-
|
|
35
|
-
> Failure/Error: Decidim::Elections.bulletin_board.reset_test_database
|
|
36
|
-
>
|
|
37
|
-
> StandardError:
|
|
38
|
-
> Sorry, something went wrong
|
|
39
|
-
>
|
|
40
|
-
> ./spec/shared/test_bulletin_board_shared_context.rb:6:in 'block (2 levels) in <top (required)>'
|
|
41
|
-
> (...)
|
|
42
|
-
> -- Caused by:
|
|
43
|
-
> Errno::ECONNREFUSED:
|
|
44
|
-
> Connection refused - connect(2) for 127.0.0.1:5017
|
|
45
|
-
> ./spec/shared/test_bulletin_board_shared_context.rb:6:in 'block (2 levels) in <top (required)>'
|
|
3
|
+
The Decidim::Elections is a component that allows users to setup non-cryptographic elections. Elections are basically polls/surveys with census access management built-in. This allows registered or non-registered users to directly participate in them.
|
|
46
4
|
|
|
47
5
|
## Installation
|
|
48
6
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
```ruby
|
|
52
|
-
gem "decidim-elections"
|
|
53
|
-
```
|
|
54
|
-
|
|
55
|
-
And then execute:
|
|
56
|
-
|
|
57
|
-
```bash
|
|
58
|
-
bundle
|
|
59
|
-
```
|
|
60
|
-
|
|
61
|
-
## Configuration
|
|
62
|
-
|
|
63
|
-
### Identification numbers
|
|
64
|
-
|
|
65
|
-
For the verification of the participants' data in the Voting's census, you can configure which type of documents a participant can have. By default these documents are `identification_number` and `passport`, but in some countries you may need to adapt these to your specifics needs. For instance, in Spain there are `dni`, `nie` and `passport`.
|
|
66
|
-
|
|
67
|
-
For configuring these you can do so with the Environment Variable `ELECTIONS_DOCUMENT_TYPES`.
|
|
68
|
-
|
|
69
|
-
```env
|
|
70
|
-
ELECTIONS_DOCUMENT_TYPES="dni,nie,passport"
|
|
71
|
-
```
|
|
72
|
-
|
|
73
|
-
You need to also add the following keys in your i18n files (i.e. `config/locales/en.yml`).
|
|
74
|
-
|
|
75
|
-
```yaml
|
|
76
|
-
en:
|
|
77
|
-
decidim:
|
|
78
|
-
votings:
|
|
79
|
-
census:
|
|
80
|
-
document_types:
|
|
81
|
-
dni: DNI
|
|
82
|
-
nie: NIE
|
|
83
|
-
passport: Passport
|
|
84
|
-
```
|
|
85
|
-
|
|
86
|
-
### Scheduled tasks
|
|
87
|
-
|
|
88
|
-
For the Elections module to function as expected, there are some background tasks that should be scheduled to be executed regularly. Alternatively you could use `whenever` gem or the scheduled jobs of your hosting provider.
|
|
7
|
+
In order to install use this module, you need at least Decidim 0.31 to be installed.
|
|
89
8
|
|
|
90
|
-
|
|
9
|
+
To install this module, run in your console:
|
|
91
10
|
|
|
92
11
|
```bash
|
|
93
|
-
|
|
94
|
-
0 0 * * * cd /home/user/decidim_application && RAILS_ENV=production bundle exec rake decidim_votings_census:delete_census_access_codes_export
|
|
12
|
+
bundle add decidim-elections
|
|
95
13
|
```
|
|
96
14
|
|
|
97
15
|
## Contributing
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Decidim
|
|
4
|
+
module Elections
|
|
5
|
+
# This cell renders metadata for an instance of a Meeting
|
|
6
|
+
class ElectionCardMetadataCell < Decidim::CardMetadataCell
|
|
7
|
+
include Decidim::LayoutHelper
|
|
8
|
+
include ActionView::Helpers::DateHelper
|
|
9
|
+
|
|
10
|
+
alias election model
|
|
11
|
+
|
|
12
|
+
delegate :start_at, :end_at, to: :election
|
|
13
|
+
|
|
14
|
+
def initialize(*)
|
|
15
|
+
super
|
|
16
|
+
|
|
17
|
+
@items.prepend(*election_items)
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
def election_items
|
|
21
|
+
[label, progress_item]
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
def label
|
|
25
|
+
{
|
|
26
|
+
text: content_tag("span", t(election.status, scope: "decidim.elections.status"), class: "#{election.status} label")
|
|
27
|
+
}
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
def current_date
|
|
31
|
+
@current_date ||= Time.current.to_time
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
def start_date
|
|
35
|
+
return if start_at.blank?
|
|
36
|
+
|
|
37
|
+
@start_date ||= start_at.to_time
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
def end_date
|
|
41
|
+
return if end_at.blank?
|
|
42
|
+
|
|
43
|
+
@end_date ||= end_at.to_time
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
def progress_text
|
|
47
|
+
if election.published_results? && election.finished?
|
|
48
|
+
return t("published_results", scope: "decidim.metadata.progress",
|
|
49
|
+
end_date: l(election.results_at.to_time, format: :decidim_short))
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
super
|
|
53
|
+
end
|
|
54
|
+
end
|
|
55
|
+
end
|
|
56
|
+
end
|
|
@@ -2,10 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
module Decidim
|
|
4
4
|
module Elections
|
|
5
|
-
# This cell renders the election card for an instance of an election
|
|
6
|
-
# the default size is the Search Card (:s)
|
|
7
5
|
class ElectionCell < Decidim::ViewModel
|
|
8
|
-
include ElectionCellsHelper
|
|
9
6
|
include Cell::ViewModel::Partial
|
|
10
7
|
|
|
11
8
|
def show
|
|
@@ -18,8 +15,10 @@ module Decidim
|
|
|
18
15
|
case @options[:size]
|
|
19
16
|
when :s
|
|
20
17
|
"decidim/elections/election_s"
|
|
21
|
-
|
|
18
|
+
when :g
|
|
22
19
|
"decidim/elections/election_g"
|
|
20
|
+
else
|
|
21
|
+
"decidim/elections/election_l"
|
|
23
22
|
end
|
|
24
23
|
end
|
|
25
24
|
end
|
|
@@ -1,22 +1,24 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
+
require "cell/partial"
|
|
4
|
+
|
|
3
5
|
module Decidim
|
|
4
6
|
module Elections
|
|
5
|
-
# This cell renders the
|
|
7
|
+
# This cell renders the Search (:s) election card
|
|
6
8
|
# for a given instance of an Election
|
|
7
9
|
class ElectionGCell < Decidim::CardGCell
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
def metadata_cell
|
|
11
|
-
"decidim/elections/election_metadata"
|
|
10
|
+
def show
|
|
11
|
+
render
|
|
12
12
|
end
|
|
13
13
|
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
private
|
|
15
|
+
|
|
16
|
+
def show_description?
|
|
17
|
+
true
|
|
16
18
|
end
|
|
17
19
|
|
|
18
|
-
def
|
|
19
|
-
|
|
20
|
+
def metadata_cell
|
|
21
|
+
"decidim/elections/election_card_metadata"
|
|
20
22
|
end
|
|
21
23
|
end
|
|
22
24
|
end
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require "cell/partial"
|
|
4
|
+
|
|
5
|
+
module Decidim
|
|
6
|
+
module Elections
|
|
7
|
+
# This cell renders the Search (:s) election card
|
|
8
|
+
# for a given instance of an Election
|
|
9
|
+
class ElectionLCell < Decidim::CardLCell
|
|
10
|
+
delegate :photo, to: :model
|
|
11
|
+
|
|
12
|
+
private
|
|
13
|
+
|
|
14
|
+
def has_description?
|
|
15
|
+
true
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
def title
|
|
19
|
+
present(model).title(html_escape: true)
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
def description
|
|
23
|
+
text = translated_attribute(model.description)
|
|
24
|
+
|
|
25
|
+
decidim_sanitize(html_truncate(text, length: 240), strip_tags: true)
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
def metadata_cell
|
|
29
|
+
"decidim/elections/election_card_metadata"
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
def resource_image_url
|
|
33
|
+
return if photo.blank?
|
|
34
|
+
|
|
35
|
+
photo.url
|
|
36
|
+
end
|
|
37
|
+
end
|
|
38
|
+
end
|
|
39
|
+
end
|
|
@@ -1,10 +1,21 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
+
require "cell/partial"
|
|
4
|
+
|
|
3
5
|
module Decidim
|
|
4
6
|
module Elections
|
|
5
7
|
# This cell renders the Search (:s) election card
|
|
6
8
|
# for a given instance of an Election
|
|
7
9
|
class ElectionSCell < Decidim::CardSCell
|
|
10
|
+
private
|
|
11
|
+
|
|
12
|
+
def title
|
|
13
|
+
present(model).title(html_escape: true)
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
def metadata_cell
|
|
17
|
+
"decidim/elections/election_card_metadata"
|
|
18
|
+
end
|
|
8
19
|
end
|
|
9
20
|
end
|
|
10
21
|
end
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Decidim
|
|
4
|
+
module Elections
|
|
5
|
+
module Admin
|
|
6
|
+
module Censuses
|
|
7
|
+
# A command with the business logic to create census data for an
|
|
8
|
+
# election.
|
|
9
|
+
class TokenCsv < Decidim::Command
|
|
10
|
+
def initialize(form, election)
|
|
11
|
+
@form = form
|
|
12
|
+
@election = election
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
# Executes the command. Broadcast these events:
|
|
16
|
+
# - :ok when everything is valid
|
|
17
|
+
# - :invalid when the form was not valid and could not proceed-
|
|
18
|
+
#
|
|
19
|
+
# Returns nothing.
|
|
20
|
+
def call
|
|
21
|
+
return broadcast(:invalid) if @form.invalid?
|
|
22
|
+
return broadcast(:invalid) if @form.remove_all && @election.census.blank?
|
|
23
|
+
|
|
24
|
+
# If the form is set to remove all, we just delete all voters
|
|
25
|
+
if @form.remove_all
|
|
26
|
+
@election.voters.delete_all
|
|
27
|
+
return broadcast(:ok)
|
|
28
|
+
end
|
|
29
|
+
return broadcast(:invalid) unless @form.file
|
|
30
|
+
|
|
31
|
+
rows = @form.data
|
|
32
|
+
return broadcast(:invalid) if rows.blank?
|
|
33
|
+
|
|
34
|
+
Voter.bulk_insert(@election, rows.map { |row| { email: row.first.downcase, token: row.second } })
|
|
35
|
+
broadcast(:ok)
|
|
36
|
+
end
|
|
37
|
+
end
|
|
38
|
+
end
|
|
39
|
+
end
|
|
40
|
+
end
|
|
41
|
+
end
|
|
@@ -3,56 +3,45 @@
|
|
|
3
3
|
module Decidim
|
|
4
4
|
module Elections
|
|
5
5
|
module Admin
|
|
6
|
-
|
|
7
|
-
# from the admin panel.
|
|
8
|
-
class CreateElection < Decidim::Command
|
|
6
|
+
class CreateElection < Decidim::Commands::CreateResource
|
|
9
7
|
include ::Decidim::GalleryMethods
|
|
10
8
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
9
|
+
fetch_form_attributes :title, :description, :start_at, :end_at, :results_availability
|
|
10
|
+
|
|
11
|
+
protected
|
|
12
|
+
|
|
13
|
+
attr_reader :gallery
|
|
14
14
|
|
|
15
|
-
|
|
16
|
-
#
|
|
17
|
-
# Broadcasts :ok if successful, :invalid otherwise.
|
|
18
|
-
def call
|
|
19
|
-
return broadcast(:invalid) if form.invalid?
|
|
15
|
+
def resource_class = Decidim::Elections::Election
|
|
20
16
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
end
|
|
17
|
+
def extra_params
|
|
18
|
+
{ visibility: "all" }
|
|
19
|
+
end
|
|
25
20
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
21
|
+
def attributes
|
|
22
|
+
parsed_title = Decidim::ContentProcessor.parse(form.title, current_organization: form.current_organization).rewrite
|
|
23
|
+
parsed_description = Decidim::ContentProcessor.parse_with_processor(:inline_images, form.description, current_organization: form.current_organization).rewrite
|
|
24
|
+
|
|
25
|
+
super.merge({
|
|
26
|
+
component: form.current_component,
|
|
27
|
+
title: parsed_title,
|
|
28
|
+
description: parsed_description,
|
|
29
|
+
start_at: form.manual_start ? nil : form.start_at,
|
|
30
|
+
end_at: form.end_at,
|
|
31
|
+
results_availability: form.results_availability
|
|
32
|
+
})
|
|
33
|
+
end
|
|
30
34
|
|
|
31
|
-
|
|
35
|
+
def run_after_hooks
|
|
36
|
+
@attached_to = resource
|
|
37
|
+
create_gallery if process_gallery?
|
|
32
38
|
end
|
|
33
39
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
attributes = {
|
|
40
|
-
title: form.title,
|
|
41
|
-
description: form.description,
|
|
42
|
-
start_time: form.start_time,
|
|
43
|
-
end_time: form.end_time,
|
|
44
|
-
component: form.current_component,
|
|
45
|
-
questionnaire: Decidim::Forms::Questionnaire.new,
|
|
46
|
-
salt: Tokenizer.random_salt
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
@election = Decidim.traceability.create!(
|
|
50
|
-
Election,
|
|
51
|
-
form.current_user,
|
|
52
|
-
attributes,
|
|
53
|
-
visibility: "all"
|
|
54
|
-
)
|
|
55
|
-
@attached_to = @election
|
|
40
|
+
def run_before_hooks
|
|
41
|
+
return unless process_gallery?
|
|
42
|
+
|
|
43
|
+
build_gallery
|
|
44
|
+
raise Decidim::Commands::HookError if gallery_invalid?
|
|
56
45
|
end
|
|
57
46
|
end
|
|
58
47
|
end
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Decidim
|
|
4
|
+
module Elections
|
|
5
|
+
module Admin
|
|
6
|
+
# A command with the business logic to create census data for an
|
|
7
|
+
# election.
|
|
8
|
+
class ProcessCensus < Decidim::Commands::UpdateResource
|
|
9
|
+
def attributes
|
|
10
|
+
{
|
|
11
|
+
census_manifest: resource.census.name,
|
|
12
|
+
census_settings: census_settings
|
|
13
|
+
}
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
# This will run any post-processing hooks defined in the census manifest
|
|
17
|
+
def run_after_hooks
|
|
18
|
+
command = resource.census.after_update_command&.safe_constantize
|
|
19
|
+
return unless command
|
|
20
|
+
|
|
21
|
+
command.call(form, resource)
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
def census_settings
|
|
25
|
+
return {} unless form.respond_to?(:census_settings)
|
|
26
|
+
|
|
27
|
+
form.census_settings
|
|
28
|
+
end
|
|
29
|
+
end
|
|
30
|
+
end
|
|
31
|
+
end
|
|
32
|
+
end
|
|
@@ -3,23 +3,28 @@
|
|
|
3
3
|
module Decidim
|
|
4
4
|
module Elections
|
|
5
5
|
module Admin
|
|
6
|
-
# This command gets called when an election is published from the admin panel.
|
|
7
6
|
class PublishElection < Decidim::Command
|
|
8
|
-
#
|
|
7
|
+
# A command to publish an election.
|
|
9
8
|
#
|
|
10
|
-
#
|
|
11
|
-
#
|
|
9
|
+
# election - Decidim::Elections::Election
|
|
10
|
+
# Current_user - the user performing the action
|
|
12
11
|
def initialize(election, current_user)
|
|
13
12
|
@election = election
|
|
14
13
|
@current_user = current_user
|
|
15
14
|
end
|
|
16
15
|
|
|
17
|
-
#
|
|
16
|
+
# Executes the command. Broadcasts these events:
|
|
18
17
|
#
|
|
19
|
-
#
|
|
18
|
+
# - :ok when everything is valid.
|
|
19
|
+
# - :invalid if the form was not valid and we could not proceed.
|
|
20
|
+
#
|
|
21
|
+
# Returns nothing.
|
|
20
22
|
def call
|
|
21
|
-
|
|
22
|
-
|
|
23
|
+
return broadcast(:invalid) if election.published?
|
|
24
|
+
|
|
25
|
+
transaction do
|
|
26
|
+
publish_election
|
|
27
|
+
end
|
|
23
28
|
|
|
24
29
|
broadcast(:ok, election)
|
|
25
30
|
end
|
|
@@ -29,7 +34,7 @@ module Decidim
|
|
|
29
34
|
attr_reader :election, :current_user
|
|
30
35
|
|
|
31
36
|
def publish_election
|
|
32
|
-
Decidim.traceability.perform_action!(
|
|
37
|
+
@election = Decidim.traceability.perform_action!(
|
|
33
38
|
:publish,
|
|
34
39
|
election,
|
|
35
40
|
current_user,
|
|
@@ -39,15 +44,6 @@ module Decidim
|
|
|
39
44
|
election
|
|
40
45
|
end
|
|
41
46
|
end
|
|
42
|
-
|
|
43
|
-
def publish_event
|
|
44
|
-
Decidim::EventsManager.publish(
|
|
45
|
-
event: "decidim.events.elections.election_published",
|
|
46
|
-
event_class: ::Decidim::Elections::ElectionPublishedEvent,
|
|
47
|
-
resource: election,
|
|
48
|
-
followers: election.participatory_space.followers
|
|
49
|
-
)
|
|
50
|
-
end
|
|
51
47
|
end
|
|
52
48
|
end
|
|
53
49
|
end
|
|
@@ -3,40 +3,42 @@
|
|
|
3
3
|
module Decidim
|
|
4
4
|
module Elections
|
|
5
5
|
module Admin
|
|
6
|
-
#
|
|
6
|
+
# A command with all the business logic that unpublishes an
|
|
7
|
+
# existing election.
|
|
7
8
|
class UnpublishElection < Decidim::Command
|
|
8
|
-
# Public:
|
|
9
|
+
# Public: initializes the command.
|
|
9
10
|
#
|
|
10
|
-
# election -
|
|
11
|
+
# election - Decidim::Elections::Election
|
|
11
12
|
# current_user - the user performing the action
|
|
12
13
|
def initialize(election, current_user)
|
|
13
14
|
@election = election
|
|
14
15
|
@current_user = current_user
|
|
15
16
|
end
|
|
16
17
|
|
|
17
|
-
#
|
|
18
|
+
# Executes the command. Broadcasts these events:
|
|
18
19
|
#
|
|
19
|
-
#
|
|
20
|
+
# - :ok when everything is valid.
|
|
21
|
+
# - :invalid if the form was not valid and we could not proceed.
|
|
22
|
+
#
|
|
23
|
+
# Returns nothing.
|
|
20
24
|
def call
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
broadcast(:ok)
|
|
24
|
-
end
|
|
25
|
+
return broadcast(:invalid) unless election.published?
|
|
25
26
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
attr_reader :election, :current_user
|
|
29
|
-
|
|
30
|
-
def unpublish_election
|
|
31
|
-
Decidim.traceability.perform_action!(
|
|
27
|
+
@election = Decidim.traceability.perform_action!(
|
|
32
28
|
:unpublish,
|
|
33
29
|
election,
|
|
34
|
-
current_user
|
|
30
|
+
current_user,
|
|
31
|
+
visibility: "all"
|
|
35
32
|
) do
|
|
36
33
|
election.unpublish!
|
|
37
34
|
election
|
|
38
35
|
end
|
|
36
|
+
broadcast(:ok, election)
|
|
39
37
|
end
|
|
38
|
+
|
|
39
|
+
private
|
|
40
|
+
|
|
41
|
+
attr_reader :election, :current_user
|
|
40
42
|
end
|
|
41
43
|
end
|
|
42
44
|
end
|
|
@@ -3,55 +3,55 @@
|
|
|
3
3
|
module Decidim
|
|
4
4
|
module Elections
|
|
5
5
|
module Admin
|
|
6
|
-
|
|
7
|
-
# from the admin panel.
|
|
8
|
-
class UpdateElection < Decidim::Command
|
|
6
|
+
class UpdateElection < Decidim::Commands::UpdateResource
|
|
9
7
|
include ::Decidim::GalleryMethods
|
|
8
|
+
fetch_form_attributes :title, :description, :start_at, :end_at, :results_availability
|
|
10
9
|
|
|
11
10
|
def initialize(form, election)
|
|
12
|
-
|
|
13
|
-
@election = election
|
|
11
|
+
super
|
|
14
12
|
@attached_to = election
|
|
15
13
|
end
|
|
16
14
|
|
|
17
|
-
|
|
18
|
-
#
|
|
19
|
-
# Broadcasts :ok if successful, :invalid otherwise.
|
|
20
|
-
def call
|
|
21
|
-
return broadcast(:invalid) if form.invalid?
|
|
15
|
+
private
|
|
22
16
|
|
|
23
|
-
|
|
24
|
-
build_gallery
|
|
25
|
-
return broadcast(:invalid) if gallery_invalid?
|
|
26
|
-
end
|
|
17
|
+
alias election resource
|
|
27
18
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
photo_cleanup!
|
|
32
|
-
end
|
|
19
|
+
def attributes
|
|
20
|
+
election.published? ? published_election_attributes : unpublished_election_attributes
|
|
21
|
+
end
|
|
33
22
|
|
|
34
|
-
|
|
23
|
+
def published_election_attributes
|
|
24
|
+
{ description: parsed_description }
|
|
35
25
|
end
|
|
36
26
|
|
|
37
|
-
|
|
27
|
+
def unpublished_election_attributes
|
|
28
|
+
{
|
|
29
|
+
title: parsed_title,
|
|
30
|
+
description: parsed_description,
|
|
31
|
+
start_at: form.manual_start ? nil : form.start_at,
|
|
32
|
+
end_at: form.end_at,
|
|
33
|
+
results_availability: form.results_availability
|
|
34
|
+
}
|
|
35
|
+
end
|
|
38
36
|
|
|
39
|
-
|
|
37
|
+
def parsed_title
|
|
38
|
+
Decidim::ContentProcessor.parse(form.title, current_organization: form.current_organization).rewrite
|
|
39
|
+
end
|
|
40
40
|
|
|
41
|
-
def
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
41
|
+
def parsed_description
|
|
42
|
+
Decidim::ContentProcessor.parse(form.description, current_organization: form.current_organization).rewrite
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
def run_after_hooks
|
|
46
|
+
create_gallery if process_gallery?
|
|
47
|
+
photo_cleanup!
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
def run_before_hooks
|
|
51
|
+
return unless process_gallery?
|
|
48
52
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
form.current_user,
|
|
52
|
-
attributes,
|
|
53
|
-
visibility: "all"
|
|
54
|
-
)
|
|
53
|
+
build_gallery
|
|
54
|
+
raise Decidim::Commands::HookError if gallery_invalid?
|
|
55
55
|
end
|
|
56
56
|
end
|
|
57
57
|
end
|