|
9 | 9 | {{end}}
|
10 | 10 |
|
11 | 11 | {{ $createdStr:= TimeSinceUnix .Issue.CreatedUnix $.Lang }}
|
12 |
| - <div class="twelve wide column comment-list"> |
| 12 | + <div class="twelve wide column comment-list prevent-before-timeline"> |
13 | 13 | <ui class="ui comments">
|
14 |
| - <div class="comment"> |
15 |
| - <a class="avatar" {{if gt .Issue.Poster.ID 0}}href="{{.Issue.Poster.HomeLink}}"{{end}}> |
16 |
| - <img src="{{.Issue.Poster.RelAvatarLink}}"> |
17 |
| - </a> |
18 |
| - <div class="content"> |
19 |
| - <div class="ui top attached header"> |
20 |
| - <span class="text grey"><a {{if gt .Issue.Poster.ID 0}}href="{{.Issue.Poster.HomeLink}}"{{end}}>{{.Issue.Poster.GetDisplayName}}</a> {{.i18n.Tr "repo.issues.commented_at" .Issue.HashTag $createdStr | Safe}}</span> |
21 |
| - {{if not $.Repository.IsArchived}} |
22 |
| - <div class="ui right actions"> |
23 |
| - {{template "repo/issue/view_content/add_reaction" Dict "ctx" $ "ActionURL" (Printf "%s/issues/%d/reactions" $.RepoLink .Issue.Index) }} |
24 |
| - {{if or .IsIssueWriter .IsIssuePoster}} |
25 |
| - <div class="item action"> |
26 |
| - <a class="edit-content" href="#"><i class="octicon octicon-pencil"></i></a> |
27 |
| - </div> |
28 |
| - {{end}} |
29 |
| - </div> |
30 |
| - {{end}} |
31 |
| - </div> |
32 |
| - <div class="ui attached segment"> |
33 |
| - <div class="render-content markdown has-emoji"> |
34 |
| - {{if .Issue.RenderedContent}} |
35 |
| - {{.Issue.RenderedContent|Str2html}} |
36 |
| - {{else}} |
37 |
| - <span class="no-content">{{.i18n.Tr "repo.issues.no_content"}}</span> |
| 14 | + <div class="timeline-line"> |
| 15 | + <div class="comment"> |
| 16 | + <a class="avatar" {{if gt .Issue.Poster.ID 0}}href="{{.Issue.Poster.HomeLink}}"{{end}}> |
| 17 | + <img src="{{.Issue.Poster.RelAvatarLink}}"> |
| 18 | + </a> |
| 19 | + <div class="content"> |
| 20 | + <div class="ui top attached header"> |
| 21 | + <span class="text grey"><a {{if gt .Issue.Poster.ID 0}}href="{{.Issue.Poster.HomeLink}}"{{end}}>{{.Issue.Poster.GetDisplayName}}</a> {{.i18n.Tr "repo.issues.commented_at" .Issue.HashTag $createdStr | Safe}}</span> |
| 22 | + {{if not $.Repository.IsArchived}} |
| 23 | + <div class="ui right actions"> |
| 24 | + {{template "repo/issue/view_content/add_reaction" Dict "ctx" $ "ActionURL" (Printf "%s/issues/%d/reactions" $.RepoLink .Issue.Index) }} |
| 25 | + {{if or .IsIssueWriter .IsIssuePoster}} |
| 26 | + <div class="item action"> |
| 27 | + <a class="edit-content" href="#"><i class="octicon octicon-pencil"></i></a> |
| 28 | + </div> |
| 29 | + {{end}} |
| 30 | + </div> |
38 | 31 | {{end}}
|
39 | 32 | </div>
|
40 |
| - <div class="raw-content hide">{{.Issue.Content}}</div> |
41 |
| - <div class="edit-content-zone hide" data-write="issue-{{.Issue.ID}}-write" data-preview="issue-{{.Issue.ID}}-preview" data-update-url="{{$.RepoLink}}/issues/{{.Issue.Index}}/content" data-context="{{.RepoLink}}"></div> |
42 |
| - </div> |
43 |
| - {{$reactions := .Issue.Reactions.GroupByType}} |
44 |
| - {{if $reactions}} |
45 |
| - <div class="ui attached segment reactions"> |
46 |
| - {{template "repo/issue/view_content/reactions" Dict "ctx" $ "ActionURL" (Printf "%s/issues/%d/reactions" $.RepoLink .Issue.Index) "Reactions" $reactions }} |
47 |
| - </div> |
48 |
| - {{end}} |
49 |
| - {{if .Issue.Attachments}} |
50 |
| - <div class="ui bottom attached segment"> |
51 |
| - <div class="ui small images"> |
52 |
| - {{range .Issue.Attachments}} |
53 |
| - <a target="_blank" rel="noopener noreferrer" href="{{AppSubUrl}}/attachments/{{.UUID}}"> |
54 |
| - {{if FilenameIsImage .Name}} |
55 |
| - <img class="ui image" src="{{AppSubUrl}}/attachments/{{.UUID}}" title='{{$.i18n.Tr "repo.issues.attachment.open_tab" .Name}}'> |
56 |
| - {{else}} |
57 |
| - <span class="ui image octicon octicon-desktop-download" title='{{$.i18n.Tr "repo.issues.attachment.download" .Name}}'></span> |
58 |
| - {{end}} |
59 |
| - </a> |
| 33 | + <div class="ui attached segment"> |
| 34 | + <div class="render-content markdown has-emoji"> |
| 35 | + {{if .Issue.RenderedContent}} |
| 36 | + {{.Issue.RenderedContent|Str2html}} |
| 37 | + {{else}} |
| 38 | + <span class="no-content">{{.i18n.Tr "repo.issues.no_content"}}</span> |
60 | 39 | {{end}}
|
61 | 40 | </div>
|
| 41 | + <div class="raw-content hide">{{.Issue.Content}}</div> |
| 42 | + <div class="edit-content-zone hide" data-write="issue-{{.Issue.ID}}-write" data-preview="issue-{{.Issue.ID}}-preview" data-update-url="{{$.RepoLink}}/issues/{{.Issue.Index}}/content" data-context="{{.RepoLink}}"></div> |
62 | 43 | </div>
|
63 |
| - {{end}} |
64 |
| - </div> |
65 |
| - </div> |
66 |
| - |
67 |
| - {{ template "repo/issue/view_content/comments" . }} |
68 |
| - |
69 |
| - {{if and .Issue.IsPull (not $.Repository.IsArchived)}} |
70 |
| - {{ template "repo/issue/view_content/pull". }} |
71 |
| - {{end}} |
72 |
| - {{if .IsSigned}} |
73 |
| - {{ if and (or .IsRepoAdmin .IsRepoIssuesWriter (or (not .Issue.IsLocked))) (not .Repository.IsArchived) }} |
74 |
| - <div class="comment form"> |
75 |
| - <a class="avatar" href="{{.SignedUser.HomeLink}}"> |
76 |
| - <img src="{{.SignedUser.RelAvatarLink}}"> |
77 |
| - </a> |
78 |
| - <div class="content"> |
79 |
| - <form class="ui segment form" id="comment-form" action="{{$.RepoLink}}/issues/{{.Issue.Index}}/comments" method="post"> |
80 |
| - {{template "repo/issue/comment_tab" .}} |
81 |
| - {{.CsrfTokenHtml}} |
82 |
| - <input id="status" name="status" type="hidden"> |
83 |
| - <div class="text right"> |
84 |
| - {{if and (or .IsIssueWriter .IsIssuePoster) (not .DisableStatusChange)}} |
85 |
| - {{if .Issue.IsClosed}} |
86 |
| - <div id="status-button" class="ui green basic button" tabindex="6" data-status="{{.i18n.Tr "repo.issues.reopen_issue"}}" data-status-and-comment="{{.i18n.Tr "repo.issues.reopen_comment_issue"}}" data-status-val="reopen"> |
87 |
| - {{.i18n.Tr "repo.issues.reopen_issue"}} |
88 |
| - </div> |
89 |
| - {{else}} |
90 |
| - <div id="status-button" class="ui red basic button" tabindex="6" data-status="{{.i18n.Tr "repo.issues.close_issue"}}" data-status-and-comment="{{.i18n.Tr "repo.issues.close_comment_issue"}}" data-status-val="close"> |
91 |
| - {{.i18n.Tr "repo.issues.close_issue"}} |
92 |
| - </div> |
| 44 | + {{$reactions := .Issue.Reactions.GroupByType}} |
| 45 | + {{if $reactions}} |
| 46 | + <div class="ui attached segment reactions"> |
| 47 | + {{template "repo/issue/view_content/reactions" Dict "ctx" $ "ActionURL" (Printf "%s/issues/%d/reactions" $.RepoLink .Issue.Index) "Reactions" $reactions }} |
| 48 | + </div> |
| 49 | + {{end}} |
| 50 | + {{if .Issue.Attachments}} |
| 51 | + <div class="ui bottom attached segment"> |
| 52 | + <div class="ui small images"> |
| 53 | + {{range .Issue.Attachments}} |
| 54 | + <a target="_blank" rel="noopener noreferrer" href="{{AppSubUrl}}/attachments/{{.UUID}}"> |
| 55 | + {{if FilenameIsImage .Name}} |
| 56 | + <img class="ui image" src="{{AppSubUrl}}/attachments/{{.UUID}}" title='{{$.i18n.Tr "repo.issues.attachment.open_tab" .Name}}'> |
| 57 | + {{else}} |
| 58 | + <span class="ui image octicon octicon-desktop-download" title='{{$.i18n.Tr "repo.issues.attachment.download" .Name}}'></span> |
| 59 | + {{end}} |
| 60 | + </a> |
93 | 61 | {{end}}
|
94 |
| - {{end}} |
95 |
| - <button class="ui green button" tabindex="5"> |
96 |
| - {{.i18n.Tr "repo.issues.create_comment"}} |
97 |
| - </button> |
| 62 | + </div> |
98 | 63 | </div>
|
99 |
| - </form> |
| 64 | + {{end}} |
100 | 65 | </div>
|
101 | 66 | </div>
|
102 |
| - {{ end }} |
103 |
| - {{else}} |
104 |
| - {{if .Repository.IsArchived}} |
105 |
| - <div class="ui warning message"> |
106 |
| - {{if .Issue.IsPull}} |
107 |
| - {{.i18n.Tr "repo.archive.pull.nocomment"}} |
108 |
| - {{else}} |
109 |
| - {{.i18n.Tr "repo.archive.issue.nocomment"}} |
110 |
| - {{end}} |
111 |
| - </div> |
112 |
| - {{else}} |
| 67 | + |
| 68 | + {{ template "repo/issue/view_content/comments" . }} |
| 69 | + |
| 70 | + {{if and .Issue.IsPull (not $.Repository.IsArchived)}} |
| 71 | + {{ template "repo/issue/view_content/pull". }} |
| 72 | + {{end}} |
113 | 73 | {{if .IsSigned}}
|
114 |
| - {{if .Repository.IsArchived}} |
| 74 | + {{ if and (or .IsRepoAdmin .IsRepoIssuesWriter (or (not .Issue.IsLocked))) (not .Repository.IsArchived) }} |
115 | 75 | <div class="comment form">
|
116 | 76 | <a class="avatar" href="{{.SignedUser.HomeLink}}">
|
117 | 77 | <img src="{{.SignedUser.RelAvatarLink}}">
|
|
140 | 100 | </form>
|
141 | 101 | </div>
|
142 | 102 | </div>
|
143 |
| - {{end}} |
| 103 | + {{ end }} |
144 | 104 | {{else}}
|
| 105 | + {{if .Repository.IsArchived}} |
145 | 106 | <div class="ui warning message">
|
146 |
| - {{.i18n.Tr "repo.issues.sign_in_require_desc" .SignInLink | Safe}} |
| 107 | + {{if .Issue.IsPull}} |
| 108 | + {{.i18n.Tr "repo.archive.pull.nocomment"}} |
| 109 | + {{else}} |
| 110 | + {{.i18n.Tr "repo.archive.issue.nocomment"}} |
| 111 | + {{end}} |
147 | 112 | </div>
|
| 113 | + {{else}} |
| 114 | + {{if .IsSigned}} |
| 115 | + {{if .Repository.IsArchived}} |
| 116 | + <div class="comment form"> |
| 117 | + <a class="avatar" href="{{.SignedUser.HomeLink}}"> |
| 118 | + <img src="{{.SignedUser.RelAvatarLink}}"> |
| 119 | + </a> |
| 120 | + <div class="content"> |
| 121 | + <form class="ui segment form" id="comment-form" action="{{$.RepoLink}}/issues/{{.Issue.Index}}/comments" method="post"> |
| 122 | + {{template "repo/issue/comment_tab" .}} |
| 123 | + {{.CsrfTokenHtml}} |
| 124 | + <input id="status" name="status" type="hidden"> |
| 125 | + <div class="text right"> |
| 126 | + {{if and (or .IsIssueWriter .IsIssuePoster) (not .DisableStatusChange)}} |
| 127 | + {{if .Issue.IsClosed}} |
| 128 | + <div id="status-button" class="ui green basic button" tabindex="6" data-status="{{.i18n.Tr "repo.issues.reopen_issue"}}" data-status-and-comment="{{.i18n.Tr "repo.issues.reopen_comment_issue"}}" data-status-val="reopen"> |
| 129 | + {{.i18n.Tr "repo.issues.reopen_issue"}} |
| 130 | + </div> |
| 131 | + {{else}} |
| 132 | + <div id="status-button" class="ui red basic button" tabindex="6" data-status="{{.i18n.Tr "repo.issues.close_issue"}}" data-status-and-comment="{{.i18n.Tr "repo.issues.close_comment_issue"}}" data-status-val="close"> |
| 133 | + {{.i18n.Tr "repo.issues.close_issue"}} |
| 134 | + </div> |
| 135 | + {{end}} |
| 136 | + {{end}} |
| 137 | + <button class="ui green button" tabindex="5"> |
| 138 | + {{.i18n.Tr "repo.issues.create_comment"}} |
| 139 | + </button> |
| 140 | + </div> |
| 141 | + </form> |
| 142 | + </div> |
| 143 | + </div> |
| 144 | + {{end}} |
| 145 | + {{else}} |
| 146 | + <div class="ui warning message"> |
| 147 | + {{.i18n.Tr "repo.issues.sign_in_require_desc" .SignInLink | Safe}} |
| 148 | + </div> |
| 149 | + {{end}} |
148 | 150 | {{end}}
|
149 | 151 | {{end}}
|
150 |
| - {{end}} |
| 152 | + </div> |
151 | 153 | </ui>
|
152 | 154 | </div>
|
153 | 155 |
|
|
0 commit comments