From 3d6f1731b5fd1378ffc7999ef26154c510eb6eba Mon Sep 17 00:00:00 2001 From: guillep2k <18600385+guillep2k@users.noreply.github.com> Date: Thu, 16 Apr 2020 18:26:24 -0300 Subject: [PATCH] Fix and simplify some tmpl conditions (#11080) --- templates/repo/diff/blob_excerpt.tmpl | 4 ++-- templates/repo/diff/box.tmpl | 2 +- templates/repo/diff/section_unified.tmpl | 2 +- templates/repo/issue/view_content.tmpl | 2 +- templates/repo/wiki/revision.tmpl | 2 +- templates/user/dashboard/feeds.tmpl | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/templates/repo/diff/blob_excerpt.tmpl b/templates/repo/diff/blob_excerpt.tmpl index ad5e3b1b10..cff5e6385d 100644 --- a/templates/repo/diff/blob_excerpt.tmpl +++ b/templates/repo/diff/blob_excerpt.tmpl @@ -9,7 +9,7 @@ {{if or (eq $line.GetExpandDirection 3) (eq $line.GetExpandDirection 4) }} {{end}} - {{if or (eq $line.GetExpandDirection 2)}} + {{if eq $line.GetExpandDirection 2}} {{svg "octicon-fold" 16}} {{end}} @@ -35,7 +35,7 @@ {{if or (eq $line.GetExpandDirection 3) (eq $line.GetExpandDirection 5) }} {{end}} - {{if or (eq $line.GetExpandDirection 2)}} + {{if eq $line.GetExpandDirection 2}} {{svg "octicon-fold" 16}} {{end}} diff --git a/templates/repo/diff/box.tmpl b/templates/repo/diff/box.tmpl index 0b5c7a0564..d113f9ecee 100644 --- a/templates/repo/diff/box.tmpl +++ b/templates/repo/diff/box.tmpl @@ -132,7 +132,7 @@ {{if or (eq $line.GetExpandDirection 3) (eq $line.GetExpandDirection 4) }} {{end}} - {{if or (eq $line.GetExpandDirection 2)}} + {{if eq $line.GetExpandDirection 2}} {{svg "octicon-fold" 16}} {{end}} diff --git a/templates/repo/diff/section_unified.tmpl b/templates/repo/diff/section_unified.tmpl index 33544fd032..c25d3ef079 100644 --- a/templates/repo/diff/section_unified.tmpl +++ b/templates/repo/diff/section_unified.tmpl @@ -11,7 +11,7 @@ {{if or (eq $line.GetExpandDirection 3) (eq $line.GetExpandDirection 4) }} {{end}} - {{if or (eq $line.GetExpandDirection 2)}} + {{if eq $line.GetExpandDirection 2}} {{svg "octicon-fold" 16}} {{end}} diff --git a/templates/repo/issue/view_content.tmpl b/templates/repo/issue/view_content.tmpl index b003342c3f..bf06a12d6f 100644 --- a/templates/repo/issue/view_content.tmpl +++ b/templates/repo/issue/view_content.tmpl @@ -66,7 +66,7 @@ {{ template "repo/issue/view_content/pull". }} {{end}} {{if .IsSigned}} - {{ if and (or .IsRepoAdmin .HasIssuesOrPullsWritePermission (or (not .Issue.IsLocked))) (not .Repository.IsArchived) }} + {{ if and (or .IsRepoAdmin .HasIssuesOrPullsWritePermission (not .Issue.IsLocked)) (not .Repository.IsArchived) }}
diff --git a/templates/repo/wiki/revision.tmpl b/templates/repo/wiki/revision.tmpl index 019bd1ea45..46167838c5 100644 --- a/templates/repo/wiki/revision.tmpl +++ b/templates/repo/wiki/revision.tmpl @@ -21,7 +21,7 @@ {{else if and (not $.DisableSSH) (or $.IsSigned $.ExposeAnonSSH)}} {{end}} - {{if or ((not $.DisableHTTP) (and (not $.DisableSSH) (or $.IsSigned $.ExposeAnonSSH)))}} + {{if or (not $.DisableHTTP) (and (not $.DisableSSH) (or $.IsSigned $.ExposeAnonSSH))}} diff --git a/templates/user/dashboard/feeds.tmpl b/templates/user/dashboard/feeds.tmpl index fe92cad559..b97eda3ca5 100644 --- a/templates/user/dashboard/feeds.tmpl +++ b/templates/user/dashboard/feeds.tmpl @@ -94,7 +94,7 @@

{{index .GetIssueInfos 1}}

{{else if eq .GetOpType 11}}

{{index .GetIssueInfos 1}}

- {{else if (or (or (eq .GetOpType 12) (eq .GetOpType 13)) (or (eq .GetOpType 14) (eq .GetOpType 15)))}} + {{else if or (eq .GetOpType 12) (eq .GetOpType 13) (eq .GetOpType 14) (eq .GetOpType 15)}} {{.GetIssueTitle}} {{end}}

{{TimeSince .GetCreate $.i18n.Lang}}