forked from forgejo/forgejo
Add units concept for modulable functions of a repository (#742)
* Add units concept for modulable functions of a repository * remove unused comment codes & fix lints and tests * remove unused comment codes * use struct config instead of map * fix lint * rm wrong files * fix tests
This commit is contained in:
parent
49fa03bf42
commit
8a421b1fd7
16 changed files with 668 additions and 89 deletions
|
@ -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
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue