From ccd797abee10489ee8932cfaa77606a5979e4844 Mon Sep 17 00:00:00 2001 From: Rajesh Jonnalagadda Date: Mon, 11 Nov 2024 21:59:27 +0530 Subject: [PATCH] chore: fixed the tmpl lint issues --- templates/repo/diff/blob_excerpt.tmpl | 150 ++++++++++++----------- templates/repo/diff/section_split.tmpl | 40 +++--- templates/repo/diff/section_unified.tmpl | 46 +++---- 3 files changed, 120 insertions(+), 116 deletions(-) diff --git a/templates/repo/diff/blob_excerpt.tmpl b/templates/repo/diff/blob_excerpt.tmpl index 50ecd26621..9793b17b8f 100644 --- a/templates/repo/diff/blob_excerpt.tmpl +++ b/templates/repo/diff/blob_excerpt.tmpl @@ -5,33 +5,33 @@ {{if eq .GetType 4}} {{$expandDirection := $line.GetExpandDirection}} -
-
- {{if $line.SectionInfo.HasComments}} - - {{end}} -
-
- {{if or (eq $expandDirection 3) (eq $expandDirection 5)}} - - {{end}} - {{if or (eq $expandDirection 3) (eq $expandDirection 4)}} - - {{end}} - {{if eq $expandDirection 2}} - - {{end}} -
-
- +
+
+ {{if $line.SectionInfo.HasComments}} + + {{end}} +
+
+ {{if or (eq $expandDirection 3) (eq $expandDirection 5)}} + + {{end}} + {{if or (eq $expandDirection 3) (eq $expandDirection 4)}} + + {{end}} + {{if eq $expandDirection 2}} + + {{end}} +
+
+ {{$inlineDiff := $.section.GetComputedInlineDiffFor $line ctx.Locale}}{{/* */}}{{template "repo/diff/section_code" dict "diff" $inlineDiff}} {{else}} @@ -39,10 +39,10 @@ {{if and $line.LeftIdx $inlineDiff.EscapeStatus.Escaped}}{{end}} {{if $line.LeftIdx}}{{end}} {{/* - */}}{{if and $.SignedUserID $.PageIsPullFiles}}{{/* + */}}{{if and $.SignedUserID $.PageIsPullFiles}}{{/* */}}{{/* + */}}{{/* */}}{{end}}{{/* */}}{{if $line.LeftIdx}}{{template "repo/diff/section_code" dict "diff" $inlineDiff}}{{else}}{{/* */}}{{/* @@ -52,10 +52,10 @@ {{if and $line.RightIdx $inlineDiff.EscapeStatus.Escaped}}{{end}} {{if $line.RightIdx}}{{end}} {{/* - */}}{{if and $.SignedUserID $.PageIsPullFiles}}{{/* + */}}{{if and $.SignedUserID $.PageIsPullFiles}}{{/* */}}{{/* + */}}{{/* */}}{{end}}{{/* */}}{{if $line.RightIdx}}{{template "repo/diff/section_code" dict "diff" $inlineDiff}}{{else}}{{/* */}}{{/* @@ -64,12 +64,12 @@ {{end}} {{if $line.Comments}} - - - {{template "repo/diff/conversation" dict "." $ "comments" $line.Comments}}} - - - {{end}} + + + {{template "repo/diff/conversation" dict "." $ "comments" $line.Comments}}} + + + {{end}} {{end}} {{else}} {{range $k, $line := $.section.Lines}} @@ -78,32 +78,32 @@ {{if eq .GetType 4}} {{$expandDirection := $line.GetExpandDirection}} -
-
- {{if $line.SectionInfo.HasComments}} - - {{end}} -
-
- {{if or (eq $expandDirection 3) (eq $expandDirection 5)}} - - {{end}} - {{if or (eq $expandDirection 3) (eq $expandDirection 4)}} - - {{end}} - {{if eq $expandDirection 2}} - - {{end}} +
+
+ {{if $line.SectionInfo.HasComments}} + + {{end}} +
+
+ {{if or (eq $expandDirection 3) (eq $expandDirection 5)}} + + {{end}} + {{if or (eq $expandDirection 3) (eq $expandDirection 4)}} + + {{end}} + {{if eq $expandDirection 2}} + + {{end}} +
-
{{else}} @@ -112,18 +112,22 @@ {{if $inlineDiff.EscapeStatus.Escaped}}{{end}} - {{if and $.SignedUserID $.PageIsPullFiles}} - - {{end}} - {{$inlineDiff.Content}} + {{if and $.SignedUserID $.PageIsPullFiles}} + + {{end}} + + {{$inlineDiff.Content}} + + {{if $line.Comments}} - - - {{template "repo/diff/conversation" dict "." $ "comments" $line.Comments}} - - - {{end}} + + + {{template "repo/diff/conversation" dict "." $ "comments" $line.Comments}} + + + {{end}} {{end}} {{end}} diff --git a/templates/repo/diff/section_split.tmpl b/templates/repo/diff/section_split.tmpl index fb432bf4ff..3d36b41697 100644 --- a/templates/repo/diff/section_split.tmpl +++ b/templates/repo/diff/section_split.tmpl @@ -20,28 +20,28 @@
- {{if $line.SectionInfo.HasComments}} - - {{end}} + {{if $line.SectionInfo.HasComments}} + + {{end}}
- {{if or (eq $expandDirection 3) (eq $expandDirection 5)}} - - {{end}} - {{if or (eq $expandDirection 3) (eq $expandDirection 4)}} - - {{end}} - {{if eq $expandDirection 2}} - - {{end}} + {{if or (eq $expandDirection 3) (eq $expandDirection 5)}} + + {{end}} + {{if or (eq $expandDirection 3) (eq $expandDirection 4)}} + + {{end}} + {{if eq $expandDirection 2}} + + {{end}}
{{$inlineDiff := $section.GetComputedInlineDiffFor $line ctx.Locale}} diff --git a/templates/repo/diff/section_unified.tmpl b/templates/repo/diff/section_unified.tmpl index f2b51cfa16..79f8139ae3 100644 --- a/templates/repo/diff/section_unified.tmpl +++ b/templates/repo/diff/section_unified.tmpl @@ -13,32 +13,32 @@ {{if eq .GetType 4}} {{if $.root.AfterCommitID}} {{$expandDirection := $line.GetExpandDirection}} - +
- {{if $line.SectionInfo.HasComments}} - - {{end}} + {{if $line.SectionInfo.HasComments}} + + {{end}} +
+
+ {{if or (eq $expandDirection 3) (eq $expandDirection 5)}} + + {{end}} + {{if or (eq $expandDirection 3) (eq $expandDirection 4)}} + + {{end}} + {{if eq $expandDirection 2}} + + {{end}}
-
- {{if or (eq $expandDirection 3) (eq $expandDirection 5)}} - - {{end}} - {{if or (eq $expandDirection 3) (eq $expandDirection 4)}} - - {{end}} - {{if eq $expandDirection 2}} - - {{end}} -
{{else}}