Skip to content

Commit 9b01908

Browse files
authored
Remove id="comment-form" dead code, fix tag (#23555)
The code has been dead code since #5073 . `#5073` duplicated the code in a new `if` block. The dead code blocks * #23290
1 parent ce9dee5 commit 9b01908

File tree

1 file changed

+15
-53
lines changed

1 file changed

+15
-53
lines changed

templates/repo/issue/view_content.tmpl

+15-53
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,15 @@
1717

1818
{{$createdStr:= TimeSinceUnix .Issue.CreatedUnix $.locale}}
1919
<div class="twelve wide column comment-list prevent-before-timeline">
20-
<ui class="ui timeline">
20+
<div class="ui timeline">
2121
<div id="{{.Issue.HashTag}}" class="timeline-item comment first">
22-
{{if .Issue.OriginalAuthor}}
22+
{{if .Issue.OriginalAuthor}}
2323
<span class="timeline-avatar"><img src="{{AppSubUrl}}/assets/img/avatar_default.png"></span>
24-
{{else}}
24+
{{else}}
2525
<a class="timeline-avatar" {{if gt .Issue.Poster.ID 0}}href="{{.Issue.Poster.HomeLink}}"{{end}}>
2626
{{avatar $.Context .Issue.Poster}}
2727
</a>
28-
{{end}}
28+
{{end}}
2929
<div class="content comment-container">
3030
<div class="ui top attached header comment-header gt-df gt-ac gt-sb" role="heading" aria-level="3">
3131
<div class="comment-header-left gt-df gt-ac">
@@ -97,6 +97,7 @@
9797
{{if and .Issue.IsPull (not $.Repository.IsArchived)}}
9898
{{template "repo/issue/view_content/pull".}}
9999
{{end}}
100+
100101
{{if .IsSigned}}
101102
{{if and (or .IsRepoAdmin .HasIssuesOrPullsWritePermission (not .Issue.IsLocked)) (not .Repository.IsArchived)}}
102103
<div class="timeline-item comment form">
@@ -142,61 +143,22 @@
142143
{{end}}
143144
</div>
144145
{{end}}
145-
{{else}}
146-
{{if .Repository.IsArchived}}
147-
<div class="ui warning message">
148-
{{if .Issue.IsPull}}
149-
{{.locale.Tr "repo.archive.pull.nocomment"}}
150-
{{else}}
151-
{{.locale.Tr "repo.archive.issue.nocomment"}}
152-
{{end}}
153-
</div>
154-
{{else}}
155-
{{if .IsSigned}}
156-
{{if .Repository.IsArchived}}
157-
<div class="timeline-item comment form">
158-
<a class="timeline-avatar" href="{{.SignedUser.HomeLink}}">
159-
{{avatar $.Context .SignedUser}}
160-
</a>
161-
<div class="content">
162-
<form class="ui segment form" id="comment-form" action="{{$.RepoLink}}/issues/{{.Issue.Index}}/comments" method="post">
163-
{{template "repo/issue/comment_tab" .}}
164-
{{.CsrfTokenHtml}}
165-
<input id="status" name="status" type="hidden">
166-
<div class="field footer">
167-
<div class="text right">
168-
{{if and (or .HasIssuesOrPullsWritePermission .IsIssuePoster) (not .DisableStatusChange)}}
169-
{{if .Issue.IsClosed}}
170-
<button id="status-button" class="ui green basic button" tabindex="6" data-status="{{.locale.Tr "repo.issues.reopen_issue"}}" data-status-and-comment="{{.locale.Tr "repo.issues.reopen_comment_issue"}}" data-status-val="reopen">
171-
{{.locale.Tr "repo.issues.reopen_issue"}}
172-
</button>
173-
{{else}}
174-
{{$closeTranslationKey := "repo.issues.close"}}
175-
{{if .Issue.IsPull}}
176-
{{$closeTranslationKey = "repo.pulls.close"}}
177-
{{end}}
178-
<button id="status-button" class="ui red basic button" tabindex="6" data-status="{{.locale.Tr $closeTranslationKey}}" data-status-and-comment="{{.locale.Tr "repo.issues.close_comment_issue"}}" data-status-val="close">
179-
{{.locale.Tr $closeTranslationKey}}
180-
</button>
181-
{{end}}
182-
{{end}}
183-
<button class="ui green button loading-button" tabindex="5">
184-
{{.locale.Tr "repo.issues.create_comment"}}
185-
</button>
186-
</div>
187-
</div>
188-
</form>
189-
</div>
146+
{{else}} {{/* not .IsSigned */}}
147+
{{if .Repository.IsArchived}}
148+
<div class="ui warning message">
149+
{{if .Issue.IsPull}}
150+
{{.locale.Tr "repo.archive.pull.nocomment"}}
151+
{{else}}
152+
{{.locale.Tr "repo.archive.issue.nocomment"}}
153+
{{end}}
190154
</div>
191-
{{end}}
192155
{{else}}
193156
<div class="ui warning message">
194157
{{.locale.Tr "repo.issues.sign_in_require_desc" (.SignInLink|Escape) | Safe}}
195158
</div>
196159
{{end}}
197-
{{end}}
198-
{{end}}
199-
</ui>
160+
{{end}}{{/* end if: .IsSigned */}}
161+
</div>
200162
</div>
201163

202164
{{template "repo/issue/view_content/sidebar" .}}

0 commit comments

Comments
 (0)