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