]> source.dussan.org Git - gitea.git/commitdiff
Remove `id="comment-form"` dead code, fix tag (#23555)
authorwxiaoguang <wxiaoguang@gmail.com>
Tue, 21 Mar 2023 20:35:02 +0000 (04:35 +0800)
committerGitHub <noreply@github.com>
Tue, 21 Mar 2023 20:35:02 +0000 (16:35 -0400)
The code has been dead code since #5073 . `#5073` duplicated the code in
a new `if` block.

The dead code blocks
* #23290

templates/repo/issue/view_content.tmpl

index 1b3cbdbec2e022f0e50aa69d99d590c57d89ca52..3e43701b635171202403f5251c0e9bbd11d3f680 100644 (file)
 
        {{$createdStr:= TimeSinceUnix .Issue.CreatedUnix $.locale}}
        <div class="twelve wide column comment-list prevent-before-timeline">
-               <ui class="ui timeline">
+               <div class="ui timeline">
                        <div id="{{.Issue.HashTag}}" class="timeline-item comment first">
-                       {{if .Issue.OriginalAuthor}}
+                               {{if .Issue.OriginalAuthor}}
                                <span class="timeline-avatar"><img src="{{AppSubUrl}}/assets/img/avatar_default.png"></span>
-                       {{else}}
+                               {{else}}
                                <a class="timeline-avatar" {{if gt .Issue.Poster.ID 0}}href="{{.Issue.Poster.HomeLink}}"{{end}}>
                                        {{avatar $.Context .Issue.Poster}}
                                </a>
-                       {{end}}
+                               {{end}}
                                <div class="content comment-container">
                                        <div class="ui top attached header comment-header gt-df gt-ac gt-sb" role="heading" aria-level="3">
                                                <div class="comment-header-left gt-df gt-ac">
@@ -97,6 +97,7 @@
                        {{if and .Issue.IsPull (not $.Repository.IsArchived)}}
                                {{template "repo/issue/view_content/pull".}}
                        {{end}}
+
                        {{if .IsSigned}}
                                {{if and (or .IsRepoAdmin .HasIssuesOrPullsWritePermission (not .Issue.IsLocked)) (not .Repository.IsArchived)}}
                                <div class="timeline-item comment form">
                                                {{end}}
                                        </div>
                                {{end}}
-                       {{else}}
-                       {{if .Repository.IsArchived}}
-                               <div class="ui warning message">
-                                       {{if .Issue.IsPull}}
-                                               {{.locale.Tr "repo.archive.pull.nocomment"}}
-                                       {{else}}
-                                               {{.locale.Tr "repo.archive.issue.nocomment"}}
-                                       {{end}}
-                               </div>
-                       {{else}}
-                               {{if .IsSigned}}
-                                       {{if .Repository.IsArchived}}
-                                       <div class="timeline-item comment form">
-                                               <a class="timeline-avatar" href="{{.SignedUser.HomeLink}}">
-                                                       {{avatar $.Context .SignedUser}}
-                                               </a>
-                                               <div class="content">
-                                                       <form class="ui segment form" id="comment-form" action="{{$.RepoLink}}/issues/{{.Issue.Index}}/comments" method="post">
-                                                               {{template "repo/issue/comment_tab" .}}
-                                                               {{.CsrfTokenHtml}}
-                                                               <input id="status" name="status" type="hidden">
-                                                               <div class="field footer">
-                                                                       <div class="text right">
-                                                                               {{if and (or .HasIssuesOrPullsWritePermission .IsIssuePoster) (not .DisableStatusChange)}}
-                                                                                       {{if .Issue.IsClosed}}
-                                                                                               <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">
-                                                                                                       {{.locale.Tr "repo.issues.reopen_issue"}}
-                                                                                               </button>
-                                                                                       {{else}}
-                                                                                       {{$closeTranslationKey := "repo.issues.close"}}
-                                                                                       {{if .Issue.IsPull}}
-                                                                                               {{$closeTranslationKey = "repo.pulls.close"}}
-                                                                                       {{end}}
-                                                                                       <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">
-                                                                                               {{.locale.Tr $closeTranslationKey}}
-                                                                                       </button>
-                                                                                       {{end}}
-                                                                               {{end}}
-                                                                               <button class="ui green button loading-button" tabindex="5">
-                                                                                       {{.locale.Tr "repo.issues.create_comment"}}
-                                                                               </button>
-                                                                       </div>
-                                                               </div>
-                                                       </form>
-                                               </div>
+                       {{else}} {{/* not .IsSigned */}}
+                               {{if .Repository.IsArchived}}
+                                       <div class="ui warning message">
+                                               {{if .Issue.IsPull}}
+                                                       {{.locale.Tr "repo.archive.pull.nocomment"}}
+                                               {{else}}
+                                                       {{.locale.Tr "repo.archive.issue.nocomment"}}
+                                               {{end}}
                                        </div>
-                                       {{end}}
                                {{else}}
                                        <div class="ui warning message">
                                                {{.locale.Tr "repo.issues.sign_in_require_desc" (.SignInLink|Escape) | Safe}}
                                        </div>
                                {{end}}
-                       {{end}}
-               {{end}}
-               </ui>
+                       {{end}}{{/* end if: .IsSigned */}}
+               </div>
        </div>
 
        {{template "repo/issue/view_content/sidebar" .}}