cerrado @ 56d346178e364c186e7b6029c15810502ebccd9c

  1// Code generated by qtc from "gitlist.qtpl". DO NOT EDIT.
  2// See https://github.com/valyala/quicktemplate for details.
  3
  4//line templates/gitlist.qtpl:1
  5package templates
  6
  7//line templates/gitlist.qtpl:1
  8import "git.gabrielgio.me/cerrado/pkg/service"
  9
 10//line templates/gitlist.qtpl:2
 11import "context"
 12
 13//line templates/gitlist.qtpl:3
 14import "strings"
 15
 16//line templates/gitlist.qtpl:5
 17import (
 18	qtio422016 "io"
 19
 20	qt422016 "github.com/valyala/quicktemplate"
 21)
 22
 23//line templates/gitlist.qtpl:5
 24var (
 25	_ = qtio422016.Copy
 26	_ = qt422016.AcquireByteBuffer
 27)
 28
 29//line templates/gitlist.qtpl:6
 30type GitListPage struct {
 31	Respositories []*service.Repository
 32	About         []byte
 33}
 34
 35//line templates/gitlist.qtpl:13
 36func firstLine(text string) string {
 37	lines := strings.Split(text, "\n")
 38	if len(lines) > 0 {
 39		return lines[0]
 40	}
 41	return ""
 42}
 43
 44//line templates/gitlist.qtpl:22
 45func (p *GitListPage) StreamTitle(qw422016 *qt422016.Writer, ctx context.Context) {
 46//line templates/gitlist.qtpl:22
 47	qw422016.N().S(`Git | List`)
 48//line templates/gitlist.qtpl:22
 49}
 50
 51//line templates/gitlist.qtpl:22
 52func (p *GitListPage) WriteTitle(qq422016 qtio422016.Writer, ctx context.Context) {
 53//line templates/gitlist.qtpl:22
 54	qw422016 := qt422016.AcquireWriter(qq422016)
 55//line templates/gitlist.qtpl:22
 56	p.StreamTitle(qw422016, ctx)
 57//line templates/gitlist.qtpl:22
 58	qt422016.ReleaseWriter(qw422016)
 59//line templates/gitlist.qtpl:22
 60}
 61
 62//line templates/gitlist.qtpl:22
 63func (p *GitListPage) Title(ctx context.Context) string {
 64//line templates/gitlist.qtpl:22
 65	qb422016 := qt422016.AcquireByteBuffer()
 66//line templates/gitlist.qtpl:22
 67	p.WriteTitle(qb422016, ctx)
 68//line templates/gitlist.qtpl:22
 69	qs422016 := string(qb422016.B)
 70//line templates/gitlist.qtpl:22
 71	qt422016.ReleaseByteBuffer(qb422016)
 72//line templates/gitlist.qtpl:22
 73	return qs422016
 74//line templates/gitlist.qtpl:22
 75}
 76
 77//line templates/gitlist.qtpl:24
 78func (p *GitListPage) StreamNavbar(qw422016 *qt422016.Writer, ctx context.Context) {
 79//line templates/gitlist.qtpl:24
 80	StreamNavbar(qw422016, ctx, Git)
 81//line templates/gitlist.qtpl:24
 82}
 83
 84//line templates/gitlist.qtpl:24
 85func (p *GitListPage) WriteNavbar(qq422016 qtio422016.Writer, ctx context.Context) {
 86//line templates/gitlist.qtpl:24
 87	qw422016 := qt422016.AcquireWriter(qq422016)
 88//line templates/gitlist.qtpl:24
 89	p.StreamNavbar(qw422016, ctx)
 90//line templates/gitlist.qtpl:24
 91	qt422016.ReleaseWriter(qw422016)
 92//line templates/gitlist.qtpl:24
 93}
 94
 95//line templates/gitlist.qtpl:24
 96func (p *GitListPage) Navbar(ctx context.Context) string {
 97//line templates/gitlist.qtpl:24
 98	qb422016 := qt422016.AcquireByteBuffer()
 99//line templates/gitlist.qtpl:24
100	p.WriteNavbar(qb422016, ctx)
101//line templates/gitlist.qtpl:24
102	qs422016 := string(qb422016.B)
103//line templates/gitlist.qtpl:24
104	qt422016.ReleaseByteBuffer(qb422016)
105//line templates/gitlist.qtpl:24
106	return qs422016
107//line templates/gitlist.qtpl:24
108}
109
110//line templates/gitlist.qtpl:26
111func (p *GitListPage) StreamContent(qw422016 *qt422016.Writer, ctx context.Context) {
112//line templates/gitlist.qtpl:26
113	qw422016.N().S(`
114<div class="row">
115  <div class="col-md-6 order-last order-md-first">
116    <div class="event-list">
117      `)
118//line templates/gitlist.qtpl:30
119	for _, r := range p.Respositories {
120//line templates/gitlist.qtpl:30
121		qw422016.N().S(`
122      <div class="event">
123        <div class="row">
124          <div class="col-md">
125              <a href="/`)
126//line templates/gitlist.qtpl:34
127		qw422016.E().S(r.Name)
128//line templates/gitlist.qtpl:34
129		qw422016.N().S(`/">`)
130//line templates/gitlist.qtpl:34
131		qw422016.E().S(r.Name)
132//line templates/gitlist.qtpl:34
133		qw422016.N().S(`</a>
134          </div>
135          <div class="col-md text-md-end">
136            <small>`)
137//line templates/gitlist.qtpl:37
138		if !r.Public {
139//line templates/gitlist.qtpl:37
140			qw422016.N().S(`private`)
141//line templates/gitlist.qtpl:37
142		}
143//line templates/gitlist.qtpl:37
144		qw422016.N().S(`</small>
145          </div>
146        </div>
147        </hr>
148        <p>`)
149//line templates/gitlist.qtpl:41
150		qw422016.E().S(r.Description)
151//line templates/gitlist.qtpl:41
152		qw422016.N().S(`</p>
153        <p style="background: #dadada">
154            <a title="`)
155//line templates/gitlist.qtpl:43
156		qw422016.E().S(r.LastCommit.Hash.String())
157//line templates/gitlist.qtpl:43
158		qw422016.N().S(`" href="/`)
159//line templates/gitlist.qtpl:43
160		qw422016.E().S(r.Name)
161//line templates/gitlist.qtpl:43
162		qw422016.N().S(`/commit/`)
163//line templates/gitlist.qtpl:43
164		qw422016.E().S(r.LastCommit.Hash.String())
165//line templates/gitlist.qtpl:43
166		qw422016.N().S(`/">`)
167//line templates/gitlist.qtpl:43
168		qw422016.E().S(r.LastCommit.Hash.String()[0:8])
169//line templates/gitlist.qtpl:43
170		qw422016.N().S(`</a> - 
171            <a title="`)
172//line templates/gitlist.qtpl:44
173		qw422016.E().S(r.LastCommit.Author.Email)
174//line templates/gitlist.qtpl:44
175		qw422016.N().S(`">`)
176//line templates/gitlist.qtpl:44
177		qw422016.E().S(r.LastCommit.Author.Name)
178//line templates/gitlist.qtpl:44
179		qw422016.N().S(`</a> - 
180            `)
181//line templates/gitlist.qtpl:45
182		qw422016.E().S(firstLine(r.LastCommit.Message))
183//line templates/gitlist.qtpl:45
184		qw422016.N().S(`</p>
185        <p>
186          <a href="/`)
187//line templates/gitlist.qtpl:47
188		qw422016.E().S(r.Name)
189//line templates/gitlist.qtpl:47
190		qw422016.N().S(`/log/`)
191//line templates/gitlist.qtpl:47
192		qw422016.E().S(r.Ref)
193//line templates/gitlist.qtpl:47
194		qw422016.N().S(`/">log</a>
195          <a href="/`)
196//line templates/gitlist.qtpl:48
197		qw422016.E().S(r.Name)
198//line templates/gitlist.qtpl:48
199		qw422016.N().S(`/tree/`)
200//line templates/gitlist.qtpl:48
201		qw422016.E().S(r.Ref)
202//line templates/gitlist.qtpl:48
203		qw422016.N().S(`/">tree</a>
204          <a href="/`)
205//line templates/gitlist.qtpl:49
206		qw422016.E().S(r.Name)
207//line templates/gitlist.qtpl:49
208		qw422016.N().S(`/refs/">refs</a>
209        </p>
210      </div>
211      `)
212//line templates/gitlist.qtpl:52
213	}
214//line templates/gitlist.qtpl:52
215	qw422016.N().S(`
216    </div>
217  </div>
218  <div id="about" class="col-md-4 order-first order-md-last">
219    `)
220//line templates/gitlist.qtpl:56
221	qw422016.N().Z(p.About)
222//line templates/gitlist.qtpl:56
223	qw422016.N().S(`
224    <div class="alert alert-warning text-center" role="alert">
225        This project is under development, things may be broken or incomplete.
226    </div>
227  </div>
228</div>
229`)
230//line templates/gitlist.qtpl:62
231}
232
233//line templates/gitlist.qtpl:62
234func (p *GitListPage) WriteContent(qq422016 qtio422016.Writer, ctx context.Context) {
235//line templates/gitlist.qtpl:62
236	qw422016 := qt422016.AcquireWriter(qq422016)
237//line templates/gitlist.qtpl:62
238	p.StreamContent(qw422016, ctx)
239//line templates/gitlist.qtpl:62
240	qt422016.ReleaseWriter(qw422016)
241//line templates/gitlist.qtpl:62
242}
243
244//line templates/gitlist.qtpl:62
245func (p *GitListPage) Content(ctx context.Context) string {
246//line templates/gitlist.qtpl:62
247	qb422016 := qt422016.AcquireByteBuffer()
248//line templates/gitlist.qtpl:62
249	p.WriteContent(qb422016, ctx)
250//line templates/gitlist.qtpl:62
251	qs422016 := string(qb422016.B)
252//line templates/gitlist.qtpl:62
253	qt422016.ReleaseByteBuffer(qb422016)
254//line templates/gitlist.qtpl:62
255	return qs422016
256//line templates/gitlist.qtpl:62
257}
258
259//line templates/gitlist.qtpl:64
260func (p *GitListPage) StreamScript(qw422016 *qt422016.Writer, ctx context.Context) {
261//line templates/gitlist.qtpl:64
262	qw422016.N().S(`
263`)
264//line templates/gitlist.qtpl:65
265}
266
267//line templates/gitlist.qtpl:65
268func (p *GitListPage) WriteScript(qq422016 qtio422016.Writer, ctx context.Context) {
269//line templates/gitlist.qtpl:65
270	qw422016 := qt422016.AcquireWriter(qq422016)
271//line templates/gitlist.qtpl:65
272	p.StreamScript(qw422016, ctx)
273//line templates/gitlist.qtpl:65
274	qt422016.ReleaseWriter(qw422016)
275//line templates/gitlist.qtpl:65
276}
277
278//line templates/gitlist.qtpl:65
279func (p *GitListPage) Script(ctx context.Context) string {
280//line templates/gitlist.qtpl:65
281	qb422016 := qt422016.AcquireByteBuffer()
282//line templates/gitlist.qtpl:65
283	p.WriteScript(qb422016, ctx)
284//line templates/gitlist.qtpl:65
285	qs422016 := string(qb422016.B)
286//line templates/gitlist.qtpl:65
287	qt422016.ReleaseByteBuffer(qb422016)
288//line templates/gitlist.qtpl:65
289	return qs422016
290//line templates/gitlist.qtpl:65
291}