aboutsummaryrefslogtreecommitdiff
path: root/pkg/context/context.go
diff options
context:
space:
mode:
authorUnknwon <u@gogs.io>2017-04-07 21:44:55 -0400
committerUnknwon <u@gogs.io>2017-04-07 21:44:55 -0400
commit91cd350b631f721d1d6dd38bbafd3cac612e53c6 (patch)
tree9c9355f33fa24ca8a9df18ee1851047a87685a61 /pkg/context/context.go
parent6ea9642d6415073c6312c80bf6533a5070630ad2 (diff)
repo/editor: fix wrong context for subdirectory (#4368)
Diffstat (limited to 'pkg/context/context.go')
-rw-r--r--pkg/context/context.go13
1 files changed, 13 insertions, 0 deletions
diff --git a/pkg/context/context.go b/pkg/context/context.go
index 1457deec..abf4aaec 100644
--- a/pkg/context/context.go
+++ b/pkg/context/context.go
@@ -51,6 +51,19 @@ func (c *Context) PageIs(name string) {
c.Data["PageIs"+name] = true
}
+// Require sets "Requirexxx" field in template data.
+func (c *Context) Require(name string) {
+ c.Data["Require"+name] = true
+}
+
+func (c *Context) RequireHighlightJS() {
+ c.Require("HighlightJS")
+}
+
+func (c *Context) RequireSimpleMDE() {
+ c.Require("SimpleMDE")
+}
+
// FormErr sets "Err_xxx" field in template data.
func (c *Context) FormErr(names ...string) {
for i := range names {