gitea
Зеркало из https://github.com/go-gitea/gitea
1{{range .comments}}
2
3{{$createdStr:= TimeSinceUnix .CreatedUnix ctx.Locale}}
4<div class="comment" id="{{.HashTag}}">
5{{if .OriginalAuthor}}
6<span class="avatar">{{ctx.AvatarUtils.Avatar nil}}</span>
7{{else}}
8{{template "shared/user/avatarlink" dict "user" .Poster}}
9{{end}}
10<div class="content comment-container">
11<div class="ui top attached header comment-header tw-flex tw-items-center tw-justify-between">
12<div class="comment-header-left tw-flex tw-items-center">
13{{if .OriginalAuthor}}
14<span class="text black tw-font-semibold tw-mr-1">
15{{svg (MigrationIcon $.root.Repository.GetOriginalURLHostname)}}
16{{.OriginalAuthor}}
17</span>
18<span class="text grey muted-links">
19{{ctx.Locale.Tr "repo.issues.commented_at" .HashTag $createdStr}}
20</span>
21<span class="text migrate">
22{{if $.root.Repository.OriginalURL}}
23({{ctx.Locale.Tr "repo.migrated_from" $.root.Repository.OriginalURL $.root.Repository.GetOriginalURLHostname}})
24{{end}}
25</span>
26{{else}}
27<span class="text grey muted-links">
28{{template "shared/user/namelink" .Poster}}
29{{ctx.Locale.Tr "repo.issues.commented_at" .HashTag $createdStr}}
30</span>
31{{end}}
32</div>
33<div class="comment-header-right actions tw-flex tw-items-center">
34{{if .Invalidated}}
35{{$referenceUrl := printf "%s#%s" $.root.Issue.Link .HashTag}}
36<a href="{{$referenceUrl}}" class="ui label basic small" data-tooltip-content="{{ctx.Locale.Tr "repo.issues.review.outdated_description"}}">
37{{ctx.Locale.Tr "repo.issues.review.outdated"}}
38</a>
39{{end}}
40{{if .Review}}
41{{if eq .Review.Type 0}}
42<div class="ui label basic small yellow pending-label" data-tooltip-content="{{ctx.Locale.Tr "repo.issues.review.pending.tooltip" (ctx.Locale.Tr "repo.diff.review") (ctx.Locale.Tr "repo.diff.review.approve") (ctx.Locale.Tr "repo.diff.review.comment") (ctx.Locale.Tr "repo.diff.review.reject")}}">
43{{ctx.Locale.Tr "repo.issues.review.pending"}}
44</div>
45{{else}}
46<div class="ui label basic small">
47{{ctx.Locale.Tr "repo.issues.review.review"}}
48</div>
49{{end}}
50{{end}}
51{{template "repo/issue/view_content/add_reaction" dict "ActionURL" (printf "%s/comments/%d/reactions" $.root.RepoLink .ID)}}
52{{template "repo/issue/view_content/context_menu" dict "ctxData" $.root "item" . "delete" true "issue" false "diff" true "IsCommentPoster" (and $.root.IsSigned (eq $.root.SignedUserID .PosterID))}}
53</div>
54</div>
55<div class="ui attached segment comment-body">
56<div class="render-content markup" {{if or $.Permission.IsAdmin $.HasIssuesOrPullsWritePermission (and $.root.IsSigned (eq $.root.SignedUserID .PosterID))}}data-can-edit="true"{{end}}>
57{{if .RenderedContent}}
58{{.RenderedContent}}
59{{else}}
60<span class="no-content">{{ctx.Locale.Tr "repo.issues.no_content"}}</span>
61{{end}}
62</div>
63<div id="issuecomment-{{.ID}}-raw" class="raw-content tw-hidden">{{.Content}}</div>
64<div class="edit-content-zone tw-hidden" data-update-url="{{$.root.RepoLink}}/comments/{{.ID}}" data-content-version="{{.ContentVersion}}" data-context="{{$.root.RepoLink}}" data-attachment-url="{{$.root.RepoLink}}/comments/{{.ID}}/attachments"></div>
65{{if .Attachments}}
66{{template "repo/issue/view_content/attachments" dict "Attachments" .Attachments "RenderedContent" .RenderedContent}}
67{{end}}
68</div>
69{{$reactions := .Reactions.GroupByType}}
70{{if $reactions}}
71{{template "repo/issue/view_content/reactions" dict "ActionURL" (printf "%s/comments/%d/reactions" $.root.RepoLink .ID) "Reactions" $reactions}}
72{{end}}
73</div>
74</div>
75{{end}}
76