Core

/views/verror/Unauthorized.html (747 B)

 1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
{% import (
"{{{ .Package }}}/app"
"{{{ .Package }}}/app/controller/cutil"{{{ if .HasAccount }}}
"{{{ .Package }}}/app/lib/user"{{{ end }}}
"{{{ .Package }}}/views/layout"
) %}

{% code type Unauthorized struct {
layout.Basic
Path string
Message string{{{ if .HasAccount }}}
Accounts user.Accounts{{{ end }}}
} %}

{% func (p *Unauthorized) Body(as *app.State, ps *cutil.PageState) %}
<div class="card">
<h3>Unauthorized</h3>
<em>{%s p.Message %}</em>
<p>You're not authorized to view <code>{%s p.Path %}</code></p>{{{ if.HasAccount }}}
{%- if len(p.Accounts) == 0 -%}
<p>Sorry about that, maybe try <a href="{%s as.Auth.LoginURL() %}">logging in</a>?</p>
{%- endif -%}{{{ end }}}
</div>
{% endfunc %}