Skip to content

Commit 647b264

Browse files
authored
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
1 parent c80ca94 commit 647b264

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

62 files changed

+251
-251
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ clean:
243243
.PHONY: fmt
244244
fmt:
245245
@MISSPELL_PACKAGE=$(MISSPELL_PACKAGE) GOFUMPT_PACKAGE=$(GOFUMPT_PACKAGE) $(GO) run build/code-batch-process.go gitea-fmt -w '{file-list}'
246-
$(eval TEMPLATES := $(wildcard templates/**/*.tmpl))
246+
$(eval TEMPLATES := $(shell find templates -type f -name '*.tmpl'))
247247
@# strip whitespace after '{{' and before `}}` unless there is only whitespace before it
248248
@$(SED_INPLACE) -e 's/{{[ ]\{1,\}/{{/g' -e '/^[ ]\{1,\}}}/! s/[ ]\{1,\}}}/}}/g' $(TEMPLATES)
249249

templates/admin/auth/edit.tmpl

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323

2424
<!-- LDAP and DLDAP -->
2525
{{if or .Source.IsLDAP .Source.IsDLDAP}}
26-
{{ $cfg:=.Source.Cfg }}
26+
{{$cfg:=.Source.Cfg}}
2727
<div class="inline required field {{if .Err_SecurityProtocol}}error{{end}}">
2828
<label>{{.locale.Tr "admin.auths.security_protocol"}}</label>
2929
<div class="ui selection security-protocol dropdown">
@@ -180,7 +180,7 @@
180180

181181
<!-- SMTP -->
182182
{{if .Source.IsSMTP}}
183-
{{ $cfg:=.Source.Cfg }}
183+
{{$cfg:=.Source.Cfg}}
184184
<div class="inline required field">
185185
<label>{{.locale.Tr "admin.auths.smtp_auth"}}</label>
186186
<div class="ui selection type dropdown">
@@ -242,7 +242,7 @@
242242

243243
<!-- PAM -->
244244
{{if .Source.IsPAM}}
245-
{{ $cfg:=.Source.Cfg }}
245+
{{$cfg:=.Source.Cfg}}
246246
<div class="required field">
247247
<label for="pam_service_name">{{.locale.Tr "admin.auths.pam_service_name"}}</label>
248248
<input id="pam_service_name" name="pam_service_name" value="{{$cfg.ServiceName}}" required>
@@ -262,7 +262,7 @@
262262

263263
<!-- OAuth2 -->
264264
{{if .Source.IsOAuth2}}
265-
{{ $cfg:=.Source.Cfg }}
265+
{{$cfg:=.Source.Cfg}}
266266
<div class="inline required field">
267267
<label>{{.locale.Tr "admin.auths.oauth2_provider"}}</label>
268268
<div class="ui selection type dropdown">
@@ -337,7 +337,7 @@
337337

338338
<div class="field">
339339
<label for="oauth2_scopes">{{.locale.Tr "admin.auths.oauth2_scopes"}}</label>
340-
<input id="oauth2_scopes" name="oauth2_scopes" value="{{if $cfg.Scopes}}{{Join $cfg.Scopes "," }}{{end}}">
340+
<input id="oauth2_scopes" name="oauth2_scopes" value="{{if $cfg.Scopes}}{{Join $cfg.Scopes ","}}{{end}}">
341341
</div>
342342
<div class="field">
343343
<label for="oauth2_required_claim_name">{{.locale.Tr "admin.auths.oauth2_required_claim_name"}}</label>
@@ -365,7 +365,7 @@
365365

366366
<!-- SSPI -->
367367
{{if .Source.IsSSPI}}
368-
{{ $cfg:=.Source.Cfg }}
368+
{{$cfg:=.Source.Cfg}}
369369
<div class="field">
370370
<div class="ui checkbox">
371371
<label for="sspi_auto_create_users"><strong>{{.locale.Tr "admin.auths.sspi_auto_create_users"}}</strong></label>

templates/admin/auth/new.tmpl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,10 @@
3030
</div>
3131

3232
<!-- LDAP and DLDAP -->
33-
{{ template "admin/auth/source/ldap" . }}
33+
{{template "admin/auth/source/ldap" .}}
3434

3535
<!-- SMTP -->
36-
{{ template "admin/auth/source/smtp" . }}
36+
{{template "admin/auth/source/smtp" .}}
3737

3838
<!-- PAM -->
3939
<div class="pam required field {{if not (eq .type 4)}}hide{{end}}">
@@ -51,10 +51,10 @@
5151
</div>
5252

5353
<!-- OAuth2 -->
54-
{{ template "admin/auth/source/oauth" . }}
54+
{{template "admin/auth/source/oauth" .}}
5555

5656
<!-- SSPI -->
57-
{{ template "admin/auth/source/sspi" . }}
57+
{{template "admin/auth/source/sspi" .}}
5858

5959
<div class="ldap field">
6060
<div class="ui checkbox">

templates/admin/user/edit.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
{{.CsrfTokenHtml}}
1313
<div class="field {{if .Err_UserName}}error{{end}}">
1414
<label for="user_name">{{.locale.Tr "username"}}</label>
15-
<input id="user_name" name="user_name" value="{{.User.Name}}" autofocus {{if not .User.IsLocal }}disabled{{end}}>
15+
<input id="user_name" name="user_name" value="{{.User.Name}}" autofocus {{if not .User.IsLocal}}disabled{{end}}>
1616
</div>
1717
<!-- Types and name -->
1818
<div class="inline required field {{if .Err_LoginType}}error{{end}}">

templates/admin/user/new.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@
6969

7070
<div class="inline field local{{if ne .login_type "0-0"}} hide{{end}}">
7171
<div class="ui checkbox">
72-
<label><strong>{{.locale.Tr "auth.allow_password_change" }}</strong></label>
72+
<label><strong>{{.locale.Tr "auth.allow_password_change"}}</strong></label>
7373
<input name="must_change_password" type="checkbox" checked>
7474
</div>
7575
</div>

templates/mail/auth/activate.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<title>{{.locale.Tr "mail.activate_account.title" (.DisplayName|DotEscape)}}</title>
77
</head>
88

9-
{{ $activate_url := printf "%suser/activate?code=%s" AppUrl (QueryEscape .Code)}}
9+
{{$activate_url := printf "%suser/activate?code=%s" AppUrl (QueryEscape .Code)}}
1010
<body>
1111
<p>{{.locale.Tr "mail.activate_account.text_1" (.DisplayName|DotEscape) AppName | Str2html}}</p><br>
1212
<p>{{.locale.Tr "mail.activate_account.text_2" .ActiveCodeLives | Str2html}}</p><p><a href="{{$activate_url}}">{{$activate_url}}</a></p><br>

templates/mail/auth/activate_email.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<title>{{.locale.Tr "mail.activate_email.title" (.DisplayName|DotEscape)}}</title>
77
</head>
88

9-
{{ $activate_url := printf "%suser/activate_email?code=%s&email=%s" AppUrl (QueryEscape .Code) (QueryEscape .Email)}}
9+
{{$activate_url := printf "%suser/activate_email?code=%s&email=%s" AppUrl (QueryEscape .Code) (QueryEscape .Email)}}
1010
<body>
1111
<p>{{.locale.Tr "mail.hi_user_x" (.DisplayName|DotEscape) | Str2html}}</p><br>
1212
<p>{{.locale.Tr "mail.activate_email.text" .ActiveCodeLives | Str2html}}</p><p><a href="{{$activate_url}}">{{$activate_url}}</a></p><br>

templates/mail/auth/reset_passwd.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<title>{{.locale.Tr "mail.reset_password.title" (.DisplayName|DotEscape)}}</title>
77
</head>
88

9-
{{ $recover_url := printf "%suser/recover_account?code=%s" AppUrl (QueryEscape .Code)}}
9+
{{$recover_url := printf "%suser/recover_account?code=%s" AppUrl (QueryEscape .Code)}}
1010
<body>
1111
<p>{{.locale.Tr "mail.hi_user_x" (.DisplayName|DotEscape) | Str2html}}</p><br>
1212
<p>{{.locale.Tr "mail.reset_password.text" .ResetPwdCodeLives | Str2html}}</p><p><a href="{{$recover_url}}">{{$recover_url}}</a></p><br>

templates/org/member/members.tmpl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
{{template "base/alert" .}}
66

77
<div class="list">
8-
{{ range .Members}}
8+
{{range .Members}}
99
<div class="item ui grid">
1010
<div class="ui four wide column" style="display: flex;">
1111
{{avatar . 48}}
@@ -19,7 +19,7 @@
1919
{{$.locale.Tr "org.members.membership_visibility"}}
2020
</div>
2121
<div class="meta">
22-
{{ $isPublic := index $.MembersIsPublicMember .ID}}
22+
{{$isPublic := index $.MembersIsPublicMember .ID}}
2323
{{if $isPublic}}
2424
<strong>{{$.locale.Tr "org.members.public"}}</strong>
2525
{{if or (eq $.SignedUser.ID .ID) $.IsOrganizationOwner}}(<a class="link-action" href data-url="{{$.OrgLink}}/members/action/private?uid={{.ID}}">{{$.locale.Tr "org.members.public_helper"}}</a>){{end}}

templates/package/shared/list.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
{{svg "octicon-package" 32}}
5151
<h2>{{.locale.Tr "packages.empty"}}</h2>
5252
{{if and .Repository .CanWritePackages}}
53-
{{$packagesUrl := URLJoin .Owner.HTMLURL "-" "packages" }}
53+
{{$packagesUrl := URLJoin .Owner.HTMLURL "-" "packages"}}
5454
<p>{{.locale.Tr "packages.empty.repo" $packagesUrl | Safe}}</p>
5555
{{end}}
5656
<p>{{.locale.Tr "packages.empty.documentation" | Safe}}</p>

templates/repo/diff/blob_excerpt.tmpl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@
33
<tr class="{{DiffLineTypeToStr .GetType}}-code nl-{{$k}} ol-{{$k}}">
44
{{if eq .GetType 4}}
55
<td class="lines-num lines-num-old" data-line-num="{{if $line.LeftIdx}}{{$line.LeftIdx}}{{end}}">
6-
{{if or (eq $line.GetExpandDirection 3) (eq $line.GetExpandDirection 5) }}
6+
{{if or (eq $line.GetExpandDirection 3) (eq $line.GetExpandDirection 5)}}
77
<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}}">
88
{{svg "octicon-fold-down"}}
99
</a>
1010
{{end}}
11-
{{if or (eq $line.GetExpandDirection 3) (eq $line.GetExpandDirection 4) }}
11+
{{if or (eq $line.GetExpandDirection 3) (eq $line.GetExpandDirection 4)}}
1212
<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}}">
1313
{{svg "octicon-fold-up"}}
1414
</a>
@@ -47,12 +47,12 @@
4747
<tr class="{{DiffLineTypeToStr .GetType}}-code nl-{{$k}} ol-{{$k}}">
4848
{{if eq .GetType 4}}
4949
<td colspan="2" class="lines-num">
50-
{{if or (eq $line.GetExpandDirection 3) (eq $line.GetExpandDirection 5) }}
50+
{{if or (eq $line.GetExpandDirection 3) (eq $line.GetExpandDirection 5)}}
5151
<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}}">
5252
{{svg "octicon-fold-down"}}
5353
</a>
5454
{{end}}
55-
{{if or (eq $line.GetExpandDirection 3) (eq $line.GetExpandDirection 4) }}
55+
{{if or (eq $line.GetExpandDirection 3) (eq $line.GetExpandDirection 4)}}
5656
<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}}">
5757
{{svg "octicon-fold-up"}}
5858
</a>
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{{if $.comment}}
2-
{{ template "repo/diff/comment_form" dict "root" $.root "hidden" $.hidden "reply" $.reply "Line" $.comment.UnsignedLine "File" $.comment.TreePath "Side" $.comment.DiffSide "HasComments" true}}
2+
{{template "repo/diff/comment_form" dict "root" $.root "hidden" $.hidden "reply" $.reply "Line" $.comment.UnsignedLine "File" $.comment.TreePath "Side" $.comment.DiffSide "HasComments" true}}
33
{{else if $.root}}
4-
{{ template "repo/diff/comment_form" $}}
4+
{{template "repo/diff/comment_form" $}}
55
{{else}}
6-
{{ template "repo/diff/comment_form" dict "root" $}}
6+
{{template "repo/diff/comment_form" dict "root" $}}
77
{{end}}

templates/repo/diff/comments.tmpl

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{{range .comments}}
22

3-
{{ $createdStr:= TimeSinceUnix .CreatedUnix $.root.locale }}
3+
{{$createdStr:= TimeSinceUnix .CreatedUnix $.root.locale}}
44
<div class="comment" id="{{.HashTag}}">
5-
{{if .OriginalAuthor }}
5+
{{if .OriginalAuthor}}
66
<span class="avatar"><img src="{{AppSubUrl}}/assets/img/avatar_default.png"></span>
77
{{else}}
88
<a class="avatar" {{if gt .Poster.ID 0}}href="{{.Poster.HomeLink}}"{{end}}>
@@ -12,17 +12,17 @@
1212
<div class="content comment-container">
1313
<div class="ui top attached header comment-header df ac sb">
1414
<div class="comment-header-left df ac">
15-
{{if .OriginalAuthor }}
15+
{{if .OriginalAuthor}}
1616
<span class="text black mr-2">
1717
{{svg (MigrationIcon $.root.Repository.GetOriginalURLHostname)}}
18-
{{ .OriginalAuthor }}
18+
{{.OriginalAuthor}}
1919
</span>
2020
<span class="text grey">
2121
{{$.root.locale.Tr "repo.issues.commented_at" (.HashTag|Escape) $createdStr | Safe}}
2222
</span>
2323
<span class="text migrate">
2424
{{if $.root.Repository.OriginalURL}}
25-
({{$.root.locale.Tr "repo.migrated_from" ($.root.Repository.OriginalURL | Escape) ($.root.Repository.GetOriginalURLHostname | Escape) | Safe }})
25+
({{$.root.locale.Tr "repo.migrated_from" ($.root.Repository.OriginalURL | Escape) ($.root.Repository.GetOriginalURLHostname | Escape) | Safe}})
2626
{{end}}
2727
</span>
2828
{{else}}
@@ -46,7 +46,7 @@
4646
</div>
4747
{{end}}
4848
{{end}}
49-
{{template "repo/issue/view_content/add_reaction" Dict "ctx" $.root "ActionURL" (Printf "%s/comments/%d/reactions" $.root.RepoLink .ID) }}
49+
{{template "repo/issue/view_content/add_reaction" Dict "ctx" $.root "ActionURL" (Printf "%s/comments/%d/reactions" $.root.RepoLink .ID)}}
5050
{{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))}}
5151
</div>
5252
</div>

templates/repo/diff/compare.tmpl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@
77
{{if and $.PageIsComparePull $.IsSigned (not .Repository.IsArchived)}}
88
{{.locale.Tr "repo.pulls.compare_changes"}}
99
<div class="sub header">{{.locale.Tr "repo.pulls.compare_changes_desc"}}</div>
10-
{{ else }}
10+
{{else}}
1111
{{.locale.Tr "action.compare_commits_general"}}
12-
{{ end }}
12+
{{end}}
1313
</h2>
14-
{{ $BaseCompareName := $.BaseName -}}
14+
{{$BaseCompareName := $.BaseName -}}
1515
{{- $HeadCompareName := $.HeadRepo.OwnerName -}}
1616
{{- if and (eq $.BaseName $.HeadRepo.OwnerName) (ne $.Repository.Name $.HeadRepo.Name) -}}
1717
{{- $HeadCompareName = printf "%s/%s" $.HeadRepo.OwnerName $.HeadRepo.Name -}}
@@ -174,7 +174,7 @@
174174
</div>
175175

176176
{{if .IsNothingToCompare}}
177-
{{if and $.IsSigned $.AllowEmptyPr (not .Repository.IsArchived) }}
177+
{{if and $.IsSigned $.AllowEmptyPr (not .Repository.IsArchived)}}
178178
<div class="ui segment">{{.locale.Tr "repo.pulls.nothing_to_compare_and_allow_empty_pr"}}</div>
179179
<div class="ui info message show-form-container" {{if .Flash}}style="display: none"{{end}}>
180180
<button class="ui button green show-form">{{.locale.Tr "repo.pulls.new"}}</button>

templates/repo/diff/image_diff.tmpl

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,17 @@
44
<div class="image-diff" data-path-before="{{.root.BeforeRawPath}}/{{PathEscapeSegments .file.OldName}}" data-path-after="{{.root.RawPath}}/{{PathEscapeSegments .file.Name}}">
55
<div class="ui secondary pointing tabular top attached borderless menu stackable new-menu">
66
<div class="new-menu-inner">
7-
<a class="item active" data-tab="diff-side-by-side-{{ .file.Index }}">{{.root.locale.Tr "repo.diff.image.side_by_side"}}</a>
7+
<a class="item active" data-tab="diff-side-by-side-{{.file.Index}}">{{.root.locale.Tr "repo.diff.image.side_by_side"}}</a>
88
{{if and .blobBase .blobHead}}
9-
<a class="item" data-tab="diff-swipe-{{ .file.Index }}">{{.root.locale.Tr "repo.diff.image.swipe"}}</a>
10-
<a class="item" data-tab="diff-overlay-{{ .file.Index }}">{{.root.locale.Tr "repo.diff.image.overlay"}}</a>
9+
<a class="item" data-tab="diff-swipe-{{.file.Index}}">{{.root.locale.Tr "repo.diff.image.swipe"}}</a>
10+
<a class="item" data-tab="diff-overlay-{{.file.Index}}">{{.root.locale.Tr "repo.diff.image.overlay"}}</a>
1111
{{end}}
1212
</div>
1313
</div>
1414
<div class="hide">
15-
<div class="ui bottom attached tab image-diff-container active" data-tab="diff-side-by-side-{{ .file.Index }}">
15+
<div class="ui bottom attached tab image-diff-container active" data-tab="diff-side-by-side-{{.file.Index}}">
1616
<div class="diff-side-by-side">
17-
{{if .blobBase }}
17+
{{if .blobBase}}
1818
<span class="side">
1919
<p class="side-header">{{.root.locale.Tr "repo.diff.file_before"}}</p>
2020
<span class="before-container"><img class="image-before" /></span>
@@ -29,7 +29,7 @@
2929
</p>
3030
</span>
3131
{{end}}
32-
{{if .blobHead }}
32+
{{if .blobHead}}
3333
<span class="side">
3434
<p class="side-header">{{.root.locale.Tr "repo.diff.file_after"}}</p>
3535
<span class="after-container"><img class="image-after" /></span>
@@ -47,7 +47,7 @@
4747
</div>
4848
</div>
4949
{{if and .blobBase .blobHead}}
50-
<div class="ui bottom attached tab image-diff-container" data-tab="diff-swipe-{{ .file.Index }}">
50+
<div class="ui bottom attached tab image-diff-container" data-tab="diff-swipe-{{.file.Index}}">
5151
<div class="diff-swipe">
5252
<div class="swipe-frame">
5353
<span class="before-container"><img class="image-before" /></span>
@@ -61,7 +61,7 @@
6161
</div>
6262
</div>
6363
</div>
64-
<div class="ui bottom attached tab image-diff-container" data-tab="diff-overlay-{{ .file.Index }}">
64+
<div class="ui bottom attached tab image-diff-container" data-tab="diff-overlay-{{.file.Index}}">
6565
<div class="diff-overlay">
6666
<div class="overlay-frame">
6767
<div class="ui centered">

templates/repo/diff/new_review.tmpl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@
2222
</div>
2323
{{end}}
2424
<div class="ui divider"></div>
25-
<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>
25+
<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>
2626
<button type="submit" name="type" value="comment" class="ui submit tiny basic button btn-submit">{{$.locale.Tr "repo.diff.review.comment"}}</button>
27-
<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>
27+
<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>
2828
</form>
2929
</div>
3030
</div>

templates/repo/diff/section_split.tmpl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@
66
<tr class="{{DiffLineTypeToStr .GetType}}-code nl-{{$k}} ol-{{$k}}" data-line-type="{{DiffLineTypeToStr .GetType}}">
77
{{if eq .GetType 4}}
88
<td class="lines-num lines-num-old">
9-
{{if or (eq $line.GetExpandDirection 3) (eq $line.GetExpandDirection 5) }}
9+
{{if or (eq $line.GetExpandDirection 3) (eq $line.GetExpandDirection 5)}}
1010
<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}}">
1111
{{svg "octicon-fold-down"}}
1212
</a>
1313
{{end}}
14-
{{if or (eq $line.GetExpandDirection 3) (eq $line.GetExpandDirection 4) }}
14+
{{if or (eq $line.GetExpandDirection 3) (eq $line.GetExpandDirection 4)}}
1515
<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}}">
1616
{{svg "octicon-fold-up"}}
1717
</a>

templates/repo/diff/section_unified.tmpl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@
55
<tr class="{{DiffLineTypeToStr .GetType}}-code nl-{{$k}} ol-{{$k}}" data-line-type="{{DiffLineTypeToStr .GetType}}">
66
{{if eq .GetType 4}}
77
<td colspan="2" class="lines-num">
8-
{{if or (eq $line.GetExpandDirection 3) (eq $line.GetExpandDirection 5) }}
8+
{{if or (eq $line.GetExpandDirection 3) (eq $line.GetExpandDirection 5)}}
99
<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}}">
1010
{{svg "octicon-fold-down"}}
1111
</a>
1212
{{end}}
13-
{{if or (eq $line.GetExpandDirection 3) (eq $line.GetExpandDirection 4) }}
13+
{{if or (eq $line.GetExpandDirection 3) (eq $line.GetExpandDirection 4)}}
1414
<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}}">
1515
{{svg "octicon-fold-up"}}
1616
</a>

0 commit comments

Comments
 (0)