Add link to comment in code
Signed-off-by: Jonas Franz <info@jonasfranz.software>
This commit is contained in:
parent
c79e5a1f53
commit
39fcc99583
|
@ -433,6 +433,15 @@ func (c *Comment) MustAsDiff() *Diff {
|
|||
return diff
|
||||
}
|
||||
|
||||
func (c *Comment) CodeCommentURL() string {
|
||||
err := c.LoadIssue()
|
||||
if err != nil { // Silently dropping errors :unamused:
|
||||
log.Error(4, "LoadIssue(%d): %v", c.IssueID, err)
|
||||
return ""
|
||||
}
|
||||
return fmt.Sprintf("%s/files#%s", c.Issue.HTMLURL(), c.HashTag())
|
||||
}
|
||||
|
||||
func createComment(e *xorm.Session, opts *CreateCommentOptions) (_ *Comment, err error) {
|
||||
var LabelID int64
|
||||
if opts.Label != nil {
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -371,7 +371,11 @@ pre, code {
|
|||
}
|
||||
}
|
||||
|
||||
.file-comment {
|
||||
font: 12px Consolas,"Liberation Mono",Menlo,Courier,monospace;
|
||||
color: rgba(0,0,0,.87);
|
||||
|
||||
}
|
||||
|
||||
.overflow.menu {
|
||||
.items {
|
||||
|
|
|
@ -271,7 +271,7 @@
|
|||
{{$.i18n.Tr "repo.issues.review.hide_outdated"}}
|
||||
</button>
|
||||
{{end}}
|
||||
<code>{{$filename}}</code>
|
||||
<a href="{{(index $comms 0).CodeCommentURL}}" class="file-comment">{{$filename}}</a>
|
||||
</div>
|
||||
{{$diff := ((index $comms 0).MustAsDiff)}}
|
||||
{{if $diff}}
|
||||
|
|
Loading…
Reference in New Issue
Block a user