aboutsummaryrefslogtreecommitdiff
path: root/templates/navbar.qtpl
diff options
context:
space:
mode:
authorGabriel A. Giovanini <mail@gabrielgio.me>2024-05-30 15:06:28 +0200
committerGabriel A. Giovanini <mail@gabrielgio.me>2024-05-30 15:06:28 +0200
commit242ba7f412d4e54f21385afff3f2b884f57f6ced (patch)
tree574b05ad544b0473f53a66d474591751989add94 /templates/navbar.qtpl
parent2dd4cf35aab8324608a83d337459fd8354521b92 (diff)
downloadcerrado-242ba7f412d4e54f21385afff3f2b884f57f6ced.tar.gz
cerrado-242ba7f412d4e54f21385afff3f2b884f57f6ced.tar.bz2
cerrado-242ba7f412d4e54f21385afff3f2b884f57f6ced.zip
feat: Add navbar selection
Diffstat (limited to 'templates/navbar.qtpl')
-rw-r--r--templates/navbar.qtpl23
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 %}