aboutsummaryrefslogtreecommitdiff
path: root/templates/gititem.qtpl
diff options
context:
space:
mode:
authorGabriel A. Giovanini <mail@gabrielgio.me>2024-05-30 18:08:12 +0200
committerGabriel A. Giovanini <mail@gabrielgio.me>2024-05-30 18:08:12 +0200
commit8f5f9ff24b0327f7640e3619de109e1f19cfba1d (patch)
tree693e669355c00ed2445da34f4032bfd60abdbbe8 /templates/gititem.qtpl
parentfb45f1f5002ffdb40150333c5a48458b801f3022 (diff)
downloadcerrado-8f5f9ff24b0327f7640e3619de109e1f19cfba1d.tar.gz
cerrado-8f5f9ff24b0327f7640e3619de109e1f19cfba1d.tar.bz2
cerrado-8f5f9ff24b0327f7640e3619de109e1f19cfba1d.zip
feat: Add git sub page
Diffstat (limited to 'templates/gititem.qtpl')
-rw-r--r--templates/gititem.qtpl44
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 %}