github.com/kyleu/dbaudit@v0.0.2-0.20240321155047-ff2f2c940496/views/vprofile/Profile.html.go (about) 1 // Code generated by qtc from "Profile.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/vprofile/Profile.html:2 7 package vprofile 8 9 //line views/vprofile/Profile.html:2 10 import ( 11 "github.com/kyleu/dbaudit/app" 12 "github.com/kyleu/dbaudit/app/controller/cutil" 13 "github.com/kyleu/dbaudit/app/lib/auth" 14 "github.com/kyleu/dbaudit/app/lib/theme" 15 "github.com/kyleu/dbaudit/app/lib/user" 16 "github.com/kyleu/dbaudit/views/components" 17 "github.com/kyleu/dbaudit/views/components/edit" 18 "github.com/kyleu/dbaudit/views/layout" 19 "github.com/kyleu/dbaudit/views/vauth" 20 "github.com/kyleu/dbaudit/views/vtheme" 21 ) 22 23 //line views/vprofile/Profile.html:15 24 import ( 25 qtio422016 "io" 26 27 qt422016 "github.com/valyala/quicktemplate" 28 ) 29 30 //line views/vprofile/Profile.html:15 31 var ( 32 _ = qtio422016.Copy 33 _ = qt422016.AcquireByteBuffer 34 ) 35 36 //line views/vprofile/Profile.html:15 37 type Profile struct { 38 layout.Basic 39 Profile *user.Profile 40 Theme *theme.Theme 41 Providers auth.Providers 42 Referrer string 43 } 44 45 //line views/vprofile/Profile.html:23 46 func (p *Profile) StreamBody(qw422016 *qt422016.Writer, as *app.State, ps *cutil.PageState) { 47 //line views/vprofile/Profile.html:23 48 qw422016.N().S(` 49 `) 50 //line views/vprofile/Profile.html:24 51 vauth.StreamSigninTable(qw422016, p.Providers, p.Referrer, as, ps) 52 //line views/vprofile/Profile.html:24 53 qw422016.N().S(` 54 <form action="" method="post"> 55 <input name="referrer" type="hidden" value="`) 56 //line views/vprofile/Profile.html:26 57 qw422016.E().S(p.Referrer) 58 //line views/vprofile/Profile.html:26 59 qw422016.N().S(`" /> 60 <div class="card"> 61 <div class="right"> 62 <a href="#modal-profile"><button type="button">Profile</button></a> 63 <a href="#modal-theme"><button type="button">Theme</button></a> 64 </div> 65 <h3>Profile</h3> 66 <div class="overflow full-width"> 67 <table class="mt expanded"> 68 <tbody> 69 `) 70 //line views/vprofile/Profile.html:36 71 edit.StreamStringTable(qw422016, "name", "", "Name", ps.Username(), 5) 72 //line views/vprofile/Profile.html:36 73 qw422016.N().S(` 74 <tr> 75 <th class="shrink"><label>Mode</label></th> 76 <td> 77 <label> 78 `) 79 //line views/vprofile/Profile.html:41 80 if p.Profile.Mode == "" { 81 //line views/vprofile/Profile.html:41 82 qw422016.N().S(` <input type="radio" class="mode-input" name="mode" value="" checked="checked" /> 83 `) 84 //line views/vprofile/Profile.html:43 85 } else { 86 //line views/vprofile/Profile.html:43 87 qw422016.N().S(` <input type="radio" class="mode-input" name="mode" value="" /> 88 `) 89 //line views/vprofile/Profile.html:45 90 } 91 //line views/vprofile/Profile.html:45 92 qw422016.N().S(` System Default 93 </label> 94 <label> 95 `) 96 //line views/vprofile/Profile.html:49 97 if p.Profile.Mode == "light" { 98 //line views/vprofile/Profile.html:49 99 qw422016.N().S(` <input type="radio" class="mode-input" name="mode" value="light" checked="checked" /> 100 `) 101 //line views/vprofile/Profile.html:51 102 } else { 103 //line views/vprofile/Profile.html:51 104 qw422016.N().S(` <input type="radio" class="mode-input" name="mode" value="light" /> 105 `) 106 //line views/vprofile/Profile.html:53 107 } 108 //line views/vprofile/Profile.html:53 109 qw422016.N().S(` Light 110 </label> 111 <label> 112 `) 113 //line views/vprofile/Profile.html:57 114 if p.Profile.Mode == "dark" { 115 //line views/vprofile/Profile.html:57 116 qw422016.N().S(` <input type="radio" class="mode-input" name="mode" value="dark" checked="checked" /> 117 `) 118 //line views/vprofile/Profile.html:59 119 } else { 120 //line views/vprofile/Profile.html:59 121 qw422016.N().S(` <input type="radio" class="mode-input" name="mode" value="dark" /> 122 `) 123 //line views/vprofile/Profile.html:61 124 } 125 //line views/vprofile/Profile.html:61 126 qw422016.N().S(` Dark 127 </label> 128 </td> 129 </tr> 130 `) 131 //line views/vprofile/Profile.html:66 132 vtheme.StreamChoicePanel(qw422016, as.Themes.All(ps.Logger), "app", 5, ps) 133 //line views/vprofile/Profile.html:66 134 qw422016.N().S(` 135 </tbody> 136 </table> 137 </div> 138 <div class="mt"> 139 <button type="submit">Save All Changes</button> 140 <button type="reset">Reset</button> 141 </div> 142 </div> 143 </form> 144 145 `) 146 //line views/vprofile/Profile.html:77 147 components.StreamJSONModal(qw422016, "profile", "Profile JSON", p.Profile, 1) 148 //line views/vprofile/Profile.html:77 149 qw422016.N().S(` 150 `) 151 //line views/vprofile/Profile.html:78 152 components.StreamJSONModal(qw422016, "theme", "Theme JSON", p.Theme, 1) 153 //line views/vprofile/Profile.html:78 154 qw422016.N().S(` 155 `) 156 //line views/vprofile/Profile.html:79 157 } 158 159 //line views/vprofile/Profile.html:79 160 func (p *Profile) WriteBody(qq422016 qtio422016.Writer, as *app.State, ps *cutil.PageState) { 161 //line views/vprofile/Profile.html:79 162 qw422016 := qt422016.AcquireWriter(qq422016) 163 //line views/vprofile/Profile.html:79 164 p.StreamBody(qw422016, as, ps) 165 //line views/vprofile/Profile.html:79 166 qt422016.ReleaseWriter(qw422016) 167 //line views/vprofile/Profile.html:79 168 } 169 170 //line views/vprofile/Profile.html:79 171 func (p *Profile) Body(as *app.State, ps *cutil.PageState) string { 172 //line views/vprofile/Profile.html:79 173 qb422016 := qt422016.AcquireByteBuffer() 174 //line views/vprofile/Profile.html:79 175 p.WriteBody(qb422016, as, ps) 176 //line views/vprofile/Profile.html:79 177 qs422016 := string(qb422016.B) 178 //line views/vprofile/Profile.html:79 179 qt422016.ReleaseByteBuffer(qb422016) 180 //line views/vprofile/Profile.html:79 181 return qs422016 182 //line views/vprofile/Profile.html:79 183 }