summaryrefslogtreecommitdiffstats
path: root/modules/middleware/context.go
diff options
context:
space:
mode:
authorUnknwon <u@gogs.io>2015-07-08 19:47:56 +0800
committerUnknwon <u@gogs.io>2015-07-08 19:47:56 +0800
commit5cf37323396fa08e8f93baa6f19ad3b1a6371324 (patch)
tree5b65039ae359f52bbc8b0e4abf1924c4c187d9c5 /modules/middleware/context.go
parent5dd3dd71a0529590a209c0e58e0a962b83515ae8 (diff)
downloadgitea-5cf37323396fa08e8f93baa6f19ad3b1a6371324.tar.gz
gitea-5cf37323396fa08e8f93baa6f19ad3b1a6371324.zip
UI: install - new version
Diffstat (limited to 'modules/middleware/context.go')
-rw-r--r--modules/middleware/context.go8
1 files changed, 7 insertions, 1 deletions
diff --git a/modules/middleware/context.go b/modules/middleware/context.go
index 200a74cb3a..2995d5788e 100644
--- a/modules/middleware/context.go
+++ b/modules/middleware/context.go
@@ -106,6 +106,12 @@ func (ctx *Context) HasError() bool {
return hasErr.(bool)
}
+// HasValue returns true if value of given name exists.
+func (ctx *Context) HasValue(name string) bool {
+ _, ok := ctx.Data[name]
+ return ok
+}
+
// HTML calls Context.HTML and converts template name to string.
func (ctx *Context) HTML(status int, name base.TplName) {
ctx.Context.HTML(status, string(name))
@@ -140,7 +146,7 @@ func (ctx *Context) Handle(status int, title string, err error) {
}
func (ctx *Context) HandleText(status int, title string) {
- if (status / 100 == 4) || (status / 100 == 5) {
+ if (status/100 == 4) || (status/100 == 5) {
log.Error(4, "%s", title)
}
ctx.RenderData(status, []byte(title))