diff options
author | Gabriel A. Giovanini <mail@gabrielgio.me> | 2024-05-26 20:33:37 +0200 |
---|---|---|
committer | Gabriel A. Giovanini <mail@gabrielgio.me> | 2024-05-26 20:33:37 +0200 |
commit | 4534dffb865eb1a50bfbc291a5c3798183081caf (patch) | |
tree | d5bd1a2d9912a6442e3be1511ffb1d99f12287b0 /templates | |
parent | 349a3d1ff36a436261b1b65b870f8f262f06584f (diff) | |
download | cerrado-4534dffb865eb1a50bfbc291a5c3798183081caf.tar.gz cerrado-4534dffb865eb1a50bfbc291a5c3798183081caf.tar.bz2 cerrado-4534dffb865eb1a50bfbc291a5c3798183081caf.zip |
feat: Add actual git listing implementation
Diffstat (limited to 'templates')
-rw-r--r-- | templates/base.qtpl | 1 | ||||
-rw-r--r-- | templates/base.qtpl.go | 129 | ||||
-rw-r--r-- | templates/gitlist.qtpl | 11 | ||||
-rw-r--r-- | templates/gitlist.qtpl.go | 89 |
4 files changed, 121 insertions, 109 deletions
diff --git a/templates/base.qtpl b/templates/base.qtpl index 6bef986..df6c6fc 100644 --- a/templates/base.qtpl +++ b/templates/base.qtpl @@ -25,6 +25,7 @@ Page prints a page implementing Page interface. <html lang="en"> <head> <meta charset="utf-8"> + <link rel="icon" href="data:,"> <title>cerrado | {%= p.Title() %}</title> <link rel="stylesheet" href="/static/main.css"> <meta name="viewport" content="width=device-width, initial-scale=1" /> diff --git a/templates/base.qtpl.go b/templates/base.qtpl.go index ffee940..f78744d 100644 --- a/templates/base.qtpl.go +++ b/templates/base.qtpl.go @@ -63,10 +63,11 @@ func StreamPageTemplate(qw422016 *qt422016.Writer, p Page) { <html lang="en"> <head> <meta charset="utf-8"> + <link rel="icon" href="data:,"> <title>cerrado | `) -//line base.qtpl:28 +//line base.qtpl:29 p.StreamTitle(qw422016) -//line base.qtpl:28 +//line base.qtpl:29 qw422016.N().S(`</title> <link rel="stylesheet" href="/static/main.css"> <meta name="viewport" content="width=device-width, initial-scale=1" /> @@ -84,108 +85,75 @@ func StreamPageTemplate(qw422016 *qt422016.Writer, p Page) { </nav> <div class="container"> `) -//line base.qtpl:44 +//line base.qtpl:45 p.StreamContent(qw422016) -//line base.qtpl:44 +//line base.qtpl:45 qw422016.N().S(` </div> </body> `) -//line base.qtpl:47 +//line base.qtpl:48 p.StreamScript(qw422016) -//line base.qtpl:47 +//line base.qtpl:48 qw422016.N().S(` </html> `) -//line base.qtpl:49 +//line base.qtpl:50 } -//line base.qtpl:49 +//line base.qtpl:50 func WritePageTemplate(qq422016 qtio422016.Writer, p Page) { -//line base.qtpl:49 +//line base.qtpl:50 qw422016 := qt422016.AcquireWriter(qq422016) -//line base.qtpl:49 +//line base.qtpl:50 StreamPageTemplate(qw422016, p) -//line base.qtpl:49 +//line base.qtpl:50 qt422016.ReleaseWriter(qw422016) -//line base.qtpl:49 +//line base.qtpl:50 } -//line base.qtpl:49 +//line base.qtpl:50 func PageTemplate(p Page) string { -//line base.qtpl:49 +//line base.qtpl:50 qb422016 := qt422016.AcquireByteBuffer() -//line base.qtpl:49 +//line base.qtpl:50 WritePageTemplate(qb422016, p) -//line base.qtpl:49 +//line base.qtpl:50 qs422016 := string(qb422016.B) -//line base.qtpl:49 +//line base.qtpl:50 qt422016.ReleaseByteBuffer(qb422016) -//line base.qtpl:49 +//line base.qtpl:50 return qs422016 -//line base.qtpl:49 +//line base.qtpl:50 } -//line base.qtpl:51 -type BasePage struct{} - -//line base.qtpl:52 -func (p *BasePage) StreamTitle(qw422016 *qt422016.Writer) { -//line base.qtpl:52 - qw422016.N().S(`Empty`) -//line base.qtpl:52 -} - -//line base.qtpl:52 -func (p *BasePage) WriteTitle(qq422016 qtio422016.Writer) { -//line base.qtpl:52 - qw422016 := qt422016.AcquireWriter(qq422016) -//line base.qtpl:52 - p.StreamTitle(qw422016) -//line base.qtpl:52 - qt422016.ReleaseWriter(qw422016) -//line base.qtpl:52 -} - -//line base.qtpl:52 -func (p *BasePage) Title() string { -//line base.qtpl:52 - qb422016 := qt422016.AcquireByteBuffer() //line base.qtpl:52 - p.WriteTitle(qb422016) -//line base.qtpl:52 - qs422016 := string(qb422016.B) -//line base.qtpl:52 - qt422016.ReleaseByteBuffer(qb422016) -//line base.qtpl:52 - return qs422016 -//line base.qtpl:52 -} +type BasePage struct{} //line base.qtpl:53 -func (p *BasePage) StreamBody(qw422016 *qt422016.Writer) { +func (p *BasePage) StreamTitle(qw422016 *qt422016.Writer) { //line base.qtpl:53 - qw422016.N().S(`HelloWorld`) + qw422016.N().S(`Empty`) //line base.qtpl:53 } //line base.qtpl:53 -func (p *BasePage) WriteBody(qq422016 qtio422016.Writer) { +func (p *BasePage) WriteTitle(qq422016 qtio422016.Writer) { //line base.qtpl:53 qw422016 := qt422016.AcquireWriter(qq422016) //line base.qtpl:53 - p.StreamBody(qw422016) + p.StreamTitle(qw422016) //line base.qtpl:53 qt422016.ReleaseWriter(qw422016) //line base.qtpl:53 } //line base.qtpl:53 -func (p *BasePage) Body() string { +func (p *BasePage) Title() string { //line base.qtpl:53 qb422016 := qt422016.AcquireByteBuffer() //line base.qtpl:53 - p.WriteBody(qb422016) + p.WriteTitle(qb422016) //line base.qtpl:53 qs422016 := string(qb422016.B) //line base.qtpl:53 @@ -196,27 +164,29 @@ func (p *BasePage) Body() string { } //line base.qtpl:54 -func (p *BasePage) StreamScript(qw422016 *qt422016.Writer) { +func (p *BasePage) StreamBody(qw422016 *qt422016.Writer) { +//line base.qtpl:54 + qw422016.N().S(`HelloWorld`) //line base.qtpl:54 } //line base.qtpl:54 -func (p *BasePage) WriteScript(qq422016 qtio422016.Writer) { +func (p *BasePage) WriteBody(qq422016 qtio422016.Writer) { //line base.qtpl:54 qw422016 := qt422016.AcquireWriter(qq422016) //line base.qtpl:54 - p.StreamScript(qw422016) + p.StreamBody(qw422016) //line base.qtpl:54 qt422016.ReleaseWriter(qw422016) //line base.qtpl:54 } //line base.qtpl:54 -func (p *BasePage) Script() string { +func (p *BasePage) Body() string { //line base.qtpl:54 qb422016 := qt422016.AcquireByteBuffer() //line base.qtpl:54 - p.WriteScript(qb422016) + p.WriteBody(qb422016) //line base.qtpl:54 qs422016 := string(qb422016.B) //line base.qtpl:54 @@ -225,3 +195,34 @@ func (p *BasePage) Script() string { return qs422016 //line base.qtpl:54 } + +//line base.qtpl:55 +func (p *BasePage) StreamScript(qw422016 *qt422016.Writer) { +//line base.qtpl:55 +} + +//line base.qtpl:55 +func (p *BasePage) WriteScript(qq422016 qtio422016.Writer) { +//line base.qtpl:55 + qw422016 := qt422016.AcquireWriter(qq422016) +//line base.qtpl:55 + p.StreamScript(qw422016) +//line base.qtpl:55 + qt422016.ReleaseWriter(qw422016) +//line base.qtpl:55 +} + +//line base.qtpl:55 +func (p *BasePage) Script() string { +//line base.qtpl:55 + qb422016 := qt422016.AcquireByteBuffer() +//line base.qtpl:55 + p.WriteScript(qb422016) +//line base.qtpl:55 + qs422016 := string(qb422016.B) +//line base.qtpl:55 + qt422016.ReleaseByteBuffer(qb422016) +//line base.qtpl:55 + return qs422016 +//line base.qtpl:55 +} diff --git a/templates/gitlist.qtpl b/templates/gitlist.qtpl index 10a89da..84a42f9 100644 --- a/templates/gitlist.qtpl +++ b/templates/gitlist.qtpl @@ -14,14 +14,17 @@ type GitListPage struct { {% for _, c := range u.ChunkBy(p.Respositories, 3) %} <div class="row"> {% for _, r := range c %} - <div class="col-md-4 g-0"> + <div class="col-md g-1"> <div class="card"> <div class="card-header"> - {%s r.Title %} + <a href="/{%s r.Name %}" class="btn btn-primary">{%s r.Title %}</a> </div> <div class="card-body"> - <p class="card-text">{%s r.Description %}</p> - <a href="/{%s r.Name %}" class="btn btn-primary">go to repository</a> + <p class="card-text lead">{%s r.LastCommitMessage %}</p> + <p class="card-text"><small>{%s r.LastCommitDate %}</small></p> + <a href="#" class="card-link">summary</a> + <a href="#" class="card-link">log</a> + <a href="#" class="card-link">tree</a> </div> </div> </div> diff --git a/templates/gitlist.qtpl.go b/templates/gitlist.qtpl.go index b02eead..d16b8d5 100644 --- a/templates/gitlist.qtpl.go +++ b/templates/gitlist.qtpl.go @@ -76,100 +76,107 @@ func (p *GitListPage) StreamContent(qw422016 *qt422016.Writer) { for _, r := range c { //line gitlist.qtpl:16 qw422016.N().S(` - <div class="col-md-4 g-0"> + <div class="col-md g-1"> <div class="card"> <div class="card-header"> - `) + <a href="/`) +//line gitlist.qtpl:20 + qw422016.E().S(r.Name) +//line gitlist.qtpl:20 + qw422016.N().S(`" class="btn btn-primary">`) //line gitlist.qtpl:20 qw422016.E().S(r.Title) //line gitlist.qtpl:20 - qw422016.N().S(` + qw422016.N().S(`</a> </div> <div class="card-body"> - <p class="card-text">`) + <p class="card-text lead">`) //line gitlist.qtpl:23 - qw422016.E().S(r.Description) + qw422016.E().S(r.LastCommitMessage) //line gitlist.qtpl:23 - qw422016.N().S(`</p> - <a href="/`) + qw422016.N().S(`</p> + <p class="card-text"><small>`) //line gitlist.qtpl:24 - qw422016.E().S(r.Name) + qw422016.E().S(r.LastCommitDate) //line gitlist.qtpl:24 - qw422016.N().S(`" class="btn btn-primary">go to repository</a> + qw422016.N().S(`</small></p> + <a href="#" class="card-link">summary</a> + <a href="#" class="card-link">log</a> + <a href="#" class="card-link">tree</a> </div> </div> </div> `) -//line gitlist.qtpl:28 +//line gitlist.qtpl:31 } -//line gitlist.qtpl:28 +//line gitlist.qtpl:31 qw422016.N().S(` </div> `) -//line gitlist.qtpl:30 +//line gitlist.qtpl:33 } -//line gitlist.qtpl:30 +//line gitlist.qtpl:33 qw422016.N().S(` `) -//line gitlist.qtpl:31 +//line gitlist.qtpl:34 } -//line gitlist.qtpl:31 +//line gitlist.qtpl:34 func (p *GitListPage) WriteContent(qq422016 qtio422016.Writer) { -//line gitlist.qtpl:31 +//line gitlist.qtpl:34 qw422016 := qt422016.AcquireWriter(qq422016) -//line gitlist.qtpl:31 +//line gitlist.qtpl:34 p.StreamContent(qw422016) -//line gitlist.qtpl:31 +//line gitlist.qtpl:34 qt422016.ReleaseWriter(qw422016) -//line gitlist.qtpl:31 +//line gitlist.qtpl:34 } -//line gitlist.qtpl:31 +//line gitlist.qtpl:34 func (p *GitListPage) Content() string { -//line gitlist.qtpl:31 +//line gitlist.qtpl:34 qb422016 := qt422016.AcquireByteBuffer() -//line gitlist.qtpl:31 +//line gitlist.qtpl:34 p.WriteContent(qb422016) -//line gitlist.qtpl:31 +//line gitlist.qtpl:34 qs422016 := string(qb422016.B) -//line gitlist.qtpl:31 +//line gitlist.qtpl:34 qt422016.ReleaseByteBuffer(qb422016) -//line gitlist.qtpl:31 +//line gitlist.qtpl:34 return qs422016 -//line gitlist.qtpl:31 +//line gitlist.qtpl:34 } -//line gitlist.qtpl:33 +//line gitlist.qtpl:36 func (p *GitListPage) StreamScript(qw422016 *qt422016.Writer) { -//line gitlist.qtpl:33 +//line gitlist.qtpl:36 qw422016.N().S(` `) -//line gitlist.qtpl:34 +//line gitlist.qtpl:37 } -//line gitlist.qtpl:34 +//line gitlist.qtpl:37 func (p *GitListPage) WriteScript(qq422016 qtio422016.Writer) { -//line gitlist.qtpl:34 +//line gitlist.qtpl:37 qw422016 := qt422016.AcquireWriter(qq422016) -//line gitlist.qtpl:34 +//line gitlist.qtpl:37 p.StreamScript(qw422016) -//line gitlist.qtpl:34 +//line gitlist.qtpl:37 qt422016.ReleaseWriter(qw422016) -//line gitlist.qtpl:34 +//line gitlist.qtpl:37 } -//line gitlist.qtpl:34 +//line gitlist.qtpl:37 func (p *GitListPage) Script() string { -//line gitlist.qtpl:34 +//line gitlist.qtpl:37 qb422016 := qt422016.AcquireByteBuffer() -//line gitlist.qtpl:34 +//line gitlist.qtpl:37 p.WriteScript(qb422016) -//line gitlist.qtpl:34 +//line gitlist.qtpl:37 qs422016 := string(qb422016.B) -//line gitlist.qtpl:34 +//line gitlist.qtpl:37 qt422016.ReleaseByteBuffer(qb422016) -//line gitlist.qtpl:34 +//line gitlist.qtpl:37 return qs422016 -//line gitlist.qtpl:34 +//line gitlist.qtpl:37 } |