Fixed showing correct index in issue comment
Signed-off-by: Konrad <konrad@kola-entertainments.de>
This commit is contained in:
parent
4d992e7c90
commit
26b283f3c4
|
|
@ -279,6 +279,18 @@ func (c *Comment) LoadAssignees() error {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Load Dependent Issue Details
|
||||||
|
func (c *Comment) LoadDepIssueDetails() error {
|
||||||
|
var err error
|
||||||
|
if c.DependentIssueID > 0 {
|
||||||
|
c.DependentIssue, err = getIssueByID(x, c.DependentIssueID)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
// MailParticipants sends new comment emails to repository watchers
|
// MailParticipants sends new comment emails to repository watchers
|
||||||
// and mentioned people.
|
// and mentioned people.
|
||||||
func (c *Comment) MailParticipants(e Engine, opType ActionType, issue *Issue) (err error) {
|
func (c *Comment) MailParticipants(e Engine, opType ActionType, issue *Issue) (err error) {
|
||||||
|
|
|
||||||
|
|
@ -27,6 +27,7 @@ import (
|
||||||
"code.gitea.io/gitea/modules/notification"
|
"code.gitea.io/gitea/modules/notification"
|
||||||
"code.gitea.io/gitea/modules/setting"
|
"code.gitea.io/gitea/modules/setting"
|
||||||
"code.gitea.io/gitea/modules/util"
|
"code.gitea.io/gitea/modules/util"
|
||||||
|
"net/http"
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
|
@ -641,6 +642,11 @@ func ViewIssue(ctx *context.Context) {
|
||||||
ctx.Handle(500, "LoadAssignees", err)
|
ctx.Handle(500, "LoadAssignees", err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
} else if comment.Type == models.CommentTypeRemovedDependency || comment.Type == models.CommentTypeAddedDependency{
|
||||||
|
if err = comment.LoadDepIssueDetails(); err != nil{
|
||||||
|
ctx.Handle(http.StatusInternalServerError, "LoadDepIssueDetails", err)
|
||||||
|
return
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -155,7 +155,7 @@
|
||||||
|
|
||||||
<!-- TODO: Use issue index instead of id -->
|
<!-- TODO: Use issue index instead of id -->
|
||||||
|
|
||||||
<a href="{{$.RepoLink}}/issues/{{.DependentIssueID}}">#{{.DependentIssueID}} {{.Content}}</a>
|
<a href="{{$.RepoLink}}/issues/{{.DependentIssue.Index}}">#{{.DependentIssue.Index}} {{.Content}}</a>
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -171,7 +171,7 @@
|
||||||
<div class="detail">
|
<div class="detail">
|
||||||
<span class="text grey">
|
<span class="text grey">
|
||||||
<i class="octicon octicon-trashcan"></i>
|
<i class="octicon octicon-trashcan"></i>
|
||||||
<a href="{{$.RepoLink}}/issues/{{.DependentIssueID}}">#{{.DependentIssueID}} {{.Content}}</a>
|
<a href="{{$.RepoLink}}/issues/{{.DependentIssue.Index}}">#{{.DependentIssue.Index}} {{.Content}}</a>
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user