0
0
mirror of https://github.com/go-gitea/gitea.git synced 2026-04-04 23:10:38 +02:00
gitea/templates/repo/diff/commit_conversation.tmpl
yuvrajangadsingh 3a08115768 refactor: use Comment table with junction table for commit comments
Per @lunny's feedback, rework to reuse the existing Comment table
instead of a standalone commit_comment table. The junction table
(commit_comment) now only stores repo_id, commit_sha, comment_id.

Actual comment data (content, tree_path, line, patch, poster) lives
in the Comment table with Type = CommentTypeCommitComment (39).
This gives commit comments reactions, attachments, and all existing
comment infrastructure for free.
2026-04-02 16:55:52 +05:30

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" $ "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 $.SignedUserID (not $.Repository.IsArchived)}}
{{template "repo/diff/commit_comment_form" dict "hidden" true "root" $}}
{{end}}
</div>
</div>
{{end}}