aboutsummaryrefslogtreecommitdiff
path: root/templates/navbar.qtpl
blob: 636c619eaafe24b6bb4ce5bc975a7ad37627ff8c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
{% code
type Selection int
const (
    Git Selection = iota
    List
    About
    Config
)
%}

{% func insertIfEqual(s, d Selection) %}{% if s == d %} selected{% endif %}{% endfunc %}


{% func Navbar (s Selection) %}
        <nav class="container navbar navbar-expand">
          <div class="navbar-nav">
            <a class="nav-link{%= insertIfEqual(s, Git) %}" href="/">git</a>
            <a class="nav-link{%= insertIfEqual(s, List) %}" href="/list">list</a>
            <a class="nav-link{%= insertIfEqual(s, About) %}" href="/about">about</a>
            <a class="nav-link{%= insertIfEqual(s, Config) %}" href="/config">config</a>
          </div>
        </nav>
{% endfunc %}