Skip to content

Commit fddda21

Browse files
committed
Fix comment form orphan tag issue with lint
1 parent 5ba8ae1 commit fddda21

File tree

2 files changed

+28
-25
lines changed

2 files changed

+28
-25
lines changed

templates/repo/conversation/comment_form.tmpl

Lines changed: 4 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -11,34 +11,13 @@
1111
<div class="ui segment">
1212
{{if .IsIssue}}
1313
<form class="ui form form-fetch-action" id="comment-form" action="{{$.RepoLink}}/issues/{{.Issue.Index}}/comments" method="post">
14+
{{template "repo/conversation/comment_form_content" .}}
15+
</form>
1416
{{else}}
1517
<form class="ui form form-fetch-action" id="comment-form" action="{{$.RepoLink}}/conversations/{{.Conversation.Index}}/comments" method="post">
18+
{{template "repo/conversation/comment_form_content" .}}
19+
</form>
1620
{{end}}
17-
{{template "repo/conversation/comment_tab" .}}
18-
{{.CsrfTokenHtml}}
19-
<div class="field footer">
20-
<div class="text right">
21-
{{if and (or .HasIssuesOrPullsWritePermission .IsIssuePoster) (not .DisableStatusChange)}}
22-
{{if and .IsIssue .Issue.IsClosed}}
23-
<button id="status-button" class="ui primary basic button" data-status="{{ctx.Locale.Tr "repo.issues.reopen_issue"}}" data-status-and-comment="{{ctx.Locale.Tr "repo.issues.reopen_comment_issue"}}" name="status" value="reopen">
24-
{{ctx.Locale.Tr "repo.issues.reopen_issue"}}
25-
</button>
26-
{{else}}
27-
{{$closeTranslationKey := "repo.issues.close"}}
28-
{{if and .IsIssue .Issue.IsPull}}
29-
{{$closeTranslationKey = "repo.pulls.close"}}
30-
{{end}}
31-
<button id="status-button" class="ui red basic button" data-status="{{ctx.Locale.Tr $closeTranslationKey}}" data-status-and-comment="{{ctx.Locale.Tr "repo.issues.close_comment_issue"}}" name="status" value="close">
32-
{{ctx.Locale.Tr $closeTranslationKey}}
33-
</button>
34-
{{end}}
35-
{{end}}
36-
<button id="comment-button" class="ui primary button">
37-
{{ctx.Locale.Tr "repo.issues.create_comment"}}
38-
</button>
39-
</div>
40-
</div>
41-
</form>
4221
</div>
4322
</div>
4423
</div>
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{{template "repo/conversation/comment_tab" .}}
2+
{{.CsrfTokenHtml}}
3+
<div class="field footer">
4+
<div class="text right">
5+
{{if and (or .HasIssuesOrPullsWritePermission .IsIssuePoster) (not .DisableStatusChange)}}
6+
{{if and .IsIssue .Issue.IsClosed}}
7+
<button id="status-button" class="ui primary basic button" data-status="{{ctx.Locale.Tr "repo.issues.reopen_issue"}}" data-status-and-comment="{{ctx.Locale.Tr "repo.issues.reopen_comment_issue"}}" name="status" value="reopen">
8+
{{ctx.Locale.Tr "repo.issues.reopen_issue"}}
9+
</button>
10+
{{else}}
11+
{{$closeTranslationKey := "repo.issues.close"}}
12+
{{if and .IsIssue .Issue.IsPull}}
13+
{{$closeTranslationKey = "repo.pulls.close"}}
14+
{{end}}
15+
<button id="status-button" class="ui red basic button" data-status="{{ctx.Locale.Tr $closeTranslationKey}}" data-status-and-comment="{{ctx.Locale.Tr "repo.issues.close_comment_issue"}}" name="status" value="close">
16+
{{ctx.Locale.Tr $closeTranslationKey}}
17+
</button>
18+
{{end}}
19+
{{end}}
20+
<button id="comment-button" class="ui primary button">
21+
{{ctx.Locale.Tr "repo.issues.create_comment"}}
22+
</button>
23+
</div>
24+
</div>

0 commit comments

Comments
 (0)