Class: Decidim::Votings::PollingOfficerZone::InPersonVotesController
- Inherits:
-
ApplicationController
- Object
- DecidimController
- ApplicationController
- ApplicationController
- Decidim::Votings::PollingOfficerZone::InPersonVotesController
- Includes:
- Elections::HasVoteFlow, FormFactory
- Defined in:
- decidim-elections/app/controllers/decidim/votings/polling_officer_zone/in_person_votes_controller.rb
Overview
Space to manage the elections for a Polling Station Officer
Instance Method Summary collapse
Methods included from Elections::HasVoteFlow
#ballot_questions, #can_preview?, #default_vote_flow, #preview_mode?, #vote_flow
Methods included from UserProfile
#available_verification_workflows
Methods included from UserGroups
Methods included from UserBlockedChecker
#check_user_block_status, #check_user_not_blocked
Methods included from NeedsSnippets
Methods included from Headers::HttpCachingDisabler
Methods included from HasStoredPath
#skip_store_location?, #store_current_location
Methods included from RegistersPermissions
Methods included from NeedsOrganization
enhance_controller, extended, included
Instance Method Details
#create ⇒ Object
24 25 26 27 28 29 30 31 32 33 34 |
# File 'decidim-elections/app/controllers/decidim/votings/polling_officer_zone/in_person_votes_controller.rb', line 24 def create (:manage, :in_person_vote, polling_officer:) return if has_pending_in_person_vote? if verified_voter? store_in_person_vote else identify_voter end end |
#new ⇒ Object
18 19 20 21 22 |
# File 'decidim-elections/app/controllers/decidim/votings/polling_officer_zone/in_person_votes_controller.rb', line 18 def new (:manage, :in_person_vote, polling_officer:) has_pending_in_person_vote? end |
#show ⇒ Object
36 37 38 |
# File 'decidim-elections/app/controllers/decidim/votings/polling_officer_zone/in_person_votes_controller.rb', line 36 def show :manage, :in_person_vote, polling_officer: end |
#update ⇒ Object
40 41 42 43 44 45 46 47 48 49 50 51 52 53 |
# File 'decidim-elections/app/controllers/decidim/votings/polling_officer_zone/in_person_votes_controller.rb', line 40 def update (:manage, :in_person_vote, polling_officer:) Decidim::Votings::Voter::UpdateInPersonVoteStatus.call(in_person_vote) do on(:ok) do = in_person_vote.accepted? ? :notice : :alert flash[] = I18n.t("in_person_votes.update.success.#{in_person_vote.status}", scope: "decidim.votings.polling_officer_zone") end on(:invalid) do flash[:alert] = I18n.t("in_person_votes.update.error", scope: "decidim.votings.polling_officer_zone") end end redirect_to exit_path end |