Remove non-API navigation links when using auth
This commit is contained in:
parent
be15ba076d
commit
6987edc0d8
@ -98,6 +98,7 @@ func setup() *web.Mux {
|
|||||||
TemplateSet := pongo2.NewSet("templates", p2l)
|
TemplateSet := pongo2.NewSet("templates", p2l)
|
||||||
TemplateSet.Globals["sitename"] = Config.siteName
|
TemplateSet.Globals["sitename"] = Config.siteName
|
||||||
TemplateSet.Globals["siteurl"] = Config.siteURL
|
TemplateSet.Globals["siteurl"] = Config.siteURL
|
||||||
|
TemplateSet.Globals["using_auth"] = Config.authFile != ""
|
||||||
err = populateTemplatesMap(TemplateSet, Templates)
|
err = populateTemplatesMap(TemplateSet, Templates)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatal("Error: could not load templates", err)
|
log.Fatal("Error: could not load templates", err)
|
||||||
|
@ -13,8 +13,10 @@
|
|||||||
<div id="container">
|
<div id="container">
|
||||||
<div id="header">
|
<div id="header">
|
||||||
<div id="navigation" class="right">
|
<div id="navigation" class="right">
|
||||||
|
{% if !using_auth %}
|
||||||
<a href="/">Upload</a> |
|
<a href="/">Upload</a> |
|
||||||
<a href="/paste/">Paste</a> |
|
<a href="/paste/">Paste</a> |
|
||||||
|
{% endif %}
|
||||||
<a href="/API/">API</a>
|
<a href="/API/">API</a>
|
||||||
</div>
|
</div>
|
||||||
<h2><a href="/" title="{{ sitename }}">{{ sitename }}</a></h2>
|
<h2><a href="/" title="{{ sitename }}">{{ sitename }}</a></h2>
|
||||||
|
Loading…
Reference in New Issue
Block a user