~bigbes/sr-ht-dolt

ref: 4520d5cf9385a3a7c18037e0c3dba95ad1874b35 sr-ht-dolt/web/templates/nav.html -rw-r--r-- 843 bytes
4520d5cf — Eugene Blikh feat(web): pluggable alternative-view registry for repositories a month ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
{{define "nav" -}}
<span class="navbar-brand">
  {{icon "circle"}}
  <a class="navbar-brand" href="/">
    {{.SiteName}}
    <span class="text-danger">{{.SiteLabel}}</span>
  </a>
</span>
<ul class="navbar-nav">
  {{if .CurrentUser}}
  {{range .Network}}
  {{if ne .Site "hub.sr.ht"}}
  <li class="nav-item {{if .Active}}active{{end}}">
    <a class="nav-link" href="{{.Origin}}">{{.Name}}</a>
  </li>
  {{end}}
  {{end}}
  {{end}}
</ul>
<div class="login">
  {{if .CurrentUser}}
  <span class="navbar-text">
    Logged in as
    <a href="{{.MetaOrigin}}/profile">{{.CurrentUser.Username}}</a>
    &mdash;
    <a href="{{.LogoutURL}}">Log out</a>
  </span>
  {{else}}
  <span class="navbar-text">
    <a href="{{.LoginURL}}" rel="nofollow">Log in</a>
    &mdash;
    <a href="{{.MetaOrigin}}">Register</a>
  </span>
  {{end}}
</div>
{{- end}}