Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove id="comment-form" dead code, fix tag #23555

Merged
merged 5 commits into from
Mar 21, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
68 changes: 15 additions & 53 deletions templates/repo/issue/view_content.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -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">
Expand Down Expand Up @@ -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">
Expand Down Expand Up @@ -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" .}}
Expand Down