aboutsummaryrefslogtreecommitdiff
path: root/templates
diff options
context:
space:
mode:
authorGabriel A. Giovanini <mail@gabrielgio.me>2024-06-07 14:02:25 +0200
committerGabriel A. Giovanini <mail@gabrielgio.me>2024-06-07 14:02:25 +0200
commit18aa098f50e2a2c7db01dd4d04dde460fd40f5d5 (patch)
tree5e3b3d3ba3206f2765db1a23a378275852154a51 /templates
parentd0e0c1eb99303e1000140d4b98c610077278dc42 (diff)
downloadcerrado-18aa098f50e2a2c7db01dd4d04dde460fd40f5d5.tar.gz
cerrado-18aa098f50e2a2c7db01dd4d04dde460fd40f5d5.tar.bz2
cerrado-18aa098f50e2a2c7db01dd4d04dde460fd40f5d5.zip
feat: Add blob endpoint
Diffstat (limited to 'templates')
-rw-r--r--templates/base.qtpl5
-rw-r--r--templates/base.qtpl.go145
-rw-r--r--templates/gititemblob.qtpl14
-rw-r--r--templates/gititemblob.qtpl.go98
-rw-r--r--templates/gititemtree.qtpl20
-rw-r--r--templates/gititemtree.qtpl.go145
-rw-r--r--templates/navbar.qtpl3
-rw-r--r--templates/navbar.qtpl.go134
8 files changed, 392 insertions, 172 deletions
diff --git a/templates/base.qtpl b/templates/base.qtpl
index 16b8780..180b1ab 100644
--- a/templates/base.qtpl
+++ b/templates/base.qtpl
@@ -30,6 +30,11 @@ Page {
}
%}
+{% code func Ignore[T any](v T, _ error) T {
+ return v
+ }
+%}
+
Page prints a page implementing Page interface.
{% func PageTemplate(p Page) %}
<html lang="en">
diff --git a/templates/base.qtpl.go b/templates/base.qtpl.go
index 6d4d0a0..c5570c8 100644
--- a/templates/base.qtpl.go
+++ b/templates/base.qtpl.go
@@ -71,174 +71,179 @@ func TimeFormat(t time.Time) string {
return t.Format("2006-01-02")
}
+//line base.qtpl:33
+func Ignore[T any](v T, _ error) T {
+ return v
+}
+
// Page prints a page implementing Page interface.
-//line base.qtpl:34
+//line base.qtpl:39
func StreamPageTemplate(qw422016 *qt422016.Writer, p Page) {
-//line base.qtpl:34
+//line base.qtpl:39
qw422016.N().S(`
<html lang="en">
<head>
<meta charset="utf-8">
<link rel="icon" href="data:,">
<title>cerrado | `)
-//line base.qtpl:39
+//line base.qtpl:44
p.StreamTitle(qw422016)
-//line base.qtpl:39
+//line base.qtpl:44
qw422016.N().S(`</title>
<link rel="stylesheet" href="/static/main`)
-//line base.qtpl:40
+//line base.qtpl:45
qw422016.E().S(Slug)
-//line base.qtpl:40
+//line base.qtpl:45
qw422016.N().S(`.css">
<meta name="viewport" content="width=device-width, initial-scale=1" />
</head>
<body>
`)
-//line base.qtpl:44
+//line base.qtpl:49
p.StreamNavbar(qw422016)
-//line base.qtpl:44
+//line base.qtpl:49
qw422016.N().S(`
<div class="container">
`)
-//line base.qtpl:46
+//line base.qtpl:51
p.StreamContent(qw422016)
-//line base.qtpl:46
+//line base.qtpl:51
qw422016.N().S(`
</div>
</body>
`)
-//line base.qtpl:49
+//line base.qtpl:54
p.StreamScript(qw422016)
-//line base.qtpl:49
+//line base.qtpl:54
qw422016.N().S(`
</html>
`)
-//line base.qtpl:51
+//line base.qtpl:56
}
-//line base.qtpl:51
+//line base.qtpl:56
func WritePageTemplate(qq422016 qtio422016.Writer, p Page) {
-//line base.qtpl:51
+//line base.qtpl:56
qw422016 := qt422016.AcquireWriter(qq422016)
-//line base.qtpl:51
+//line base.qtpl:56
StreamPageTemplate(qw422016, p)
-//line base.qtpl:51
+//line base.qtpl:56
qt422016.ReleaseWriter(qw422016)
-//line base.qtpl:51
+//line base.qtpl:56
}
-//line base.qtpl:51
+//line base.qtpl:56
func PageTemplate(p Page) string {
-//line base.qtpl:51
+//line base.qtpl:56
qb422016 := qt422016.AcquireByteBuffer()
-//line base.qtpl:51
+//line base.qtpl:56
WritePageTemplate(qb422016, p)
-//line base.qtpl:51
+//line base.qtpl:56
qs422016 := string(qb422016.B)
-//line base.qtpl:51
+//line base.qtpl:56
qt422016.ReleaseByteBuffer(qb422016)
-//line base.qtpl:51
+//line base.qtpl:56
return qs422016
-//line base.qtpl:51
+//line base.qtpl:56
}
-//line base.qtpl:53
+//line base.qtpl:58
type BasePage struct{}
-//line base.qtpl:54
+//line base.qtpl:59
func (p *BasePage) StreamTitle(qw422016 *qt422016.Writer) {
-//line base.qtpl:54
+//line base.qtpl:59
qw422016.N().S(`Empty`)
-//line base.qtpl:54
+//line base.qtpl:59
}
-//line base.qtpl:54
+//line base.qtpl:59
func (p *BasePage) WriteTitle(qq422016 qtio422016.Writer) {
-//line base.qtpl:54
+//line base.qtpl:59
qw422016 := qt422016.AcquireWriter(qq422016)
-//line base.qtpl:54
+//line base.qtpl:59
p.StreamTitle(qw422016)
-//line base.qtpl:54
+//line base.qtpl:59
qt422016.ReleaseWriter(qw422016)
-//line base.qtpl:54
+//line base.qtpl:59
}
-//line base.qtpl:54
+//line base.qtpl:59
func (p *BasePage) Title() string {
-//line base.qtpl:54
+//line base.qtpl:59
qb422016 := qt422016.AcquireByteBuffer()
-//line base.qtpl:54
+//line base.qtpl:59
p.WriteTitle(qb422016)
-//line base.qtpl:54
+//line base.qtpl:59
qs422016 := string(qb422016.B)
-//line base.qtpl:54
+//line base.qtpl:59
qt422016.ReleaseByteBuffer(qb422016)
-//line base.qtpl:54
+//line base.qtpl:59
return qs422016
-//line base.qtpl:54
+//line base.qtpl:59
}
-//line base.qtpl:55
+//line base.qtpl:60
func (p *BasePage) StreamBody(qw422016 *qt422016.Writer) {
-//line base.qtpl:55
+//line base.qtpl:60
qw422016.N().S(`HelloWorld`)
-//line base.qtpl:55
+//line base.qtpl:60
}
-//line base.qtpl:55
+//line base.qtpl:60
func (p *BasePage) WriteBody(qq422016 qtio422016.Writer) {
-//line base.qtpl:55
+//line base.qtpl:60
qw422016 := qt422016.AcquireWriter(qq422016)
-//line base.qtpl:55
+//line base.qtpl:60
p.StreamBody(qw422016)
-//line base.qtpl:55
+//line base.qtpl:60
qt422016.ReleaseWriter(qw422016)
-//line base.qtpl:55
+//line base.qtpl:60
}
-//line base.qtpl:55
+//line base.qtpl:60
func (p *BasePage) Body() string {
-//line base.qtpl:55
+//line base.qtpl:60
qb422016 := qt422016.AcquireByteBuffer()
-//line base.qtpl:55
+//line base.qtpl:60
p.WriteBody(qb422016)
-//line base.qtpl:55
+//line base.qtpl:60
qs422016 := string(qb422016.B)
-//line base.qtpl:55
+//line base.qtpl:60
qt422016.ReleaseByteBuffer(qb422016)
-//line base.qtpl:55
+//line base.qtpl:60
return qs422016
-//line base.qtpl:55
+//line base.qtpl:60
}
-//line base.qtpl:56
+//line base.qtpl:61
func (p *BasePage) StreamScript(qw422016 *qt422016.Writer) {
-//line base.qtpl:56
+//line base.qtpl:61
}
-//line base.qtpl:56
+//line base.qtpl:61
func (p *BasePage) WriteScript(qq422016 qtio422016.Writer) {
-//line base.qtpl:56
+//line base.qtpl:61
qw422016 := qt422016.AcquireWriter(qq422016)
-//line base.qtpl:56
+//line base.qtpl:61
p.StreamScript(qw422016)
-//line base.qtpl:56
+//line base.qtpl:61
qt422016.ReleaseWriter(qw422016)
-//line base.qtpl:56
+//line base.qtpl:61
}
-//line base.qtpl:56
+//line base.qtpl:61
func (p *BasePage) Script() string {
-//line base.qtpl:56
+//line base.qtpl:61
qb422016 := qt422016.AcquireByteBuffer()
-//line base.qtpl:56
+//line base.qtpl:61
p.WriteScript(qb422016)
-//line base.qtpl:56
+//line base.qtpl:61
qs422016 := string(qb422016.B)
-//line base.qtpl:56
+//line base.qtpl:61
qt422016.ReleaseByteBuffer(qb422016)
-//line base.qtpl:56
+//line base.qtpl:61
return qs422016
-//line base.qtpl:56
+//line base.qtpl:61
}
diff --git a/templates/gititemblob.qtpl b/templates/gititemblob.qtpl
new file mode 100644
index 0000000..89d002d
--- /dev/null
+++ b/templates/gititemblob.qtpl
@@ -0,0 +1,14 @@
+{% code
+type GitItemBlobPage struct {
+ File string
+ Content []byte
+}
+%}
+
+{% func (g *GitItemBlobPage) Nav(name, ref string) %}{%= GitItemNav(name, ref, Tree) %}{% endfunc %}
+
+{% func (g *GitItemBlobPage) GitContent() %}
+<div class="code-view">
+{%z= g.Content %}
+</div>
+{% endfunc %}
diff --git a/templates/gititemblob.qtpl.go b/templates/gititemblob.qtpl.go
new file mode 100644
index 0000000..6b4e187
--- /dev/null
+++ b/templates/gititemblob.qtpl.go
@@ -0,0 +1,98 @@
+// Code generated by qtc from "gititemblob.qtpl". DO NOT EDIT.
+// See https://github.com/valyala/quicktemplate for details.
+
+//line gititemblob.qtpl:1
+package templates
+
+//line gititemblob.qtpl:1
+import (
+ qtio422016 "io"
+
+ qt422016 "github.com/valyala/quicktemplate"
+)
+
+//line gititemblob.qtpl:1
+var (
+ _ = qtio422016.Copy
+ _ = qt422016.AcquireByteBuffer
+)
+
+//line gititemblob.qtpl:2
+type GitItemBlobPage struct {
+ File string
+ Content []byte
+}
+
+//line gititemblob.qtpl:8
+func (g *GitItemBlobPage) StreamNav(qw422016 *qt422016.Writer, name, ref string) {
+//line gititemblob.qtpl:8
+ StreamGitItemNav(qw422016, name, ref, Tree)
+//line gititemblob.qtpl:8
+}
+
+//line gititemblob.qtpl:8
+func (g *GitItemBlobPage) WriteNav(qq422016 qtio422016.Writer, name, ref string) {
+//line gititemblob.qtpl:8
+ qw422016 := qt422016.AcquireWriter(qq422016)
+//line gititemblob.qtpl:8
+ g.StreamNav(qw422016, name, ref)
+//line gititemblob.qtpl:8
+ qt422016.ReleaseWriter(qw422016)
+//line gititemblob.qtpl:8
+}
+
+//line gititemblob.qtpl:8
+func (g *GitItemBlobPage) Nav(name, ref string) string {
+//line gititemblob.qtpl:8
+ qb422016 := qt422016.AcquireByteBuffer()
+//line gititemblob.qtpl:8
+ g.WriteNav(qb422016, name, ref)
+//line gititemblob.qtpl:8
+ qs422016 := string(qb422016.B)
+//line gititemblob.qtpl:8
+ qt422016.ReleaseByteBuffer(qb422016)
+//line gititemblob.qtpl:8
+ return qs422016
+//line gititemblob.qtpl:8
+}
+
+//line gititemblob.qtpl:10
+func (g *GitItemBlobPage) StreamGitContent(qw422016 *qt422016.Writer) {
+//line gititemblob.qtpl:10
+ qw422016.N().S(`
+<div class="code-view">
+`)
+//line gititemblob.qtpl:12
+ qw422016.N().Z(g.Content)
+//line gititemblob.qtpl:12
+ qw422016.N().S(`
+</div>
+`)
+//line gititemblob.qtpl:14
+}
+
+//line gititemblob.qtpl:14
+func (g *GitItemBlobPage) WriteGitContent(qq422016 qtio422016.Writer) {
+//line gititemblob.qtpl:14
+ qw422016 := qt422016.AcquireWriter(qq422016)
+//line gititemblob.qtpl:14
+ g.StreamGitContent(qw422016)
+//line gititemblob.qtpl:14
+ qt422016.ReleaseWriter(qw422016)
+//line gititemblob.qtpl:14
+}
+
+//line gititemblob.qtpl:14
+func (g *GitItemBlobPage) GitContent() string {
+//line gititemblob.qtpl:14
+ qb422016 := qt422016.AcquireByteBuffer()
+//line gititemblob.qtpl:14
+ g.WriteGitContent(qb422016)
+//line gititemblob.qtpl:14
+ qs422016 := string(qb422016.B)
+//line gititemblob.qtpl:14
+ qt422016.ReleaseByteBuffer(qb422016)
+//line gititemblob.qtpl:14
+ return qs422016
+//line gititemblob.qtpl:14
+}
diff --git a/templates/gititemtree.qtpl b/templates/gititemtree.qtpl
index 5ace7b0..be7a27d 100644
--- a/templates/gititemtree.qtpl
+++ b/templates/gititemtree.qtpl
@@ -1,10 +1,28 @@
+{% import "github.com/go-git/go-git/v5/plumbing/object" %}
+
{% code
type GitItemTreePage struct {
+ CurrentPath string
+ Tree *object.Tree
+
+ // TODO: remove this since it can be passed by GitCommit
+ Ref string
+ Name string
}
%}
{% func (g *GitItemTreePage) Nav(name, ref string) %}{%= GitItemNav(name, ref, Tree) %}{% endfunc %}
{% func (g *GitItemTreePage) GitContent() %}
-<h4>Tree</h4>
+{% for _, e := range g.Tree.Entries %}
+<div class="row">
+ <div class="col">{%s Ignore(e.Mode.ToOSFileMode()).String() %}</div>
+ {% if e.Mode.IsFile() %}
+ <div class="col-md"><a href="/{%s g.Name %}/blob/{%s g.Ref%}/{%s g.CurrentPath %}/{%s e.Name %}">{%s e.Name %}</a></div>
+ {% else %}
+ <div class="col-md"><a href="./{%s g.CurrentPath %}/{%s e.Name %}">{%s e.Name %}</a></div>
+ {% endif %}
+ <div class="col-md">{%dl Ignore(g.Tree.Size(e.Name))%} KiB</div>
+</div>
+{% endfor %}
{% endfunc %}
diff --git a/templates/gititemtree.qtpl.go b/templates/gititemtree.qtpl.go
index d8beb0e..cdc374f 100644
--- a/templates/gititemtree.qtpl.go
+++ b/templates/gititemtree.qtpl.go
@@ -5,86 +5,165 @@
package templates
//line gititemtree.qtpl:1
+import "github.com/go-git/go-git/v5/plumbing/object"
+
+//line gititemtree.qtpl:3
import (
qtio422016 "io"
qt422016 "github.com/valyala/quicktemplate"
)
-//line gititemtree.qtpl:1
+//line gititemtree.qtpl:3
var (
_ = qtio422016.Copy
_ = qt422016.AcquireByteBuffer
)
-//line gititemtree.qtpl:2
+//line gititemtree.qtpl:4
type GitItemTreePage struct {
+ CurrentPath string
+ Tree *object.Tree
+
+ // TODO: remove this since it can be passed by GitCommit
+ Ref string
+ Name string
}
-//line gititemtree.qtpl:6
+//line gititemtree.qtpl:14
func (g *GitItemTreePage) StreamNav(qw422016 *qt422016.Writer, name, ref string) {
-//line gititemtree.qtpl:6
+//line gititemtree.qtpl:14
StreamGitItemNav(qw422016, name, ref, Tree)
-//line gititemtree.qtpl:6
+//line gititemtree.qtpl:14
}
-//line gititemtree.qtpl:6
+//line gititemtree.qtpl:14
func (g *GitItemTreePage) WriteNav(qq422016 qtio422016.Writer, name, ref string) {
-//line gititemtree.qtpl:6
+//line gititemtree.qtpl:14
qw422016 := qt422016.AcquireWriter(qq422016)
-//line gititemtree.qtpl:6
+//line gititemtree.qtpl:14
g.StreamNav(qw422016, name, ref)
-//line gititemtree.qtpl:6
+//line gititemtree.qtpl:14
qt422016.ReleaseWriter(qw422016)
-//line gititemtree.qtpl:6
+//line gititemtree.qtpl:14
}
-//line gititemtree.qtpl:6
+//line gititemtree.qtpl:14
func (g *GitItemTreePage) Nav(name, ref string) string {
-//line gititemtree.qtpl:6
+//line gititemtree.qtpl:14
qb422016 := qt422016.AcquireByteBuffer()
-//line gititemtree.qtpl:6
+//line gititemtree.qtpl:14
g.WriteNav(qb422016, name, ref)
-//line gititemtree.qtpl:6
+//line gititemtree.qtpl:14
qs422016 := string(qb422016.B)
-//line gititemtree.qtpl:6
+//line gititemtree.qtpl:14
qt422016.ReleaseByteBuffer(qb422016)
-//line gititemtree.qtpl:6
+//line gititemtree.qtpl:14
return qs422016
-//line gititemtree.qtpl:6
+//line gititemtree.qtpl:14
}
-//line gititemtree.qtpl:8
+//line gititemtree.qtpl:16
func (g *GitItemTreePage) StreamGitContent(qw422016 *qt422016.Writer) {
-//line gititemtree.qtpl:8
+//line gititemtree.qtpl:16
+ qw422016.N().S(`
+`)
+//line gititemtree.qtpl:17
+ for _, e := range g.Tree.Entries {
+//line gititemtree.qtpl:17
+ qw422016.N().S(`
+<div class="row">
+ <div class="col">`)
+//line gititemtree.qtpl:19
+ qw422016.E().S(Ignore(e.Mode.ToOSFileMode()).String())
+//line gititemtree.qtpl:19
+ qw422016.N().S(`</div>
+ `)
+//line gititemtree.qtpl:20
+ if e.Mode.IsFile() {
+//line gititemtree.qtpl:20
+ qw422016.N().S(`
+ <div class="col-md"><a href="/`)
+//line gititemtree.qtpl:21
+ qw422016.E().S(g.Name)
+//line gititemtree.qtpl:21
+ qw422016.N().S(`/blob/`)
+//line gititemtree.qtpl:21
+ qw422016.E().S(g.Ref)
+//line gititemtree.qtpl:21
+ qw422016.N().S(`/`)
+//line gititemtree.qtpl:21
+ qw422016.E().S(g.CurrentPath)
+//line gititemtree.qtpl:21
+ qw422016.N().S(`/`)
+//line gititemtree.qtpl:21
+ qw422016.E().S(e.Name)
+//line gititemtree.qtpl:21
+ qw422016.N().S(`">`)
+//line gititemtree.qtpl:21
+ qw422016.E().S(e.Name)
+//line gititemtree.qtpl:21
+ qw422016.N().S(`</a></div>
+ `)
+//line gititemtree.qtpl:22
+ } else {
+//line gititemtree.qtpl:22
+ qw422016.N().S(`
+ <div class="col-md"><a href="./`)
+//line gititemtree.qtpl:23
+ qw422016.E().S(g.CurrentPath)
+//line gititemtree.qtpl:23
+ qw422016.N().S(`/`)
+//line gititemtree.qtpl:23
+ qw422016.E().S(e.Name)
+//line gititemtree.qtpl:23
+ qw422016.N().S(`">`)
+//line gititemtree.qtpl:23
+ qw422016.E().S(e.Name)
+//line gititemtree.qtpl:23
+ qw422016.N().S(`</a></div>
+ `)
+//line gititemtree.qtpl:24
+ }
+//line gititemtree.qtpl:24
+ qw422016.N().S(`
+ <div class="col-md">`)
+//line gititemtree.qtpl:25
+ qw422016.N().DL(Ignore(g.Tree.Size(e.Name)))
+//line gititemtree.qtpl:25
+ qw422016.N().S(` KiB</div>
+</div>
+`)
+//line gititemtree.qtpl:27
+ }
+//line gititemtree.qtpl:27
qw422016.N().S(`
-<h4>Tree</h4>
`)
-//line gititemtree.qtpl:10
+//line gititemtree.qtpl:28
}
-//line gititemtree.qtpl:10
+//line gititemtree.qtpl:28
func (g *GitItemTreePage) WriteGitContent(qq422016 qtio422016.Writer) {
-//line gititemtree.qtpl:10
+//line gititemtree.qtpl:28
qw422016 := qt422016.AcquireWriter(qq422016)
-//line gititemtree.qtpl:10
+//line gititemtree.qtpl:28
g.StreamGitContent(qw422016)
-//line gititemtree.qtpl:10
+//line gititemtree.qtpl:28
qt422016.ReleaseWriter(qw422016)
-//line gititemtree.qtpl:10
+//line gititemtree.qtpl:28
}
-//line gititemtree.qtpl:10
+//line gititemtree.qtpl:28
func (g *GitItemTreePage) GitContent() string {
-//line gititemtree.qtpl:10
+//line gititemtree.qtpl:28
qb422016 := qt422016.AcquireByteBuffer()
-//line gititemtree.qtpl:10
+//line gititemtree.qtpl:28
g.WriteGitContent(qb422016)
-//line gititemtree.qtpl:10
+//line gititemtree.qtpl:28
qs422016 := string(qb422016.B)
-//line gititemtree.qtpl:10
+//line gititemtree.qtpl:28
qt422016.ReleaseByteBuffer(qb422016)
-//line gititemtree.qtpl:10
+//line gititemtree.qtpl:28
return qs422016
-//line gititemtree.qtpl:10
+//line gititemtree.qtpl:28
}
diff --git a/templates/navbar.qtpl b/templates/navbar.qtpl
index 775f496..9681fa4 100644
--- a/templates/navbar.qtpl
+++ b/templates/navbar.qtpl
@@ -25,7 +25,10 @@ const (
<nav class="container navbar navbar-expand">
<div class="navbar-nav">
<a class="nav-link{%= insertIfEqual(s, Git) %}" href="/">git</a>
+{% comment %}
+Add this back once needed
<a class="nav-link{%= insertIfEqual(s, List) %}" href="/list">list</a>
+{% endcomment %}
<a class="nav-link{%= insertIfEqual(s, About) %}" href="/about">about</a>
<a class="nav-link{%= insertIfEqual(s, Config) %}" href="/config">config</a>
</div>
diff --git a/templates/navbar.qtpl.go b/templates/navbar.qtpl.go
index cddc6a6..a2989db 100644
--- a/templates/navbar.qtpl.go
+++ b/templates/navbar.qtpl.go
@@ -86,167 +86,165 @@ func StreamNavbar(qw422016 *qt422016.Writer, s Selection) {
streaminsertIfEqual(qw422016, s, Git)
//line navbar.qtpl:27
qw422016.N().S(`" href="/">git</a>
+`)
+//line navbar.qtpl:31
+ qw422016.N().S(`
<a class="nav-link`)
-//line navbar.qtpl:28
- streaminsertIfEqual(qw422016, s, List)
-//line navbar.qtpl:28
- qw422016.N().S(`" href="/list">list</a>
- <a class="nav-link`)
-//line navbar.qtpl:29
+//line navbar.qtpl:32
streaminsertIfEqual(qw422016, s, About)
-//line navbar.qtpl:29
+//line navbar.qtpl:32
qw422016.N().S(`" href="/about">about</a>
<a class="nav-link`)
-//line navbar.qtpl:30
+//line navbar.qtpl:33
streaminsertIfEqual(qw422016, s, Config)
-//line navbar.qtpl:30
+//line navbar.qtpl:33
qw422016.N().S(`" href="/config">config</a>
</div>
</nav>
`)
-//line navbar.qtpl:33
+//line navbar.qtpl:36
}
-//line navbar.qtpl:33
+//line navbar.qtpl:36
func WriteNavbar(qq422016 qtio422016.Writer, s Selection) {
-//line navbar.qtpl:33
+//line navbar.qtpl:36
qw422016 := qt422016.AcquireWriter(qq422016)
-//line navbar.qtpl:33
+//line navbar.qtpl:36
StreamNavbar(qw422016, s)
-//line navbar.qtpl:33
+//line navbar.qtpl:36
qt422016.ReleaseWriter(qw422016)
-//line navbar.qtpl:33
+//line navbar.qtpl:36
}
-//line navbar.qtpl:33
+//line navbar.qtpl:36
func Navbar(s Selection) string {
-//line navbar.qtpl:33
+//line navbar.qtpl:36
qb422016 := qt422016.AcquireByteBuffer()
-//line navbar.qtpl:33
+//line navbar.qtpl:36
WriteNavbar(qb422016, s)
-//line navbar.qtpl:33
+//line navbar.qtpl:36
qs422016 := string(qb422016.B)
-//line navbar.qtpl:33
+//line navbar.qtpl:36
qt422016.ReleaseByteBuffer(qb422016)
-//line navbar.qtpl:33
+//line navbar.qtpl:36
return qs422016
-//line navbar.qtpl:33
+//line navbar.qtpl:36
}
-//line navbar.qtpl:35
+//line navbar.qtpl:38
func StreamGitItemNav(qw422016 *qt422016.Writer, name, ref string, s GitSelection) {
-//line navbar.qtpl:35
+//line navbar.qtpl:38
qw422016.N().S(`
<div class="row">
<h3>`)
-//line navbar.qtpl:37
+//line navbar.qtpl:40
qw422016.E().S(name)
-//line navbar.qtpl:37
+//line navbar.qtpl:40
qw422016.N().S(` `)
-//line navbar.qtpl:37
+//line navbar.qtpl:40
if ref != "" && (s == Log || s == Tree) {
-//line navbar.qtpl:37
+//line navbar.qtpl:40
qw422016.N().S(`@ `)
-//line navbar.qtpl:37
+//line navbar.qtpl:40
qw422016.E().S(ref)
-//line navbar.qtpl:37
+//line navbar.qtpl:40
}
-//line navbar.qtpl:37
+//line navbar.qtpl:40
qw422016.N().S(`</h3>
</div>
<div class="row">
<ul class="nav">
<li class="nav-item">
<a class="nav-link`)
-//line navbar.qtpl:42
- streaminsertIfEqual(qw422016, s, Readme)
-//line navbar.qtpl:42
- qw422016.N().S(`" aria-current="page" href="/`)
-//line navbar.qtpl:42
- qw422016.E().S(name)
-//line navbar.qtpl:42
- qw422016.N().S(`/about">about</a>
- </li>
- <li class="nav-item">
- <a class="nav-link`)
//line navbar.qtpl:45
- streaminsertIfEqual(qw422016, s, Log)
+ streaminsertIfEqual(qw422016, s, Readme)
//line navbar.qtpl:45
qw422016.N().S(`" aria-current="page" href="/`)
//line navbar.qtpl:45
qw422016.E().S(name)
//line navbar.qtpl:45
- qw422016.N().S(`/log/`)
-//line navbar.qtpl:45
- qw422016.E().S(ref)
-//line navbar.qtpl:45
- qw422016.N().S(`">log</a>
+ qw422016.N().S(`/about">about</a>
</li>
<li class="nav-item">
<a class="nav-link`)
//line navbar.qtpl:48
- streaminsertIfEqual(qw422016, s, Summary)
+ streaminsertIfEqual(qw422016, s, Log)
//line navbar.qtpl:48
qw422016.N().S(`" aria-current="page" href="/`)
//line navbar.qtpl:48
qw422016.E().S(name)
//line navbar.qtpl:48
- qw422016.N().S(`">summary</a>
+ qw422016.N().S(`/log/`)
+//line navbar.qtpl:48
+ qw422016.E().S(ref)
+//line navbar.qtpl:48
+ qw422016.N().S(`">log</a>
</li>
<li class="nav-item">
<a class="nav-link`)
//line navbar.qtpl:51
- streaminsertIfEqual(qw422016, s, Refs)
+ streaminsertIfEqual(qw422016, s, Summary)
//line navbar.qtpl:51
qw422016.N().S(`" aria-current="page" href="/`)
//line navbar.qtpl:51
qw422016.E().S(name)
//line navbar.qtpl:51
- qw422016.N().S(`/refs">refs</a>
+ qw422016.N().S(`">summary</a>
</li>
<li class="nav-item">
<a class="nav-link`)
//line navbar.qtpl:54
- streaminsertIfEqual(qw422016, s, Tree)
+ streaminsertIfEqual(qw422016, s, Refs)
//line navbar.qtpl:54
qw422016.N().S(`" aria-current="page" href="/`)
//line navbar.qtpl:54
qw422016.E().S(name)
//line navbar.qtpl:54
+ qw422016.N().S(`/refs">refs</a>
+ </li>
+ <li class="nav-item">
+ <a class="nav-link`)
+//line navbar.qtpl:57
+ streaminsertIfEqual(qw422016, s, Tree)
+//line navbar.qtpl:57
+ qw422016.N().S(`" aria-current="page" href="/`)
+//line navbar.qtpl:57
+ qw422016.E().S(name)
+//line navbar.qtpl:57
qw422016.N().S(`/tree/`)
-//line navbar.qtpl:54
+//line navbar.qtpl:57
qw422016.E().S(ref)
-//line navbar.qtpl:54
+//line navbar.qtpl:57
qw422016.N().S(`">tree</a>
</li>
</ul>
</div>
`)
-//line navbar.qtpl:58
+//line navbar.qtpl:61
}
-//line navbar.qtpl:58
+//line navbar.qtpl:61
func WriteGitItemNav(qq422016 qtio422016.Writer, name, ref string, s GitSelection) {
-//line navbar.qtpl:58
+//line navbar.qtpl:61
qw422016 := qt422016.AcquireWriter(qq422016)
-//line navbar.qtpl:58
+//line navbar.qtpl:61
StreamGitItemNav(qw422016, name, ref, s)
-//line navbar.qtpl:58
+//line navbar.qtpl:61
qt422016.ReleaseWriter(qw422016)
-//line navbar.qtpl:58
+//line navbar.qtpl:61
}
-//line navbar.qtpl:58
+//line navbar.qtpl:61
func GitItemNav(name, ref string, s GitSelection) string {
-//line navbar.qtpl:58
+//line navbar.qtpl:61
qb422016 := qt422016.AcquireByteBuffer()
-//line navbar.qtpl:58
+//line navbar.qtpl:61
WriteGitItemNav(qb422016, name, ref, s)
-//line navbar.qtpl:58
+//line navbar.qtpl:61
qs422016 := string(qb422016.B)
-//line navbar.qtpl:58
+//line navbar.qtpl:61
qt422016.ReleaseByteBuffer(qb422016)
-//line navbar.qtpl:58
+//line navbar.qtpl:61
return qs422016
-//line navbar.qtpl:58
+//line navbar.qtpl:61
}