Merge pull request #802 from mattermost/plt-291

PLT-291 Fixing 404 page props
This commit is contained in:
Corey Hulen
2015-09-25 08:13:45 -07:00
2 changed files with 6 additions and 11 deletions

View File

@@ -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) {

View File

@@ -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>