github.com/kyleu/dbaudit@v0.0.2-0.20240321155047-ff2f2c940496/views/components/edit/Bool.html.go (about) 1 // Code generated by qtc from "Bool.html". DO NOT EDIT. 2 // See https://github.com/valyala/quicktemplate for details. 3 4 // <!-- Content managed by Project Forge, see [projectforge.md] for details. --> 5 6 //line views/components/edit/Bool.html:2 7 package edit 8 9 //line views/components/edit/Bool.html:2 10 import ( 11 "fmt" 12 13 "github.com/kyleu/dbaudit/app/util" 14 ) 15 16 //line views/components/edit/Bool.html:8 17 import ( 18 qtio422016 "io" 19 20 qt422016 "github.com/valyala/quicktemplate" 21 ) 22 23 //line views/components/edit/Bool.html:8 24 var ( 25 _ = qtio422016.Copy 26 _ = qt422016.AcquireByteBuffer 27 ) 28 29 //line views/components/edit/Bool.html:8 30 func StreamBool(qw422016 *qt422016.Writer, key string, id string, x any, nullable bool) { 31 //line views/components/edit/Bool.html:9 32 b, isBool := x.(bool) 33 34 //line views/components/edit/Bool.html:10 35 if isBool && b { 36 //line views/components/edit/Bool.html:10 37 qw422016.N().S(`<label class="radiolabel"><input value="`) 38 //line views/components/edit/Bool.html:11 39 qw422016.E().S(util.BoolTrue) 40 //line views/components/edit/Bool.html:11 41 qw422016.N().S(`" name="`) 42 //line views/components/edit/Bool.html:11 43 qw422016.E().S(key) 44 //line views/components/edit/Bool.html:11 45 qw422016.N().S(`" type="radio" checked="checked" />`) 46 //line views/components/edit/Bool.html:11 47 qw422016.E().S(util.BoolTrue) 48 //line views/components/edit/Bool.html:11 49 qw422016.N().S(`</label>`) 50 //line views/components/edit/Bool.html:12 51 } else { 52 //line views/components/edit/Bool.html:12 53 qw422016.N().S(`<label class="radiolabel"><input value="`) 54 //line views/components/edit/Bool.html:13 55 qw422016.E().S(util.BoolTrue) 56 //line views/components/edit/Bool.html:13 57 qw422016.N().S(`" name="`) 58 //line views/components/edit/Bool.html:13 59 qw422016.E().S(key) 60 //line views/components/edit/Bool.html:13 61 qw422016.N().S(`" type="radio" />`) 62 //line views/components/edit/Bool.html:13 63 qw422016.E().S(util.BoolTrue) 64 //line views/components/edit/Bool.html:13 65 qw422016.N().S(`</label>`) 66 //line views/components/edit/Bool.html:14 67 } 68 //line views/components/edit/Bool.html:16 69 if isBool && !b { 70 //line views/components/edit/Bool.html:16 71 qw422016.N().S(`<label class="radiolabel"><input value="`) 72 //line views/components/edit/Bool.html:17 73 qw422016.E().S(util.BoolFalse) 74 //line views/components/edit/Bool.html:17 75 qw422016.N().S(`" name="`) 76 //line views/components/edit/Bool.html:17 77 qw422016.E().S(key) 78 //line views/components/edit/Bool.html:17 79 qw422016.N().S(`" type="radio" checked="checked" />`) 80 //line views/components/edit/Bool.html:17 81 qw422016.E().S(util.BoolFalse) 82 //line views/components/edit/Bool.html:17 83 qw422016.N().S(`</label>`) 84 //line views/components/edit/Bool.html:18 85 } else { 86 //line views/components/edit/Bool.html:18 87 qw422016.N().S(`<label class="radiolabel"><input value="`) 88 //line views/components/edit/Bool.html:19 89 qw422016.E().S(util.BoolFalse) 90 //line views/components/edit/Bool.html:19 91 qw422016.N().S(`" name="`) 92 //line views/components/edit/Bool.html:19 93 qw422016.E().S(key) 94 //line views/components/edit/Bool.html:19 95 qw422016.N().S(`" type="radio" />`) 96 //line views/components/edit/Bool.html:19 97 qw422016.E().S(util.BoolFalse) 98 //line views/components/edit/Bool.html:19 99 qw422016.N().S(`</label>`) 100 //line views/components/edit/Bool.html:20 101 } 102 //line views/components/edit/Bool.html:22 103 if nullable { 104 //line views/components/edit/Bool.html:23 105 if x == nil { 106 //line views/components/edit/Bool.html:23 107 qw422016.N().S(`<label class="radiolabel"><input value="∅" name="`) 108 //line views/components/edit/Bool.html:24 109 qw422016.E().S(key) 110 //line views/components/edit/Bool.html:24 111 qw422016.N().S(`" type="radio" checked="checked" /> nil</label>`) 112 //line views/components/edit/Bool.html:25 113 } else { 114 //line views/components/edit/Bool.html:25 115 qw422016.N().S(`<label class="radiolabel"><input value="∅" name="`) 116 //line views/components/edit/Bool.html:26 117 qw422016.E().S(key) 118 //line views/components/edit/Bool.html:26 119 qw422016.N().S(`" type="radio" /> nil</label>`) 120 //line views/components/edit/Bool.html:27 121 } 122 //line views/components/edit/Bool.html:28 123 } 124 //line views/components/edit/Bool.html:29 125 } 126 127 //line views/components/edit/Bool.html:29 128 func WriteBool(qq422016 qtio422016.Writer, key string, id string, x any, nullable bool) { 129 //line views/components/edit/Bool.html:29 130 qw422016 := qt422016.AcquireWriter(qq422016) 131 //line views/components/edit/Bool.html:29 132 StreamBool(qw422016, key, id, x, nullable) 133 //line views/components/edit/Bool.html:29 134 qt422016.ReleaseWriter(qw422016) 135 //line views/components/edit/Bool.html:29 136 } 137 138 //line views/components/edit/Bool.html:29 139 func Bool(key string, id string, x any, nullable bool) string { 140 //line views/components/edit/Bool.html:29 141 qb422016 := qt422016.AcquireByteBuffer() 142 //line views/components/edit/Bool.html:29 143 WriteBool(qb422016, key, id, x, nullable) 144 //line views/components/edit/Bool.html:29 145 qs422016 := string(qb422016.B) 146 //line views/components/edit/Bool.html:29 147 qt422016.ReleaseByteBuffer(qb422016) 148 //line views/components/edit/Bool.html:29 149 return qs422016 150 //line views/components/edit/Bool.html:29 151 } 152 153 //line views/components/edit/Bool.html:31 154 func StreamBoolVertical(qw422016 *qt422016.Writer, key string, title string, value bool, indent int, help ...string) { 155 //line views/components/edit/Bool.html:32 156 StreamRadioVertical(qw422016, key, title, fmt.Sprint(value), []string{util.BoolTrue, util.BoolFalse}, []string{"True", "False"}, indent) 157 //line views/components/edit/Bool.html:33 158 } 159 160 //line views/components/edit/Bool.html:33 161 func WriteBoolVertical(qq422016 qtio422016.Writer, key string, title string, value bool, indent int, help ...string) { 162 //line views/components/edit/Bool.html:33 163 qw422016 := qt422016.AcquireWriter(qq422016) 164 //line views/components/edit/Bool.html:33 165 StreamBoolVertical(qw422016, key, title, value, indent, help...) 166 //line views/components/edit/Bool.html:33 167 qt422016.ReleaseWriter(qw422016) 168 //line views/components/edit/Bool.html:33 169 } 170 171 //line views/components/edit/Bool.html:33 172 func BoolVertical(key string, title string, value bool, indent int, help ...string) string { 173 //line views/components/edit/Bool.html:33 174 qb422016 := qt422016.AcquireByteBuffer() 175 //line views/components/edit/Bool.html:33 176 WriteBoolVertical(qb422016, key, title, value, indent, help...) 177 //line views/components/edit/Bool.html:33 178 qs422016 := string(qb422016.B) 179 //line views/components/edit/Bool.html:33 180 qt422016.ReleaseByteBuffer(qb422016) 181 //line views/components/edit/Bool.html:33 182 return qs422016 183 //line views/components/edit/Bool.html:33 184 } 185 186 //line views/components/edit/Bool.html:35 187 func StreamBoolTable(qw422016 *qt422016.Writer, key string, title string, value bool, indent int, help ...string) { 188 //line views/components/edit/Bool.html:36 189 StreamRadioTable(qw422016, key, title, fmt.Sprint(value), []string{util.BoolTrue, util.BoolFalse}, []string{"True", "False"}, indent) 190 //line views/components/edit/Bool.html:37 191 } 192 193 //line views/components/edit/Bool.html:37 194 func WriteBoolTable(qq422016 qtio422016.Writer, key string, title string, value bool, indent int, help ...string) { 195 //line views/components/edit/Bool.html:37 196 qw422016 := qt422016.AcquireWriter(qq422016) 197 //line views/components/edit/Bool.html:37 198 StreamBoolTable(qw422016, key, title, value, indent, help...) 199 //line views/components/edit/Bool.html:37 200 qt422016.ReleaseWriter(qw422016) 201 //line views/components/edit/Bool.html:37 202 } 203 204 //line views/components/edit/Bool.html:37 205 func BoolTable(key string, title string, value bool, indent int, help ...string) string { 206 //line views/components/edit/Bool.html:37 207 qb422016 := qt422016.AcquireByteBuffer() 208 //line views/components/edit/Bool.html:37 209 WriteBoolTable(qb422016, key, title, value, indent, help...) 210 //line views/components/edit/Bool.html:37 211 qs422016 := string(qb422016.B) 212 //line views/components/edit/Bool.html:37 213 qt422016.ReleaseByteBuffer(qb422016) 214 //line views/components/edit/Bool.html:37 215 return qs422016 216 //line views/components/edit/Bool.html:37 217 }