Previously, most redirects targeted the root of the application.
This was okay for the first part of development where only one week would be
active, but would be annoying when using multiple weeks.
Change those redirects to call week::week.
Change the login path to be dependant on the current week as well,
so it can be correctly redirected.
Implement a way for admins to introduce new weeks and set them as the last active one.
The last active week is the last one that is accessible to players, and will also prevent
the graph from being displayed.
Implement arrows for navigating between the weeks in the HTML.
Now, the graph will only show when everyone has voted and the week is no longer
the last one active.
This is to minimize information gathering by looking during voting.
Don't fetch the vote data for the admin : it is not used, so no need to
query the database.
Update README with new TODOs and clean up main includes a bit.
I made a choice to only log confirmed votes : there is no blank vote in the database.
This means that when fetching a user's vote, if they have not voted for everyone
there will be votes missing.
As this is sent to the templating engine via a Vector, the ordering of the votes
will be incorrect : all existing votes will follow each other, and there will be
missing votes at the end.
Update the select logic in the truth template to account for that by checking
the truth_id directly, rather than via the index of the array. (O(N²)...)
Remove 'has_vote' as this is not useful anymore.
It looks like the width of the element is calculated *inside* the padding, so the
outer width is really width+2*padding.
This leads to the edit box going outside of the truth column and clipping the graph.
Compute the width to take the padding into account.
I didn't like the default colors, so introduce a new set of them and
set them to the datasets.
Do it after the sort, otherwise the colors wouldn't stay consistent.
The media query used to switch the ratio of the graph would only fire when
switching from landscape to portrait, or the other way around.
This makes controlling the point where the graph switches to vertical is
only possible at this exact point.
Introduce a limit aspect-ratio that controls the change and use it for the
MediaQuery as well.
Make sure we don't delete/recreate the chart for no reason as well.
The SQL query retrieving the votes is deterministicly sorted, but goes through
a HashMap, for ease of processing and transfer, which does not maintaing order.
Sort the resulting object in the Javascript to keep a consistent order in the graph.
In order to fill the missing truths with 0, a counter follows the next expected
truth number.
If it suddenly drops down, we changed player and it should reset as well.
However, as not all players are voted for on all truths, we might change players
but get a higher truth, which was not taken into account and could miss all
the zeroes at the beggining for this player.
Reset the counter if we change players.
- Create a new migration adding a Weeks table, allowing for new weekly introductions
and paving the way for multiple week handling.
- Add route to update the weekly introduction
- Move the week rendering to a specific week file
- Update the templates to use the week number from the week data
- Update templates to render and edit weekly introductions
This first version allows login of pre-existing users, creation and update of truths
by admins, vote on the truths by users, their display as well as a simple graph
for the vote results.
Everything persisting in a SQLite database.