diff options
Diffstat (limited to 'internal/web/templates/partials/dashnav.html')
| -rw-r--r-- | internal/web/templates/partials/dashnav.html | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/internal/web/templates/partials/dashnav.html b/internal/web/templates/partials/dashnav.html index 13a04d0..44e518e 100644 --- a/internal/web/templates/partials/dashnav.html +++ b/internal/web/templates/partials/dashnav.html @@ -4,23 +4,26 @@ {{if .User}} <span class="who">{{.User.Username}}{{if .User.IsSuperadmin}} (superadmin){{end}}</span> <span class="links"> - {{if .User.IsSuperadmin}}<a href="/admin/">Admin</a>{{end}} - <a href="/account/password">Password</a> + {{if .User.IsSuperadmin}}<a href="/admin/"{{if hasPrefix .Path "/admin/"}} class="active"{{end}}>Admin</a>{{end}} + <a href="/account/password"{{if eq .Path "/account/password"}} class="active"{{end}}>Password</a> <form method="post" action="/logout" class="inline"><input type="hidden" name="_csrf" value="{{.CSRF}}"><button type="submit" class="linkbtn">Log out</button></form> </span> {{end}} </div> </div> {{if .Blog}} +{{$b := printf "/b/%s/" .Blog.Subdomain}} <div class="blogbar"> <div class="topbar-inner"> <strong class="blogname">{{.Blog.Title}}</strong> - <a href="/b/{{.Blog.Subdomain}}/">Overview</a> - <a href="/b/{{.Blog.Subdomain}}/posts">Posts</a> - <a href="/b/{{.Blog.Subdomain}}/pages">Pages</a> - <a href="/b/{{.Blog.Subdomain}}/design">Design</a> - <a href="/b/{{.Blog.Subdomain}}/images">Images</a> - <a href="/b/{{.Blog.Subdomain}}/settings">Settings</a> + <span class="tabs"> + <a href="{{$b}}"{{if eq .Path $b}} class="active"{{end}}>Overview</a> + <a href="{{$b}}posts"{{if hasPrefix .Path (print $b "posts")}} class="active"{{end}}>Posts</a> + <a href="{{$b}}pages"{{if hasPrefix .Path (print $b "pages")}} class="active"{{end}}>Pages</a> + <a href="{{$b}}design"{{if hasPrefix .Path (print $b "design")}} class="active"{{end}}>Design</a> + <a href="{{$b}}images"{{if hasPrefix .Path (print $b "images")}} class="active"{{end}}>Images</a> + <a href="{{$b}}settings"{{if hasPrefix .Path (print $b "settings")}} class="active"{{end}}>Settings</a> + </span> <a class="view" href="{{.BlogURL}}" target="_blank">View blog ↗</a> </div> </div> |
