Commit graph

13 commits

Author SHA1 Message Date
36be6b51ae style: Update truth titles, change style of hr
Center the truth titles and add a border with the body, padding accordingly.
To no overload the page and maintain connection, make the hr dotted and match the color.
2024-07-26 19:52:02 +01:00
07d8cf42d7 vote: Properly take player and truth numbers into account
Fetch the amount of truths for the week and the player count to find the total possible votes.
Use this to remove the hardocded value in the check.
Update the check to fail if there was an error as well.

Now that the truth count is calculated, send it to the javascript to build the graph
labels automatically as well.
2024-07-26 19:25:41 +01:00
e08a46af3a week: Create new weeks and change active one
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.
2024-07-26 00:52:41 +01:00
f41f5142c9 styles: Minor reorganization
Properly split what is custom classes and regular HTML tags.
2024-07-26 00:41:05 +01:00
2b3dd28fed style: Fix edit box clipping the graph
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.
2024-07-25 18:39:07 +01:00
f74ed20e80 vote_chart: Add custom colors
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.
2024-07-24 18:11:37 +01:00
4c89a0783d vote_chart: Add title to the graph 2024-07-24 18:08:13 +01:00
d0843d600e vote_chart: Control the graph ratio switch
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.
2024-07-24 16:56:08 +01:00
8fd8ce8220 vote_chart: Remove test code
This was written for testing the chart before plugging in to the database,
remove it now that is not useful anymore.
2024-07-24 16:27:43 +01:00
982a7ffd65 vote_chart: sort parsed votes
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.
2024-07-24 15:23:52 +01:00
dc00e22dba vote_chart: Remove log of received datasets
Another debug print that I forgot for the release.
2024-07-23 21:51:59 +01:00
67ce54e992 v1.1: Add weekly introductions
- 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
2024-07-23 21:51:51 +01:00
9911895b5b v1.0: First production version
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.
2024-07-23 21:51:42 +01:00