summaryrefslogtreecommitdiffstats
path: root/api
diff options
context:
space:
mode:
authorCorey Hulen <corey@hulen.com>2015-09-25 08:13:45 -0700
committerCorey Hulen <corey@hulen.com>2015-09-25 08:13:45 -0700
commit74ccf423875a5310f11b28f92406572142cd2ed8 (patch)
treee03dac4490074c0172fee137ad9266304fea1430 /api
parent2322a7c74ed8e5d411e08e59b45c54f4663a1683 (diff)
parent3bb2e67203c70e494b40b8bea532730bea336d4c (diff)
downloadchat-74ccf423875a5310f11b28f92406572142cd2ed8.tar.gz
chat-74ccf423875a5310f11b28f92406572142cd2ed8.tar.bz2
chat-74ccf423875a5310f11b28f92406572142cd2ed8.zip
Merge pull request #802 from mattermost/plt-291
PLT-291 Fixing 404 page props
Diffstat (limited to 'api')
-rw-r--r--api/context.go15
-rw-r--r--api/templates/error.html2
2 files changed, 6 insertions, 11 deletions
diff --git a/api/context.go b/api/context.go
index 9a276a1a1..f123d8702 100644
--- a/api/context.go
+++ b/api/context.go
@@ -456,18 +456,13 @@ func IsPrivateIpAddress(ipAddress string) bool {
}
func RenderWebError(err *model.AppError, w http.ResponseWriter, r *http.Request) {
-
- protocol := GetProtocol(r)
- SiteURL := protocol + "://" + r.Host
-
- m := make(map[string]string)
- m["Message"] = err.Message
- m["Details"] = err.DetailedError
- m["SiteName"] = utils.Cfg.TeamSettings.SiteName
- m["SiteURL"] = SiteURL
+ props := make(map[string]string)
+ props["Message"] = err.Message
+ props["Details"] = err.DetailedError
+ props["SiteURL"] = GetProtocol(r) + "://" + r.Host
w.WriteHeader(err.StatusCode)
- ServerTemplates.ExecuteTemplate(w, "error.html", m)
+ ServerTemplates.ExecuteTemplate(w, "error.html", Page{Props: props, ClientProps: utils.ClientProperties})
}
func Handle404(w http.ResponseWriter, r *http.Request) {
diff --git a/api/templates/error.html b/api/templates/error.html
index 760578896..6b643556e 100644
--- a/api/templates/error.html
+++ b/api/templates/error.html
@@ -23,7 +23,7 @@
<div class="error__container">
<div class="error__icon"><i class="fa fa-exclamation-triangle"></i></div>
<h2>{{ .ClientProps.SiteName }} needs your help:</h2>
- <p>{{.Message}}</p>
+ <p>{{ .Props.Message }}</p>
<a href="{{.Props.SiteURL}}">Go back to team site</a>
</div>
</div>