From 0af990f4b96927a6a3d026cfcb5c651169dc21cc Mon Sep 17 00:00:00 2001 From: joeyak Date: Sat, 8 Feb 2025 21:54:09 -0500 Subject: [PATCH] Show votes on current cycle page --- web/templates/cycle.html | 73 +++++++++++++++++++++------------------- 1 file changed, 38 insertions(+), 35 deletions(-) diff --git a/web/templates/cycle.html b/web/templates/cycle.html index 5ed69ae..0c5af9f 100644 --- a/web/templates/cycle.html +++ b/web/templates/cycle.html @@ -16,26 +16,26 @@ var x = setInterval(function() { - var now = new Date().getTime(); - var distance = countDownDate - now; + var now = new Date().getTime(); + var distance = countDownDate - now; - var days = Math.floor(distance / (1000 * 60 * 60 * 24)); - var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60)); + var days = Math.floor(distance / (1000 * 60 * 60 * 24)); + var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60)); - document.getElementById("countdown-clock").innerHTML = days + "d " + hours + "h "; + document.getElementById("countdown-clock").innerHTML = days + "d " + hours + "h "; - if (distance < 0) { - clearInterval(x); - document.getElementById("countdown-clock").innerHTML = "TODAY!"; - } -}, 1000); + if (distance < 0) { + clearInterval(x); + document.getElementById("countdown-clock").innerHTML = "TODAY!"; + } + }, 1000);
-

- The next Movienight will be in: -

+

+ The next Movienight will be in: +

{{end}} {{end}} @@ -44,12 +44,12 @@ {{if .LastCycle}} {{if .LastCycle.Watched}}
- In the last Movienight on {{.LastCycle.EndedString}} we watched: - + In the last Movienight on {{.LastCycle.EndedString}} we watched: +
{{end}} {{end}} @@ -77,27 +77,30 @@ {{.Name}}
-
- {{if .CycleWatched}} -
Watched:
{{.CycleWatched.EndedString}}
- {{end}} +
+ {{if .CycleWatched}} +
Watched:
{{.CycleWatched.EndedString}}
+ {{end}} +
+
+ Votes: {{len .Votes}}
{{if $user}} -
- {{if .UserVoted $user.Id }} - {{if and $votingEnabled (not .CycleWatched)}} +
+ {{if .UserVoted $user.Id }} + {{if and $votingEnabled (not .CycleWatched)}} Voted - {{end}} - {{else}} - {{if not .CycleWatched}} - {{if lt $votesAvailable 1}}No votes
available + {{end}} + {{else}} + {{if not .CycleWatched}} + {{if lt $votesAvailable 1}}No votes
available {{else if and (gt $votesAvailable 0) $votingEnabled }} - Vote - {{end}} - {{end}} - {{end}} -
+ Vote + {{end}} {{end}} + {{end}} +
+ {{end}}
{{end}}