cerrado @ d0e0c1eb99303e1000140d4b98c610077278dc42

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