From acd9c66c663ea6b0b2fb9dd0a563897c2fae45eb Mon Sep 17 00:00:00 2001 From: Tom Smeding Date: Fri, 3 Apr 2026 22:10:56 +0200 Subject: Calendar view --- aratamete-ircbrowse.cabal | 2 + config.txt | 2 +- pages/calendar-day.mustache | 36 +++++++++++ pages/calendar.mustache | 59 +++++++++++++++++ pages/log.mustache | 8 +-- pages/style.css | 47 ++++++++++++-- src/Calendar.hs | 69 ++++++++++++++++++++ src/Config.hs | 1 - src/Index.hs | 65 ++++++++++++++----- src/Main.hs | 151 ++++++++++++++++++++++++++++++++++---------- src/Util.hs | 20 ++++++ 11 files changed, 401 insertions(+), 59 deletions(-) create mode 100644 pages/calendar-day.mustache create mode 100644 pages/calendar.mustache create mode 100644 src/Calendar.hs diff --git a/aratamete-ircbrowse.cabal b/aratamete-ircbrowse.cabal index 6b5f720..9ef818d 100644 --- a/aratamete-ircbrowse.cabal +++ b/aratamete-ircbrowse.cabal @@ -10,6 +10,7 @@ executable aratamete-ircbrowse main-is: Main.hs other-modules: Cache + Calendar Config Index Mmap @@ -27,6 +28,7 @@ executable aratamete-ircbrowse mustache, random, text >= 2.1.2, + transformers, time, unix, vector, diff --git a/config.txt b/config.txt index 2745cd3..d0dc1af 100644 --- a/config.txt +++ b/config.txt @@ -1,5 +1,5 @@ port 8000 -logs /home/tom/git/ircbrowse/logs-snapshot +logs /home/tom/git/ircbrowse/logs-snapshot-UTC channel liberachat #haskell haskell channel liberachat #kmonad kmonad channel liberachat #xmonad xmonad diff --git a/pages/calendar-day.mustache b/pages/calendar-day.mustache new file mode 100644 index 0000000..0291226 --- /dev/null +++ b/pages/calendar-day.mustache @@ -0,0 +1,36 @@ + + + + + {{channel}} {{date}} ({{network}}) - ircbrowse2 + + + + +
+
+ Home + {{network}}/{{channel}}: + Logs + Calendar +
+
+

Logs on {{date}} ({{network}}/{{channel}})

+ + {{#events}} + + + + + + {{/events}} +
{{time}}{{#nickwrap1}}{{nickwrap1}}{{/nickwrap1}}{{nick}}{{#nickwrap2}}{{nickwrap2}}{{/nickwrap2}}{{message}}
+

All times are in UTC.

+
+ +
+ + diff --git a/pages/calendar.mustache b/pages/calendar.mustache new file mode 100644 index 0000000..79475cb --- /dev/null +++ b/pages/calendar.mustache @@ -0,0 +1,59 @@ + + + + + Calendar {{channel}} ({{network}}) - ircbrowse2 + + + + +
+
+ Home + {{network}}/{{channel}}: + Logs + Calendar +
+
+

Calendar: {{network}}/{{channel}}

+ {{#years}} +

{{year}}

+ + {{#monrows}} + + {{#months}} + + {{/months}} + + {{/monrows}} +
+ {{#monthname}} + {{monthname}}
+ + {{#weeks}} + + {{#days}} + + {{/days}} + {{^days}} + + {{/days}} + + {{/weeks}} + {{#phantomweek}} + + + + {{/phantomweek}} +
{{#date}}{{date}}{{/date}} 
30303030303030
+ {{/monthname}} +
+ {{/years}} +
+ +
+ + diff --git a/pages/log.mustache b/pages/log.mustache index 254a9cd..1257d7e 100644 --- a/pages/log.mustache +++ b/pages/log.mustache @@ -2,7 +2,7 @@ - ircbrowse2: {{channel}} ({{network}}) + {{channel}} ({{network}}) - ircbrowse2 @@ -10,7 +10,8 @@
Home - + {{network}}/{{channel}}: + Logs Calendar
@@ -81,9 +82,8 @@ {{/lastpage}}
{{/picker}} - - {{totalevents}} events total +

All times are in UTC.