cerrado @ v0.0.18

  1// Code generated by qtc from "navbar.qtpl". DO NOT EDIT.
  2// See https://github.com/valyala/quicktemplate for details.
  3
  4//line templates/navbar.qtpl:1
  5package templates
  6
  7//line templates/navbar.qtpl:1
  8import "context"
  9
 10//line templates/navbar.qtpl:3
 11import (
 12	qtio422016 "io"
 13
 14	qt422016 "github.com/valyala/quicktemplate"
 15)
 16
 17//line templates/navbar.qtpl:3
 18var (
 19	_ = qtio422016.Copy
 20	_ = qt422016.AcquireByteBuffer
 21)
 22
 23//line templates/navbar.qtpl:4
 24type Selection int
 25
 26const (
 27	Git Selection = iota
 28	List
 29	About
 30	Config
 31	Login
 32)
 33
 34//line templates/navbar.qtpl:15
 35type GitSelection int
 36
 37const (
 38	Readme GitSelection = iota
 39	Log
 40	Summary
 41	Refs
 42	Tree
 43)
 44
 45//line templates/navbar.qtpl:25
 46func streaminsertIfEqual(qw422016 *qt422016.Writer, s, d any) {
 47//line templates/navbar.qtpl:25
 48	if s == d {
 49//line templates/navbar.qtpl:25
 50		qw422016.N().S(` selected`)
 51//line templates/navbar.qtpl:25
 52	}
 53//line templates/navbar.qtpl:25
 54}
 55
 56//line templates/navbar.qtpl:25
 57func writeinsertIfEqual(qq422016 qtio422016.Writer, s, d any) {
 58//line templates/navbar.qtpl:25
 59	qw422016 := qt422016.AcquireWriter(qq422016)
 60//line templates/navbar.qtpl:25
 61	streaminsertIfEqual(qw422016, s, d)
 62//line templates/navbar.qtpl:25
 63	qt422016.ReleaseWriter(qw422016)
 64//line templates/navbar.qtpl:25
 65}
 66
 67//line templates/navbar.qtpl:25
 68func insertIfEqual(s, d any) string {
 69//line templates/navbar.qtpl:25
 70	qb422016 := qt422016.AcquireByteBuffer()
 71//line templates/navbar.qtpl:25
 72	writeinsertIfEqual(qb422016, s, d)
 73//line templates/navbar.qtpl:25
 74	qs422016 := string(qb422016.B)
 75//line templates/navbar.qtpl:25
 76	qt422016.ReleaseByteBuffer(qb422016)
 77//line templates/navbar.qtpl:25
 78	return qs422016
 79//line templates/navbar.qtpl:25
 80}
 81
 82//line templates/navbar.qtpl:27
 83func StreamNavbar(qw422016 *qt422016.Writer, ctx context.Context, s Selection) {
 84//line templates/navbar.qtpl:27
 85	qw422016.N().S(`
 86        <nav class="container navbar navbar-expand">
 87          <div class="navbar-nav">
 88            <a class="nav-link`)
 89//line templates/navbar.qtpl:30
 90	streaminsertIfEqual(qw422016, s, Git)
 91//line templates/navbar.qtpl:30
 92	qw422016.N().S(`" href="/">git</a>
 93          </div>
 94          <div class="navbar-nav ms-auto">
 95          `)
 96//line templates/navbar.qtpl:33
 97	if !IsAuthenticationDisabled(ctx) {
 98//line templates/navbar.qtpl:33
 99		qw422016.N().S(`
100          `)
101//line templates/navbar.qtpl:34
102		if IsLoggedIn(ctx) {
103//line templates/navbar.qtpl:34
104			qw422016.N().S(`
105            <a class="nav-link`)
106//line templates/navbar.qtpl:35
107			streaminsertIfEqual(qw422016, s, Login)
108//line templates/navbar.qtpl:35
109			qw422016.N().S(`" href="/logout/">logout</a>
110          `)
111//line templates/navbar.qtpl:36
112		} else {
113//line templates/navbar.qtpl:36
114			qw422016.N().S(`
115            <a class="nav-link`)
116//line templates/navbar.qtpl:37
117			streaminsertIfEqual(qw422016, s, Login)
118//line templates/navbar.qtpl:37
119			qw422016.N().S(`" href="/login/">login</a>
120          `)
121//line templates/navbar.qtpl:38
122		}
123//line templates/navbar.qtpl:38
124		qw422016.N().S(`
125          `)
126//line templates/navbar.qtpl:39
127	}
128//line templates/navbar.qtpl:39
129	qw422016.N().S(`
130`)
131//line templates/navbar.qtpl:43
132	qw422016.N().S(`
133`)
134//line templates/navbar.qtpl:47
135	qw422016.N().S(`
136          </div>
137        </nav>
138`)
139//line templates/navbar.qtpl:50
140}
141
142//line templates/navbar.qtpl:50
143func WriteNavbar(qq422016 qtio422016.Writer, ctx context.Context, s Selection) {
144//line templates/navbar.qtpl:50
145	qw422016 := qt422016.AcquireWriter(qq422016)
146//line templates/navbar.qtpl:50
147	StreamNavbar(qw422016, ctx, s)
148//line templates/navbar.qtpl:50
149	qt422016.ReleaseWriter(qw422016)
150//line templates/navbar.qtpl:50
151}
152
153//line templates/navbar.qtpl:50
154func Navbar(ctx context.Context, s Selection) string {
155//line templates/navbar.qtpl:50
156	qb422016 := qt422016.AcquireByteBuffer()
157//line templates/navbar.qtpl:50
158	WriteNavbar(qb422016, ctx, s)
159//line templates/navbar.qtpl:50
160	qs422016 := string(qb422016.B)
161//line templates/navbar.qtpl:50
162	qt422016.ReleaseByteBuffer(qb422016)
163//line templates/navbar.qtpl:50
164	return qs422016
165//line templates/navbar.qtpl:50
166}
167
168//line templates/navbar.qtpl:52
169func StreamGitItemNav(qw422016 *qt422016.Writer, name, ref string, s GitSelection) {
170//line templates/navbar.qtpl:52
171	qw422016.N().S(`
172<div class="row">
173    <h3 id="name">`)
174//line templates/navbar.qtpl:54
175	qw422016.E().S(name)
176//line templates/navbar.qtpl:54
177	qw422016.N().S(` `)
178//line templates/navbar.qtpl:54
179	if ref != "" && (s == Log || s == Tree) {
180//line templates/navbar.qtpl:54
181		qw422016.N().S(`@ `)
182//line templates/navbar.qtpl:54
183		qw422016.E().S(ref)
184//line templates/navbar.qtpl:54
185	}
186//line templates/navbar.qtpl:54
187	qw422016.N().S(`</h3>
188</div>
189<div class="row">
190  <ul class="nav">
191    <li class="nav-item">
192      <a class="nav-link`)
193//line templates/navbar.qtpl:59
194	streaminsertIfEqual(qw422016, s, Readme)
195//line templates/navbar.qtpl:59
196	qw422016.N().S(`" aria-current="page" href="/`)
197//line templates/navbar.qtpl:59
198	qw422016.E().S(name)
199//line templates/navbar.qtpl:59
200	qw422016.N().S(`/about/">about</a>
201    </li>
202    <li class="nav-item">
203      <a class="nav-link`)
204//line templates/navbar.qtpl:62
205	streaminsertIfEqual(qw422016, s, Summary)
206//line templates/navbar.qtpl:62
207	qw422016.N().S(`" aria-current="page" href="/`)
208//line templates/navbar.qtpl:62
209	qw422016.E().S(name)
210//line templates/navbar.qtpl:62
211	qw422016.N().S(`/">summary</a>
212    </li>
213    <li class="nav-item">
214      <a class="nav-link`)
215//line templates/navbar.qtpl:65
216	streaminsertIfEqual(qw422016, s, Refs)
217//line templates/navbar.qtpl:65
218	qw422016.N().S(`" aria-current="page" href="/`)
219//line templates/navbar.qtpl:65
220	qw422016.E().S(name)
221//line templates/navbar.qtpl:65
222	qw422016.N().S(`/refs/">refs</a>
223    </li>
224    <li class="nav-item">
225      <a class="nav-link`)
226//line templates/navbar.qtpl:68
227	streaminsertIfEqual(qw422016, s, Log)
228//line templates/navbar.qtpl:68
229	qw422016.N().S(`" aria-current="page" href="/`)
230//line templates/navbar.qtpl:68
231	qw422016.E().S(name)
232//line templates/navbar.qtpl:68
233	qw422016.N().S(`/log/`)
234//line templates/navbar.qtpl:68
235	qw422016.E().S(ref)
236//line templates/navbar.qtpl:68
237	qw422016.N().S(`/">log</a>
238    </li>
239    <li class="nav-item">
240      <a class="nav-link`)
241//line templates/navbar.qtpl:71
242	streaminsertIfEqual(qw422016, s, Tree)
243//line templates/navbar.qtpl:71
244	qw422016.N().S(`" aria-current="page" href="/`)
245//line templates/navbar.qtpl:71
246	qw422016.E().S(name)
247//line templates/navbar.qtpl:71
248	qw422016.N().S(`/tree/`)
249//line templates/navbar.qtpl:71
250	qw422016.E().S(ref)
251//line templates/navbar.qtpl:71
252	qw422016.N().S(`/">tree</a>
253    </li>
254  </ul>
255</div>
256`)
257//line templates/navbar.qtpl:75
258}
259
260//line templates/navbar.qtpl:75
261func WriteGitItemNav(qq422016 qtio422016.Writer, name, ref string, s GitSelection) {
262//line templates/navbar.qtpl:75
263	qw422016 := qt422016.AcquireWriter(qq422016)
264//line templates/navbar.qtpl:75
265	StreamGitItemNav(qw422016, name, ref, s)
266//line templates/navbar.qtpl:75
267	qt422016.ReleaseWriter(qw422016)
268//line templates/navbar.qtpl:75
269}
270
271//line templates/navbar.qtpl:75
272func GitItemNav(name, ref string, s GitSelection) string {
273//line templates/navbar.qtpl:75
274	qb422016 := qt422016.AcquireByteBuffer()
275//line templates/navbar.qtpl:75
276	WriteGitItemNav(qb422016, name, ref, s)
277//line templates/navbar.qtpl:75
278	qs422016 := string(qb422016.B)
279//line templates/navbar.qtpl:75
280	qt422016.ReleaseByteBuffer(qb422016)
281//line templates/navbar.qtpl:75
282	return qs422016
283//line templates/navbar.qtpl:75
284}