cerrado @ 079454e99be416de248c642fd196bf2927bc1dae

  1// Code generated by qtc from "commit.qtpl". DO NOT EDIT.
  2// See https://github.com/valyala/quicktemplate for details.
  3
  4//line templates/commit.qtpl:1
  5package templates
  6
  7//line templates/commit.qtpl:1
  8import "git.gabrielgio.me/cerrado/pkg/git"
  9
 10//line templates/commit.qtpl:2
 11import "git.gabrielgio.me/cerrado/pkg/humanize"
 12
 13//line templates/commit.qtpl:4
 14import (
 15	qtio422016 "io"
 16
 17	qt422016 "github.com/valyala/quicktemplate"
 18)
 19
 20//line templates/commit.qtpl:4
 21var (
 22	_ = qtio422016.Copy
 23	_ = qt422016.AcquireByteBuffer
 24)
 25
 26//line templates/commit.qtpl:4
 27func StreamCommit(qw422016 *qt422016.Writer, name string, c *git.CommitReference, showTar bool) {
 28//line templates/commit.qtpl:4
 29	qw422016.N().S(`
 30  <div class="row event">
 31    <div class="row">
 32      <div class="col-md">
 33       <a title="`)
 34//line templates/commit.qtpl:8
 35	qw422016.E().S(c.Commit().Hash.String())
 36//line templates/commit.qtpl:8
 37	qw422016.N().S(`" href="/`)
 38//line templates/commit.qtpl:8
 39	qw422016.E().S(name)
 40//line templates/commit.qtpl:8
 41	qw422016.N().S(`/commit/`)
 42//line templates/commit.qtpl:8
 43	qw422016.E().S(c.Commit().Hash.String())
 44//line templates/commit.qtpl:8
 45	qw422016.N().S(`/">`)
 46//line templates/commit.qtpl:8
 47	qw422016.E().S(c.Commit().Hash.String()[0:8])
 48//line templates/commit.qtpl:8
 49	qw422016.N().S(`</a> —
 50       <a title="`)
 51//line templates/commit.qtpl:9
 52	qw422016.E().S(c.Commit().Committer.Email)
 53//line templates/commit.qtpl:9
 54	qw422016.N().S(`" href="mailto:`)
 55//line templates/commit.qtpl:9
 56	qw422016.E().S(c.Commit().Author.Email)
 57//line templates/commit.qtpl:9
 58	qw422016.N().S(`">`)
 59//line templates/commit.qtpl:9
 60	qw422016.E().S(c.Commit().Author.Name)
 61//line templates/commit.qtpl:9
 62	qw422016.N().S(`</a>
 63       `)
 64//line templates/commit.qtpl:10
 65	if c.HasReference() {
 66//line templates/commit.qtpl:10
 67		qw422016.N().S(`
 68 69       `)
 70//line templates/commit.qtpl:12
 71		for _, r := range c.References() {
 72//line templates/commit.qtpl:12
 73			qw422016.N().S(`
 74       `)
 75//line templates/commit.qtpl:13
 76			if r.Name().IsBranch() {
 77//line templates/commit.qtpl:13
 78				qw422016.N().S(`
 79       <a class="ref branch" title="`)
 80//line templates/commit.qtpl:14
 81				qw422016.E().S(c.Commit().Hash.String())
 82//line templates/commit.qtpl:14
 83				qw422016.N().S(`" href="/`)
 84//line templates/commit.qtpl:14
 85				qw422016.E().S(name)
 86//line templates/commit.qtpl:14
 87				qw422016.N().S(`/tree/`)
 88//line templates/commit.qtpl:14
 89				qw422016.E().S(r.Name().Short())
 90//line templates/commit.qtpl:14
 91				qw422016.N().S(`/">`)
 92//line templates/commit.qtpl:14
 93				qw422016.E().S(r.Name().Short())
 94//line templates/commit.qtpl:14
 95				qw422016.N().S(`</a>
 96       `)
 97//line templates/commit.qtpl:15
 98			} else {
 99//line templates/commit.qtpl:15
100				qw422016.N().S(`
101       <a class="ref tag" title="`)
102//line templates/commit.qtpl:16
103				qw422016.E().S(c.Commit().Hash.String())
104//line templates/commit.qtpl:16
105				qw422016.N().S(`" href="/`)
106//line templates/commit.qtpl:16
107				qw422016.E().S(name)
108//line templates/commit.qtpl:16
109				qw422016.N().S(`/commit/`)
110//line templates/commit.qtpl:16
111				qw422016.E().S(c.Commit().Hash.String())
112//line templates/commit.qtpl:16
113				qw422016.N().S(`/">`)
114//line templates/commit.qtpl:16
115				qw422016.E().S(r.Name().Short())
116//line templates/commit.qtpl:16
117				qw422016.N().S(`</a>
118       `)
119//line templates/commit.qtpl:17
120			}
121//line templates/commit.qtpl:17
122			qw422016.N().S(`
123       `)
124//line templates/commit.qtpl:18
125		}
126//line templates/commit.qtpl:18
127		qw422016.N().S(`
128       `)
129//line templates/commit.qtpl:19
130	}
131//line templates/commit.qtpl:19
132	qw422016.N().S(`
133      </div>
134      `)
135//line templates/commit.qtpl:21
136	if showTar {
137//line templates/commit.qtpl:21
138		qw422016.N().S(`
139      <div class="col-md text-md-center">
140       <a title="tar.gz for `)
141//line templates/commit.qtpl:23
142		qw422016.E().S(c.Commit().Hash.String())
143//line templates/commit.qtpl:23
144		qw422016.N().S(`" href="/`)
145//line templates/commit.qtpl:23
146		qw422016.E().S(name)
147//line templates/commit.qtpl:23
148		qw422016.N().S(`/archive/`)
149//line templates/commit.qtpl:23
150		qw422016.E().S(c.Commit().Hash.String())
151//line templates/commit.qtpl:23
152		qw422016.N().S(`.tar.gz">tar.gz</a>
153      </div>
154      `)
155//line templates/commit.qtpl:25
156	}
157//line templates/commit.qtpl:25
158	qw422016.N().S(`
159      <div class="col-md text-md-end">
160        <a title="`)
161//line templates/commit.qtpl:27
162	qw422016.E().S(c.Commit().Author.When.UTC().Format("2006-01-02 15:04:05"))
163//line templates/commit.qtpl:27
164	qw422016.N().S(` UTC">`)
165//line templates/commit.qtpl:27
166	qw422016.E().S(humanize.Time(c.Commit().Author.When))
167//line templates/commit.qtpl:27
168	qw422016.N().S(`</a>
169      </div>
170    </div>
171    <div class="code-view">
172     <pre>`)
173//line templates/commit.qtpl:31
174	qw422016.E().S(c.Commit().Message)
175//line templates/commit.qtpl:31
176	qw422016.N().S(`</pre>
177    </div>
178  </div>
179`)
180//line templates/commit.qtpl:34
181}
182
183//line templates/commit.qtpl:34
184func WriteCommit(qq422016 qtio422016.Writer, name string, c *git.CommitReference, showTar bool) {
185//line templates/commit.qtpl:34
186	qw422016 := qt422016.AcquireWriter(qq422016)
187//line templates/commit.qtpl:34
188	StreamCommit(qw422016, name, c, showTar)
189//line templates/commit.qtpl:34
190	qt422016.ReleaseWriter(qw422016)
191//line templates/commit.qtpl:34
192}
193
194//line templates/commit.qtpl:34
195func Commit(name string, c *git.CommitReference, showTar bool) string {
196//line templates/commit.qtpl:34
197	qb422016 := qt422016.AcquireByteBuffer()
198//line templates/commit.qtpl:34
199	WriteCommit(qb422016, name, c, showTar)
200//line templates/commit.qtpl:34
201	qs422016 := string(qb422016.B)
202//line templates/commit.qtpl:34
203	qt422016.ReleaseByteBuffer(qb422016)
204//line templates/commit.qtpl:34
205	return qs422016
206//line templates/commit.qtpl:34
207}