mirror of
https://github.com/go-gitea/gitea.git
synced 2026-04-04 18:56:28 +02:00
- Remove commit_comment junction table, query Comment directly via repo_id + commit_sha + type filter - Add RepoID column to Comment (migration v326) - Add reqRepoCodeWriter permission checks to all commit comment routes - Fix delete auth: use CanWrite(TypeCode) instead of IsAdmin() - Fix CanComment: gate on write access, not read - Guard LoadIssue against IssueID=0 (commit comments have no issue) - Extract duplicated markdown rendering loop in commit.go - Fix template dict keys: use "root" instead of "." - Show delete button for users with code write access - Add unit tests for create, delete, get, find operations
26 lines
1.1 KiB
Handlebars
26 lines
1.1 KiB
Handlebars
{{if .comments}}
|
|
{{$comment := index .comments 0}}
|
|
<div class="conversation-holder" data-path="{{$comment.TreePath}}" data-side="{{if eq $comment.DiffSide "previous"}}left{{else}}right{{end}}" data-idx="{{$comment.UnsignedLine}}">
|
|
<div id="code-comments-{{$comment.ID}}" class="field comment-code-cloud">
|
|
<div class="comment-list">
|
|
<div class="ui comments">
|
|
{{template "repo/diff/commit_comments" dict "root" $.root "comments" .comments}}
|
|
</div>
|
|
</div>
|
|
<div class="flex-text-block tw-mt-2 tw-flex-wrap tw-justify-end">
|
|
<div class="ui buttons">
|
|
<button class="ui icon tiny basic button previous-conversation">
|
|
{{svg "octicon-arrow-up" 12}} {{ctx.Locale.Tr "repo.issues.previous"}}
|
|
</button>
|
|
<button class="ui icon tiny basic button next-conversation">
|
|
{{svg "octicon-arrow-down" 12}} {{ctx.Locale.Tr "repo.issues.next"}}
|
|
</button>
|
|
</div>
|
|
</div>
|
|
{{if and $.root.SignedUserID (not $.root.Repository.IsArchived)}}
|
|
{{template "repo/diff/commit_comment_form" dict "hidden" true "root" $.root}}
|
|
{{end}}
|
|
</div>
|
|
</div>
|
|
{{end}}
|