diff options
Diffstat (limited to 'templates/gititem.qtpl')
-rw-r--r-- | templates/gititem.qtpl | 44 |
1 files changed, 14 insertions, 30 deletions
diff --git a/templates/gititem.qtpl b/templates/gititem.qtpl index 156325f..4a6c49a 100644 --- a/templates/gititem.qtpl +++ b/templates/gititem.qtpl @@ -1,46 +1,30 @@ +{% interface +GitItemBase { + Nav(name string) + GitContent() +} +%} + {% code type GitItemPage struct { + Name string + GitItemBase } %} - -{% 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 %} - {% func (p *GitItemPage) Title() %}Git | List{% endfunc %} {% func (p *GitItemPage) Navbar() %}{%= Navbar(Git) %}{% endfunc %} {% func (p *GitItemPage) Content() %} <div class="row"> - <h3>AoC2022.git</h3> + <h3>{%s p.Name %}</h3> +</div> +<div class="row"> +{%= p.Nav(p.Name) %} </div> <div class="row"> - <ul class="nav"> - <li class="nav-item"> - <a class="nav-link" aria-current="page" href="#">about</a> - </li> - <li class="nav-item"> - <a class="nav-link" aria-current="page" href="#">summary</a> - </li> - <li class="nav-item"> - <a class="nav-link" aria-current="page" href="#">refs</a> - </li> - <li class="nav-item"> - <a class="nav-link" aria-current="page" href="#">tree</a> - </li> - </ul> +{%= p.GitContent() %} </div> {% endfunc %} |