Skip to content

Commit ed576c2

Browse files
committed
Fix lint backend compliance issues
1 parent 8b68cc8 commit ed576c2

File tree

7 files changed

+148
-148
lines changed

7 files changed

+148
-148
lines changed

templates/repo/conversation/comment_form.tmpl

Lines changed: 42 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -2,46 +2,46 @@
22
<!-- If the user has not signed in, it shows a box to suggest sign in instead -->
33

44
{{if .IsSigned}}
5-
{{if and (or .IsRepoAdmin .HasIssuesOrPullsWritePermission (not (and .IsIssue .Issue.IsLocked))) (not .Repository.IsArchived)}}
6-
<div class="timeline-item comment form">
7-
<a class="timeline-avatar" href="{{.SignedUser.HomeLink}}">
8-
{{ctx.AvatarUtils.Avatar .SignedUser 40}}
9-
</a>
10-
<div class="content">
11-
<div class="ui segment">
12-
{{if .IsIssue}}
13-
<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>
16-
{{else}}
17-
<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>
20-
{{end}}
21-
</div>
22-
</div>
23-
</div>
24-
{{else if .Repository.IsArchived}}
25-
<div class="ui warning message tw-text-center">
26-
{{if and .IsIssue .Issue.IsPull}}
27-
{{ctx.Locale.Tr "repo.archive.pull.nocomment"}}
28-
{{else}}
29-
{{ctx.Locale.Tr "repo.archive.issue.nocomment"}}
30-
{{end}}
31-
</div>
32-
{{end}}
5+
{{if and (or .IsRepoAdmin .HasIssuesOrPullsWritePermission (not (and .IsIssue .Issue.IsLocked))) (not .Repository.IsArchived)}}
6+
<div class="timeline-item comment form">
7+
<a class="timeline-avatar" href="{{.SignedUser.HomeLink}}">
8+
{{ctx.AvatarUtils.Avatar .SignedUser 40}}
9+
</a>
10+
<div class="content">
11+
<div class="ui segment">
12+
{{if .IsIssue}}
13+
<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>
16+
{{else}}
17+
<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>
20+
{{end}}
21+
</div>
22+
</div>
23+
</div>
24+
{{else if .Repository.IsArchived}}
25+
<div class="ui warning message tw-text-center">
26+
{{if and .IsIssue .Issue.IsPull}}
27+
{{ctx.Locale.Tr "repo.archive.pull.nocomment"}}
28+
{{else}}
29+
{{ctx.Locale.Tr "repo.archive.issue.nocomment"}}
30+
{{end}}
31+
</div>
32+
{{end}}
3333
{{else}} {{/* not .IsSigned */}}
34-
{{if .Repository.IsArchived}}
35-
<div class="ui warning message tw-text-center">
36-
{{if .IsIssue and .Issue.IsPull}}
37-
{{ctx.Locale.Tr "repo.archive.pull.nocomment"}}
38-
{{else}}
39-
{{ctx.Locale.Tr "repo.archive.issue.nocomment"}}
40-
{{end}}
41-
</div>
42-
{{else}}
43-
<div class="ui warning message">
44-
{{ctx.Locale.Tr "repo.issues.sign_in_require_desc" .SignInLink}}
45-
</div>
46-
{{end}}
47-
{{end}}{{/* end if: .IsSigned */}}
34+
{{if .Repository.IsArchived}}
35+
<div class="ui warning message tw-text-center">
36+
{{if .IsIssue and .Issue.IsPull}}
37+
{{ctx.Locale.Tr "repo.archive.pull.nocomment"}}
38+
{{else}}
39+
{{ctx.Locale.Tr "repo.archive.issue.nocomment"}}
40+
{{end}}
41+
</div>
42+
{{else}}
43+
<div class="ui warning message">
44+
{{ctx.Locale.Tr "repo.issues.sign_in_require_desc" .SignInLink}}
45+
</div>
46+
{{end}}
47+
{{end}}{{/* end if: .IsSigned */}}
Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,24 @@
11
{{template "repo/conversation/comment_tab" .}}
22
{{.CsrfTokenHtml}}
33
<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>
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>

templates/repo/conversation/comments.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@
8383
{{$EditURL:=printf "%s/%s/%d" $.RepoLink "conversations/comments" .ID}}
8484
<div class="edit-content-zone tw-hidden" data-update-url="{{$EditURL}}" data-content-version="{{.ContentVersion}}" data-context="{{$.RepoLink}}" data-attachment-url="{{$EditURL}}/attachments"></div>
8585
{{end}}
86-
86+
8787
{{if .Attachments}}
8888
{{template "repo/issue/view_content/attachments" dict "Attachments" .Attachments "RenderedContent" .RenderedContent}}
8989
{{end}}

templates/repo/conversation/context_menu.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
{{if .pull}}
1212
{{$referenceUrl = printf "%s/files#%s" .ctxData.Issue.Link .item.HashTag}}
1313
{{end}}
14-
14+
1515
{{if .commit}}
1616
{{$referenceUrl = printf "%s#%s" .ctxData.Conversation.Link .item.HashTag}}
1717
{{end}}
Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,27 @@
11
<!-- Pass in IsIssue (bool) if this conversation is attached to an Issue -->
22
<div class="conversation-container">
3-
{{if .ConversationTitle}}
4-
<div class="divider"></div>
3+
{{if .ConversationTitle}}
4+
<div class="divider"></div>
55
<h2 class="tw-mb-0 tw-flex-1">
6-
<span class="conversation-title" title="Comments">{{.ConversationTitle}}</span>
7-
</h2>
8-
<div class="divider"></div>
9-
{{end}}
10-
<div class="conversation-content comment-list prevent-before-timeline">
11-
<div class="ui timeline">
12-
{{if .IsIssue}}
13-
{{template "repo/conversation/issue_header_comment" .}}
14-
{{end}}
6+
<span class="conversation-title" title="Comments">{{.ConversationTitle}}</span>
7+
</h2>
8+
<div class="divider"></div>
9+
{{end}}
10+
<div class="conversation-content comment-list prevent-before-timeline">
11+
<div class="ui timeline">
12+
{{if .IsIssue}}
13+
{{template "repo/conversation/issue_header_comment" .}}
14+
{{end}}
1515

16-
{{template "repo/conversation/comments" .}}
16+
{{template "repo/conversation/comments" .}}
1717

18-
{{if .IsIssue}}
19-
{{if and .Issue.IsPull (not $.Repository.IsArchived)}}
20-
{{template "repo/issue/view_content/pull".}}
21-
{{end}}
22-
{{end}}
18+
{{if .IsIssue}}
19+
{{if and .Issue.IsPull (not $.Repository.IsArchived)}}
20+
{{template "repo/issue/view_content/pull".}}
21+
{{end}}
22+
{{end}}
2323

24-
{{template "repo/conversation/comment_form" .}}
25-
</div>
26-
</div>
27-
</div>
24+
{{template "repo/conversation/comment_form" .}}
25+
</div>
26+
</div>
27+
</div>

templates/repo/conversation/issue_header_comment.tmpl

Lines changed: 61 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -2,64 +2,64 @@
22
<!-- Fake comment that is based on the Issue's Title and Description -->
33
<div id="{{.Issue.HashTag}}" class="timeline-item comment first">
44
{{$createdStr:= TimeSinceUnix .Issue.CreatedUnix ctx.Locale}}
5-
{{if .Issue.OriginalAuthor}}
6-
<span class="timeline-avatar">
7-
{{ctx.AvatarUtils.Avatar nil 40}}
8-
</span>
9-
{{else}}
10-
<a class="timeline-avatar" {{if gt .Issue.Poster.ID 0}}href="{{.Issue.Poster.HomeLink}}"{{end}}>
11-
{{ctx.AvatarUtils.Avatar .Issue.Poster 40}}
12-
</a>
13-
{{end}}
14-
<div class="content comment-container">
15-
<div class="ui top attached header comment-header tw-flex tw-items-center tw-justify-between" role="heading" aria-level="3">
16-
<div class="comment-header-left tw-flex tw-items-center">
17-
{{if .Issue.OriginalAuthor}}
18-
<span class="text black tw-font-semibold">
19-
{{svg (MigrationIcon .Repository.GetOriginalURLHostname)}}
20-
{{.Issue.OriginalAuthor}}
21-
</span>
22-
<span class="text grey muted-links">
23-
{{ctx.Locale.Tr "repo.issues.commented_at" .Issue.HashTag $createdStr}}
24-
</span>
25-
<span class="text migrate">
26-
{{if .Repository.OriginalURL}} ({{ctx.Locale.Tr "repo.migrated_from" .Repository.OriginalURL .Repository.GetOriginalURLHostname}}){{end}}
27-
</span>
28-
{{else}}
29-
<a class="inline-timeline-avatar" href="{{.Issue.Poster.HomeLink}}">
30-
{{ctx.AvatarUtils.Avatar .Issue.Poster 24}}
31-
</a>
32-
<span class="text grey muted-links">
33-
{{template "shared/user/authorlink" .Issue.Poster}}
34-
{{ctx.Locale.Tr "repo.issues.commented_at" .Issue.HashTag $createdStr}}
35-
</span>
36-
{{end}}
37-
</div>
38-
<div class="comment-header-right actions tw-flex tw-items-center">
39-
{{template "repo/issue/view_content/show_role" dict "ShowRole" .Issue.ShowRole "IgnorePoster" true}}
40-
{{if not $.Repository.IsArchived}}
41-
{{template "repo/issue/view_content/add_reaction" dict "ActionURL" (printf "%s/issues/%d/reactions" $.RepoLink .Issue.Index)}}
42-
{{end}}
43-
{{template "repo/issue/view_content/context_menu" dict "ctxData" $ "item" .Issue "delete" false "issue" true "diff" false "IsCommentPoster" $.IsIssuePoster}}
44-
</div>
45-
</div>
46-
<div class="ui attached segment comment-body" role="article">
47-
<div class="render-content markup" {{if or $.Permission.IsAdmin $.HasIssuesOrPullsWritePermission $.IsIssuePoster}}data-can-edit="true"{{end}}>
48-
{{if .Issue.RenderedContent}}
49-
{{.Issue.RenderedContent}}
50-
{{else}}
51-
<span class="no-content">{{ctx.Locale.Tr "repo.issues.no_content"}}</span>
52-
{{end}}
53-
</div>
54-
<div id="issue-{{.Issue.ID}}-raw" class="raw-content tw-hidden">{{.Issue.Content}}</div>
55-
<div class="edit-content-zone tw-hidden" data-update-url="{{$.RepoLink}}/issues/{{.Issue.Index}}/content" data-content-version="{{.Issue.ContentVersion}}" data-context="{{.RepoLink}}" data-attachment-url="{{$.RepoLink}}/issues/{{.Issue.Index}}/attachments" data-view-attachment-url="{{$.RepoLink}}/issues/{{.Issue.Index}}/view-attachments"></div>
56-
{{if .Issue.Attachments}}
57-
{{template "repo/issue/view_content/attachments" dict "Attachments" .Issue.Attachments "RenderedContent" .Issue.RenderedContent}}
58-
{{end}}
59-
</div>
60-
{{$reactions := .Issue.Reactions.GroupByType}}
61-
{{if $reactions}}
62-
{{template "repo/issue/view_content/reactions" dict "ActionURL" (printf "%s/issues/%d/reactions" $.RepoLink .Issue.Index) "Reactions" $reactions}}
63-
{{end}}
64-
</div>
65-
</div>
5+
{{if .Issue.OriginalAuthor}}
6+
<span class="timeline-avatar">
7+
{{ctx.AvatarUtils.Avatar nil 40}}
8+
</span>
9+
{{else}}
10+
<a class="timeline-avatar" {{if gt .Issue.Poster.ID 0}}href="{{.Issue.Poster.HomeLink}}"{{end}}>
11+
{{ctx.AvatarUtils.Avatar .Issue.Poster 40}}
12+
</a>
13+
{{end}}
14+
<div class="content comment-container">
15+
<div class="ui top attached header comment-header tw-flex tw-items-center tw-justify-between" role="heading" aria-level="3">
16+
<div class="comment-header-left tw-flex tw-items-center">
17+
{{if .Issue.OriginalAuthor}}
18+
<span class="text black tw-font-semibold">
19+
{{svg (MigrationIcon .Repository.GetOriginalURLHostname)}}
20+
{{.Issue.OriginalAuthor}}
21+
</span>
22+
<span class="text grey muted-links">
23+
{{ctx.Locale.Tr "repo.issues.commented_at" .Issue.HashTag $createdStr}}
24+
</span>
25+
<span class="text migrate">
26+
{{if .Repository.OriginalURL}} ({{ctx.Locale.Tr "repo.migrated_from" .Repository.OriginalURL .Repository.GetOriginalURLHostname}}){{end}}
27+
</span>
28+
{{else}}
29+
<a class="inline-timeline-avatar" href="{{.Issue.Poster.HomeLink}}">
30+
{{ctx.AvatarUtils.Avatar .Issue.Poster 24}}
31+
</a>
32+
<span class="text grey muted-links">
33+
{{template "shared/user/authorlink" .Issue.Poster}}
34+
{{ctx.Locale.Tr "repo.issues.commented_at" .Issue.HashTag $createdStr}}
35+
</span>
36+
{{end}}
37+
</div>
38+
<div class="comment-header-right actions tw-flex tw-items-center">
39+
{{template "repo/issue/view_content/show_role" dict "ShowRole" .Issue.ShowRole "IgnorePoster" true}}
40+
{{if not $.Repository.IsArchived}}
41+
{{template "repo/issue/view_content/add_reaction" dict "ActionURL" (printf "%s/issues/%d/reactions" $.RepoLink .Issue.Index)}}
42+
{{end}}
43+
{{template "repo/issue/view_content/context_menu" dict "ctxData" $ "item" .Issue "delete" false "issue" true "diff" false "IsCommentPoster" $.IsIssuePoster}}
44+
</div>
45+
</div>
46+
<div class="ui attached segment comment-body" role="article">
47+
<div class="render-content markup" {{if or $.Permission.IsAdmin $.HasIssuesOrPullsWritePermission $.IsIssuePoster}}data-can-edit="true"{{end}}>
48+
{{if .Issue.RenderedContent}}
49+
{{.Issue.RenderedContent}}
50+
{{else}}
51+
<span class="no-content">{{ctx.Locale.Tr "repo.issues.no_content"}}</span>
52+
{{end}}
53+
</div>
54+
<div id="issue-{{.Issue.ID}}-raw" class="raw-content tw-hidden">{{.Issue.Content}}</div>
55+
<div class="edit-content-zone tw-hidden" data-update-url="{{$.RepoLink}}/issues/{{.Issue.Index}}/content" data-content-version="{{.Issue.ContentVersion}}" data-context="{{.RepoLink}}" data-attachment-url="{{$.RepoLink}}/issues/{{.Issue.Index}}/attachments" data-view-attachment-url="{{$.RepoLink}}/issues/{{.Issue.Index}}/view-attachments"></div>
56+
{{if .Issue.Attachments}}
57+
{{template "repo/issue/view_content/attachments" dict "Attachments" .Issue.Attachments "RenderedContent" .Issue.RenderedContent}}
58+
{{end}}
59+
</div>
60+
{{$reactions := .Issue.Reactions.GroupByType}}
61+
{{if $reactions}}
62+
{{template "repo/issue/view_content/reactions" dict "ActionURL" (printf "%s/issues/%d/reactions" $.RepoLink .Issue.Index) "Reactions" $reactions}}
63+
{{end}}
64+
</div>
65+
</div>
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{{template "repo/conversation/comment_tab" .}}
1+
{{template "repo/conversation/comment_tab" .}}

0 commit comments

Comments
 (0)