From 9d5a1348675c78592e9e2b2de06b934277266bda Mon Sep 17 00:00:00 2001 From: Findeton Date: Wed, 3 Jul 2024 17:49:18 -0500 Subject: [PATCH 01/17] wip --- app.less | 1 + .../voter-eligibility-directive.html | 20 +++++++++++++++++++ .../voter-eligibility-directive.js | 13 ++++++++++++ .../voter-eligibility-directive.less | 2 ++ index.html | 1 + 5 files changed, 37 insertions(+) create mode 100644 avBooth/voter-eligibility-directive/voter-eligibility-directive.html create mode 100644 avBooth/voter-eligibility-directive/voter-eligibility-directive.js create mode 100644 avBooth/voter-eligibility-directive/voter-eligibility-directive.less diff --git a/app.less b/app.less index 383b4be1..b400ff94 100755 --- a/app.less +++ b/app.less @@ -19,6 +19,7 @@ @import "avBooth/booth.less"; @import "avBooth/2questions-conditional-screen-directive/2questions-conditional-screen-directive.less"; @import "avBooth/election-chooser-screen-directive/election-chooser-screen-directive.less"; +@import "avBooth/voter-eligibility-directive/voter-eligibility-directive.less"; @import "avBooth/voting-step-directive/voting-step-directive.less"; @import "avBooth/watermark-directive/watermark-directive.less"; @import "avBooth/accordion-option-directive/accordion-option-directive.less"; diff --git a/avBooth/voter-eligibility-directive/voter-eligibility-directive.html b/avBooth/voter-eligibility-directive/voter-eligibility-directive.html new file mode 100644 index 00000000..5664e14a --- /dev/null +++ b/avBooth/voter-eligibility-directive/voter-eligibility-directive.html @@ -0,0 +1,20 @@ +/** + * This file is part of voting-booth. + * Copyright (C) 2024 Sequent Tech Inc + + * voting-booth is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License. + + * voting-booth is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + + * You should have received a copy of the GNU Affero General Public License + * along with voting-booth. If not, see . +**/ + +
+ +
\ No newline at end of file diff --git a/avBooth/voter-eligibility-directive/voter-eligibility-directive.js b/avBooth/voter-eligibility-directive/voter-eligibility-directive.js new file mode 100644 index 00000000..9ff6151f --- /dev/null +++ b/avBooth/voter-eligibility-directive/voter-eligibility-directive.js @@ -0,0 +1,13 @@ + +angular.module('avBooth') + .directive('avbVoterEligibilityScreen', function($window, $timeout, $q, $modal, ConfigService) { + + function link(scope, element, attrs) { + } + return { + restrict: 'AE', + scope: true, + link: link, + templateUrl: 'avBooth/voter-eligibility-directive/voter-eligibility-directive.html' + }; + }); diff --git a/avBooth/voter-eligibility-directive/voter-eligibility-directive.less b/avBooth/voter-eligibility-directive/voter-eligibility-directive.less new file mode 100644 index 00000000..0fdefa06 --- /dev/null +++ b/avBooth/voter-eligibility-directive/voter-eligibility-directive.less @@ -0,0 +1,2 @@ +[avb-voter-eligibility-screen] { +} \ No newline at end of file diff --git a/index.html b/index.html index 0bcea4eb..0c393567 100755 --- a/index.html +++ b/index.html @@ -66,6 +66,7 @@ + From 2cfa68158487424529a1f31ba483804b669684f3 Mon Sep 17 00:00:00 2001 From: Findeton Date: Wed, 3 Jul 2024 18:04:52 -0500 Subject: [PATCH 02/17] wip --- app.less | 2 +- avBooth/booth-directive/booth-directive.html | 2 ++ .../election-chooser-screen-directive.html | 1 + .../election-chooser-screen-directive.js | 3 +++ .../voter-eligibility-screen-directive.html} | 2 +- .../voter-eligibility-screen-directive.js} | 2 +- .../voter-eligibility-screen-directive.less} | 0 index.html | 2 +- 8 files changed, 10 insertions(+), 4 deletions(-) rename avBooth/{voter-eligibility-directive/voter-eligibility-directive.html => voter-eligibility-screen-directive/voter-eligibility-screen-directive.html} (98%) rename avBooth/{voter-eligibility-directive/voter-eligibility-directive.js => voter-eligibility-screen-directive/voter-eligibility-screen-directive.js} (71%) rename avBooth/{voter-eligibility-directive/voter-eligibility-directive.less => voter-eligibility-screen-directive/voter-eligibility-screen-directive.less} (100%) diff --git a/app.less b/app.less index b400ff94..098997d0 100755 --- a/app.less +++ b/app.less @@ -19,7 +19,7 @@ @import "avBooth/booth.less"; @import "avBooth/2questions-conditional-screen-directive/2questions-conditional-screen-directive.less"; @import "avBooth/election-chooser-screen-directive/election-chooser-screen-directive.less"; -@import "avBooth/voter-eligibility-directive/voter-eligibility-directive.less"; +@import "avBooth/voter-eligibility-screen-directive/voter-eligibility-screen-directive.less"; @import "avBooth/voting-step-directive/voting-step-directive.less"; @import "avBooth/watermark-directive/watermark-directive.less"; @import "avBooth/accordion-option-directive/accordion-option-directive.less"; diff --git a/avBooth/booth-directive/booth-directive.html b/avBooth/booth-directive/booth-directive.html index 1b7fe007..259c0aa4 100644 --- a/avBooth/booth-directive/booth-directive.html +++ b/avBooth/booth-directive/booth-directive.html @@ -4,6 +4,8 @@
+
+
diff --git a/avBooth/election-chooser-screen-directive/election-chooser-screen-directive.html b/avBooth/election-chooser-screen-directive/election-chooser-screen-directive.html index 709a428f..6f370c5b 100644 --- a/avBooth/election-chooser-screen-directive/election-chooser-screen-directive.html +++ b/avBooth/election-chooser-screen-directive/election-chooser-screen-directive.html @@ -14,6 +14,7 @@

+
Go to Voter Eligibility

diff --git a/avBooth/election-chooser-screen-directive/election-chooser-screen-directive.js b/avBooth/election-chooser-screen-directive/election-chooser-screen-directive.js index 3e939b06..9861eb25 100644 --- a/avBooth/election-chooser-screen-directive/election-chooser-screen-directive.js +++ b/avBooth/election-chooser-screen-directive/election-chooser-screen-directive.js @@ -201,6 +201,9 @@ angular.module('avBooth') checkDisabled(); scope.chooseElection = chooseElection; + scope.goToVoterEligibility = function () { + scope.setState(stateEnum.voterEligibilityScreen, {}); + }; scope.showHelp = function () { $modal.open({ diff --git a/avBooth/voter-eligibility-directive/voter-eligibility-directive.html b/avBooth/voter-eligibility-screen-directive/voter-eligibility-screen-directive.html similarity index 98% rename from avBooth/voter-eligibility-directive/voter-eligibility-directive.html rename to avBooth/voter-eligibility-screen-directive/voter-eligibility-screen-directive.html index 5664e14a..8b42aa29 100644 --- a/avBooth/voter-eligibility-directive/voter-eligibility-directive.html +++ b/avBooth/voter-eligibility-screen-directive/voter-eligibility-screen-directive.html @@ -16,5 +16,5 @@ **/

- + Felix test
\ No newline at end of file diff --git a/avBooth/voter-eligibility-directive/voter-eligibility-directive.js b/avBooth/voter-eligibility-screen-directive/voter-eligibility-screen-directive.js similarity index 71% rename from avBooth/voter-eligibility-directive/voter-eligibility-directive.js rename to avBooth/voter-eligibility-screen-directive/voter-eligibility-screen-directive.js index 9ff6151f..659d57ed 100644 --- a/avBooth/voter-eligibility-directive/voter-eligibility-directive.js +++ b/avBooth/voter-eligibility-screen-directive/voter-eligibility-screen-directive.js @@ -8,6 +8,6 @@ angular.module('avBooth') restrict: 'AE', scope: true, link: link, - templateUrl: 'avBooth/voter-eligibility-directive/voter-eligibility-directive.html' + templateUrl: 'avBooth/voter-eligibility-screen-directive/voter-eligibility-screen-directive.html' }; }); diff --git a/avBooth/voter-eligibility-directive/voter-eligibility-directive.less b/avBooth/voter-eligibility-screen-directive/voter-eligibility-screen-directive.less similarity index 100% rename from avBooth/voter-eligibility-directive/voter-eligibility-directive.less rename to avBooth/voter-eligibility-screen-directive/voter-eligibility-screen-directive.less diff --git a/index.html b/index.html index 0c393567..f5755357 100755 --- a/index.html +++ b/index.html @@ -66,7 +66,7 @@ - + From 325824fd7c7dcbb3260211ec778aa58b13a73a4f Mon Sep 17 00:00:00 2001 From: Findeton Date: Wed, 3 Jul 2024 18:11:21 -0500 Subject: [PATCH 03/17] wip --- .../election-chooser-screen-directive.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/avBooth/election-chooser-screen-directive/election-chooser-screen-directive.js b/avBooth/election-chooser-screen-directive/election-chooser-screen-directive.js index 9861eb25..cf0e7290 100644 --- a/avBooth/election-chooser-screen-directive/election-chooser-screen-directive.js +++ b/avBooth/election-chooser-screen-directive/election-chooser-screen-directive.js @@ -202,7 +202,7 @@ angular.module('avBooth') checkDisabled(); scope.chooseElection = chooseElection; scope.goToVoterEligibility = function () { - scope.setState(stateEnum.voterEligibilityScreen, {}); + scope.setState(scope.stateEnum.voterEligibilityScreen, {}); }; scope.showHelp = function () { From c281d52e60174f12da94246e1617d65e1a7eec11 Mon Sep 17 00:00:00 2001 From: Findeton Date: Wed, 3 Jul 2024 18:19:32 -0500 Subject: [PATCH 04/17] wip --- avBooth/booth-directive/booth-directive.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/avBooth/booth-directive/booth-directive.js b/avBooth/booth-directive/booth-directive.js index 526814ab..305a79fa 100644 --- a/avBooth/booth-directive/booth-directive.js +++ b/avBooth/booth-directive/booth-directive.js @@ -68,7 +68,8 @@ angular.module('avBooth') castingBallotScreen: 'castingBallotScreen', successScreen: 'successScreen', showPdf: 'showPdf', - simultaneousQuestionsV2Screen: 'simultaneousQuestionsV2Screen' + simultaneousQuestionsV2Screen: 'simultaneousQuestionsV2Screen', + voterEligibilityScreen: 'voterEligibilityScreen' }; // This is used to enable custom css overriding From 61087d13815b03ccfe737f129864564c8b3c286f Mon Sep 17 00:00:00 2001 From: Findeton Date: Wed, 3 Jul 2024 18:27:20 -0500 Subject: [PATCH 05/17] wip --- .../voter-eligibility-screen-directive.html | 16 ---------------- .../voter-eligibility-screen-directive.js | 16 ++++++++++++++++ 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/avBooth/voter-eligibility-screen-directive/voter-eligibility-screen-directive.html b/avBooth/voter-eligibility-screen-directive/voter-eligibility-screen-directive.html index 8b42aa29..cf423093 100644 --- a/avBooth/voter-eligibility-screen-directive/voter-eligibility-screen-directive.html +++ b/avBooth/voter-eligibility-screen-directive/voter-eligibility-screen-directive.html @@ -1,19 +1,3 @@ -/** - * This file is part of voting-booth. - * Copyright (C) 2024 Sequent Tech Inc - - * voting-booth is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation, either version 3 of the License. - - * voting-booth is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - - * You should have received a copy of the GNU Affero General Public License - * along with voting-booth. If not, see . -**/
Felix test diff --git a/avBooth/voter-eligibility-screen-directive/voter-eligibility-screen-directive.js b/avBooth/voter-eligibility-screen-directive/voter-eligibility-screen-directive.js index 659d57ed..8929348a 100644 --- a/avBooth/voter-eligibility-screen-directive/voter-eligibility-screen-directive.js +++ b/avBooth/voter-eligibility-screen-directive/voter-eligibility-screen-directive.js @@ -1,3 +1,19 @@ +/** + * This file is part of voting-booth. + * Copyright (C) 2024 Sequent Tech Inc + + * voting-booth is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License. + + * voting-booth is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + + * You should have received a copy of the GNU Affero General Public License + * along with voting-booth. If not, see . +**/ angular.module('avBooth') .directive('avbVoterEligibilityScreen', function($window, $timeout, $q, $modal, ConfigService) { From 5475261733f834fcf068c09a9b00e0be5b58dd4c Mon Sep 17 00:00:00 2001 From: Findeton Date: Thu, 4 Jul 2024 16:13:43 -0500 Subject: [PATCH 06/17] wip --- .../voter-eligibility-screen-directive.html | 19 +- .../voter-eligibility-screen-directive.js | 180 ++++++++++++++++++ 2 files changed, 198 insertions(+), 1 deletion(-) diff --git a/avBooth/voter-eligibility-screen-directive/voter-eligibility-screen-directive.html b/avBooth/voter-eligibility-screen-directive/voter-eligibility-screen-directive.html index cf423093..df6afe71 100644 --- a/avBooth/voter-eligibility-screen-directive/voter-eligibility-screen-directive.html +++ b/avBooth/voter-eligibility-screen-directive/voter-eligibility-screen-directive.html @@ -1,4 +1,21 @@ + + + +
+
- Felix test +
\ No newline at end of file diff --git a/avBooth/voter-eligibility-screen-directive/voter-eligibility-screen-directive.js b/avBooth/voter-eligibility-screen-directive/voter-eligibility-screen-directive.js index 8929348a..de70903f 100644 --- a/avBooth/voter-eligibility-screen-directive/voter-eligibility-screen-directive.js +++ b/avBooth/voter-eligibility-screen-directive/voter-eligibility-screen-directive.js @@ -19,6 +19,186 @@ angular.module('avBooth') .directive('avbVoterEligibilityScreen', function($window, $timeout, $q, $modal, ConfigService) { function link(scope, element, attrs) { + scope.showSkippedElections = false; + scope.organization = ConfigService.organization; + function findElectionCredentials(electionId, credentials) { + return _.find( + credentials, + function (credential) { + return credential.electionId === electionId; + } + ); + } + + function calculateCanVote(elCredentials) { + return ( + !!elCredentials && + !!elCredentials.token && + ( + elCredentials.numSuccessfulLogins < elCredentials.numSuccessfulLoginsAllowed || + elCredentials.numSuccessfulLoginsAllowed === 0 + ) + ); + } + + function calculateIsVoter(elCredentials) { + return ( + !!elCredentials && + elCredentials.numSuccessfulLoginsAllowed !== -1 + ); + } + + function getElectionCredentials() { + // need to reload in case this changed in success screen.. + var credentialsStr = $window.sessionStorage.getItem("vote_permission_tokens"); + return JSON.parse(credentialsStr); + } + + function isChooserDisabled() { + return ( + scope.parentElection && + scope.parentElection.presentation && + scope.parentElection.presentation.extra_options && + !!scope.parentElection.presentation.extra_options.disable__election_chooser_screen + ); + } + + function generateChildrenInfo() { + var childrenInfo = angular.copy( + scope.parentAuthEvent.children_election_info + ); + + // need to reload in case this changed in success screen.. + var credentials = getElectionCredentials(); + + // if it's a demo, yes, allow voting by default + scope.canVote = scope.isDemo || scope.isPreview; + scope.hasVoted = false; + scope.skippedElections = []; + childrenInfo.presentation.categories = _.map( + childrenInfo.presentation.categories, + function (category) { + category.events = _.map( + category.events, + function (election) { + var elCredentials = findElectionCredentials( + election.event_id, credentials + ); + var canVote = calculateCanVote(elCredentials); + var isVoter = calculateIsVoter(elCredentials); + if ( + elCredentials && + elCredentials.numSuccessfulLogins > 0 + ) { + scope.hasVoted = true; + } + var retValue = Object.assign( + {}, + election, + elCredentials || {}, + { + disabled: (!scope.isDemo && !scope.isPreview && !canVote), + hidden: (!scope.isDemo && !scope.isPreview && !isVoter) + } + ); + if (!!retValue.skipped) { + scope.skippedElections.push(retValue); + } + return retValue; + } + ); + return category; + }); + return childrenInfo; + } + + function getChildrenElectionsData() { + if (!scope.childrenElectionInfo || isChooserDisabled()) { + return; + } + + _.map( + scope.childrenElectionInfo.presentation.categories, + function (category) { + _.map( + category.events, + function (event) { + if (event.hidden) { + return {}; + } + return scope.simpleGetElection(event.event_id).then( + function (electionData) { + event.electionData = electionData; + $timeout(function () { + scope.$apply(); + }); + } + ); + } + ); + } + ); + } + + function chooseElection(electionId) { + scope.setState(scope.stateEnum.receivingElection, {}); + scope.retrieveElectionConfig(electionId + ""); + } + + scope.childrenElectionInfo = generateChildrenInfo(); + getChildrenElectionsData(); + + function checkDisabled() { + // if election chooser is disabled and can vote, then go to the first + // election in which it can vote + if (isChooserDisabled()) { + var orderedElectionIds = scope + .childrenElectionInfo + .natural_order; + // If it's a demo booth, do not rely on election credentials + if (scope.isDemo || scope.isPreview) { + scope.increaseDemoElectionIndex(); + if (scope.demoElectionIndex < orderedElectionIds.length) { + chooseElection( + orderedElectionIds[scope.demoElectionIndex] + ); + } else { + scope.hasVoted = true; + scope.canVote = false; + } + return; + } + + var credentials = getElectionCredentials(); + for (var i = 0; i < orderedElectionIds.length; i++) { + var electionId = orderedElectionIds[i]; + var elCredentials = findElectionCredentials( + electionId, + credentials + ); + if ( + !elCredentials.skipped && + !elCredentials.voted && + calculateCanVote(elCredentials) + ) { + chooseElection(electionId); + return; + } + } + // If redirected to no election but there are skipped elections, it + // means that the voter can re-login to vote again so we set the + // showSkippedElections flag + if (scope.skippedElections.length > 0) { + scope.showSkippedElections = true; + } + } + } + + checkDisabled(); + scope.chooseElection = chooseElection; + scope.goToVoterEligibility = function () { + scope.setState(scope.stateEnum.voterEligibilityScreen, {}); + }; } return { restrict: 'AE', From 0e4cadb5b1565fda06d8835bbfb3a2f318240e80 Mon Sep 17 00:00:00 2001 From: Findeton Date: Thu, 4 Jul 2024 16:14:12 -0500 Subject: [PATCH 07/17] wip --- .../voter-eligibility-screen-directive.html | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/avBooth/voter-eligibility-screen-directive/voter-eligibility-screen-directive.html b/avBooth/voter-eligibility-screen-directive/voter-eligibility-screen-directive.html index df6afe71..8161db27 100644 --- a/avBooth/voter-eligibility-screen-directive/voter-eligibility-screen-directive.html +++ b/avBooth/voter-eligibility-screen-directive/voter-eligibility-screen-directive.html @@ -18,4 +18,6 @@ skipped-elections="skippedElections" parent-election="parentElection" >
- \ No newline at end of file + + + \ No newline at end of file From 2701f62aff935c64da5b84f07cafd6f837d1bebf Mon Sep 17 00:00:00 2001 From: Findeton Date: Thu, 4 Jul 2024 16:28:06 -0500 Subject: [PATCH 08/17] wip --- .../booth-children-elections-directive.js | 1 + 1 file changed, 1 insertion(+) diff --git a/avBooth/booth-children-elections-directive/booth-children-elections-directive.js b/avBooth/booth-children-elections-directive/booth-children-elections-directive.js index 94e827fb..f5a3bdc5 100644 --- a/avBooth/booth-children-elections-directive/booth-children-elections-directive.js +++ b/avBooth/booth-children-elections-directive/booth-children-elections-directive.js @@ -63,6 +63,7 @@ angular.module('avUi') { if (!scope.canVote) { console.log("user cannot vote, so ignoring click"); + return; } if (scope.hasVoted) { console.log("user has already voted, so ignoring click"); From 2c3d57c43774027035ab83d9dc50d411ac96fd09 Mon Sep 17 00:00:00 2001 From: Findeton Date: Thu, 4 Jul 2024 16:32:24 -0500 Subject: [PATCH 09/17] wip --- .../election-chooser-screen-directive.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/avBooth/election-chooser-screen-directive/election-chooser-screen-directive.js b/avBooth/election-chooser-screen-directive/election-chooser-screen-directive.js index cf0e7290..02df32b0 100644 --- a/avBooth/election-chooser-screen-directive/election-chooser-screen-directive.js +++ b/avBooth/election-chooser-screen-directive/election-chooser-screen-directive.js @@ -90,6 +90,9 @@ angular.module('avBooth') election.event_id, credentials ); var canVote = calculateCanVote(elCredentials); + if (canVote) { + scope.canVote = true; + } var isVoter = calculateIsVoter(elCredentials); if ( elCredentials && From bbef531b054ca51e8ab702d75cccfa100bf82fd8 Mon Sep 17 00:00:00 2001 From: Findeton Date: Mon, 8 Jul 2024 11:33:44 -0500 Subject: [PATCH 10/17] wip --- .../voter-eligibility-screen-directive.html | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/avBooth/voter-eligibility-screen-directive/voter-eligibility-screen-directive.html b/avBooth/voter-eligibility-screen-directive/voter-eligibility-screen-directive.html index 8161db27..c896dcef 100644 --- a/avBooth/voter-eligibility-screen-directive/voter-eligibility-screen-directive.html +++ b/avBooth/voter-eligibility-screen-directive/voter-eligibility-screen-directive.html @@ -4,6 +4,20 @@
+ +

+

+ +
+
+
+ + + \ No newline at end of file From 38d8389da2b70c1540f30c792f03f9d0ee1bd5d8 Mon Sep 17 00:00:00 2001 From: Findeton Date: Mon, 8 Jul 2024 17:20:37 -0500 Subject: [PATCH 11/17] wip --- .../voter-eligibility-screen-directive.html | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/avBooth/voter-eligibility-screen-directive/voter-eligibility-screen-directive.html b/avBooth/voter-eligibility-screen-directive/voter-eligibility-screen-directive.html index c896dcef..fd176293 100644 --- a/avBooth/voter-eligibility-screen-directive/voter-eligibility-screen-directive.html +++ b/avBooth/voter-eligibility-screen-directive/voter-eligibility-screen-directive.html @@ -7,15 +7,15 @@

+ ng-if="election.presentation && election.presentation.voter_eligibility_screen" + ng-bind-html="(election.presentation.voter_eligibility_screen | customI18n : 'description')">
@@ -37,8 +37,8 @@ \ No newline at end of file From 402d0c1f594ea312622bbd9892432ddd9d2f5990 Mon Sep 17 00:00:00 2001 From: Findeton Date: Mon, 8 Jul 2024 17:34:06 -0500 Subject: [PATCH 12/17] wip --- .../voter-eligibility-screen-directive.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/avBooth/voter-eligibility-screen-directive/voter-eligibility-screen-directive.html b/avBooth/voter-eligibility-screen-directive/voter-eligibility-screen-directive.html index fd176293..b6a96341 100644 --- a/avBooth/voter-eligibility-screen-directive/voter-eligibility-screen-directive.html +++ b/avBooth/voter-eligibility-screen-directive/voter-eligibility-screen-directive.html @@ -13,7 +13,7 @@
@@ -36,7 +36,7 @@ From 8169ebcc3aad5e0dbd1786f23297d7802f4d652a Mon Sep 17 00:00:00 2001 From: Findeton Date: Mon, 8 Jul 2024 18:56:11 -0500 Subject: [PATCH 13/17] wip --- app.js | 8 ++++++++ avBooth/booth-directive/booth-directive.js | 1 + .../election-chooser-screen-directive.js | 4 ++++ 3 files changed, 13 insertions(+) diff --git a/app.js b/app.js index bd16739b..bf8ab192 100755 --- a/app.js +++ b/app.js @@ -206,6 +206,14 @@ angular.module('voting-booth').config( isDemo: true } }) + .state('election.booth-demo', { + url: '/:id/eligibility', + templateUrl: 'avBooth/booth.html', + controller: "BoothController", + params: { + isEligibility: true + } + }) .state('election.booth-preview', { url: '/:id/preview-vote', templateUrl: 'avBooth/booth.html', diff --git a/avBooth/booth-directive/booth-directive.js b/avBooth/booth-directive/booth-directive.js index 305a79fa..9c829a67 100644 --- a/avBooth/booth-directive/booth-directive.js +++ b/avBooth/booth-directive/booth-directive.js @@ -46,6 +46,7 @@ angular.module('avBooth') scope.isDemo = (attrs.isDemo === "true"); scope.isPreview = (attrs.isPreview === "true"); scope.isUuidPreview = (attrs.isUuidPreview === "true"); + scope.isEligibility = (attrs.isEligibility === "true"); scope.documentation = ConfigService.documentation; scope.hasSeenStartScreenInThisSession = false; diff --git a/avBooth/election-chooser-screen-directive/election-chooser-screen-directive.js b/avBooth/election-chooser-screen-directive/election-chooser-screen-directive.js index 02df32b0..1e2329e7 100644 --- a/avBooth/election-chooser-screen-directive/election-chooser-screen-directive.js +++ b/avBooth/election-chooser-screen-directive/election-chooser-screen-directive.js @@ -208,6 +208,10 @@ angular.module('avBooth') scope.setState(scope.stateEnum.voterEligibilityScreen, {}); }; + if (scope.isEligibility) { + goToVoterEligibility(); + } + scope.showHelp = function () { $modal.open({ ariaLabelledBy: 'modal-title', From ab00a27fdd29b57815b08b24514129895533994e Mon Sep 17 00:00:00 2001 From: Findeton Date: Mon, 8 Jul 2024 18:57:12 -0500 Subject: [PATCH 14/17] wip --- .../election-chooser-screen-directive.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/avBooth/election-chooser-screen-directive/election-chooser-screen-directive.js b/avBooth/election-chooser-screen-directive/election-chooser-screen-directive.js index 1e2329e7..d5751488 100644 --- a/avBooth/election-chooser-screen-directive/election-chooser-screen-directive.js +++ b/avBooth/election-chooser-screen-directive/election-chooser-screen-directive.js @@ -209,7 +209,7 @@ angular.module('avBooth') }; if (scope.isEligibility) { - goToVoterEligibility(); + scope.goToVoterEligibility(); } scope.showHelp = function () { From 3e693e3b71ec7f6172b789bda9570e67234fa9e0 Mon Sep 17 00:00:00 2001 From: Findeton Date: Mon, 8 Jul 2024 18:59:36 -0500 Subject: [PATCH 15/17] wip --- app.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app.js b/app.js index bf8ab192..d2c304ee 100755 --- a/app.js +++ b/app.js @@ -206,7 +206,7 @@ angular.module('voting-booth').config( isDemo: true } }) - .state('election.booth-demo', { + .state('election.booth-eligibility', { url: '/:id/eligibility', templateUrl: 'avBooth/booth.html', controller: "BoothController", From 3f770e6b7fdac69ba7cab61b09000a9ed1672079 Mon Sep 17 00:00:00 2001 From: Findeton Date: Mon, 8 Jul 2024 19:08:30 -0500 Subject: [PATCH 16/17] wip --- avBooth/booth.html | 1 + avBooth/booth.js | 1 + 2 files changed, 2 insertions(+) diff --git a/avBooth/booth.html b/avBooth/booth.html index c5fe2570..23cac9e5 100644 --- a/avBooth/booth.html +++ b/avBooth/booth.html @@ -6,5 +6,6 @@ is-preview="{{isPreview}}" is-uuid-preview="{{isUuidPreview}}" preview-election="{{previewElection}}" + is-eligibility="{{isEligibility}}" > diff --git a/avBooth/booth.js b/avBooth/booth.js index d12da70e..6d07f099 100644 --- a/avBooth/booth.js +++ b/avBooth/booth.js @@ -49,6 +49,7 @@ angular $scope.previewElection = previewElectionParam && decodeURIComponent(previewElectionParam); $scope.isPreview = $stateParams.isPreview || false; $scope.isUuidPreview = $stateParams.isUuidPreview || false; + $scope.isEligibility = $stateParams.isEligibility || false; $scope.electionId = $stateParams.id; $scope.baseUrl = ConfigService.baseUrl; $scope.config = $filter('json')(ConfigService); From fc6788cdb6d5fed357422cac5b508847eba884b1 Mon Sep 17 00:00:00 2001 From: Findeton Date: Mon, 8 Jul 2024 19:38:22 -0500 Subject: [PATCH 17/17] wip --- .../booth-children-elections-directive.html | 2 +- .../election-chooser-screen-directive.html | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/avBooth/booth-children-elections-directive/booth-children-elections-directive.html b/avBooth/booth-children-elections-directive/booth-children-elections-directive.html index 649da3f5..5b7d13e2 100644 --- a/avBooth/booth-children-elections-directive/booth-children-elections-directive.html +++ b/avBooth/booth-children-elections-directive/booth-children-elections-directive.html @@ -91,7 +91,7 @@

{{electio diff --git a/avBooth/election-chooser-screen-directive/election-chooser-screen-directive.html b/avBooth/election-chooser-screen-directive/election-chooser-screen-directive.html index 6f370c5b..709a428f 100644 --- a/avBooth/election-chooser-screen-directive/election-chooser-screen-directive.html +++ b/avBooth/election-chooser-screen-directive/election-chooser-screen-directive.html @@ -14,7 +14,6 @@

-
Go to Voter Eligibility