Fully implemented Repo setting to enable/disable Issue Dependencies
Signed-off-by: Konrad <konrad@kola-entertainments.de>
This commit is contained in:
parent
c0d03825d1
commit
6e5c686457
|
|
@ -714,6 +714,7 @@ func ViewIssue(ctx *context.Context) {
|
|||
}
|
||||
|
||||
// Get Dependencies
|
||||
ctx.Data["IssueDependenciesEnabled"] = repo.UnitEnabled(models.UnitTypeIssueDependencies)
|
||||
ctx.Data["BlockedByDependencies"], err = repo.BlockedByDependencies(issue.ID)
|
||||
ctx.Data["BlockingDependencies"], err = repo.BlockingDependencies(issue.ID)
|
||||
|
||||
|
|
|
|||
|
|
@ -15,6 +15,9 @@ import (
|
|||
|
||||
// Adds new dependencies
|
||||
func AddDependency(c *context.Context) {
|
||||
|
||||
// TODO: should should an issue only have dependencies in it's own repo?
|
||||
|
||||
depID, err := strconv.ParseInt(c.Req.PostForm.Get("newDependency"), 10, 64)
|
||||
if err != nil {
|
||||
c.Handle(http.StatusBadRequest, "issue ID is not int", err)
|
||||
|
|
@ -28,6 +31,12 @@ func AddDependency(c *context.Context) {
|
|||
return
|
||||
}
|
||||
|
||||
// Check if the Repo is allowed to have dependencies
|
||||
if !c.Repo.Repository.UnitEnabled(models.UnitTypeIssueDependencies) {
|
||||
c.Handle(404, "MustEnableIssueDependencies", nil)
|
||||
return
|
||||
}
|
||||
|
||||
// Dependency
|
||||
dep, err := models.GetIssueByID(depID)
|
||||
if err != nil {
|
||||
|
|
|
|||
|
|
@ -191,6 +191,7 @@
|
|||
{{end}}
|
||||
{{end}}
|
||||
|
||||
{{if .IssueDependenciesEnabled}}
|
||||
<div class="ui divider"></div>
|
||||
|
||||
<div class="ui depending">
|
||||
|
|
@ -309,3 +310,4 @@
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{end}}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user