1{{ template "base/alert" }}
2{{range .Issue.Comments}}
3	{{ $createdStr:= TimeSinceUnix .CreatedUnix $.Lang }}
4
5	<!-- 0 = COMMENT, 1 = REOPEN, 2 = CLOSE, 3 = ISSUE_REF, 4 = COMMIT_REF,
6	5 = COMMENT_REF, 6 = PULL_REF, 7 = COMMENT_LABEL, 12 = START_TRACKING,
7	13 = STOP_TRACKING, 14 = ADD_TIME_MANUAL, 16 = ADDED_DEADLINE, 17 = MODIFIED_DEADLINE,
8	18 = REMOVED_DEADLINE, 19 = ADD_DEPENDENCY, 20 = REMOVE_DEPENDENCY, 21 = CODE,
9	22 = REVIEW, 23 = ISSUE_LOCKED, 24 = ISSUE_UNLOCKED, 25 = TARGET_BRANCH_CHANGED,
10	26 = DELETE_TIME_MANUAL, 27 = REVIEW_REQUEST, 28 = MERGE_PULL_REQUEST,
11	29 = PULL_PUSH_EVENT, 30 = PROJECT_CHANGED, 31 = PROJECT_BOARD_CHANGED
12	32 = DISMISSED_REVIEW -->
13	{{if eq .Type 0}}
14		<div class="timeline-item comment" id="{{.HashTag}}">
15		{{if .OriginalAuthor }}
16			<span class="timeline-avatar"><img src="{{AppSubUrl}}/assets/img/avatar_default.png"></span>
17		{{else}}
18			<a class="timeline-avatar" {{if gt .Poster.ID 0}}href="{{.Poster.HomeLink}}"{{end}}>
19				{{avatar .Poster}}
20			</a>
21		{{end}}
22			<div class="content comment-container">
23				<div class="ui top attached header comment-header df ac sb">
24					<div class="comment-header-left df ac">
25						{{if .OriginalAuthor }}
26							<span class="text black mr-2">
27								{{svg (MigrationIcon $.Repository.GetOriginalURLHostname)}}
28								{{ .OriginalAuthor }}
29							</span>
30							<span class="text grey">
31								{{$.i18n.Tr "repo.issues.commented_at" (.HashTag|Escape) $createdStr | Safe}} {{if $.Repository.OriginalURL}}
32							</span>
33							<span class="text migrate">
34								({{$.i18n.Tr "repo.migrated_from" ($.Repository.OriginalURL|Escape) ($.Repository.GetOriginalURLHostname|Escape) | Safe }}){{end}}
35							</span>
36						{{else}}
37							<span class="text grey">
38								<a class="author"{{if gt .Poster.ID 0}} href="{{.Poster.HomeLink}}"{{end}}>
39									{{.Poster.GetDisplayName}}
40								</a>
41								{{$.i18n.Tr "repo.issues.commented_at" (.HashTag|Escape) $createdStr | Safe}}
42							</span>
43						{{end}}
44					</div>
45					<div class="comment-header-right actions df ac">
46						{{if (.ShowRole.HasRole "Poster")}}
47							<div class="ui basic label">
48								{{$.i18n.Tr "repo.issues.poster"}}
49							</div>
50						{{end}}
51						{{if (.ShowRole.HasRole "Writer")}}
52							<div class="ui basic label">
53								{{$.i18n.Tr "repo.issues.collaborator"}}
54							</div>
55						{{end}}
56						{{if (.ShowRole.HasRole "Owner")}}
57							<div class="ui basic label">
58								{{$.i18n.Tr "repo.issues.owner"}}
59							</div>
60						{{end}}
61						{{if not $.Repository.IsArchived}}
62							{{template "repo/issue/view_content/add_reaction" Dict "ctx" $ "ActionURL" (Printf "%s/comments/%d/reactions" $.RepoLink .ID)}}
63							{{template "repo/issue/view_content/context_menu" Dict "ctx" $ "item" . "delete" true "issue" true "diff" false "IsCommentPoster" (and $.IsSigned (eq $.SignedUserID .PosterID))}}
64						{{end}}
65					</div>
66				</div>
67				<div class="ui attached segment comment-body">
68					<div class="render-content markup" {{if or $.Permission.IsAdmin $.HasIssuesOrPullsWritePermission (and $.IsSigned (eq $.SignedUserID .PosterID))}}data-can-edit="true"{{end}}>
69						{{if .RenderedContent}}
70							{{.RenderedContent|Str2html}}
71						{{else}}
72							<span class="no-content">{{$.i18n.Tr "repo.issues.no_content"}}</span>
73						{{end}}
74					</div>
75					<div id="comment-{{.ID}}" class="raw-content hide">{{.Content}}</div>
76					<div class="edit-content-zone hide" data-write="issuecomment-{{.ID}}-write" data-preview="issuecomment-{{.ID}}-preview" data-update-url="{{$.RepoLink}}/comments/{{.ID}}" data-context="{{$.RepoLink}}" data-attachment-url="{{$.RepoLink}}/comments/{{.ID}}/attachments"></div>
77					{{if .Attachments}}
78						{{template "repo/issue/view_content/attachments" Dict "ctx" $ "Attachments" .Attachments "Content" .RenderedContent}}
79					{{end}}
80				</div>
81				{{$reactions := .Reactions.GroupByType}}
82				{{if $reactions}}
83					<div class="ui attached segment reactions">
84						{{template "repo/issue/view_content/reactions" Dict "ctx" $ "ActionURL" (Printf "%s/comments/%d/reactions" $.RepoLink .ID) "Reactions" $reactions}}
85					</div>
86				{{end}}
87			</div>
88		</div>
89	{{else if eq .Type 1}}
90		<div class="timeline-item event" id="{{.HashTag}}">
91			<span class="badge bg-green text-white">{{svg "octicon-dot-fill"}}</span>
92			<a href="{{.Poster.HomeLink}}">
93				{{avatar .Poster}}
94			</a>
95			<span class="text grey">
96				<a class="author" href="{{.Poster.HomeLink}}">{{.Poster.GetDisplayName}}</a>
97				{{if .Issue.IsPull }}
98					{{$.i18n.Tr "repo.pulls.reopened_at" .EventTag $createdStr | Safe}}
99				{{else}}
100					{{$.i18n.Tr "repo.issues.reopened_at" .EventTag $createdStr | Safe}}
101				{{end}}
102			</span>
103		</div>
104	{{else if eq .Type 2}}
105		<div class="timeline-item event" id="{{.HashTag}}">
106			<span class="badge bg-red text-white">{{svg "octicon-circle-slash"}}</span>
107			<a href="{{.Poster.HomeLink}}">
108				{{avatar .Poster}}
109			</a>
110			<span class="text grey">
111				<a class="author" href="{{.Poster.HomeLink}}">{{.Poster.GetDisplayName}}</a>
112				{{if .Issue.IsPull }}
113					{{$.i18n.Tr "repo.pulls.closed_at" .EventTag $createdStr | Safe}}
114				{{else}}
115					{{$.i18n.Tr "repo.issues.closed_at" .EventTag $createdStr | Safe}}
116				{{end}}
117			</span>
118		</div>
119	{{else if eq .Type 28}}
120		<div class="timeline-item event" id="{{.HashTag}}">
121			<span class="badge bg-purple text-white">{{svg "octicon-git-merge"}}</span>
122			<a href="{{.Poster.HomeLink}}">
123				{{avatar .Poster}}
124			</a>
125			<span class="text grey">
126				<a class="author" href="{{.Poster.HomeLink}}">{{.Poster.GetDisplayName}}</a>
127				{{$link := printf "%s/commit/%s" $.Repository.HTMLURL ($.Issue.PullRequest.MergedCommitID|PathEscape)}}
128				{{if eq $.Issue.PullRequest.Status 3}}
129					{{$.i18n.Tr "repo.issues.manually_pull_merged_at" ($link|Escape) (ShortSha $.Issue.PullRequest.MergedCommitID) ($.BaseTarget|Escape) $createdStr | Str2html}}
130				{{else}}
131					{{$.i18n.Tr "repo.issues.pull_merged_at" ($link|Escape) (ShortSha $.Issue.PullRequest.MergedCommitID) ($.BaseTarget|Escape) $createdStr | Str2html}}
132				{{end}}
133			</span>
134		</div>
135	{{else if eq .Type 3 5 6}}
136		{{ $refFrom:= "" }}
137		{{if ne .RefRepoID .Issue.RepoID}}
138			{{ $refFrom = $.i18n.Tr "repo.issues.ref_from" (.RefRepo.FullName|Escape) }}
139		{{end}}
140		{{ $refTr := "repo.issues.ref_issue_from" }}
141		{{if .Issue.IsPull}}
142			{{ $refTr = "repo.issues.ref_pull_from" }}
143		{{else if eq .RefAction 1 }}
144			{{ $refTr = "repo.issues.ref_closing_from" }}
145		{{else if eq .RefAction 2 }}
146			{{ $refTr = "repo.issues.ref_reopening_from" }}
147		{{end}}
148		{{ $createdStr:= TimeSinceUnix .CreatedUnix $.Lang }}
149		<div class="timeline-item event" id="{{.HashTag}}">
150			<span class="badge">{{svg "octicon-bookmark"}}</span>
151			<a href="{{.Poster.HomeLink}}">
152				{{avatar .Poster}}
153			</a>
154			{{if eq .RefAction 3}}<del>{{end}}
155			<span class="text grey">
156				<a class="author" href="{{.Poster.HomeLink}}">{{.Poster.GetDisplayName}}</a>
157				{{$.i18n.Tr $refTr (.EventTag|Escape) $createdStr (.RefCommentHTMLURL|Escape) $refFrom | Safe}}
158			</span>
159			{{if eq .RefAction 3}}</del>{{end}}
160
161			<div class="detail">
162				<span class="text grey"><a href="{{.RefIssueHTMLURL}}"><b>{{.RefIssueTitle}}</b> {{.RefIssueIdent}}</a></span>
163			</div>
164		</div>
165	{{else if eq .Type 4}}
166		<div class="timeline-item event" id="{{.HashTag}}">
167			<span class="badge">{{svg "octicon-bookmark"}}</span>
168			<a href="{{.Poster.HomeLink}}">
169				{{avatar .Poster}}
170			</a>
171			<span class="text grey">
172				<a class="author" href="{{.Poster.HomeLink}}">{{.Poster.GetDisplayName}}</a>
173				{{$.i18n.Tr "repo.issues.commit_ref_at" .EventTag $createdStr | Safe}}
174			</span>
175			<div class="detail">
176				{{svg "octicon-git-commit"}}
177				<span class="text grey">{{.Content | Str2html}}</span>
178			</div>
179		</div>
180	{{else if eq .Type 7}}
181		{{if or .AddedLabels .RemovedLabels}}
182			<div class="timeline-item event" id="{{.HashTag}}">
183				<span class="badge">{{svg "octicon-tag"}}</span>
184				<a href="{{.Poster.HomeLink}}">
185					{{avatar .Poster}}
186				</a>
187				<span class="text grey">
188					<a class="author" href="{{.Poster.HomeLink}}">{{.Poster.GetDisplayName}}</a>
189					{{if and .AddedLabels (not .RemovedLabels)}}
190						{{$.i18n.TrN (len .AddedLabels) "repo.issues.add_label" "repo.issues.add_labels" (RenderLabels .AddedLabels) $createdStr | Safe}}
191					{{else if and (not .AddedLabels) .RemovedLabels}}
192						{{$.i18n.TrN (len .RemovedLabels) "repo.issues.remove_label" "repo.issues.remove_labels" (RenderLabels .RemovedLabels) $createdStr | Safe}}
193					{{else}}
194						{{$.i18n.Tr "repo.issues.add_remove_labels" (RenderLabels .AddedLabels) (RenderLabels .RemovedLabels) $createdStr | Safe}}
195					{{end}}
196				</span>
197			</div>
198		{{end}}
199	{{else if eq .Type 8}}
200		<div class="timeline-item event" id="{{.HashTag}}">
201			<span class="badge">{{svg "octicon-milestone"}}</span>
202			<a href="{{.Poster.HomeLink}}">
203				{{avatar .Poster}}
204			</a>
205			<span class="text grey">
206				<a class="author" href="{{.Poster.HomeLink}}">{{.Poster.GetDisplayName}}</a>
207				{{if gt .OldMilestoneID 0}}{{if gt .MilestoneID 0}}{{$.i18n.Tr "repo.issues.change_milestone_at" (.OldMilestone.Name|Escape) (.Milestone.Name|Escape) $createdStr | Safe}}{{else}}{{$.i18n.Tr "repo.issues.remove_milestone_at" (.OldMilestone.Name|Escape) $createdStr | Safe}}{{end}}{{else if gt .MilestoneID 0}}{{$.i18n.Tr "repo.issues.add_milestone_at" (.Milestone.Name|Escape) $createdStr | Safe}}{{end}}
208			</span>
209		</div>
210	{{else if eq .Type 9}}
211		<div class="timeline-item event" id="{{.HashTag}}">
212			<span class="badge">{{svg "octicon-person"}}</span>
213			{{if gt .AssigneeID 0}}
214				{{if .RemovedAssignee}}
215					<a href="{{.Assignee.HomeLink}}">
216						{{avatar .Assignee}}
217					</a>
218					<span class="text grey">
219						<a class="author" href="{{.Assignee.HomeLink}}">{{.Assignee.GetDisplayName}}</a>
220						{{ if eq .Poster.ID .Assignee.ID }}
221							{{$.i18n.Tr "repo.issues.remove_self_assignment" $createdStr | Safe}}
222						{{ else }}
223							{{$.i18n.Tr "repo.issues.remove_assignee_at" (.Poster.GetDisplayName|Escape) $createdStr | Safe}}
224						{{ end }}
225					</span>
226				{{else}}
227					<a href="{{.Assignee.HomeLink}}">
228						{{avatar .Assignee}}
229					</a>
230					<span class="text grey">
231						<a class="author" href="{{.Assignee.HomeLink}}">{{.Assignee.GetDisplayName}}</a>
232						{{if eq .Poster.ID .AssigneeID}}
233							{{$.i18n.Tr "repo.issues.self_assign_at" $createdStr | Safe}}
234						{{else}}
235							{{$.i18n.Tr "repo.issues.add_assignee_at" (.Poster.GetDisplayName|Escape) $createdStr | Safe}}
236						{{end}}
237					</span>
238				{{end}}
239			{{end}}
240		</div>
241	{{else if eq .Type 10}}
242		<div class="timeline-item event" id="{{.HashTag}}">
243			<span class="badge">{{svg "octicon-pencil"}}</span>
244			<a href="{{.Poster.HomeLink}}">
245				{{avatar .Poster}}
246			</a>
247			<span class="text grey">
248				<a class="author" href="{{.Poster.HomeLink}}">{{.Poster.GetDisplayName}}</a>
249				{{$.i18n.Tr "repo.issues.change_title_at" (.OldTitle|RenderEmoji) (.NewTitle|RenderEmoji) $createdStr | Safe}}
250			</span>
251		</div>
252	{{else if eq .Type 11}}
253		<div class="timeline-item event" id="{{.HashTag}}">
254			<span class="badge">{{svg "octicon-git-branch"}}</span>
255			<a href="{{.Poster.HomeLink}}">
256				{{avatar .Poster}}
257			</a>
258			<span class="text grey">
259				<a class="author" href="{{.Poster.HomeLink}}">{{.Poster.GetDisplayName}}</a>
260				{{$.i18n.Tr "repo.issues.delete_branch_at" (.OldRef|Escape) $createdStr | Safe}}
261			</span>
262		</div>
263	{{else if eq .Type 12}}
264		<div class="timeline-item event" id="{{.HashTag}}">
265			<span class="badge">{{svg "octicon-clock"}}</span>
266			<a href="{{.Poster.HomeLink}}">
267				{{avatar .Poster}}
268			</a>
269			<span class="text grey">
270				<a class="author" href="{{.Poster.HomeLink}}">{{.Poster.GetDisplayName}}</a>
271				{{$.i18n.Tr "repo.issues.start_tracking_history"  $createdStr | Safe}}
272			</span>
273		</div>
274	{{else if eq .Type 13}}
275		<div class="timeline-item event" id="{{.HashTag}}">
276			<span class="badge">{{svg "octicon-clock"}}</span>
277			<a href="{{.Poster.HomeLink}}">
278				{{avatar .Poster}}
279			</a>
280			<span class="text grey">
281				<a class="author" href="{{.Poster.HomeLink}}">{{.Poster.GetDisplayName}}</a>
282				{{$.i18n.Tr "repo.issues.stop_tracking_history"  $createdStr | Safe}}
283			</span>
284			{{ template "repo/issue/view_content/comments_delete_time" Dict "ctx" $ "comment" . }}
285			<div class="detail">
286				{{svg "octicon-clock"}}
287				<span class="text grey">{{.Content}}</span>
288			</div>
289		</div>
290	{{else if eq .Type 14}}
291		<div class="timeline-item event" id="{{.HashTag}}">
292			<span class="badge">{{svg "octicon-clock"}}</span>
293			<a href="{{.Poster.HomeLink}}">
294				{{avatar .Poster}}
295			</a>
296			<span class="text grey">
297				<a class="author" href="{{.Poster.HomeLink}}">{{.Poster.GetDisplayName}}</a>
298				{{$.i18n.Tr "repo.issues.add_time_history"  $createdStr | Safe}}
299			</span>
300			{{ template "repo/issue/view_content/comments_delete_time" Dict "ctx" $ "comment" . }}
301			<div class="detail">
302				{{svg "octicon-clock"}}
303				<span class="text grey">{{.Content}}</span>
304			</div>
305		</div>
306	{{else if eq .Type 15}}
307		<div class="timeline-item event" id="{{.HashTag}}">
308			<span class="badge">{{svg "octicon-clock"}}</span>
309			<a href="{{.Poster.HomeLink}}">
310				{{avatar .Poster}}
311			</a>
312			<span class="text grey">
313				<a class="author" href="{{.Poster.HomeLink}}">{{.Poster.GetDisplayName}}</a>
314				{{$.i18n.Tr "repo.issues.cancel_tracking_history"  $createdStr | Safe}}
315			</span>
316		</div>
317	{{else if eq .Type 16}}
318		<div class="timeline-item event" id="{{.HashTag}}">
319			<span class="badge">{{svg "octicon-clock"}}</span>
320			<a href="{{.Poster.HomeLink}}">
321				{{avatar .Poster}}
322			</a>
323			<span class="text grey">
324				<a class="author" href="{{.Poster.HomeLink}}">{{.Poster.GetDisplayName}}</a>
325				{{$.i18n.Tr "repo.issues.due_date_added" .Content $createdStr | Safe}}
326			</span>
327		</div>
328	{{else if eq .Type 17}}
329		<div class="timeline-item event" id="{{.HashTag}}">
330			<span class="badge">{{svg "octicon-clock"}}</span>
331			<a href="{{.Poster.HomeLink}}">
332				{{avatar .Poster}}
333			</a>
334			<span class="text grey">
335				<a class="author" href="{{.Poster.HomeLink}}">{{.Poster.GetDisplayName}}</a>
336				{{$.i18n.Tr "repo.issues.due_date_modified" (.Content | ParseDeadline) $createdStr | Safe}}
337			</span>
338		</div>
339	{{else if eq .Type 18}}
340		<div class="timeline-item event" id="{{.HashTag}}">
341			<span class="badge">{{svg "octicon-clock"}}</span>
342			<a href="{{.Poster.HomeLink}}">
343				{{avatar .Poster}}
344			</a>
345			<span class="text grey">
346				<a class="author" href="{{.Poster.HomeLink}}">{{.Poster.GetDisplayName}}</a>
347				{{$.i18n.Tr "repo.issues.due_date_remove" .Content $createdStr | Safe}}
348			</span>
349		</div>
350	{{else if eq .Type 19}}
351		<div class="timeline-item event" id="{{.HashTag}}">
352			<span class="badge">{{svg "octicon-package-dependents"}}</span>
353			<a href="{{.Poster.HomeLink}}">
354				{{avatar .Poster}}
355			</a>
356			<span class="text grey">
357				<a class="author" href="{{.Poster.HomeLink}}">{{.Poster.GetDisplayName}}</a>
358				{{$.i18n.Tr "repo.issues.dependency.added_dependency" $createdStr | Safe}}
359			</span>
360			{{if .DependentIssue}}
361				<div class="detail">
362					{{svg "octicon-plus"}}
363					<span class="text grey">
364						<a href="{{.DependentIssue.HTMLURL}}">
365							{{if eq .DependentIssue.RepoID .Issue.RepoID}}
366								#{{.DependentIssue.Index}} {{.DependentIssue.Title}}
367							{{else}}
368								{{.DependentIssue.Repo.FullName}}#{{.DependentIssue.Index}} - {{.DependentIssue.Title}}
369							{{end}}
370						</a>
371					</span>
372				</div>
373			{{end}}
374		</div>
375	{{else if eq .Type 20}}
376		<div class="timeline-item event" id="{{.HashTag}}">
377			<span class="badge">{{svg "octicon-package-dependents"}}</span>
378			<a href="{{.Poster.HomeLink}}">
379				{{avatar .Poster}}
380			</a>
381			<span class="text grey">
382				<a class="author" href="{{.Poster.HomeLink}}">{{.Poster.GetDisplayName}}</a>
383				{{$.i18n.Tr "repo.issues.dependency.removed_dependency" $createdStr | Safe}}
384			</span>
385			{{if .DependentIssue}}
386				<div class="detail">
387					<span class="text grey">{{svg "octicon-trash"}}</span>
388					<span class="text grey">
389						<a href="{{.DependentIssue.HTMLURL}}">
390							{{if eq .DependentIssue.RepoID .Issue.RepoID}}
391								#{{.DependentIssue.Index}} {{.DependentIssue.Title}}
392							{{else}}
393								{{.DependentIssue.Repo.FullName}}#{{.DependentIssue.Index}} - {{.DependentIssue.Title}}
394							{{end}}
395						</a>
396					</span>
397				</div>
398			{{end}}
399		</div>
400	{{else if eq .Type 22}}
401		<div class="timeline-item-group">
402			<div class="timeline-item event">
403				{{if .OriginalAuthor }}
404				{{else}}
405				<a class="timeline-avatar"{{if gt .Poster.ID 0}} href="{{.Poster.HomeLink}}"{{end}}>
406					{{avatar .Poster}}
407				</a>
408				{{end}}
409				<span class="badge{{if eq .Review.Type 1}} bg-green text-white{{else if eq .Review.Type 3}} bg-red text-white{{end}}">{{svg (printf "octicon-%s" .Review.Type.Icon)}}</span>
410				<span class="text grey">
411					{{if .OriginalAuthor }}
412						<span class="text black">
413							{{svg (MigrationIcon $.Repository.GetOriginalURLHostname)}}
414							{{ .OriginalAuthor }}
415						</span>
416						<span class="text grey"> {{if $.Repository.OriginalURL}}</span>
417						<span class="text migrate">({{$.i18n.Tr "repo.migrated_from" ($.Repository.OriginalURL|Escape) ($.Repository.GetOriginalURLHostname|Escape) | Safe }}){{end}}</span>
418					{{else}}
419						<a class="author"{{if gt .Poster.ID 0}} href="{{.Poster.HomeLink}}"{{end}}>{{.Poster.GetDisplayName}}</a>
420					{{end}}
421
422					{{if eq .Review.Type 1}}
423						{{$.i18n.Tr "repo.issues.review.approve" $createdStr | Safe}}
424					{{else if eq .Review.Type 2}}
425						{{$.i18n.Tr "repo.issues.review.comment" $createdStr | Safe}}
426					{{else if eq .Review.Type 3}}
427						{{$.i18n.Tr "repo.issues.review.reject" $createdStr | Safe}}
428					{{else}}
429						{{$.i18n.Tr "repo.issues.review.comment" $createdStr | Safe}}
430					{{end}}
431					{{if .Review.Dismissed}}
432						<div class="ui small label">{{$.i18n.Tr "repo.issues.review.dismissed_label"}}</div>
433					{{end}}
434				</span>
435			</div>
436			{{if .Content}}
437			<div class="timeline-item comment" id="{{.HashTag}}">
438				<div class="content comment-container">
439					<div class="ui top attached header comment-header df ac sb">
440						<div class="comment-header-left df ac">
441							<span class="text grey">
442								{{if .OriginalAuthor }}
443									<span class="text black">
444										{{svg (MigrationIcon $.Repository.GetOriginalURLHostname)}}
445										{{ .OriginalAuthor }}
446									</span>
447									<span class="text grey"> {{if $.Repository.OriginalURL}}</span>
448									<span class="text migrate">({{$.i18n.Tr "repo.migrated_from" ($.Repository.OriginalURL|Escape) ($.Repository.GetOriginalURLHostname|Escape) | Safe }}){{end}}</span>
449								{{else}}
450									<a class="author"{{if gt .Poster.ID 0}} href="{{.Poster.HomeLink}}"{{end}}>{{.Poster.GetDisplayName}}</a>
451								{{end}}
452
453								{{$.i18n.Tr "repo.issues.review.left_comment" | Safe}}
454							</span>
455						</div>
456						<div class="comment-header-right actions df ac">
457								{{if (.ShowRole.HasRole "Poster")}}
458									<div class="ui basic label">
459											{{$.i18n.Tr "repo.issues.poster"}}
460									</div>
461								{{end}}
462								{{if (.ShowRole.HasRole "Writer")}}
463									<div class="ui basic label">
464											{{$.i18n.Tr "repo.issues.collaborator"}}
465									</div>
466								{{end}}
467								{{if (.ShowRole.HasRole "Owner")}}
468									<div class="ui basic label">
469											{{$.i18n.Tr "repo.issues.owner"}}
470									</div>
471								{{end}}
472								{{if not $.Repository.IsArchived}}
473										{{template "repo/issue/view_content/add_reaction" Dict "ctx" $ "ActionURL" (Printf "%s/comments/%d/reactions" $.RepoLink .ID)}}
474										{{template "repo/issue/view_content/context_menu" Dict "ctx" $ "item" . "delete" true "issue" true "diff" false "IsCommentPoster" (and $.IsSigned (eq $.SignedUserID .PosterID))}}
475								{{end}}
476						</div>
477					</div>
478					<div class="ui attached segment comment-body">
479						<div class="render-content markup">
480							{{if .RenderedContent}}
481								{{.RenderedContent|Str2html}}
482							{{else}}
483								<span class="no-content">{{$.i18n.Tr "repo.issues.no_content"}}</span>
484							{{end}}
485						</div>
486						<div id="comment-{{.ID}}" class="raw-content hide">{{.Content}}</div>
487						<div class="edit-content-zone hide" data-write="issuecomment-{{.ID}}-write" data-preview="issuecomment-{{.ID}}-preview" data-update-url="{{$.RepoLink}}/comments/{{.ID}}" data-context="{{$.RepoLink}}" data-attachment-url="{{$.RepoLink}}/comments/{{.ID}}/attachments"></div>
488						{{if .Attachments}}
489							{{template "repo/issue/view_content/attachments" Dict "ctx" $ "Attachments" .Attachments "Content" .RenderedContent}}
490						{{end}}
491					</div>
492					{{$reactions := .Reactions.GroupByType}}
493					{{if $reactions}}
494						<div class="ui attached segment reactions">
495								{{template "repo/issue/view_content/reactions" Dict "ctx" $ "ActionURL" (Printf "%s/comments/%d/reactions" $.RepoLink .ID) "Reactions" $reactions}}
496						</div>
497					{{end}}
498				</div>
499			</div>
500			{{end}}
501
502			{{if .Review.CodeComments}}
503			<div class="timeline-item event">
504				{{ range $filename, $lines := .Review.CodeComments}}
505					{{range $line, $comms := $lines}}
506							<div class="ui segments">
507								<div class="ui segment py-3 df ac sb word-break">
508									{{$invalid := (index $comms 0).Invalidated}}
509									{{$resolved := (index $comms 0).IsResolved}}
510									{{$resolveDoer := (index $comms 0).ResolveDoer}}
511									{{$isNotPending := (not (eq (index $comms 0).Review.Type 0))}}
512									<div class="df ac">
513										<a href="{{(index $comms 0).CodeCommentURL}}" class="file-comment ml-3">{{$filename}}</a>
514										{{if $invalid }}
515											<span class="ui label basic small ml-3">
516												{{$.i18n.Tr "repo.issues.review.outdated"}}
517											</span>
518										{{end}}
519									</div>
520									<div>
521										{{if or $invalid $resolved}}
522											<button id="show-outdated-{{(index $comms 0).ID}}" data-comment="{{(index $comms 0).ID}}" class="{{if not $resolved}}hide {{end}}ui compact right labeled button show-outdated df ac">
523												{{svg "octicon-unfold" 16 "mr-3"}}
524												{{if $resolved}}
525													{{$.i18n.Tr "repo.issues.review.show_resolved"}}
526												{{else}}
527													{{$.i18n.Tr "repo.issues.review.show_outdated"}}
528												{{end}}
529											</button>
530											<button id="hide-outdated-{{(index $comms 0).ID}}" data-comment="{{(index $comms 0).ID}}" class="{{if $resolved}}hide {{end}}ui compact right labeled button hide-outdated df ac">
531												{{svg "octicon-fold" 16 "mr-3"}}
532												{{if $resolved}}
533													{{$.i18n.Tr "repo.issues.review.hide_resolved"}}
534												{{else}}
535													{{$.i18n.Tr "repo.issues.review.hide_outdated"}}
536												{{end}}
537											</button>
538										{{end}}
539									</div>
540								</div>
541								{{$diff := (CommentMustAsDiff (index $comms 0))}}
542								{{if $diff}}
543									{{$file := (index $diff.Files 0)}}
544									<div id="code-preview-{{(index $comms 0).ID}}" class="ui table segment{{if $resolved}} hide{{end}}">
545										<div class="diff-file-box diff-box file-content {{TabSizeClass $.Editorconfig $file.Name}}">
546											<div class="file-body file-code code-view code-diff code-diff-unified unicode-escaped">
547												<table>
548													<tbody>
549														{{template "repo/diff/section_unified" dict "file" $file "root" $}}
550													</tbody>
551												</table>
552											</div>
553										</div>
554									</div>
555								{{end}}
556								<div id="code-comments-{{(index $comms 0).ID}}" class="comment-code-cloud ui segment{{if $resolved}} hide{{end}}">
557									<div class="ui comments mb-0">
558										{{range $comms}}
559											{{ $createdSubStr:= TimeSinceUnix .CreatedUnix $.Lang }}
560											<div class="comment code-comment pb-4" id="{{.HashTag}}">
561												<div class="content">
562													<div class="header comment-header">
563														<div class="comment-header-left df ac">
564															{{if not .OriginalAuthor }}
565																<a class="avatar">
566																	{{avatar .Poster}}
567																</a>
568															{{end}}
569															<span class="text grey">
570																{{if .OriginalAuthor }}
571																	<span class="text black">
572																		{{svg (MigrationIcon $.Repository.GetOriginalURLHostname)}}
573																		{{ .OriginalAuthor }}
574																	</span>
575																	<span class="text grey"> {{if $.Repository.OriginalURL}}</span>
576																	<span class="text migrate">({{$.i18n.Tr "repo.migrated_from" ($.Repository.OriginalURL|Escape) ($.Repository.GetOriginalURLHostname|Escape) | Safe }}){{end}}</span>
577																{{else}}
578																	<a class="author"{{if gt .Poster.ID 0}} href="{{.Poster.HomeLink}}"{{end}}>{{.Poster.GetDisplayName}}</a>
579																{{end}}
580																{{$.i18n.Tr "repo.issues.commented_at" (.HashTag|Escape) $createdSubStr | Safe}}
581															</span>
582														</div>
583														<div class="comment-header-right actions df ac">
584															{{if (.ShowRole.HasRole "Poster")}}
585																<div class="ui basic label">
586																	{{$.i18n.Tr "repo.issues.poster"}}
587																</div>
588															{{end}}
589															{{if (.ShowRole.HasRole "Writer")}}
590																<div class="ui basic label">
591																	{{$.i18n.Tr "repo.issues.collaborator"}}
592																</div>
593															{{end}}
594															{{if (.ShowRole.HasRole "Owner")}}
595																<div class="ui basic label">
596																	{{$.i18n.Tr "repo.issues.owner"}}
597																</div>
598															{{end}}
599															{{if not $.Repository.IsArchived}}
600																{{template "repo/issue/view_content/add_reaction" Dict "ctx" $ "ActionURL" (Printf "%s/comments/%d/reactions" $.RepoLink .ID)}}
601																{{template "repo/issue/view_content/context_menu" Dict "ctx" $ "item" . "delete" true "issue" true "diff" true "IsCommentPoster" (and $.IsSigned (eq $.SignedUserID .PosterID))}}
602															{{end}}
603														</div>
604													</div>
605													<div class="text comment-content">
606														<div class="render-content markup" {{if or $.Permission.IsAdmin $.HasIssuesOrPullsWritePermission (and $.IsSigned (eq $.SignedUserID .PosterID))}}data-can-edit="true"{{end}}>
607														{{if .RenderedContent}}
608															{{.RenderedContent|Str2html}}
609														{{else}}
610															<span class="no-content">{{$.i18n.Tr "repo.issues.no_content"}}</span>
611														{{end}}
612														</div>
613														<div id="comment-{{.ID}}" class="raw-content hide">{{.Content}}</div>
614														<div class="edit-content-zone hide" data-write="issuecomment-{{.ID}}-write" data-preview="issuecomment-{{.ID}}-preview" data-update-url="{{$.RepoLink}}/comments/{{.ID}}" data-context="{{$.RepoLink}}" data-attachment-url="{{$.RepoLink}}/comments/{{.ID}}/attachments"></div>
615													</div>
616													{{$reactions := .Reactions.GroupByType}}
617													{{if $reactions}}
618														<div class="ui attached segment reactions">
619															{{template "repo/issue/view_content/reactions" Dict "ctx" $ "ActionURL" (Printf "%s/comments/%d/reactions" $.RepoLink .ID) "Reactions" $reactions}}
620														</div>
621													{{end}}
622												</div>
623											</div>
624										{{end}}
625									</div>
626									<div class="code-comment-buttons df ac fw mt-3 mb-2 mx-3">
627										<div class="f1">
628											{{if $resolved}}
629												<div class="ui grey text">
630													{{svg "octicon-check" 16 "mr-2"}}
631													<b>{{$resolveDoer.Name}}</b> {{$.i18n.Tr "repo.issues.review.resolved_by"}}
632												</div>
633											{{end}}
634										</div>
635										<div class="code-comment-buttons-buttons">
636											{{if and $.CanMarkConversation $isNotPending}}
637												<button class="ui tiny basic button resolve-conversation" data-origin="timeline" data-action="{{if not $resolved}}Resolve{{else}}UnResolve{{end}}" data-comment-id="{{(index $comms 0).ID}}" data-update-url="{{$.RepoLink}}/issues/resolve_conversation">
638													{{if $resolved}}
639														{{$.i18n.Tr "repo.issues.review.un_resolve_conversation"}}
640													{{else}}
641														{{$.i18n.Tr "repo.issues.review.resolve_conversation"}}
642													{{end}}
643												</button>
644											{{end}}
645											{{if and $.SignedUserID (not $.Repository.IsArchived)}}
646												<button class="comment-form-reply ui green tiny labeled icon button ml-2 mr-0">
647													{{svg "octicon-reply" 16 "reply icon mr-2"}}{{$.i18n.Tr "repo.diff.comment.reply"}}
648												</button>
649											{{end}}
650										</div>
651									</div>
652									{{template "repo/diff/comment_form_datahandler" dict "hidden" true "reply" (index $comms 0).ReviewID "root" $ "comment" (index $comms 0)}}
653								</div>
654							</div>
655					{{end}}
656				{{end}}
657			</div>
658			{{end}}
659		</div>
660	{{else if eq .Type 23}}
661		<div class="timeline-item event" id="{{.HashTag}}">
662			<span class="badge">{{svg "octicon-lock"}}</span>
663			<a href="{{.Poster.HomeLink}}">
664				{{avatar .Poster}}
665			</a>
666			{{ if .Content }}
667				<span class="text grey">
668					<a class="author" href="{{.Poster.HomeLink}}">{{.Poster.GetDisplayName}}</a>
669					{{$.i18n.Tr "repo.issues.lock_with_reason" .Content $createdStr | Safe}}
670				</span>
671			{{ else }}
672				<span class="text grey">
673					<a class="author" href="{{.Poster.HomeLink}}">{{.Poster.GetDisplayName}}</a>
674					{{$.i18n.Tr "repo.issues.lock_no_reason" $createdStr | Safe}}
675				</span>
676			{{ end }}
677		</div>
678	{{else if eq .Type 24}}
679		<div class="timeline-item event" id="{{.HashTag}}">
680			<span class="badge">{{svg "octicon-key"}}</span>
681			<a href="{{.Poster.HomeLink}}">
682				{{avatar .Poster}}
683			</a>
684			<span class="text grey">
685				<a class="author" href="{{.Poster.HomeLink}}">{{.Poster.GetDisplayName}}</a>
686				{{$.i18n.Tr "repo.issues.unlock_comment" $createdStr | Safe}}
687			</span>
688		</div>
689	{{else if eq .Type 25}}
690		<div class="timeline-item event">
691			<span class="badge">{{svg "octicon-git-branch"}}</span>
692			<a href="{{.Poster.HomeLink}}">
693				{{avatar .Poster}}
694			</a>
695			<span class="text grey">
696				<a href="{{.Poster.HomeLink}}">{{.Poster.Name}}</a>
697				{{$.i18n.Tr "repo.pulls.change_target_branch_at" (.OldRef|Escape) (.NewRef|Escape) $createdStr | Safe}}
698			</span>
699		</div>
700	{{else if eq .Type 26}}
701		<div class="timeline-item event" id="{{.HashTag}}">
702			<span class="badge">{{svg "octicon-clock"}}</span>
703			<a href="{{.Poster.HomeLink}}">
704				{{avatar .Poster}}
705			</a>
706			<span class="text grey">
707				<a class="author" href="{{.Poster.HomeLink}}">{{.Poster.GetDisplayName}}</a>
708				{{$.i18n.Tr "repo.issues.del_time_history"  $createdStr | Safe}}
709			</span>
710			<div class="detail">
711				{{svg "octicon-clock"}}
712				<span class="text grey">{{.Content}}</span>
713			</div>
714		</div>
715	{{else if eq .Type 27}}
716		<div class="timeline-item event" id="{{.HashTag}}">
717			<span class="badge">{{svg "octicon-eye"}}</span>
718			<a href="{{.Poster.HomeLink}}">
719				{{avatar .Poster}}
720			</a>
721			<span class="text grey">
722				<a class="author" href="{{.Poster.HomeLink}}">{{.Poster.GetDisplayName}}</a>
723				{{if (gt .AssigneeID 0)}}
724					{{if .RemovedAssignee}}
725						{{if eq .PosterID .AssigneeID}}
726							{{$.i18n.Tr "repo.issues.review.remove_review_request_self" $createdStr | Safe}}
727						{{else}}
728							{{$.i18n.Tr "repo.issues.review.remove_review_request" (.Assignee.GetDisplayName|Escape) $createdStr | Safe}}
729						{{end}}
730					{{else}}
731						{{$.i18n.Tr "repo.issues.review.add_review_request" (.Assignee.GetDisplayName|Escape) $createdStr | Safe}}
732					{{end}}
733				{{else}}
734					{{if .RemovedAssignee}}
735						{{$.i18n.Tr "repo.issues.review.remove_review_request" (.AssigneeTeam.Name|Escape) $createdStr | Safe}}
736					{{else}}
737						{{$.i18n.Tr "repo.issues.review.add_review_request" (.AssigneeTeam.Name|Escape) $createdStr | Safe}}
738					{{end}}
739				{{end}}
740			</span>
741		</div>
742	{{else if and (eq .Type 29) (or (gt .CommitsNum 0) .IsForcePush)}}
743		<div class="timeline-item event" id="{{.HashTag}}">
744			<span class="badge">{{svg "octicon-repo-push"}}</span>
745			<span class="text grey">
746				<a class="author" href="{{.Poster.HomeLink}}">{{.Poster.GetDisplayName}}</a>
747				{{ if .IsForcePush }}
748					{{$.i18n.Tr "repo.issues.force_push_codes" ($.Issue.PullRequest.HeadBranch|Escape) (ShortSha .OldCommit) (($.Issue.Repo.CommitLink .OldCommit)|Escape)  (ShortSha .NewCommit) (($.Issue.Repo.CommitLink .NewCommit)|Escape) $createdStr | Safe}}
749				{{else}}
750					{{$.i18n.TrN (len .Commits) "repo.issues.push_commit_1" "repo.issues.push_commits_n" (len .Commits) $createdStr | Safe}}
751				{{end}}
752			</span>
753		</div>
754		{{if not .IsForcePush}}
755			{{template "repo/commits_list_small" dict "comment" . "root" $}}
756		{{end}}
757	{{else if eq .Type 30}}
758		{{if not $.UnitProjectsGlobalDisabled}}
759		<div class="timeline-item event" id="{{.HashTag}}">
760			<span class="badge">{{svg "octicon-project"}}</span>
761			<a href="{{.Poster.HomeLink}}">
762				{{avatar .Poster}}
763			</a>
764			<span class="text grey">
765				<a class="author" href="{{.Poster.HomeLink}}">{{.Poster.GetDisplayName}}</a>
766				{{if gt .OldProjectID 0}}
767					{{if gt .ProjectID 0}}
768						{{$.i18n.Tr "repo.issues.change_project_at" (.OldProject.Title|Escape) (.Project.Title|Escape) $createdStr | Safe}}
769					{{else}}
770						{{$.i18n.Tr "repo.issues.remove_project_at" (.OldProject.Title|Escape) $createdStr | Safe}}
771					{{end}}
772				{{else if gt .ProjectID 0}}
773					{{$.i18n.Tr "repo.issues.add_project_at" (.Project.Title|Escape) $createdStr | Safe}}
774				{{end}}
775			</span>
776		</div>
777		{{end}}
778	{{else if eq .Type 32}}
779		<div class="timeline-item-group">
780			<div class="timeline-item event" id="{{.HashTag}}">
781				<a class="timeline-avatar"{{if gt .Poster.ID 0}} href="{{.Poster.HomeLink}}"{{end}}>
782					<img src="{{.Poster.AvatarLink}}">
783				</a>
784				<span class="badge grey">{{svg "octicon-x" 16}}</span>
785				<span class="text grey">
786					<a class="author"{{if gt .Poster.ID 0}} href="{{.Poster.HomeLink}}"{{end}}>{{.Poster.GetDisplayName}}</a>
787					{{$reviewerName := ""}}
788					{{if eq .Review.OriginalAuthor ""}}
789						{{$reviewerName = .Review.Reviewer.Name}}
790					{{else}}
791						{{$reviewerName = .Review.OriginalAuthor}}
792					{{end}}
793					{{$.i18n.Tr "repo.issues.review.dismissed" $reviewerName $createdStr | Safe}}
794				</span>
795			</div>
796			{{if .Content}}
797				<div class="timeline-item comment">
798					<div class="content">
799						<div class="ui top attached header arrow-top">
800							<span class="text grey">
801								{{$.i18n.Tr "action.review_dismissed_reason"}}
802							</span>
803						</div>
804						<div class="ui attached segment">
805							<div class="render-content markup">
806								{{if .RenderedContent}}
807									{{.RenderedContent|Str2html}}
808								{{else}}
809									<span class="no-content">{{$.i18n.Tr "repo.issues.no_content"}}</span>
810								{{end}}
811							</div>
812						</div>
813					</div>
814				</div>
815			{{end}}
816		</div>
817	{{else if eq .Type 33}}
818		<div class="timeline-item event" id="{{.HashTag}}">
819			<span class="badge">{{svg "octicon-git-branch"}}</span>
820			<a href="{{.Poster.HomeLink}}">
821				{{avatar .Poster}}
822			</a>
823			<span class="text grey">
824				<a class="author" href="{{.Poster.HomeLink}}">{{.Poster.GetDisplayName}}</a>
825				{{if and .OldRef .NewRef}}
826					{{$.i18n.Tr "repo.issues.change_ref_at" (.OldRef|Escape) (.NewRef|Escape) $createdStr | Safe}}
827				{{else if .OldRef}}
828					{{$.i18n.Tr "repo.issues.remove_ref_at" (.OldRef|Escape) $createdStr | Safe}}
829				{{else}}
830					{{$.i18n.Tr "repo.issues.add_ref_at" (.NewRef|Escape) $createdStr | Safe}}
831				{{end}}
832			</span>
833		</div>
834	{{end}}
835{{end}}
836