From 4740f9ddc34921bfbcf021773a261a9b74600f8f Mon Sep 17 00:00:00 2001 From: "Alexander \"Arav\" Andreev" Date: Thu, 31 Mar 2022 02:14:54 +0400 Subject: [PATCH] Well, this Jade implementation works really weird. while you must specify a name for item in each you must NOT use it, lol. Now this works, kinda. Strange thing is that if else statement doesn't support comparison operators. And as stated in examples such code as len(items) >0 should work, but no! It doesn't. Okay, at least now it works. --- internal/handlers/web/templates/index.jade | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/internal/handlers/web/templates/index.jade b/internal/handlers/web/templates/index.jade index 3d782e2..408b602 100644 --- a/internal/handlers/web/templates/index.jade +++ b/internal/handlers/web/templates/index.jade @@ -40,16 +40,15 @@ html(lang='en') p Current/peak listeners: #[span#radio-listeners #{.Status.Listeners}] / #[span#radio-listener-peak #{.Status.ListenerPeak}] p small Notice: information updates every 45 seconds. But you can #[button(id='btn-update') update] it forcibly. + if .Songs section h2 Last 10 songs table#last-played - each time, artist, title in .Songs + each s in .Songs tr - td #{time} - td #{artist} - td #{title} - else - p Nothing to show here. + td= .Time + td= .Artist + td= .Title section p The largest number of simultaneous listeners was #[b 7] at #[time(datetime='2022-02-19') 19 February 2022], and the song was "Röyksopp - 49 Percent". section