diff options
author | wxiaoguang <wxiaoguang@gmail.com> | 2023-03-22 04:35:02 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-03-21 16:35:02 -0400 |
commit | 9b0190884d88ad15cf67e1288a302d22e88d37aa (patch) | |
tree | 62b7b0cf1b4d9d50cf98bdacfbf20a1433de1f0d | |
parent | ce9dee5a1e8ae670c97621bca409d8cf43a90102 (diff) | |
download | gitea-9b0190884d88ad15cf67e1288a302d22e88d37aa.tar.gz gitea-9b0190884d88ad15cf67e1288a302d22e88d37aa.zip |
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
-rw-r--r-- | templates/repo/issue/view_content.tmpl | 68 |
1 files changed, 15 insertions, 53 deletions
diff --git a/templates/repo/issue/view_content.tmpl b/templates/repo/issue/view_content.tmpl index 1b3cbdbec2..3e43701b63 100644 --- a/templates/repo/issue/view_content.tmpl +++ b/templates/repo/issue/view_content.tmpl @@ -17,15 +17,15 @@ {{$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"> @@ -142,61 +143,22 @@ {{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" .}} |