github.com/kyleu/dbaudit@v0.0.2-0.20240321155047-ff2f2c940496/views/verror/Unauthorized.html (about) 1 <!-- Content managed by Project Forge, see [projectforge.md] for details. --> 2 {% import ( 3 "github.com/kyleu/dbaudit/app" 4 "github.com/kyleu/dbaudit/app/controller/cutil" 5 "github.com/kyleu/dbaudit/app/lib/user" 6 "github.com/kyleu/dbaudit/views/layout" 7 ) %} 8 9 {% code type Unauthorized struct { 10 layout.Basic 11 Path string 12 Message string 13 Accounts user.Accounts 14 } %} 15 16 {% func (p *Unauthorized) Body(as *app.State, ps *cutil.PageState) %} 17 <div class="card"> 18 <h3>Unauthorized</h3> 19 <em>{%s p.Message %}</em> 20 <p>You're not authorized to view <code>{%s p.Path %}</code></p> 21 {%- if len(p.Accounts) == 0 -%} 22 <p>Sorry about that, maybe try <a href="{%s as.Auth.LoginURL() %}">logging in</a>?</p> 23 {%- endif -%} 24 </div> 25 {% endfunc %} 26