Skip to content

Commit 3d6f173

Browse files
authored
Fix and simplify some tmpl conditions (#11080)
1 parent eeb968e commit 3d6f173

File tree

6 files changed

+7
-7
lines changed

6 files changed

+7
-7
lines changed

templates/repo/diff/blob_excerpt.tmpl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
{{if or (eq $line.GetExpandDirection 3) (eq $line.GetExpandDirection 4) }}
1010
<i class="ui blob-excerpt fa fa-caret-up" data-url="{{$.RepoLink}}/blob_excerpt/{{$.AfterCommitID}}" data-query="{{$line.GetBlobExcerptQuery}}&style=split&direction=up" data-anchor="{{$.Anchor}}"></i>
1111
{{end}}
12-
{{if or (eq $line.GetExpandDirection 2)}}
12+
{{if eq $line.GetExpandDirection 2}}
1313
<span class="ui blob-excerpt" data-url="{{$.RepoLink}}/blob_excerpt/{{$.AfterCommitID}}" data-query="{{$line.GetBlobExcerptQuery}}&style=split&direction=" data-anchor="{{$.Anchor}}">{{svg "octicon-fold" 16}}</span>
1414
{{end}}
1515
</td>
@@ -35,7 +35,7 @@
3535
{{if or (eq $line.GetExpandDirection 3) (eq $line.GetExpandDirection 5) }}
3636
<i class="ui blob-excerpt fa fa-caret-down" data-url="{{$.RepoLink}}/blob_excerpt/{{$.AfterCommitID}}" data-query="{{$line.GetBlobExcerptQuery}}&style=unified&direction=down" data-anchor="{{$.Anchor}}"></i>
3737
{{end}}
38-
{{if or (eq $line.GetExpandDirection 2)}}
38+
{{if eq $line.GetExpandDirection 2}}
3939
<span class="ui blob-excerpt" data-url="{{$.RepoLink}}/blob_excerpt/{{$.AfterCommitID}}" data-query="{{$line.GetBlobExcerptQuery}}&style=unified&direction=" data-anchor="{{$.Anchor}}">{{svg "octicon-fold" 16}}</span>
4040
{{end}}
4141
</td>

templates/repo/diff/box.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@
132132
{{if or (eq $line.GetExpandDirection 3) (eq $line.GetExpandDirection 4) }}
133133
<i class="ui blob-excerpt fa fa-caret-up" data-url="{{$.RepoLink}}/blob_excerpt/{{$.AfterCommitID}}" data-query="{{$line.GetBlobExcerptQuery}}&style=split&direction=up" data-anchor="diff-{{Sha1 $file.Name}}K{{$line.SectionInfo.RightIdx}}"></i>
134134
{{end}}
135-
{{if or (eq $line.GetExpandDirection 2)}}
135+
{{if eq $line.GetExpandDirection 2}}
136136
<span class="ui blob-excerpt" data-url="{{$.RepoLink}}/blob_excerpt/{{$.AfterCommitID}}" data-query="{{$line.GetBlobExcerptQuery}}&style=split&direction=" data-anchor="diff-{{Sha1 $file.Name}}K{{$line.SectionInfo.RightIdx}}">{{svg "octicon-fold" 16}}</span>
137137
{{end}}
138138
</td>

templates/repo/diff/section_unified.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
{{if or (eq $line.GetExpandDirection 3) (eq $line.GetExpandDirection 4) }}
1212
<i class="ui blob-excerpt fa fa-caret-up" data-url="{{$.root.RepoLink}}/blob_excerpt/{{$.root.AfterCommitID}}" data-query="{{$line.GetBlobExcerptQuery}}&style=unified&direction=up" data-anchor="diff-{{Sha1 $file.Name}}K{{$line.SectionInfo.RightIdx}}"></i>
1313
{{end}}
14-
{{if or (eq $line.GetExpandDirection 2)}}
14+
{{if eq $line.GetExpandDirection 2}}
1515
<span class="ui blob-excerpt" data-url="{{$.root.RepoLink}}/blob_excerpt/{{$.root.AfterCommitID}}" data-query="{{$line.GetBlobExcerptQuery}}&style=unified&direction=" data-anchor="diff-{{Sha1 $file.Name}}K{{$line.SectionInfo.RightIdx}}">{{svg "octicon-fold" 16}}</span>
1616
{{end}}
1717
</td>

templates/repo/issue/view_content.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@
6666
{{ template "repo/issue/view_content/pull". }}
6767
{{end}}
6868
{{if .IsSigned}}
69-
{{ if and (or .IsRepoAdmin .HasIssuesOrPullsWritePermission (or (not .Issue.IsLocked))) (not .Repository.IsArchived) }}
69+
{{ if and (or .IsRepoAdmin .HasIssuesOrPullsWritePermission (not .Issue.IsLocked)) (not .Repository.IsArchived) }}
7070
<div class="timeline-item comment form">
7171
<a class="timeline-avatar" href="{{.SignedUser.HomeLink}}">
7272
<img src="{{.SignedUser.RelAvatarLink}}">

templates/repo/wiki/revision.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
{{else if and (not $.DisableSSH) (or $.IsSigned $.ExposeAnonSSH)}}
2222
<input id="repo-clone-url" value="{{$.WikiCloneLink.SSH}}" readonly>
2323
{{end}}
24-
{{if or ((not $.DisableHTTP) (and (not $.DisableSSH) (or $.IsSigned $.ExposeAnonSSH)))}}
24+
{{if or (not $.DisableHTTP) (and (not $.DisableSSH) (or $.IsSigned $.ExposeAnonSSH))}}
2525
<button class="ui basic icon button poping up clipboard" id="clipboard-btn" data-original="{{.i18n.Tr "repo.copy_link"}}" data-success="{{.i18n.Tr "repo.copy_link_success"}}" data-error="{{.i18n.Tr "repo.copy_link_error"}}" data-content="{{.i18n.Tr "repo.copy_link"}}" data-variation="inverted tiny" data-clipboard-target="#repo-clone-url">
2626
{{svg "octicon-clippy" 16}}
2727
</button>

templates/user/dashboard/feeds.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@
9494
<p class="text light grey has-emoji">{{index .GetIssueInfos 1}}</p>
9595
{{else if eq .GetOpType 11}}
9696
<p class="text light grey has-emoji">{{index .GetIssueInfos 1}}</p>
97-
{{else if (or (or (eq .GetOpType 12) (eq .GetOpType 13)) (or (eq .GetOpType 14) (eq .GetOpType 15)))}}
97+
{{else if or (eq .GetOpType 12) (eq .GetOpType 13) (eq .GetOpType 14) (eq .GetOpType 15)}}
9898
<span class="text truncate issue title has-emoji">{{.GetIssueTitle}}</span>
9999
{{end}}
100100
<p class="text italic light grey">{{TimeSince .GetCreate $.i18n.Lang}}</p>

0 commit comments

Comments
 (0)