diff options
author | Alex Auvolat <alex@adnab.me> | 2022-12-06 16:01:38 +0100 |
---|---|---|
committer | Alex Auvolat <alex@adnab.me> | 2022-12-06 16:01:38 +0100 |
commit | 832c17a3a9f6277e7921f4e811401d5478755ff9 (patch) | |
tree | e5e2b0bd1d0337937a0ce5f207ba2523df7c332c /themes | |
parent | e045227527de36cdbb954e00a4cf8de041a25828 (diff) | |
parent | f01fbcbc48db5e65d69a0ebd9d7cb0deb378cf13 (diff) | |
download | alps-832c17a3a9f6277e7921f4e811401d5478755ff9.tar.gz alps-832c17a3a9f6277e7921f4e811401d5478755ff9.zip |
Merge branch 'master' into deuxfleurs
Diffstat (limited to 'themes')
-rw-r--r-- | themes/sourcehut/calendar.html | 2 | ||||
-rw-r--r-- | themes/sourcehut/nav.html | 31 |
2 files changed, 24 insertions, 9 deletions
diff --git a/themes/sourcehut/calendar.html b/themes/sourcehut/calendar.html index d0cfac0..3378fbd 100644 --- a/themes/sourcehut/calendar.html +++ b/themes/sourcehut/calendar.html @@ -30,7 +30,7 @@ <li class="nav-item"> <a class="nav-link" - href="/calendar/{{$event.Props.Text "UID" | pathescape}}" + href="{{.URL}}" > {{$event.Props.Text "SUMMARY"}} ({{$event.DateTimeStart nil | formatdate}} — {{$event.DateTimeEnd nil | formatdate}}) diff --git a/themes/sourcehut/nav.html b/themes/sourcehut/nav.html index 687dfd8..ce9fb2b 100644 --- a/themes/sourcehut/nav.html +++ b/themes/sourcehut/nav.html @@ -1,29 +1,44 @@ <nav class="container-fluid navbar navbar-light navbar-expand-sm"> - <!-- TODO: show active plugin name --> <a class="navbar-brand" href="/"> alps <span class="text-danger">mail</span> </a> - {{if .LoggedIn}} + {{ if .LoggedIn }} + {{ $page := (index .Path 0) }} <ul class="navbar-nav mr-auto d-none d-sm-flex"> - <li class="nav-item active"> + <li class="nav-item + {{ if or (eq $page "mailbox") (eq $page "message") (eq $page "compose") }} + active + {{ end }} + "> <a href="/" class="nav-link">mail</a> </li> - <!-- TODO: only show these links if plugins are loaded --> - <li class="nav-item"> + {{ if call .HavePlugin "carddav" }} + <li class="nav-item + {{ if eq $page "contacts" }} + active + {{ end }} + "> <a href="/contacts" class="nav-link">contacts</a> </li> - <li class="nav-item"> + {{ end }} + {{ if call .HavePlugin "caldav" }} + <li class="nav-item + {{ if eq $page "calendar" }} + active + {{ end }} + "> <a href="/calendar" class="nav-link">calendar</a> </li> + {{ end }} </ul> <div class="login"> <span class="navbar-text"> - Logged in as {{.Username}} — + Logged in as {{ .Username }} — <a href="/settings">Settings</a> — <a href="/logout">Log out</a> </span> </div> - {{end}} + {{ end }} </nav> |