aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHugo Hörnquist <hugo@lysator.liu.se>2020-03-31 00:43:11 +0200
committerHugo Hörnquist <hugo@lysator.liu.se>2020-03-31 00:43:11 +0200
commit58b558cca27480ffd63b36302d5e1f733eaf44ab (patch)
tree289cd1db1c996cc889c10d705c8d1929262f7ecf
parentUpdate HTML /static links to be absolute. (diff)
downloadcalp-58b558cca27480ffd63b36302d5e1f733eaf44ab.tar.gz
calp-58b558cca27480ffd63b36302d5e1f733eaf44ab.tar.xz
Add toggles between week and month view for HTML.
-rw-r--r--module/output/html.scm16
1 files changed, 15 insertions, 1 deletions
diff --git a/module/output/html.scm b/module/output/html.scm
index 50822ccf..8c7d9674 100644
--- a/module/output/html.scm
+++ b/module/output/html.scm
@@ -537,7 +537,21 @@
,(let* ((hash (get-git-version))
(url (format #f "~a/calparse/commit/?id=~a"
(repo-url) hash)))
- `(span "Version " (a (@ (href ,url)) ,hash)))))
+ `(span "Version " (a (@ (href ,url)) ,hash)))
+ (span (@ (class "nav"))
+ "View "
+ (a (@ (href "/week/" ,(date->string
+ (if (= 1 (day start-date))
+ (start-of-week start-date (week-start))
+ start-date)
+ "~1")
+ ".html"))
+ "weekly")
+ ", "
+ (a (@ (href "/month/" ,(date->string (set (day start-date) 1) "~1") ".html"))
+ "monthly")
+ ".")
+ ))
;; Whole sidebar
(aside (@ (class "sideinfo"))