projects:vote:vote
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| projects:vote:vote [2024/10/12 01:59] – jhagstrand | projects:vote:vote [2026/06/20 22:19] (current) – [vote.txt jun 2026] jhagstrand | ||
|---|---|---|---|
| Line 4: | Line 4: | ||
| todo: | todo: | ||
| - | * x delete rfk | ||
| - | * x create popup branch | ||
| - | * x push to gitlab | ||
| - | * x copy readme from github | ||
| - | * x compose ordinal | ||
| - | * x get url and usecount from svc getdecisions | + | * clean up Help: " |
| - | * x order decisions by usecount | + | * back button come back to about from wikipedia, browserhistory return to last used page |
| - | * Require login before castballot | + | * add Register button |
| - | * url' | + | * display |
| - | * 3 click handlers | + | |
| - | + | ||
| - | * clean up results page, remove " | + | |
| * add, edit, delete, approve decisions | * add, edit, delete, approve decisions | ||
| + | * if userid = ownerid, show pencil as edit link | ||
| + | * allow delete from edit screen | ||
| + | * give everyone the insert link: compose, add, insert, new | ||
| + | * a " | ||
| * add, edit, delete, approve candidate | * add, edit, delete, approve candidate | ||
| - | * AI to match duplicate | + | * AI to match duplicate |
| - | * display url on ballot | + | |
| - | * popup | + | * encryption: only the voter can see his own ballot |
| - | * issue: | + | |
| - | * adding a new candidate writes him to the database immediately | + | |
| - | * choosing a listed candidate writes to the database only on "cast ballot" | + | |
| - | * immediate | + | |
| - | | + | |
| - | * add a new button called "count votes" | + | * Add jurisdiction table, as ID, title, user ID. |
| - | * but we need the user to understand that his votes take effect immediately | + | * Had jurisdiction |
| - | * add a cast true/false flag to the rank record | + | * Add Eli to add change delete jurisdiction records |
| - | * force user to acknowledge vote before leaving page | + | * Add jurisdiction ID column |
| + | * Filter decision lookup | ||
| - | * when leaving ballot page, if has not cast ballot, warn about losing data | ||
| - | * "You have not yet " | ||
| - | * Do you wish to cast your ballot now? (if not, all your rankings will be lost." | ||
| - | * put the ballot in a popup box. | ||
| - | |||
| - | are you going to allow him to save votes or not? | ||
| - | You can't say "you will lose your data" if you've already saved the shit to the db | ||
| - | |||
| - | * screen architecture | ||
| - | * decision list, two buttons on each | ||
| - | * ballot popup, two ways out: Cast Ballot or Cancel | ||
| - | * on cancel: | ||
| - | * results popup -> " | ||
| - | |||
| - | * rename table rank to ballot | ||
| - | * because that's what it's doing, saving a user's ballot | ||
| - | * ballot: id, | ||
| Line 75: | Line 50: | ||
| * salary range confined to 1x to 2x | * salary range confined to 1x to 2x | ||
| + | ==== vote.txt jun 2026 ==== | ||
| + | < | ||
| + | vote.txt | ||
| + | |||
| + | reverse engineering | ||
| + | |||
| + | html/ | ||
| + | |||
| + | html/ | ||
| + | |||
| + | |||
| + | model of singleton objects | ||
| + | |||
| + | user.js - voyc.User, represents logged-in user | ||
| + | |||
| + | view.js - voyc.View, subscribes to nav requests: home, about, account, profile | ||
| + | |||
| + | model.js - voyc.Model, meant to be main driver for app (start with model app, then rename) | ||
| + | |||
| + | account.js - voyc.Account, | ||
| + | |||
| + | accountview.js - voyc.AccountView, | ||
| + | |||
| + | vote.js - voyc.Vote, app driver | ||
| + | |||
| + | |||
| + | |||
| + | todo: | ||
| + | define html components: account, vote | ||
| + | get nav to work in view.js | ||
| + | resolve vote and model | ||
| + | resolve Observer vs Event | ||
| + | |||
| + | webdev svc castballot makes call to webprod, hardcoded in vote.js | ||
| + | model.js does it correctly | ||
| + | |||
| + | x shell script in ~/ | ||
| + | |||
| + | castballot.php - | ||
| + | input: electionid (int), votes (string of ints) | ||
| + | insert into vote.vote (userid, electionid, votes) ...; | ||
| + | |||
| + | select id, name, party from vote.candidate where electionid = $1; | ||
| + | shuffle | ||
| + | |||
| + | select votes from vote.vote where electionid = $1; | ||
| + | build array of votes | ||
| + | count votes in rounds | ||
| + | |||
| + | output: candidates, results | ||
| + | |||
| + | validate.php - | ||
| + | function validateInteger() | ||
| + | function validateArrayOfIntegers() | ||
| + | |||
| + | ------------------- | ||
| + | |||
| + | vote.js | ||
| + | voyc.Vote() | ||
| + | |||
| + | this.comm = Comm() instantiate Comm object | ||
| + | |||
| + | getElection(electionid) | ||
| + | svc castballot return candidates, results | ||
| + | drawElection | ||
| + | show heading "2016 USA Pres" | ||
| + | drawBallot | ||
| + | get candidates from svc, | ||
| + | those who are ranked: sort by rank, | ||
| + | draw in a loop | ||
| + | those not yet ranked: sort by random | ||
| + | draw in a loop | ||
| + | enable the Cast Ballot button | ||
| + | drawResults | ||
| + | get results returned from svc | ||
| + | display the winner | ||
| + | display the rounds details in a table | ||
| + | |||
| + | nav.replace(' | ||
| + | |||
| + | on load, new voyc.Vote() | ||
| + | |||
| + | -------------------- | ||
| + | |||
| + | model.js | ||
| + | voyc.Model() | ||
| + | |||
| + | instantiate self and object model: View, User, Account, AccountView | ||
| + | |||
| + | instantiate Observer | ||
| + | |||
| + | instantiage BrowserHistory and pagedraw() function | ||
| + | |||
| + | instantiate Comm | ||
| + | |||
| + | subscribe to events: set/ | ||
| + | |||
| + | -------------------- | ||
| + | |||
| + | index.html | ||
| + | |||
| + | header - leftnav, headeruser | ||
| + | |||
| + | section content-container | ||
| + | section content-home | ||
| + | section ballot | ||
| + | section results | ||
| + | section content-about | ||
| + | section content-profile | ||
| + | |||
| + | 3 modeless dialogs | ||
| + | leftnav | ||
| + | header user | ||
| + | unused settings | ||
| + | modal container | ||
| + | 9 modal dialogs - all used by account | ||
| + | |||
| + | footer - two logo links | ||
| + | |||
| + | |||
| + | -------------------- | ||
| + | |||
| + | usage: | ||
| + | <insert from readme> | ||
| + | mv model.js to vote.js | ||
| + | substitute vote.Model to voyc.Vote | ||
| + | |||
| + | |||
| + | Event pub/sub | ||
| + | Observer | ||
| + | |||
| + | terminology | ||
| + | Observer | ||
| + | Pub/Sub | ||
| + | Data Binding | ||
| + | Message Queue | ||
| + | Event-driven architecture | ||
| + | decoupled | ||
| + | Listener | ||
| + | dispatcher | ||
| + | |||
| + | Observer/ | ||
| + | addEventListener/ | ||
| + | Publisher/ | ||
| + | Send/ | ||
| + | |||
| + | |||
| + | table | ||
| + | |||
| + | singleton object that runs it all | ||
| + | subscriber/ | ||
| + | publisher/ | ||
| + | |||
| + | verb, doer | ||
| + | |||
| + | dispatcher | ||
| + | |||
| + | manager | ||
| + | window | ||
| + | Observer | ||
| + | Event < | ||
| + | | ||
| + | |||
| + | two lists | ||
| + | 1. list of subscribers or listeners | ||
| + | 2. queue of published messages or events that can be processed asynchronously | ||
| + | |||
| + | ------------------------------- | ||
| + | |||
| + | original version, plus: | ||
| + | account management: login, register, etc | ||
| + | one vote per user, can be changed | ||
| + | multiple elections | ||
| + | election results vs rounds detailed results | ||
| + | |||
| + | election menu | ||
| + | ballot | ||
| + | results | ||
| + | detailed results | ||
| + | about | ||
| + | </ | ||
projects/vote/vote.1728712774.txt.gz · Last modified: 2024/10/12 01:59 by jhagstrand