diff options
author | Gabriel A. Giovanini <mail@gabrielgio.me> | 2024-05-30 18:08:12 +0200 |
---|---|---|
committer | Gabriel A. Giovanini <mail@gabrielgio.me> | 2024-05-30 18:08:12 +0200 |
commit | 8f5f9ff24b0327f7640e3619de109e1f19cfba1d (patch) | |
tree | 693e669355c00ed2445da34f4032bfd60abdbbe8 /templates/navbar.qtpl | |
parent | fb45f1f5002ffdb40150333c5a48458b801f3022 (diff) | |
download | cerrado-8f5f9ff24b0327f7640e3619de109e1f19cfba1d.tar.gz cerrado-8f5f9ff24b0327f7640e3619de109e1f19cfba1d.tar.bz2 cerrado-8f5f9ff24b0327f7640e3619de109e1f19cfba1d.zip |
feat: Add git sub page
Diffstat (limited to 'templates/navbar.qtpl')
-rw-r--r-- | templates/navbar.qtpl | 32 |
1 files changed, 31 insertions, 1 deletions
diff --git a/templates/navbar.qtpl b/templates/navbar.qtpl index 636c619..8b0799d 100644 --- a/templates/navbar.qtpl +++ b/templates/navbar.qtpl @@ -8,8 +8,18 @@ const ( ) %} -{% func insertIfEqual(s, d Selection) %}{% if s == d %} selected{% endif %}{% endfunc %} +{% code +type GitSelection int +const ( + Readme GitSelection = iota + Log + Summary + Refs + Tree +) +%} +{% func insertIfEqual(s, d any) %}{% if s == d %} selected{% endif %}{% endfunc %} {% func Navbar (s Selection) %} <nav class="container navbar navbar-expand"> @@ -21,3 +31,23 @@ const ( </div> </nav> {% endfunc %} + +{% func GitItemNav (name string, s GitSelection) %} + <ul class="nav"> + <li class="nav-item"> + <a class="nav-link{%= insertIfEqual(s, Readme) %}" aria-current="page" href="/{%s name %}/about">about</a> + </li> + <li class="nav-item"> + <a class="nav-link{%= insertIfEqual(s, Log) %}" aria-current="page" href="/{%s name %}/log">log</a> + </li> + <li class="nav-item"> + <a class="nav-link{%= insertIfEqual(s, Summary) %}" aria-current="page" href="/{%s name %}/summary">summary</a> + </li> + <li class="nav-item"> + <a class="nav-link{%= insertIfEqual(s, Refs) %}" aria-current="page" href="/{%s name %}/refs">refs</a> + </li> + <li class="nav-item"> + <a class="nav-link{%= insertIfEqual(s, Tree) %}" aria-current="page" href="/{%s name %}/tree">tree</a> + </li> + </ul> +{% endfunc %} |