fixed template issue, resolved conflicts

Signed-off-by: Konrad <konrad@kola-entertainments.de>
This commit is contained in:
Konrad Langenberg 2017-09-17 21:53:28 +02:00 committed by Konrad
parent 3417d871d9
commit c1ee648998
5 changed files with 7 additions and 11 deletions

View File

@ -473,7 +473,7 @@ func UpdateIssuesCommit(doer *User, repo *Repository, commits []*PushCommit) err
} }
// Check for dependencies, if there aren't any, close it // Check for dependencies, if there aren't any, close it
canbeClosed := IssueNoDependenciesLeft(issue.ID) canbeClosed := IssueNoDependenciesLeft(issue)
if canbeClosed { if canbeClosed {
if err = issue.ChangeStatus(doer, repo, true); err != nil { if err = issue.ChangeStatus(doer, repo, true); err != nil {

View File

@ -922,7 +922,7 @@ func NewComment(ctx *context.Context, form auth.CreateCommentForm) {
// Check for open dependencies // Check for open dependencies
if form.Status == "close" { if form.Status == "close" {
canbeClosed := models.IssueNoDependenciesLeft(issue.ID) canbeClosed := models.IssueNoDependenciesLeft(issue)
if !canbeClosed { if !canbeClosed {
if issue.IsPull { if issue.IsPull {

View File

@ -40,7 +40,9 @@ func AddDependency(c *context.Context) {
// Dependency // Dependency
dep, err := models.GetIssueByID(depID) dep, err := models.GetIssueByID(depID)
if err != nil { if err != nil {
c.Handle(http.StatusInternalServerError, "GetIssueByID", err) c.Flash.Error(c.Tr("add_error_dep_not_exist"))
url := fmt.Sprintf("%s/issues/%d", c.Repo.RepoLink, issueIndex)
c.Redirect(url, http.StatusSeeOther)
return return
} }
@ -49,16 +51,12 @@ func AddDependency(c *context.Context) {
c.Flash.Error(c.Tr("issues.dependency.add_error_same_issue")) c.Flash.Error(c.Tr("issues.dependency.add_error_same_issue"))
} else { } else {
exists, depExists, err := models.CreateIssueDependency(c.User, issue, dep) err, exists := models.CreateIssueDependency(c.User, issue, dep)
if err != nil { if err != nil {
c.Handle(http.StatusInternalServerError, "CreateOrUpdateIssueDependency", err) c.Handle(http.StatusInternalServerError, "CreateOrUpdateIssueDependency", err)
return return
} }
if !depExists {
c.Flash.Error(c.Tr("add_error_dep_not_exist"))
}
if exists { if exists {
c.Flash.Error(c.Tr("add_error_dep_exists")) c.Flash.Error(c.Tr("add_error_dep_exists"))
} }

View File

@ -428,7 +428,7 @@ func MergePullRequest(ctx *context.Context) {
pr.Issue = issue pr.Issue = issue
pr.Issue.Repo = ctx.Repo.Repository pr.Issue.Repo = ctx.Repo.Repository
canbeClosed := models.IssueNoDependenciesLeft(issue.ID) canbeClosed := models.IssueNoDependenciesLeft(issue)
if !canbeClosed { if !canbeClosed {
ctx.Flash.Error("You need to close all issues blocking this pull request before you can merge it!") ctx.Flash.Error("You need to close all issues blocking this pull request before you can merge it!")

View File

@ -181,7 +181,6 @@
</a> </a>
<span class="text grey"><a href="{{.Poster.HomeLink}}">{{.Poster.Name}}</a> {{$.i18n.Tr "repo.issues.cancel_tracking_history" $createdStr | Safe}}</span> <span class="text grey"><a href="{{.Poster.HomeLink}}">{{.Poster.Name}}</a> {{$.i18n.Tr "repo.issues.cancel_tracking_history" $createdStr | Safe}}</span>
</div> </div>
{{end}}
{{else if eq .Type 16}} {{else if eq .Type 16}}
<div class="event"> <div class="event">
<span class="octicon octicon-primitive-dot"></span> <span class="octicon octicon-primitive-dot"></span>
@ -192,7 +191,6 @@
<span class="text grey"> <span class="text grey">
{{$.i18n.Tr "repo.issues.dependency.added_dependency" .Poster.HomeLink .Poster.Name $createdStr | Safe}} {{$.i18n.Tr "repo.issues.dependency.added_dependency" .Poster.HomeLink .Poster.Name $createdStr | Safe}}
</span> </span>
{{end}}
{{else if eq .Type 17}} {{else if eq .Type 17}}
<div class="event"> <div class="event">
<span class="octicon octicon-primitive-dot"></span> <span class="octicon octicon-primitive-dot"></span>