diff options
author | Gabriel A. Giovanini <mail@gabrielgio.me> | 2024-06-01 19:59:43 +0200 |
---|---|---|
committer | Gabriel A. Giovanini <mail@gabrielgio.me> | 2024-06-01 19:59:43 +0200 |
commit | e3705f35c642e578625ce4574d189fa0b0869403 (patch) | |
tree | f63d779d4eb817ad6b5abed30f50ad3b85ffcab1 /templates/navbar.qtpl | |
parent | f1643ffcbd543cacfe9ab5e46eafdd0c39cd47fd (diff) | |
download | cerrado-e3705f35c642e578625ce4574d189fa0b0869403.tar.gz cerrado-e3705f35c642e578625ce4574d189fa0b0869403.tar.bz2 cerrado-e3705f35c642e578625ce4574d189fa0b0869403.zip |
feat: Add ref support
Now log and tree can be loaded using a given reference.
Diffstat (limited to 'templates/navbar.qtpl')
-rw-r--r-- | templates/navbar.qtpl | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/templates/navbar.qtpl b/templates/navbar.qtpl index 8b0799d..775f496 100644 --- a/templates/navbar.qtpl +++ b/templates/navbar.qtpl @@ -32,22 +32,27 @@ const ( </nav> {% endfunc %} -{% func GitItemNav (name string, s GitSelection) %} +{% func GitItemNav (name, ref string, s GitSelection) %} +<div class="row"> + <h3>{%s name %} {% if ref != "" && (s == Log || s == Tree) %}@ {%s ref %}{% endif %}</h3> +</div> +<div class="row"> <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> + <a class="nav-link{%= insertIfEqual(s, Log) %}" aria-current="page" href="/{%s name %}/log/{%s ref %}">log</a> </li> <li class="nav-item"> - <a class="nav-link{%= insertIfEqual(s, Summary) %}" aria-current="page" href="/{%s name %}/summary">summary</a> + <a class="nav-link{%= insertIfEqual(s, Summary) %}" aria-current="page" href="/{%s name %}">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> + <a class="nav-link{%= insertIfEqual(s, Tree) %}" aria-current="page" href="/{%s name %}/tree/{%s ref %}">tree</a> </li> </ul> +</div> {% endfunc %} |