aboutsummaryrefslogtreecommitdiff
path: root/themes
diff options
context:
space:
mode:
authorSimon Ser <contact@emersion.fr>2020-02-12 01:20:21 +0100
committerSimon Ser <contact@emersion.fr>2020-02-12 01:20:21 +0100
commit2733dcd52807c21a2831a524fb175c5b03ab9ea4 (patch)
tree448ea06359a08882eec85c1327071ad01456b722 /themes
parent73d54ca35c043eecbee51f6b1f5a051e0c0779c1 (diff)
downloadalps-2733dcd52807c21a2831a524fb175c5b03ab9ea4.tar.gz
alps-2733dcd52807c21a2831a524fb175c5b03ab9ea4.zip
themes/sourcehut: display username in navbar
Diffstat (limited to 'themes')
-rw-r--r--themes/sourcehut/address-book.html2
-rw-r--r--themes/sourcehut/address-object.html2
-rw-r--r--themes/sourcehut/compose.html2
-rw-r--r--themes/sourcehut/login.html9
-rw-r--r--themes/sourcehut/mailbox.html2
-rw-r--r--themes/sourcehut/message.html2
-rw-r--r--themes/sourcehut/nav.html41
-rw-r--r--themes/sourcehut/settings.html2
8 files changed, 29 insertions, 33 deletions
diff --git a/themes/sourcehut/address-book.html b/themes/sourcehut/address-book.html
index 4becfda..2df65c1 100644
--- a/themes/sourcehut/address-book.html
+++ b/themes/sourcehut/address-book.html
@@ -1,5 +1,5 @@
{{template "head.html"}}
-{{template "nav.html"}}
+{{template "nav.html" .Global}}
<div class="container-fluid">
<div class="row">
diff --git a/themes/sourcehut/address-object.html b/themes/sourcehut/address-object.html
index 4e4f2de..11db5e1 100644
--- a/themes/sourcehut/address-object.html
+++ b/themes/sourcehut/address-object.html
@@ -1,5 +1,5 @@
{{template "head.html"}}
-{{template "nav.html"}}
+{{template "nav.html" .Global}}
{{$fn := .AddressObject.Card.Value "FN"}}
diff --git a/themes/sourcehut/compose.html b/themes/sourcehut/compose.html
index 2433553..7538a36 100644
--- a/themes/sourcehut/compose.html
+++ b/themes/sourcehut/compose.html
@@ -1,5 +1,5 @@
{{template "head.html"}}
-{{template "nav.html"}}
+{{template "nav.html" .Global}}
<div class="container-fluid">
<div class="row">
diff --git a/themes/sourcehut/login.html b/themes/sourcehut/login.html
index 08074fe..63edfd8 100644
--- a/themes/sourcehut/login.html
+++ b/themes/sourcehut/login.html
@@ -1,12 +1,5 @@
{{template "head.html"}}
-<nav class="container navbar navbar-light navbar-expand-sm">
- <div class="col-md-12">
- <a class="navbar-brand" href="/">
- koushin
- <span class="text-danger">webmail</span>
- </a>
- </div>
-</nav>
+{{template "nav.html" .Global}}
<div class="container">
<form method="post" action="/login" class="col-md-6">
diff --git a/themes/sourcehut/mailbox.html b/themes/sourcehut/mailbox.html
index 313b89d..e360f25 100644
--- a/themes/sourcehut/mailbox.html
+++ b/themes/sourcehut/mailbox.html
@@ -1,5 +1,5 @@
{{template "head.html"}}
-{{template "nav.html"}}
+{{template "nav.html" .Global}}
<!-- TODO: Share tabs if reasonable -->
<div class="container-fluid">
diff --git a/themes/sourcehut/message.html b/themes/sourcehut/message.html
index 971b59f..4e1ab44 100644
--- a/themes/sourcehut/message.html
+++ b/themes/sourcehut/message.html
@@ -1,5 +1,5 @@
{{template "head.html"}}
-{{template "nav.html"}}
+{{template "nav.html" .Global}}
<div class="container-fluid">
<div class="row">
diff --git a/themes/sourcehut/nav.html b/themes/sourcehut/nav.html
index d41ccd8..972fc48 100644
--- a/themes/sourcehut/nav.html
+++ b/themes/sourcehut/nav.html
@@ -4,23 +4,26 @@
koushin
<span class="text-danger">mail</span>
</a>
- <ul class="navbar-nav mr-auto d-none d-sm-flex">
- <li class="nav-item active">
- <a href="/" class="nav-link">mail</a>
- </li>
- <!-- TODO: only show these links if plugins are loaded -->
- <li class="nav-item">
- <a href="/contacts" class="nav-link">contacts</a>
- </li>
- <li class="nav-item">
- <a href="/calendar" class="nav-link">calendar</a>
- </li>
- </ul>
- <div class="login">
- <span class="navbar-text">
- <a href="/settings">Settings</a>
- —
- <a href="/logout">Log out</a>
- </span>
- </div>
+ {{if .LoggedIn}}
+ <ul class="navbar-nav mr-auto d-none d-sm-flex">
+ <li class="nav-item active">
+ <a href="/" class="nav-link">mail</a>
+ </li>
+ <!-- TODO: only show these links if plugins are loaded -->
+ <li class="nav-item">
+ <a href="/contacts" class="nav-link">contacts</a>
+ </li>
+ <li class="nav-item">
+ <a href="/calendar" class="nav-link">calendar</a>
+ </li>
+ </ul>
+ <div class="login">
+ <span class="navbar-text">
+ Logged in as {{.Username}} —
+ <a href="/settings">Settings</a>
+ —
+ <a href="/logout">Log out</a>
+ </span>
+ </div>
+ {{end}}
</nav>
diff --git a/themes/sourcehut/settings.html b/themes/sourcehut/settings.html
index d52b100..292d5cc 100644
--- a/themes/sourcehut/settings.html
+++ b/themes/sourcehut/settings.html
@@ -1,5 +1,5 @@
{{template "head.html"}}
-{{template "nav.html"}}
+{{template "nav.html" .Global}}
<div class="container-fluid">
<div class="row">