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 | |
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')
-rw-r--r-- | templates/gititem.qtpl | 10 | ||||
-rw-r--r-- | templates/gititem.qtpl.go | 144 | ||||
-rw-r--r-- | templates/gititemabout.qtpl | 2 | ||||
-rw-r--r-- | templates/gititemabout.qtpl.go | 12 | ||||
-rw-r--r-- | templates/gititemlog.qtpl | 2 | ||||
-rw-r--r-- | templates/gititemlog.qtpl.go | 12 | ||||
-rw-r--r-- | templates/gititemrefs.qtpl | 4 | ||||
-rw-r--r-- | templates/gititemrefs.qtpl.go | 14 | ||||
-rw-r--r-- | templates/gititemsummary.qtpl | 2 | ||||
-rw-r--r-- | templates/gititemsummary.qtpl.go | 12 | ||||
-rw-r--r-- | templates/gititemtree.qtpl | 2 | ||||
-rw-r--r-- | templates/gititemtree.qtpl.go | 12 | ||||
-rw-r--r-- | templates/gitlist.qtpl | 8 | ||||
-rw-r--r-- | templates/gitlist.qtpl.go | 16 | ||||
-rw-r--r-- | templates/navbar.qtpl | 13 | ||||
-rw-r--r-- | templates/navbar.qtpl.go | 109 |
16 files changed, 201 insertions, 173 deletions
diff --git a/templates/gititem.qtpl b/templates/gititem.qtpl index d2fcea7..3e2dd4e 100644 --- a/templates/gititem.qtpl +++ b/templates/gititem.qtpl @@ -1,6 +1,6 @@ {% interface GitItemBase { - Nav(name string) + Nav(name, ref string) GitContent() } %} @@ -8,6 +8,7 @@ GitItemBase { {% code type GitItemPage struct { Name string + Ref string GitItemBase } %} @@ -17,12 +18,7 @@ type GitItemPage struct { {% func (p *GitItemPage) Navbar() %}{%= Navbar(Git) %}{% endfunc %} {% func (p *GitItemPage) Content() %} -<div class="row"> - <h3>{%s p.Name %}</h3> -</div> -<div class="row"> -{%= p.Nav(p.Name) %} -</div> +{%= p.Nav(p.Name, p.Ref) %} <div class="container"> {%= p.GitContent() %} </div> diff --git a/templates/gititem.qtpl.go b/templates/gititem.qtpl.go index 9709a43..2c46104 100644 --- a/templates/gititem.qtpl.go +++ b/templates/gititem.qtpl.go @@ -20,11 +20,11 @@ var ( //line gititem.qtpl:2 type GitItemBase interface { //line gititem.qtpl:2 - Nav(name string) string + Nav(name, ref string) string //line gititem.qtpl:2 - StreamNav(qw422016 *qt422016.Writer, name string) + StreamNav(qw422016 *qt422016.Writer, name, ref string) //line gititem.qtpl:2 - WriteNav(qq422016 qtio422016.Writer, name string) + WriteNav(qq422016 qtio422016.Writer, name, ref string) //line gititem.qtpl:2 GitContent() string //line gititem.qtpl:2 @@ -37,160 +37,152 @@ type GitItemBase interface { //line gititem.qtpl:9 type GitItemPage struct { Name string + Ref string GitItemBase } -//line gititem.qtpl:15 +//line gititem.qtpl:16 func (p *GitItemPage) StreamTitle(qw422016 *qt422016.Writer) { -//line gititem.qtpl:15 +//line gititem.qtpl:16 qw422016.N().S(`Git | List`) -//line gititem.qtpl:15 +//line gititem.qtpl:16 } -//line gititem.qtpl:15 +//line gititem.qtpl:16 func (p *GitItemPage) WriteTitle(qq422016 qtio422016.Writer) { -//line gititem.qtpl:15 +//line gititem.qtpl:16 qw422016 := qt422016.AcquireWriter(qq422016) -//line gititem.qtpl:15 +//line gititem.qtpl:16 p.StreamTitle(qw422016) -//line gititem.qtpl:15 +//line gititem.qtpl:16 qt422016.ReleaseWriter(qw422016) -//line gititem.qtpl:15 +//line gititem.qtpl:16 } -//line gititem.qtpl:15 +//line gititem.qtpl:16 func (p *GitItemPage) Title() string { -//line gititem.qtpl:15 +//line gititem.qtpl:16 qb422016 := qt422016.AcquireByteBuffer() -//line gititem.qtpl:15 +//line gititem.qtpl:16 p.WriteTitle(qb422016) -//line gititem.qtpl:15 +//line gititem.qtpl:16 qs422016 := string(qb422016.B) -//line gititem.qtpl:15 +//line gititem.qtpl:16 qt422016.ReleaseByteBuffer(qb422016) -//line gititem.qtpl:15 +//line gititem.qtpl:16 return qs422016 -//line gititem.qtpl:15 +//line gititem.qtpl:16 } -//line gititem.qtpl:17 +//line gititem.qtpl:18 func (p *GitItemPage) StreamNavbar(qw422016 *qt422016.Writer) { -//line gititem.qtpl:17 +//line gititem.qtpl:18 StreamNavbar(qw422016, Git) -//line gititem.qtpl:17 +//line gititem.qtpl:18 } -//line gititem.qtpl:17 +//line gititem.qtpl:18 func (p *GitItemPage) WriteNavbar(qq422016 qtio422016.Writer) { -//line gititem.qtpl:17 +//line gititem.qtpl:18 qw422016 := qt422016.AcquireWriter(qq422016) -//line gititem.qtpl:17 +//line gititem.qtpl:18 p.StreamNavbar(qw422016) -//line gititem.qtpl:17 +//line gititem.qtpl:18 qt422016.ReleaseWriter(qw422016) -//line gititem.qtpl:17 +//line gititem.qtpl:18 } -//line gititem.qtpl:17 +//line gititem.qtpl:18 func (p *GitItemPage) Navbar() string { -//line gititem.qtpl:17 +//line gititem.qtpl:18 qb422016 := qt422016.AcquireByteBuffer() -//line gititem.qtpl:17 +//line gititem.qtpl:18 p.WriteNavbar(qb422016) -//line gititem.qtpl:17 +//line gititem.qtpl:18 qs422016 := string(qb422016.B) -//line gititem.qtpl:17 +//line gititem.qtpl:18 qt422016.ReleaseByteBuffer(qb422016) -//line gititem.qtpl:17 +//line gititem.qtpl:18 return qs422016 -//line gititem.qtpl:17 +//line gititem.qtpl:18 } -//line gititem.qtpl:19 +//line gititem.qtpl:20 func (p *GitItemPage) StreamContent(qw422016 *qt422016.Writer) { -//line gititem.qtpl:19 +//line gititem.qtpl:20 qw422016.N().S(` -<div class="row"> - <h3>`) +`) //line gititem.qtpl:21 - qw422016.E().S(p.Name) + p.StreamNav(qw422016, p.Name, p.Ref) //line gititem.qtpl:21 - qw422016.N().S(`</h3> -</div> -<div class="row"> -`) -//line gititem.qtpl:24 - p.StreamNav(qw422016, p.Name) -//line gititem.qtpl:24 qw422016.N().S(` -</div> <div class="container"> `) -//line gititem.qtpl:27 +//line gititem.qtpl:23 p.StreamGitContent(qw422016) -//line gititem.qtpl:27 +//line gititem.qtpl:23 qw422016.N().S(` </div> `) -//line gititem.qtpl:29 +//line gititem.qtpl:25 } -//line gititem.qtpl:29 +//line gititem.qtpl:25 func (p *GitItemPage) WriteContent(qq422016 qtio422016.Writer) { -//line gititem.qtpl:29 +//line gititem.qtpl:25 qw422016 := qt422016.AcquireWriter(qq422016) -//line gititem.qtpl:29 +//line gititem.qtpl:25 p.StreamContent(qw422016) -//line gititem.qtpl:29 +//line gititem.qtpl:25 qt422016.ReleaseWriter(qw422016) -//line gititem.qtpl:29 +//line gititem.qtpl:25 } -//line gititem.qtpl:29 +//line gititem.qtpl:25 func (p *GitItemPage) Content() string { -//line gititem.qtpl:29 +//line gititem.qtpl:25 qb422016 := qt422016.AcquireByteBuffer() -//line gititem.qtpl:29 +//line gititem.qtpl:25 p.WriteContent(qb422016) -//line gititem.qtpl:29 +//line gititem.qtpl:25 qs422016 := string(qb422016.B) -//line gititem.qtpl:29 +//line gititem.qtpl:25 qt422016.ReleaseByteBuffer(qb422016) -//line gititem.qtpl:29 +//line gititem.qtpl:25 return qs422016 -//line gititem.qtpl:29 +//line gititem.qtpl:25 } -//line gititem.qtpl:31 +//line gititem.qtpl:27 func (p *GitItemPage) StreamScript(qw422016 *qt422016.Writer) { -//line gititem.qtpl:31 +//line gititem.qtpl:27 qw422016.N().S(` `) -//line gititem.qtpl:32 +//line gititem.qtpl:28 } -//line gititem.qtpl:32 +//line gititem.qtpl:28 func (p *GitItemPage) WriteScript(qq422016 qtio422016.Writer) { -//line gititem.qtpl:32 +//line gititem.qtpl:28 qw422016 := qt422016.AcquireWriter(qq422016) -//line gititem.qtpl:32 +//line gititem.qtpl:28 p.StreamScript(qw422016) -//line gititem.qtpl:32 +//line gititem.qtpl:28 qt422016.ReleaseWriter(qw422016) -//line gititem.qtpl:32 +//line gititem.qtpl:28 } -//line gititem.qtpl:32 +//line gititem.qtpl:28 func (p *GitItemPage) Script() string { -//line gititem.qtpl:32 +//line gititem.qtpl:28 qb422016 := qt422016.AcquireByteBuffer() -//line gititem.qtpl:32 +//line gititem.qtpl:28 p.WriteScript(qb422016) -//line gititem.qtpl:32 +//line gititem.qtpl:28 qs422016 := string(qb422016.B) -//line gititem.qtpl:32 +//line gititem.qtpl:28 qt422016.ReleaseByteBuffer(qb422016) -//line gititem.qtpl:32 +//line gititem.qtpl:28 return qs422016 -//line gititem.qtpl:32 +//line gititem.qtpl:28 } diff --git a/templates/gititemabout.qtpl b/templates/gititemabout.qtpl index 67d43f1..e0fa9c3 100644 --- a/templates/gititemabout.qtpl +++ b/templates/gititemabout.qtpl @@ -3,7 +3,7 @@ type GitItemAboutPage struct { } %} -{% func (g *GitItemAboutPage) Nav(name string) %}{%= GitItemNav(name, Readme) %}{% endfunc %} +{% func (g *GitItemAboutPage) Nav(name, ref string) %}{%= GitItemNav(name, ref, Readme) %}{% endfunc %} {% func (g *GitItemAboutPage) GitContent() %} <h4>About</h4> diff --git a/templates/gititemabout.qtpl.go b/templates/gititemabout.qtpl.go index 7b772e5..0827fbe 100644 --- a/templates/gititemabout.qtpl.go +++ b/templates/gititemabout.qtpl.go @@ -22,29 +22,29 @@ type GitItemAboutPage struct { } //line gititemabout.qtpl:6 -func (g *GitItemAboutPage) StreamNav(qw422016 *qt422016.Writer, name string) { +func (g *GitItemAboutPage) StreamNav(qw422016 *qt422016.Writer, name, ref string) { //line gititemabout.qtpl:6 - StreamGitItemNav(qw422016, name, Readme) + StreamGitItemNav(qw422016, name, ref, Readme) //line gititemabout.qtpl:6 } //line gititemabout.qtpl:6 -func (g *GitItemAboutPage) WriteNav(qq422016 qtio422016.Writer, name string) { +func (g *GitItemAboutPage) WriteNav(qq422016 qtio422016.Writer, name, ref string) { //line gititemabout.qtpl:6 qw422016 := qt422016.AcquireWriter(qq422016) //line gititemabout.qtpl:6 - g.StreamNav(qw422016, name) + g.StreamNav(qw422016, name, ref) //line gititemabout.qtpl:6 qt422016.ReleaseWriter(qw422016) //line gititemabout.qtpl:6 } //line gititemabout.qtpl:6 -func (g *GitItemAboutPage) Nav(name string) string { +func (g *GitItemAboutPage) Nav(name, ref string) string { //line gititemabout.qtpl:6 qb422016 := qt422016.AcquireByteBuffer() //line gititemabout.qtpl:6 - g.WriteNav(qb422016, name) + g.WriteNav(qb422016, name, ref) //line gititemabout.qtpl:6 qs422016 := string(qb422016.B) //line gititemabout.qtpl:6 diff --git a/templates/gititemlog.qtpl b/templates/gititemlog.qtpl index 436c1d2..e037c52 100644 --- a/templates/gititemlog.qtpl +++ b/templates/gititemlog.qtpl @@ -6,7 +6,7 @@ type GitItemLogPage struct { } %} -{% func (g *GitItemLogPage) Nav(name string) %}{%= GitItemNav(name, Log) %}{% endfunc %} +{% func (g *GitItemLogPage) Nav(name, ref string) %}{%= GitItemNav(name, ref, Log) %}{% endfunc %} {% func (g *GitItemLogPage) GitContent() %} <div class="logs"> diff --git a/templates/gititemlog.qtpl.go b/templates/gititemlog.qtpl.go index e63c871..47e700d 100644 --- a/templates/gititemlog.qtpl.go +++ b/templates/gititemlog.qtpl.go @@ -26,29 +26,29 @@ type GitItemLogPage struct { } //line gititemlog.qtpl:9 -func (g *GitItemLogPage) StreamNav(qw422016 *qt422016.Writer, name string) { +func (g *GitItemLogPage) StreamNav(qw422016 *qt422016.Writer, name, ref string) { //line gititemlog.qtpl:9 - StreamGitItemNav(qw422016, name, Log) + StreamGitItemNav(qw422016, name, ref, Log) //line gititemlog.qtpl:9 } //line gititemlog.qtpl:9 -func (g *GitItemLogPage) WriteNav(qq422016 qtio422016.Writer, name string) { +func (g *GitItemLogPage) WriteNav(qq422016 qtio422016.Writer, name, ref string) { //line gititemlog.qtpl:9 qw422016 := qt422016.AcquireWriter(qq422016) //line gititemlog.qtpl:9 - g.StreamNav(qw422016, name) + g.StreamNav(qw422016, name, ref) //line gititemlog.qtpl:9 qt422016.ReleaseWriter(qw422016) //line gititemlog.qtpl:9 } //line gititemlog.qtpl:9 -func (g *GitItemLogPage) Nav(name string) string { +func (g *GitItemLogPage) Nav(name, ref string) string { //line gititemlog.qtpl:9 qb422016 := qt422016.AcquireByteBuffer() //line gititemlog.qtpl:9 - g.WriteNav(qb422016, name) + g.WriteNav(qb422016, name, ref) //line gititemlog.qtpl:9 qs422016 := string(qb422016.B) //line gititemlog.qtpl:9 diff --git a/templates/gititemrefs.qtpl b/templates/gititemrefs.qtpl index 9c58863..56f6c2b 100644 --- a/templates/gititemrefs.qtpl +++ b/templates/gititemrefs.qtpl @@ -8,7 +8,7 @@ type GitItemRefsPage struct { } %} -{% func (g *GitItemRefsPage) Nav(name string) %}{%= GitItemNav(name ,Refs) %}{% endfunc %} +{% func (g *GitItemRefsPage) Nav(name, ref string) %}{%= GitItemNav(name, ref, Refs) %}{% endfunc %} {% func (g *GitItemRefsPage) GitContent() %} <div class="row"> @@ -36,7 +36,7 @@ type GitItemRefsPage struct { {% for _, b := range g.Branches %} <div class="row"> <div class="col-xxl"> - {%s b.String() %} + {%s b.Name().Short() %} </div> </div> {% endfor %} diff --git a/templates/gititemrefs.qtpl.go b/templates/gititemrefs.qtpl.go index f2d2b6f..d2a362e 100644 --- a/templates/gititemrefs.qtpl.go +++ b/templates/gititemrefs.qtpl.go @@ -30,29 +30,29 @@ type GitItemRefsPage struct { } //line gititemrefs.qtpl:11 -func (g *GitItemRefsPage) StreamNav(qw422016 *qt422016.Writer, name string) { +func (g *GitItemRefsPage) StreamNav(qw422016 *qt422016.Writer, name, ref string) { //line gititemrefs.qtpl:11 - StreamGitItemNav(qw422016, name, Refs) + StreamGitItemNav(qw422016, name, ref, Refs) //line gititemrefs.qtpl:11 } //line gititemrefs.qtpl:11 -func (g *GitItemRefsPage) WriteNav(qq422016 qtio422016.Writer, name string) { +func (g *GitItemRefsPage) WriteNav(qq422016 qtio422016.Writer, name, ref string) { //line gititemrefs.qtpl:11 qw422016 := qt422016.AcquireWriter(qq422016) //line gititemrefs.qtpl:11 - g.StreamNav(qw422016, name) + g.StreamNav(qw422016, name, ref) //line gititemrefs.qtpl:11 qt422016.ReleaseWriter(qw422016) //line gititemrefs.qtpl:11 } //line gititemrefs.qtpl:11 -func (g *GitItemRefsPage) Nav(name string) string { +func (g *GitItemRefsPage) Nav(name, ref string) string { //line gititemrefs.qtpl:11 qb422016 := qt422016.AcquireByteBuffer() //line gititemrefs.qtpl:11 - g.WriteNav(qb422016, name) + g.WriteNav(qb422016, name, ref) //line gititemrefs.qtpl:11 qs422016 := string(qb422016.B) //line gititemrefs.qtpl:11 @@ -117,7 +117,7 @@ func (g *GitItemRefsPage) StreamGitContent(qw422016 *qt422016.Writer) { <div class="col-xxl"> `) //line gititemrefs.qtpl:39 - qw422016.E().S(b.String()) + qw422016.E().S(b.Name().Short()) //line gititemrefs.qtpl:39 qw422016.N().S(` </div> diff --git a/templates/gititemsummary.qtpl b/templates/gititemsummary.qtpl index f4b0dd6..5756ea5 100644 --- a/templates/gititemsummary.qtpl +++ b/templates/gititemsummary.qtpl @@ -3,7 +3,7 @@ type GitItemSummaryPage struct { } %} -{% func (g *GitItemSummaryPage) Nav(name string) %}{%= GitItemNav(name, Summary) %}{% endfunc %} +{% func (g *GitItemSummaryPage) Nav(name, ref string) %}{%= GitItemNav(name, ref, Summary) %}{% endfunc %} {% func (g *GitItemSummaryPage) GitContent() %} <h4>Summary</h4> diff --git a/templates/gititemsummary.qtpl.go b/templates/gititemsummary.qtpl.go index aa41a17..99cb984 100644 --- a/templates/gititemsummary.qtpl.go +++ b/templates/gititemsummary.qtpl.go @@ -22,29 +22,29 @@ type GitItemSummaryPage struct { } //line gititemsummary.qtpl:6 -func (g *GitItemSummaryPage) StreamNav(qw422016 *qt422016.Writer, name string) { +func (g *GitItemSummaryPage) StreamNav(qw422016 *qt422016.Writer, name, ref string) { //line gititemsummary.qtpl:6 - StreamGitItemNav(qw422016, name, Summary) + StreamGitItemNav(qw422016, name, ref, Summary) //line gititemsummary.qtpl:6 } //line gititemsummary.qtpl:6 -func (g *GitItemSummaryPage) WriteNav(qq422016 qtio422016.Writer, name string) { +func (g *GitItemSummaryPage) WriteNav(qq422016 qtio422016.Writer, name, ref string) { //line gititemsummary.qtpl:6 qw422016 := qt422016.AcquireWriter(qq422016) //line gititemsummary.qtpl:6 - g.StreamNav(qw422016, name) + g.StreamNav(qw422016, name, ref) //line gititemsummary.qtpl:6 qt422016.ReleaseWriter(qw422016) //line gititemsummary.qtpl:6 } //line gititemsummary.qtpl:6 -func (g *GitItemSummaryPage) Nav(name string) string { +func (g *GitItemSummaryPage) Nav(name, ref string) string { //line gititemsummary.qtpl:6 qb422016 := qt422016.AcquireByteBuffer() //line gititemsummary.qtpl:6 - g.WriteNav(qb422016, name) + g.WriteNav(qb422016, name, ref) //line gititemsummary.qtpl:6 qs422016 := string(qb422016.B) //line gititemsummary.qtpl:6 diff --git a/templates/gititemtree.qtpl b/templates/gititemtree.qtpl index 778cc00..5ace7b0 100644 --- a/templates/gititemtree.qtpl +++ b/templates/gititemtree.qtpl @@ -3,7 +3,7 @@ type GitItemTreePage struct { } %} -{% func (g *GitItemTreePage) Nav(name string) %}{%= GitItemNav(name, Tree) %}{% endfunc %} +{% func (g *GitItemTreePage) Nav(name, ref string) %}{%= GitItemNav(name, ref, Tree) %}{% endfunc %} {% func (g *GitItemTreePage) GitContent() %} <h4>Tree</h4> diff --git a/templates/gititemtree.qtpl.go b/templates/gititemtree.qtpl.go index 04861d1..d8beb0e 100644 --- a/templates/gititemtree.qtpl.go +++ b/templates/gititemtree.qtpl.go @@ -22,29 +22,29 @@ type GitItemTreePage struct { } //line gititemtree.qtpl:6 -func (g *GitItemTreePage) StreamNav(qw422016 *qt422016.Writer, name string) { +func (g *GitItemTreePage) StreamNav(qw422016 *qt422016.Writer, name, ref string) { //line gititemtree.qtpl:6 - StreamGitItemNav(qw422016, name, Tree) + StreamGitItemNav(qw422016, name, ref, Tree) //line gititemtree.qtpl:6 } //line gititemtree.qtpl:6 -func (g *GitItemTreePage) WriteNav(qq422016 qtio422016.Writer, name string) { +func (g *GitItemTreePage) WriteNav(qq422016 qtio422016.Writer, name, ref string) { //line gititemtree.qtpl:6 qw422016 := qt422016.AcquireWriter(qq422016) //line gititemtree.qtpl:6 - g.StreamNav(qw422016, name) + g.StreamNav(qw422016, name, ref) //line gititemtree.qtpl:6 qt422016.ReleaseWriter(qw422016) //line gititemtree.qtpl:6 } //line gititemtree.qtpl:6 -func (g *GitItemTreePage) Nav(name string) string { +func (g *GitItemTreePage) Nav(name, ref string) string { //line gititemtree.qtpl:6 qb422016 := qt422016.AcquireByteBuffer() //line gititemtree.qtpl:6 - g.WriteNav(qb422016, name) + g.WriteNav(qb422016, name, ref) //line gititemtree.qtpl:6 qs422016 := string(qb422016.B) //line gititemtree.qtpl:6 diff --git a/templates/gitlist.qtpl b/templates/gitlist.qtpl index b7beca5..3d7ef82 100644 --- a/templates/gitlist.qtpl +++ b/templates/gitlist.qtpl @@ -17,15 +17,15 @@ type GitListPage struct { {% for _, r := range p.Respositories %} <div class="event"> <h4> - <a href="/{%s r.Name %}/summary">{%s r.Name %}</a> + <a href="/{%s r.Name %}">{%s r.Name %}</a> </h4> </hr> <p>{%s r.LastCommitMessage %}</p> <p><small>{%s r.LastCommitDate %}</small></p> <p> - <a href="/{%s r.Name %}/summary">summary</a> - <a href="/{%s r.Name %}/log">log</a> - <a href="/{%s r.Name %}/tree">tree</a> + <a href="/{%s r.Name %}/log/{%s r.Ref %}">log</a> + <a href="/{%s r.Name %}/tree/{%s r.Ref %}">tree</a> + <a href="/{%s r.Name %}/refs">refs</a> </p> </div> {% endfor %} diff --git a/templates/gitlist.qtpl.go b/templates/gitlist.qtpl.go index 73f887a..d9f7ec1 100644 --- a/templates/gitlist.qtpl.go +++ b/templates/gitlist.qtpl.go @@ -109,7 +109,7 @@ func (p *GitListPage) StreamContent(qw422016 *qt422016.Writer) { //line gitlist.qtpl:20 qw422016.E().S(r.Name) //line gitlist.qtpl:20 - qw422016.N().S(`/summary">`) + qw422016.N().S(`">`) //line gitlist.qtpl:20 qw422016.E().S(r.Name) //line gitlist.qtpl:20 @@ -131,17 +131,25 @@ func (p *GitListPage) StreamContent(qw422016 *qt422016.Writer) { //line gitlist.qtpl:26 qw422016.E().S(r.Name) //line gitlist.qtpl:26 - qw422016.N().S(`/summary">summary</a> + qw422016.N().S(`/log/`) +//line gitlist.qtpl:26 + qw422016.E().S(r.Ref) +//line gitlist.qtpl:26 + qw422016.N().S(`">log</a> <a href="/`) //line gitlist.qtpl:27 qw422016.E().S(r.Name) //line gitlist.qtpl:27 - qw422016.N().S(`/log">log</a> + qw422016.N().S(`/tree/`) +//line gitlist.qtpl:27 + qw422016.E().S(r.Ref) +//line gitlist.qtpl:27 + qw422016.N().S(`">tree</a> <a href="/`) //line gitlist.qtpl:28 qw422016.E().S(r.Name) //line gitlist.qtpl:28 - qw422016.N().S(`/tree">tree</a> + qw422016.N().S(`/refs">refs</a> </p> </div> `) 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 %} diff --git a/templates/navbar.qtpl.go b/templates/navbar.qtpl.go index acf21b4..cddc6a6 100644 --- a/templates/navbar.qtpl.go +++ b/templates/navbar.qtpl.go @@ -134,92 +134,119 @@ func Navbar(s Selection) string { } //line navbar.qtpl:35 -func StreamGitItemNav(qw422016 *qt422016.Writer, name string, s GitSelection) { +func StreamGitItemNav(qw422016 *qt422016.Writer, name, ref string, s GitSelection) { //line navbar.qtpl:35 qw422016.N().S(` +<div class="row"> + <h3>`) +//line navbar.qtpl:37 + qw422016.E().S(name) +//line navbar.qtpl:37 + qw422016.N().S(` `) +//line navbar.qtpl:37 + if ref != "" && (s == Log || s == Tree) { +//line navbar.qtpl:37 + qw422016.N().S(`@ `) +//line navbar.qtpl:37 + qw422016.E().S(ref) +//line navbar.qtpl:37 + } +//line navbar.qtpl:37 + qw422016.N().S(`</h3> +</div> +<div class="row"> <ul class="nav"> <li class="nav-item"> <a class="nav-link`) -//line navbar.qtpl:38 +//line navbar.qtpl:42 streaminsertIfEqual(qw422016, s, Readme) -//line navbar.qtpl:38 +//line navbar.qtpl:42 qw422016.N().S(`" aria-current="page" href="/`) -//line navbar.qtpl:38 +//line navbar.qtpl:42 qw422016.E().S(name) -//line navbar.qtpl:38 +//line navbar.qtpl:42 qw422016.N().S(`/about">about</a> </li> <li class="nav-item"> <a class="nav-link`) -//line navbar.qtpl:41 +//line navbar.qtpl:45 streaminsertIfEqual(qw422016, s, Log) -//line navbar.qtpl:41 +//line navbar.qtpl:45 qw422016.N().S(`" aria-current="page" href="/`) -//line navbar.qtpl:41 +//line navbar.qtpl:45 qw422016.E().S(name) -//line navbar.qtpl:41 - qw422016.N().S(`/log">log</a> +//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> </li> <li class="nav-item"> <a class="nav-link`) -//line navbar.qtpl:44 +//line navbar.qtpl:48 streaminsertIfEqual(qw422016, s, Summary) -//line navbar.qtpl:44 +//line navbar.qtpl:48 qw422016.N().S(`" aria-current="page" href="/`) -//line navbar.qtpl:44 +//line navbar.qtpl:48 qw422016.E().S(name) -//line navbar.qtpl:44 - qw422016.N().S(`/summary">summary</a> +//line navbar.qtpl:48 + qw422016.N().S(`">summary</a> </li> <li class="nav-item"> <a class="nav-link`) -//line navbar.qtpl:47 +//line navbar.qtpl:51 streaminsertIfEqual(qw422016, s, Refs) -//line navbar.qtpl:47 +//line navbar.qtpl:51 qw422016.N().S(`" aria-current="page" href="/`) -//line navbar.qtpl:47 +//line navbar.qtpl:51 qw422016.E().S(name) -//line navbar.qtpl:47 +//line navbar.qtpl:51 qw422016.N().S(`/refs">refs</a> </li> <li class="nav-item"> <a class="nav-link`) -//line navbar.qtpl:50 +//line navbar.qtpl:54 streaminsertIfEqual(qw422016, s, Tree) -//line navbar.qtpl:50 +//line navbar.qtpl:54 qw422016.N().S(`" aria-current="page" href="/`) -//line navbar.qtpl:50 +//line navbar.qtpl:54 qw422016.E().S(name) -//line navbar.qtpl:50 - qw422016.N().S(`/tree">tree</a> +//line navbar.qtpl:54 + qw422016.N().S(`/tree/`) +//line navbar.qtpl:54 + qw422016.E().S(ref) +//line navbar.qtpl:54 + qw422016.N().S(`">tree</a> </li> </ul> +</div> `) -//line navbar.qtpl:53 +//line navbar.qtpl:58 } -//line navbar.qtpl:53 -func WriteGitItemNav(qq422016 qtio422016.Writer, name string, s GitSelection) { -//line navbar.qtpl:53 +//line navbar.qtpl:58 +func WriteGitItemNav(qq422016 qtio422016.Writer, name, ref string, s GitSelection) { +//line navbar.qtpl:58 qw422016 := qt422016.AcquireWriter(qq422016) -//line navbar.qtpl:53 - StreamGitItemNav(qw422016, name, s) -//line navbar.qtpl:53 +//line navbar.qtpl:58 + StreamGitItemNav(qw422016, name, ref, s) +//line navbar.qtpl:58 qt422016.ReleaseWriter(qw422016) -//line navbar.qtpl:53 +//line navbar.qtpl:58 } -//line navbar.qtpl:53 -func GitItemNav(name string, s GitSelection) string { -//line navbar.qtpl:53 +//line navbar.qtpl:58 +func GitItemNav(name, ref string, s GitSelection) string { +//line navbar.qtpl:58 qb422016 := qt422016.AcquireByteBuffer() -//line navbar.qtpl:53 - WriteGitItemNav(qb422016, name, s) -//line navbar.qtpl:53 +//line navbar.qtpl:58 + WriteGitItemNav(qb422016, name, ref, s) +//line navbar.qtpl:58 qs422016 := string(qb422016.B) -//line navbar.qtpl:53 +//line navbar.qtpl:58 qt422016.ReleaseByteBuffer(qb422016) -//line navbar.qtpl:53 +//line navbar.qtpl:58 return qs422016 -//line navbar.qtpl:53 +//line navbar.qtpl:58 } |