diff options
author | Gabriel A. Giovanini <mail@gabrielgio.me> | 2024-05-26 00:05:31 +0200 |
---|---|---|
committer | Gabriel A. Giovanini <mail@gabrielgio.me> | 2024-05-26 14:41:21 +0200 |
commit | 349a3d1ff36a436261b1b65b870f8f262f06584f (patch) | |
tree | 25c4d6933c49f818e520ce662ffa15e040877f4d /templates | |
parent | c06945c189c1d8ef3cedeb51e416ba0fec36368f (diff) | |
download | cerrado-349a3d1ff36a436261b1b65b870f8f262f06584f.tar.gz cerrado-349a3d1ff36a436261b1b65b870f8f262f06584f.tar.bz2 cerrado-349a3d1ff36a436261b1b65b870f8f262f06584f.zip |
feat: Add bare bones project list
Diffstat (limited to 'templates')
-rw-r--r-- | templates/gitlist.qtpl | 34 | ||||
-rw-r--r-- | templates/gitlist.qtpl.go | 175 | ||||
-rw-r--r-- | templates/helloworld.qtpl | 2 | ||||
-rw-r--r-- | templates/helloworld.qtpl.go | 62 |
4 files changed, 239 insertions, 34 deletions
diff --git a/templates/gitlist.qtpl b/templates/gitlist.qtpl new file mode 100644 index 0000000..10a89da --- /dev/null +++ b/templates/gitlist.qtpl @@ -0,0 +1,34 @@ +{% import "git.gabrielgio.me/cerrado/pkg/service" %} +{% import "git.gabrielgio.me/cerrado/pkg/u" %} + + +{% code +type GitListPage struct { + Respositories []*service.Repository +} +%} + +{% func (p *GitListPage) Title() %}Git | List{% endfunc %} + +{% func (p *GitListPage) Content() %} +{% for _, c := range u.ChunkBy(p.Respositories, 3) %} +<div class="row"> + {% for _, r := range c %} + <div class="col-md-4 g-0"> + <div class="card"> + <div class="card-header"> + {%s r.Title %} + </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> + </div> + </div> + </div> + {% endfor %} +</div> +{% endfor %} +{% endfunc %} + +{% func (p *GitListPage) Script() %} +{% endfunc %} diff --git a/templates/gitlist.qtpl.go b/templates/gitlist.qtpl.go new file mode 100644 index 0000000..b02eead --- /dev/null +++ b/templates/gitlist.qtpl.go @@ -0,0 +1,175 @@ +// Code generated by qtc from "gitlist.qtpl". DO NOT EDIT. +// See https://github.com/valyala/quicktemplate for details. + +//line gitlist.qtpl:1 +package templates + +//line gitlist.qtpl:1 +import "git.gabrielgio.me/cerrado/pkg/service" + +//line gitlist.qtpl:2 +import "git.gabrielgio.me/cerrado/pkg/u" + +//line gitlist.qtpl:5 +import ( + qtio422016 "io" + + qt422016 "github.com/valyala/quicktemplate" +) + +//line gitlist.qtpl:5 +var ( + _ = qtio422016.Copy + _ = qt422016.AcquireByteBuffer +) + +//line gitlist.qtpl:6 +type GitListPage struct { + Respositories []*service.Repository +} + +//line gitlist.qtpl:11 +func (p *GitListPage) StreamTitle(qw422016 *qt422016.Writer) { +//line gitlist.qtpl:11 + qw422016.N().S(`Git | List`) +//line gitlist.qtpl:11 +} + +//line gitlist.qtpl:11 +func (p *GitListPage) WriteTitle(qq422016 qtio422016.Writer) { +//line gitlist.qtpl:11 + qw422016 := qt422016.AcquireWriter(qq422016) +//line gitlist.qtpl:11 + p.StreamTitle(qw422016) +//line gitlist.qtpl:11 + qt422016.ReleaseWriter(qw422016) +//line gitlist.qtpl:11 +} + +//line gitlist.qtpl:11 +func (p *GitListPage) Title() string { +//line gitlist.qtpl:11 + qb422016 := qt422016.AcquireByteBuffer() +//line gitlist.qtpl:11 + p.WriteTitle(qb422016) +//line gitlist.qtpl:11 + qs422016 := string(qb422016.B) +//line gitlist.qtpl:11 + qt422016.ReleaseByteBuffer(qb422016) +//line gitlist.qtpl:11 + return qs422016 +//line gitlist.qtpl:11 +} + +//line gitlist.qtpl:13 +func (p *GitListPage) StreamContent(qw422016 *qt422016.Writer) { +//line gitlist.qtpl:13 + qw422016.N().S(` +`) +//line gitlist.qtpl:14 + for _, c := range u.ChunkBy(p.Respositories, 3) { +//line gitlist.qtpl:14 + qw422016.N().S(` +<div class="row"> + `) +//line gitlist.qtpl:16 + for _, r := range c { +//line gitlist.qtpl:16 + qw422016.N().S(` + <div class="col-md-4 g-0"> + <div class="card"> + <div class="card-header"> + `) +//line gitlist.qtpl:20 + qw422016.E().S(r.Title) +//line gitlist.qtpl:20 + qw422016.N().S(` + </div> + <div class="card-body"> + <p class="card-text">`) +//line gitlist.qtpl:23 + qw422016.E().S(r.Description) +//line gitlist.qtpl:23 + qw422016.N().S(`</p> + <a href="/`) +//line gitlist.qtpl:24 + qw422016.E().S(r.Name) +//line gitlist.qtpl:24 + qw422016.N().S(`" class="btn btn-primary">go to repository</a> + </div> + </div> + </div> + `) +//line gitlist.qtpl:28 + } +//line gitlist.qtpl:28 + qw422016.N().S(` +</div> +`) +//line gitlist.qtpl:30 + } +//line gitlist.qtpl:30 + qw422016.N().S(` +`) +//line gitlist.qtpl:31 +} + +//line gitlist.qtpl:31 +func (p *GitListPage) WriteContent(qq422016 qtio422016.Writer) { +//line gitlist.qtpl:31 + qw422016 := qt422016.AcquireWriter(qq422016) +//line gitlist.qtpl:31 + p.StreamContent(qw422016) +//line gitlist.qtpl:31 + qt422016.ReleaseWriter(qw422016) +//line gitlist.qtpl:31 +} + +//line gitlist.qtpl:31 +func (p *GitListPage) Content() string { +//line gitlist.qtpl:31 + qb422016 := qt422016.AcquireByteBuffer() +//line gitlist.qtpl:31 + p.WriteContent(qb422016) +//line gitlist.qtpl:31 + qs422016 := string(qb422016.B) +//line gitlist.qtpl:31 + qt422016.ReleaseByteBuffer(qb422016) +//line gitlist.qtpl:31 + return qs422016 +//line gitlist.qtpl:31 +} + +//line gitlist.qtpl:33 +func (p *GitListPage) StreamScript(qw422016 *qt422016.Writer) { +//line gitlist.qtpl:33 + qw422016.N().S(` +`) +//line gitlist.qtpl:34 +} + +//line gitlist.qtpl:34 +func (p *GitListPage) WriteScript(qq422016 qtio422016.Writer) { +//line gitlist.qtpl:34 + qw422016 := qt422016.AcquireWriter(qq422016) +//line gitlist.qtpl:34 + p.StreamScript(qw422016) +//line gitlist.qtpl:34 + qt422016.ReleaseWriter(qw422016) +//line gitlist.qtpl:34 +} + +//line gitlist.qtpl:34 +func (p *GitListPage) Script() string { +//line gitlist.qtpl:34 + qb422016 := qt422016.AcquireByteBuffer() +//line gitlist.qtpl:34 + p.WriteScript(qb422016) +//line gitlist.qtpl:34 + qs422016 := string(qb422016.B) +//line gitlist.qtpl:34 + qt422016.ReleaseByteBuffer(qb422016) +//line gitlist.qtpl:34 + return qs422016 +//line gitlist.qtpl:34 +} diff --git a/templates/helloworld.qtpl b/templates/helloworld.qtpl index 66287ea..45c5595 100644 --- a/templates/helloworld.qtpl +++ b/templates/helloworld.qtpl @@ -7,8 +7,6 @@ type HelloPage struct { {% func (p *HelloPage) Title() %}Hello{% endfunc %} {% func (p *HelloPage) Content() %} -HelloWorld - {%s= p.Body %} {% endfunc %} diff --git a/templates/helloworld.qtpl.go b/templates/helloworld.qtpl.go index a12455f..61c8f75 100644 --- a/templates/helloworld.qtpl.go +++ b/templates/helloworld.qtpl.go @@ -59,73 +59,71 @@ func (p *HelloPage) Title() string { func (p *HelloPage) StreamContent(qw422016 *qt422016.Writer) { //line helloworld.qtpl:9 qw422016.N().S(` -HelloWorld - `) -//line helloworld.qtpl:12 +//line helloworld.qtpl:10 qw422016.N().S(p.Body) -//line helloworld.qtpl:12 +//line helloworld.qtpl:10 qw422016.N().S(` `) -//line helloworld.qtpl:13 +//line helloworld.qtpl:11 } -//line helloworld.qtpl:13 +//line helloworld.qtpl:11 func (p *HelloPage) WriteContent(qq422016 qtio422016.Writer) { -//line helloworld.qtpl:13 +//line helloworld.qtpl:11 qw422016 := qt422016.AcquireWriter(qq422016) -//line helloworld.qtpl:13 +//line helloworld.qtpl:11 p.StreamContent(qw422016) -//line helloworld.qtpl:13 +//line helloworld.qtpl:11 qt422016.ReleaseWriter(qw422016) -//line helloworld.qtpl:13 +//line helloworld.qtpl:11 } -//line helloworld.qtpl:13 +//line helloworld.qtpl:11 func (p *HelloPage) Content() string { -//line helloworld.qtpl:13 +//line helloworld.qtpl:11 qb422016 := qt422016.AcquireByteBuffer() -//line helloworld.qtpl:13 +//line helloworld.qtpl:11 p.WriteContent(qb422016) -//line helloworld.qtpl:13 +//line helloworld.qtpl:11 qs422016 := string(qb422016.B) -//line helloworld.qtpl:13 +//line helloworld.qtpl:11 qt422016.ReleaseByteBuffer(qb422016) -//line helloworld.qtpl:13 +//line helloworld.qtpl:11 return qs422016 -//line helloworld.qtpl:13 +//line helloworld.qtpl:11 } -//line helloworld.qtpl:15 +//line helloworld.qtpl:13 func (p *HelloPage) StreamScript(qw422016 *qt422016.Writer) { -//line helloworld.qtpl:15 +//line helloworld.qtpl:13 qw422016.N().S(` `) -//line helloworld.qtpl:16 +//line helloworld.qtpl:14 } -//line helloworld.qtpl:16 +//line helloworld.qtpl:14 func (p *HelloPage) WriteScript(qq422016 qtio422016.Writer) { -//line helloworld.qtpl:16 +//line helloworld.qtpl:14 qw422016 := qt422016.AcquireWriter(qq422016) -//line helloworld.qtpl:16 +//line helloworld.qtpl:14 p.StreamScript(qw422016) -//line helloworld.qtpl:16 +//line helloworld.qtpl:14 qt422016.ReleaseWriter(qw422016) -//line helloworld.qtpl:16 +//line helloworld.qtpl:14 } -//line helloworld.qtpl:16 +//line helloworld.qtpl:14 func (p *HelloPage) Script() string { -//line helloworld.qtpl:16 +//line helloworld.qtpl:14 qb422016 := qt422016.AcquireByteBuffer() -//line helloworld.qtpl:16 +//line helloworld.qtpl:14 p.WriteScript(qb422016) -//line helloworld.qtpl:16 +//line helloworld.qtpl:14 qs422016 := string(qb422016.B) -//line helloworld.qtpl:16 +//line helloworld.qtpl:14 qt422016.ReleaseByteBuffer(qb422016) -//line helloworld.qtpl:16 +//line helloworld.qtpl:14 return qs422016 -//line helloworld.qtpl:16 +//line helloworld.qtpl:14 } |