cerrado @ f1643ffcbd543cacfe9ab5e46eafdd0c39cd47fd

  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 string, s GitSelection) {
138//line navbar.qtpl:35
139	qw422016.N().S(`
140  <ul class="nav">
141    <li class="nav-item">
142      <a class="nav-link`)
143//line navbar.qtpl:38
144	streaminsertIfEqual(qw422016, s, Readme)
145//line navbar.qtpl:38
146	qw422016.N().S(`" aria-current="page" href="/`)
147//line navbar.qtpl:38
148	qw422016.E().S(name)
149//line navbar.qtpl:38
150	qw422016.N().S(`/about">about</a>
151    </li>
152    <li class="nav-item">
153      <a class="nav-link`)
154//line navbar.qtpl:41
155	streaminsertIfEqual(qw422016, s, Log)
156//line navbar.qtpl:41
157	qw422016.N().S(`" aria-current="page" href="/`)
158//line navbar.qtpl:41
159	qw422016.E().S(name)
160//line navbar.qtpl:41
161	qw422016.N().S(`/log">log</a>
162    </li>
163    <li class="nav-item">
164      <a class="nav-link`)
165//line navbar.qtpl:44
166	streaminsertIfEqual(qw422016, s, Summary)
167//line navbar.qtpl:44
168	qw422016.N().S(`" aria-current="page" href="/`)
169//line navbar.qtpl:44
170	qw422016.E().S(name)
171//line navbar.qtpl:44
172	qw422016.N().S(`/summary">summary</a>
173    </li>
174    <li class="nav-item">
175      <a class="nav-link`)
176//line navbar.qtpl:47
177	streaminsertIfEqual(qw422016, s, Refs)
178//line navbar.qtpl:47
179	qw422016.N().S(`" aria-current="page" href="/`)
180//line navbar.qtpl:47
181	qw422016.E().S(name)
182//line navbar.qtpl:47
183	qw422016.N().S(`/refs">refs</a>
184    </li>
185    <li class="nav-item">
186      <a class="nav-link`)
187//line navbar.qtpl:50
188	streaminsertIfEqual(qw422016, s, Tree)
189//line navbar.qtpl:50
190	qw422016.N().S(`" aria-current="page" href="/`)
191//line navbar.qtpl:50
192	qw422016.E().S(name)
193//line navbar.qtpl:50
194	qw422016.N().S(`/tree">tree</a>
195    </li>
196  </ul>
197`)
198//line navbar.qtpl:53
199}
200
201//line navbar.qtpl:53
202func WriteGitItemNav(qq422016 qtio422016.Writer, name string, s GitSelection) {
203//line navbar.qtpl:53
204	qw422016 := qt422016.AcquireWriter(qq422016)
205//line navbar.qtpl:53
206	StreamGitItemNav(qw422016, name, s)
207//line navbar.qtpl:53
208	qt422016.ReleaseWriter(qw422016)
209//line navbar.qtpl:53
210}
211
212//line navbar.qtpl:53
213func GitItemNav(name string, s GitSelection) string {
214//line navbar.qtpl:53
215	qb422016 := qt422016.AcquireByteBuffer()
216//line navbar.qtpl:53
217	WriteGitItemNav(qb422016, name, s)
218//line navbar.qtpl:53
219	qs422016 := string(qb422016.B)
220//line navbar.qtpl:53
221	qt422016.ReleaseByteBuffer(qb422016)
222//line navbar.qtpl:53
223	return qs422016
224//line navbar.qtpl:53
225}