summaryrefslogtreecommitdiffstats
path: root/templates/repo/diff
diff options
context:
space:
mode:
authorsilverwind <me@silverwind.io>2022-08-31 17:58:54 +0200
committerGitHub <noreply@github.com>2022-08-31 23:58:54 +0800
commit647b2649b1600107c5fec3505db691f78b2c1e2a (patch)
treeb3bcaf968426f6ad1ba4fde3e41f3ca3224ec47e /templates/repo/diff
parentc80ca94ab1de8ea3b13c1087cd7140165a11ceb7 (diff)
downloadgitea-647b2649b1600107c5fec3505db691f78b2c1e2a.tar.gz
gitea-647b2649b1600107c5fec3505db691f78b2c1e2a.zip
Make sure fmt catches all templates (#20979)
* Make sure fmt catches all templates Make's `wildcard` is not recursive so it missed many template files, fix that by using `find`. * Update Makefile
Diffstat (limited to 'templates/repo/diff')
-rw-r--r--templates/repo/diff/blob_excerpt.tmpl8
-rw-r--r--templates/repo/diff/comment_form_datahandler.tmpl6
-rw-r--r--templates/repo/diff/comments.tmpl12
-rw-r--r--templates/repo/diff/compare.tmpl8
-rw-r--r--templates/repo/diff/image_diff.tmpl16
-rw-r--r--templates/repo/diff/new_review.tmpl4
-rw-r--r--templates/repo/diff/section_split.tmpl4
-rw-r--r--templates/repo/diff/section_unified.tmpl4
-rw-r--r--templates/repo/diff/whitespace_dropdown.tmpl8
9 files changed, 35 insertions, 35 deletions
diff --git a/templates/repo/diff/blob_excerpt.tmpl b/templates/repo/diff/blob_excerpt.tmpl
index c821d12d90..402435c467 100644
--- a/templates/repo/diff/blob_excerpt.tmpl
+++ b/templates/repo/diff/blob_excerpt.tmpl
@@ -3,12 +3,12 @@
<tr class="{{DiffLineTypeToStr .GetType}}-code nl-{{$k}} ol-{{$k}}">
{{if eq .GetType 4}}
<td class="lines-num lines-num-old" data-line-num="{{if $line.LeftIdx}}{{$line.LeftIdx}}{{end}}">
- {{if or (eq $line.GetExpandDirection 3) (eq $line.GetExpandDirection 5) }}
+ {{if or (eq $line.GetExpandDirection 3) (eq $line.GetExpandDirection 5)}}
<a role="button" class="blob-excerpt" data-url="{{$.RepoLink}}/blob_excerpt/{{PathEscape $.AfterCommitID}}" data-query="{{$line.GetBlobExcerptQuery}}&style=split&direction=down&wiki={{$.PageIsWiki}}" data-anchor="{{$.Anchor}}">
{{svg "octicon-fold-down"}}
</a>
{{end}}
- {{if or (eq $line.GetExpandDirection 3) (eq $line.GetExpandDirection 4) }}
+ {{if or (eq $line.GetExpandDirection 3) (eq $line.GetExpandDirection 4)}}
<a role="button" class="blob-excerpt" data-url="{{$.RepoLink}}/blob_excerpt/{{PathEscape $.AfterCommitID}}" data-query="{{$line.GetBlobExcerptQuery}}&style=split&direction=up&wiki={{$.PageIsWiki}}" data-anchor="{{$.Anchor}}">
{{svg "octicon-fold-up"}}
</a>
@@ -47,12 +47,12 @@
<tr class="{{DiffLineTypeToStr .GetType}}-code nl-{{$k}} ol-{{$k}}">
{{if eq .GetType 4}}
<td colspan="2" class="lines-num">
- {{if or (eq $line.GetExpandDirection 3) (eq $line.GetExpandDirection 5) }}
+ {{if or (eq $line.GetExpandDirection 3) (eq $line.GetExpandDirection 5)}}
<a role="button" class="blob-excerpt" data-url="{{$.RepoLink}}/blob_excerpt/{{PathEscape $.AfterCommitID}}" data-query="{{$line.GetBlobExcerptQuery}}&style=unified&direction=down&wiki={{$.PageIsWiki}}" data-anchor="{{$.Anchor}}">
{{svg "octicon-fold-down"}}
</a>
{{end}}
- {{if or (eq $line.GetExpandDirection 3) (eq $line.GetExpandDirection 4) }}
+ {{if or (eq $line.GetExpandDirection 3) (eq $line.GetExpandDirection 4)}}
<a role="button" class="blob-excerpt" data-url="{{$.RepoLink}}/blob_excerpt/{{PathEscape $.AfterCommitID}}" data-query="{{$line.GetBlobExcerptQuery}}&style=unified&direction=up&wiki={{$.PageIsWiki}}" data-anchor="{{$.Anchor}}">
{{svg "octicon-fold-up"}}
</a>
diff --git a/templates/repo/diff/comment_form_datahandler.tmpl b/templates/repo/diff/comment_form_datahandler.tmpl
index 9656944719..d0e493488d 100644
--- a/templates/repo/diff/comment_form_datahandler.tmpl
+++ b/templates/repo/diff/comment_form_datahandler.tmpl
@@ -1,7 +1,7 @@
{{if $.comment}}
- {{ template "repo/diff/comment_form" dict "root" $.root "hidden" $.hidden "reply" $.reply "Line" $.comment.UnsignedLine "File" $.comment.TreePath "Side" $.comment.DiffSide "HasComments" true}}
+ {{template "repo/diff/comment_form" dict "root" $.root "hidden" $.hidden "reply" $.reply "Line" $.comment.UnsignedLine "File" $.comment.TreePath "Side" $.comment.DiffSide "HasComments" true}}
{{else if $.root}}
- {{ template "repo/diff/comment_form" $}}
+ {{template "repo/diff/comment_form" $}}
{{else}}
- {{ template "repo/diff/comment_form" dict "root" $}}
+ {{template "repo/diff/comment_form" dict "root" $}}
{{end}}
diff --git a/templates/repo/diff/comments.tmpl b/templates/repo/diff/comments.tmpl
index 9905f09baa..0cc7853378 100644
--- a/templates/repo/diff/comments.tmpl
+++ b/templates/repo/diff/comments.tmpl
@@ -1,8 +1,8 @@
{{range .comments}}
-{{ $createdStr:= TimeSinceUnix .CreatedUnix $.root.locale }}
+{{$createdStr:= TimeSinceUnix .CreatedUnix $.root.locale}}
<div class="comment" id="{{.HashTag}}">
- {{if .OriginalAuthor }}
+ {{if .OriginalAuthor}}
<span class="avatar"><img src="{{AppSubUrl}}/assets/img/avatar_default.png"></span>
{{else}}
<a class="avatar" {{if gt .Poster.ID 0}}href="{{.Poster.HomeLink}}"{{end}}>
@@ -12,17 +12,17 @@
<div class="content comment-container">
<div class="ui top attached header comment-header df ac sb">
<div class="comment-header-left df ac">
- {{if .OriginalAuthor }}
+ {{if .OriginalAuthor}}
<span class="text black mr-2">
{{svg (MigrationIcon $.root.Repository.GetOriginalURLHostname)}}
- {{ .OriginalAuthor }}
+ {{.OriginalAuthor}}
</span>
<span class="text grey">
{{$.root.locale.Tr "repo.issues.commented_at" (.HashTag|Escape) $createdStr | Safe}}
</span>
<span class="text migrate">
{{if $.root.Repository.OriginalURL}}
- ({{$.root.locale.Tr "repo.migrated_from" ($.root.Repository.OriginalURL | Escape) ($.root.Repository.GetOriginalURLHostname | Escape) | Safe }})
+ ({{$.root.locale.Tr "repo.migrated_from" ($.root.Repository.OriginalURL | Escape) ($.root.Repository.GetOriginalURLHostname | Escape) | Safe}})
{{end}}
</span>
{{else}}
@@ -46,7 +46,7 @@
</div>
{{end}}
{{end}}
- {{template "repo/issue/view_content/add_reaction" Dict "ctx" $.root "ActionURL" (Printf "%s/comments/%d/reactions" $.root.RepoLink .ID) }}
+ {{template "repo/issue/view_content/add_reaction" Dict "ctx" $.root "ActionURL" (Printf "%s/comments/%d/reactions" $.root.RepoLink .ID)}}
{{template "repo/issue/view_content/context_menu" Dict "ctx" $.root "item" . "delete" true "issue" false "diff" true "IsCommentPoster" (and $.root.IsSigned (eq $.root.SignedUserID .PosterID))}}
</div>
</div>
diff --git a/templates/repo/diff/compare.tmpl b/templates/repo/diff/compare.tmpl
index 426ea737bd..5875efaac3 100644
--- a/templates/repo/diff/compare.tmpl
+++ b/templates/repo/diff/compare.tmpl
@@ -7,11 +7,11 @@
{{if and $.PageIsComparePull $.IsSigned (not .Repository.IsArchived)}}
{{.locale.Tr "repo.pulls.compare_changes"}}
<div class="sub header">{{.locale.Tr "repo.pulls.compare_changes_desc"}}</div>
- {{ else }}
+ {{else}}
{{.locale.Tr "action.compare_commits_general"}}
- {{ end }}
+ {{end}}
</h2>
- {{ $BaseCompareName := $.BaseName -}}
+ {{$BaseCompareName := $.BaseName -}}
{{- $HeadCompareName := $.HeadRepo.OwnerName -}}
{{- if and (eq $.BaseName $.HeadRepo.OwnerName) (ne $.Repository.Name $.HeadRepo.Name) -}}
{{- $HeadCompareName = printf "%s/%s" $.HeadRepo.OwnerName $.HeadRepo.Name -}}
@@ -174,7 +174,7 @@
</div>
{{if .IsNothingToCompare}}
- {{if and $.IsSigned $.AllowEmptyPr (not .Repository.IsArchived) }}
+ {{if and $.IsSigned $.AllowEmptyPr (not .Repository.IsArchived)}}
<div class="ui segment">{{.locale.Tr "repo.pulls.nothing_to_compare_and_allow_empty_pr"}}</div>
<div class="ui info message show-form-container" {{if .Flash}}style="display: none"{{end}}>
<button class="ui button green show-form">{{.locale.Tr "repo.pulls.new"}}</button>
diff --git a/templates/repo/diff/image_diff.tmpl b/templates/repo/diff/image_diff.tmpl
index 71a6da5c5e..4b95c8d85f 100644
--- a/templates/repo/diff/image_diff.tmpl
+++ b/templates/repo/diff/image_diff.tmpl
@@ -4,17 +4,17 @@
<div class="image-diff" data-path-before="{{.root.BeforeRawPath}}/{{PathEscapeSegments .file.OldName}}" data-path-after="{{.root.RawPath}}/{{PathEscapeSegments .file.Name}}">
<div class="ui secondary pointing tabular top attached borderless menu stackable new-menu">
<div class="new-menu-inner">
- <a class="item active" data-tab="diff-side-by-side-{{ .file.Index }}">{{.root.locale.Tr "repo.diff.image.side_by_side"}}</a>
+ <a class="item active" data-tab="diff-side-by-side-{{.file.Index}}">{{.root.locale.Tr "repo.diff.image.side_by_side"}}</a>
{{if and .blobBase .blobHead}}
- <a class="item" data-tab="diff-swipe-{{ .file.Index }}">{{.root.locale.Tr "repo.diff.image.swipe"}}</a>
- <a class="item" data-tab="diff-overlay-{{ .file.Index }}">{{.root.locale.Tr "repo.diff.image.overlay"}}</a>
+ <a class="item" data-tab="diff-swipe-{{.file.Index}}">{{.root.locale.Tr "repo.diff.image.swipe"}}</a>
+ <a class="item" data-tab="diff-overlay-{{.file.Index}}">{{.root.locale.Tr "repo.diff.image.overlay"}}</a>
{{end}}
</div>
</div>
<div class="hide">
- <div class="ui bottom attached tab image-diff-container active" data-tab="diff-side-by-side-{{ .file.Index }}">
+ <div class="ui bottom attached tab image-diff-container active" data-tab="diff-side-by-side-{{.file.Index}}">
<div class="diff-side-by-side">
- {{if .blobBase }}
+ {{if .blobBase}}
<span class="side">
<p class="side-header">{{.root.locale.Tr "repo.diff.file_before"}}</p>
<span class="before-container"><img class="image-before" /></span>
@@ -29,7 +29,7 @@
</p>
</span>
{{end}}
- {{if .blobHead }}
+ {{if .blobHead}}
<span class="side">
<p class="side-header">{{.root.locale.Tr "repo.diff.file_after"}}</p>
<span class="after-container"><img class="image-after" /></span>
@@ -47,7 +47,7 @@
</div>
</div>
{{if and .blobBase .blobHead}}
- <div class="ui bottom attached tab image-diff-container" data-tab="diff-swipe-{{ .file.Index }}">
+ <div class="ui bottom attached tab image-diff-container" data-tab="diff-swipe-{{.file.Index}}">
<div class="diff-swipe">
<div class="swipe-frame">
<span class="before-container"><img class="image-before" /></span>
@@ -61,7 +61,7 @@
</div>
</div>
</div>
- <div class="ui bottom attached tab image-diff-container" data-tab="diff-overlay-{{ .file.Index }}">
+ <div class="ui bottom attached tab image-diff-container" data-tab="diff-overlay-{{.file.Index}}">
<div class="diff-overlay">
<div class="overlay-frame">
<div class="ui centered">
diff --git a/templates/repo/diff/new_review.tmpl b/templates/repo/diff/new_review.tmpl
index 857577b152..60ebb61fb9 100644
--- a/templates/repo/diff/new_review.tmpl
+++ b/templates/repo/diff/new_review.tmpl
@@ -22,9 +22,9 @@
</div>
{{end}}
<div class="ui divider"></div>
- <button type="submit" name="type" value="approve" {{ if and $.IsSigned ($.Issue.IsPoster $.SignedUser.ID) }} disabled {{ end }} class="ui submit green tiny button btn-submit">{{$.locale.Tr "repo.diff.review.approve"}}</button>
+ <button type="submit" name="type" value="approve" {{if and $.IsSigned ($.Issue.IsPoster $.SignedUser.ID)}} disabled {{end}} class="ui submit green tiny button btn-submit">{{$.locale.Tr "repo.diff.review.approve"}}</button>
<button type="submit" name="type" value="comment" class="ui submit tiny basic button btn-submit">{{$.locale.Tr "repo.diff.review.comment"}}</button>
- <button type="submit" name="type" value="reject" {{ if and $.IsSigned ($.Issue.IsPoster $.SignedUser.ID) }} disabled {{ end }} class="ui submit red tiny button btn-submit">{{$.locale.Tr "repo.diff.review.reject"}}</button>
+ <button type="submit" name="type" value="reject" {{if and $.IsSigned ($.Issue.IsPoster $.SignedUser.ID)}} disabled {{end}} class="ui submit red tiny button btn-submit">{{$.locale.Tr "repo.diff.review.reject"}}</button>
</form>
</div>
</div>
diff --git a/templates/repo/diff/section_split.tmpl b/templates/repo/diff/section_split.tmpl
index 5ea71ae595..6143a47158 100644
--- a/templates/repo/diff/section_split.tmpl
+++ b/templates/repo/diff/section_split.tmpl
@@ -6,12 +6,12 @@
<tr class="{{DiffLineTypeToStr .GetType}}-code nl-{{$k}} ol-{{$k}}" data-line-type="{{DiffLineTypeToStr .GetType}}">
{{if eq .GetType 4}}
<td class="lines-num lines-num-old">
- {{if or (eq $line.GetExpandDirection 3) (eq $line.GetExpandDirection 5) }}
+ {{if or (eq $line.GetExpandDirection 3) (eq $line.GetExpandDirection 5)}}
<a role="button" class="blob-excerpt" data-url="{{$.root.RepoLink}}/blob_excerpt/{{PathEscape $.root.AfterCommitID}}" data-query="{{$line.GetBlobExcerptQuery}}&style=split&direction=down&wiki={{$.root.PageIsWiki}}" data-anchor="diff-{{$file.NameHash}}K{{$line.SectionInfo.RightIdx}}">
{{svg "octicon-fold-down"}}
</a>
{{end}}
- {{if or (eq $line.GetExpandDirection 3) (eq $line.GetExpandDirection 4) }}
+ {{if or (eq $line.GetExpandDirection 3) (eq $line.GetExpandDirection 4)}}
<a role="button" class="blob-excerpt" data-url="{{$.root.RepoLink}}/blob_excerpt/{{PathEscape $.root.AfterCommitID}}" data-query="{{$line.GetBlobExcerptQuery}}&style=split&direction=up&wiki={{$.root.PageIsWiki}}" data-anchor="diff-{{$file.NameHash}}K{{$line.SectionInfo.RightIdx}}">
{{svg "octicon-fold-up"}}
</a>
diff --git a/templates/repo/diff/section_unified.tmpl b/templates/repo/diff/section_unified.tmpl
index aaf53b97c5..373747002c 100644
--- a/templates/repo/diff/section_unified.tmpl
+++ b/templates/repo/diff/section_unified.tmpl
@@ -5,12 +5,12 @@
<tr class="{{DiffLineTypeToStr .GetType}}-code nl-{{$k}} ol-{{$k}}" data-line-type="{{DiffLineTypeToStr .GetType}}">
{{if eq .GetType 4}}
<td colspan="2" class="lines-num">
- {{if or (eq $line.GetExpandDirection 3) (eq $line.GetExpandDirection 5) }}
+ {{if or (eq $line.GetExpandDirection 3) (eq $line.GetExpandDirection 5)}}
<a role="button" class="blob-excerpt" data-url="{{$.root.RepoLink}}/blob_excerpt/{{PathEscape $.root.AfterCommitID}}" data-query="{{$line.GetBlobExcerptQuery}}&style=unified&direction=down&wiki={{$.root.PageIsWiki}}" data-anchor="diff-{{$file.NameHash}}K{{$line.SectionInfo.RightIdx}}">
{{svg "octicon-fold-down"}}
</a>
{{end}}
- {{if or (eq $line.GetExpandDirection 3) (eq $line.GetExpandDirection 4) }}
+ {{if or (eq $line.GetExpandDirection 3) (eq $line.GetExpandDirection 4)}}
<a role="button" class="blob-excerpt" data-url="{{$.root.RepoLink}}/blob_excerpt/{{PathEscape $.root.AfterCommitID}}" data-query="{{$line.GetBlobExcerptQuery}}&style=unified&direction=up&wiki={{$.root.PageIsWiki}}" data-anchor="diff-{{$file.NameHash}}K{{$line.SectionInfo.RightIdx}}">
{{svg "octicon-fold-up"}}
</a>
diff --git a/templates/repo/diff/whitespace_dropdown.tmpl b/templates/repo/diff/whitespace_dropdown.tmpl
index d28cb12bf8..9df79dab73 100644
--- a/templates/repo/diff/whitespace_dropdown.tmpl
+++ b/templates/repo/diff/whitespace_dropdown.tmpl
@@ -3,19 +3,19 @@
{{svg "octicon-triangle-down" 14 "dropdown icon"}}
<div class="menu">
<a class="item" href="?style={{if .IsSplitStyle}}split{{else}}unified{{end}}&whitespace=show-all">
- <i class="circle {{ if eq .WhitespaceBehavior "show-all" }}dot{{else}}outline{{end}} icon"></i>
+ <i class="circle {{if eq .WhitespaceBehavior "show-all"}}dot{{else}}outline{{end}} icon"></i>
{{.locale.Tr "repo.diff.whitespace_show_everything"}}
</a>
<a class="item" href="?style={{if .IsSplitStyle}}split{{else}}unified{{end}}&whitespace=ignore-all">
- <i class="circle {{ if eq .WhitespaceBehavior "ignore-all" }}dot{{else}}outline{{end}} icon"></i>
+ <i class="circle {{if eq .WhitespaceBehavior "ignore-all"}}dot{{else}}outline{{end}} icon"></i>
{{.locale.Tr "repo.diff.whitespace_ignore_all_whitespace"}}
</a>
<a class="item" href="?style={{if .IsSplitStyle}}split{{else}}unified{{end}}&whitespace=ignore-change">
- <i class="circle {{ if eq .WhitespaceBehavior "ignore-change" }}dot{{else}}outline{{end}} icon"></i>
+ <i class="circle {{if eq .WhitespaceBehavior "ignore-change"}}dot{{else}}outline{{end}} icon"></i>
{{.locale.Tr "repo.diff.whitespace_ignore_amount_changes"}}
</a>
<a class="item" href="?style={{if .IsSplitStyle}}split{{else}}unified{{end}}&whitespace=ignore-eol">
- <i class="circle {{ if eq .WhitespaceBehavior "ignore-eol" }}dot{{else}}outline{{end}} icon"></i>
+ <i class="circle {{if eq .WhitespaceBehavior "ignore-eol"}}dot{{else}}outline{{end}} icon"></i>
{{.locale.Tr "repo.diff.whitespace_ignore_at_eol"}}
</a>
</div>