New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
rework the rest of the pages #69
Merged
Merged
Changes from 20 commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
0b8674a
remove closed elections from frontpage. relabel archives to results
ryanlerch bf85141
show all upcoming elections on index. remove open page.
ryanlerch 29212b0
front page style changes
ryanlerch 0b13c75
fix enddate resetting to 00:00:00 when editing an election
ryanlerch 0ae62e1
finish reworking all the pages
ryanlerch b430f92
remove edit election details page, as this is now in the main edit
ryanlerch 749d65e
fix css to make the graph on results page show
ryanlerch 88a2363
made the candidates list not show if election is over
ryanlerch 284fb74
add back the red line that showing the cutoff in the results
ryanlerch a6f6b1f
merged the voters per candidate and averages into the results table
ryanlerch aafcde5
styled up the results table
ryanlerch b13d9ef
converted the statistics section to some dotpoints
ryanlerch 38fd7c9
change the elections admin group back to elections
ryanlerch 31d00b6
added requirement for arrow in requirements.txt
ryanlerch 7a9d41a
made the datepicker dropdown work on the edit page
ryanlerch 354b435
fixed irc voting form and simple voting form
ryanlerch 707468a
made the edit election page 2-col
ryanlerch 7251869
started fixing tests
ryanlerch db7ffe9
fix admind groups not prefilling in form
ryanlerch d895cae
finished fixing the tests
ryanlerch 1943dc4
tidy up two more lines
ryanlerch 4698dbc
fixed over-indentation
ryanlerch File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -126,25 +126,13 @@ def admin_new_election(): | |
submit_text='Create election') | ||
|
||
|
||
@APP.route('/admin/<election_alias>/') | ||
@APP.route('/admin/<election_alias>/', methods=('GET', 'POST')) | ||
@election_admin_required | ||
def admin_view_election(election_alias): | ||
election = models.Election.get(SESSION, alias=election_alias) | ||
if not election: | ||
flask.abort(404) | ||
|
||
return flask.render_template( | ||
'admin/view_election.html', | ||
election=election) | ||
|
||
|
||
@APP.route('/admin/<election_alias>/edit', methods=('GET', 'POST')) | ||
@election_admin_required | ||
def admin_edit_election(election_alias): | ||
election = models.Election.get(SESSION, alias=election_alias) | ||
if not election: | ||
flask.abort(404) | ||
|
||
print election.admin_groups_list | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think this one can be dropped :) |
||
form = forms.ElectionForm(election.id, obj=election) | ||
if form.validate_on_submit(): | ||
form.embargoed.data = int(form.embargoed.data) | ||
|
@@ -160,6 +148,12 @@ def admin_edit_election(election_alias): | |
form.candidates_are_fasusers.data) | ||
form.populate_obj(election) | ||
|
||
# Fix start_date and end_date to use datetime | ||
election.start_date = datetime.combine(election.start_date, time()) | ||
election.end_date = datetime.combine(election.end_date, | ||
time(23, 59, 59)) | ||
SESSION.add(election) | ||
|
||
admin_groups = set(election.admin_groups_list) | ||
|
||
new_groups = set( | ||
|
@@ -213,10 +207,12 @@ def admin_edit_election(election_alias): | |
|
||
form.admin_grp.data = ', '.join(election.admin_groups_list) | ||
form.lgl_voters.data = ', '.join(election.legal_voters_list) | ||
|
||
return flask.render_template( | ||
'admin/election_form.html', | ||
form=form, | ||
submit_text='Edit election') | ||
'admin/view_election.html', | ||
election=election, | ||
form=form, | ||
submit_text='Edit election') | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Over-indented? |
||
|
||
|
||
@APP.route('/admin/<election_alias>/candidates/new', methods=('GET', 'POST')) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe just
elif election.status in ['Embargoed', 'Ended']
?