diff options
Diffstat (limited to 'templates/navbar.qtpl')
-rw-r--r-- | templates/navbar.qtpl | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/templates/navbar.qtpl b/templates/navbar.qtpl new file mode 100644 index 0000000..26991a3 --- /dev/null +++ b/templates/navbar.qtpl @@ -0,0 +1,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-sm"> + <div class="navbar-nav"> + <a class="nav-link{%= insertIfEqual(s, Git) %}" href="/git">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 %} |