summaryrefslogtreecommitdiffstats
path: root/modules/context/repo.go
diff options
context:
space:
mode:
Diffstat (limited to 'modules/context/repo.go')
-rw-r--r--modules/context/repo.go15
1 files changed, 15 insertions, 0 deletions
diff --git a/modules/context/repo.go b/modules/context/repo.go
index aca1e1b63c..8de5b9821b 100644
--- a/modules/context/repo.go
+++ b/modules/context/repo.go
@@ -477,3 +477,18 @@ func GitHookService() macaron.Handler {
}
}
}
+
+// UnitTypes returns a macaron middleware to set unit types to context variables.
+func UnitTypes() macaron.Handler {
+ return func(ctx *Context) {
+ ctx.Data["UnitTypeCode"] = models.UnitTypeCode
+ ctx.Data["UnitTypeIssues"] = models.UnitTypeIssues
+ ctx.Data["UnitTypePullRequests"] = models.UnitTypePullRequests
+ ctx.Data["UnitTypeCommits"] = models.UnitTypeCommits
+ ctx.Data["UnitTypeReleases"] = models.UnitTypeReleases
+ ctx.Data["UnitTypeWiki"] = models.UnitTypeWiki
+ ctx.Data["UnitTypeSettings"] = models.UnitTypeSettings
+ ctx.Data["UnitTypeExternalWiki"] = models.UnitTypeExternalWiki
+ ctx.Data["UnitTypeExternalTracker"] = models.UnitTypeExternalTracker
+ }
+}