Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make sure fmt catches all templates #20979

Merged
merged 4 commits into from
Aug 31, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ clean:
.PHONY: fmt
fmt:
@MISSPELL_PACKAGE=$(MISSPELL_PACKAGE) GOFUMPT_PACKAGE=$(GOFUMPT_PACKAGE) $(GO) run build/code-batch-process.go gitea-fmt -w '{file-list}'
$(eval TEMPLATES := $(wildcard templates/**/*.tmpl))
$(eval TEMPLATES := $(shell find templates -type f -iname '*.tmpl'))
silverwind marked this conversation as resolved.
Show resolved Hide resolved
silverwind marked this conversation as resolved.
Show resolved Hide resolved
@# strip whitespace after '{{' and before `}}` unless there is only whitespace before it
@$(SED_INPLACE) -e 's/{{[ ]\{1,\}/{{/g' -e '/^[ ]\{1,\}}}/! s/[ ]\{1,\}}}/}}/g' $(TEMPLATES)

Expand Down
12 changes: 6 additions & 6 deletions templates/admin/auth/edit.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

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

<!-- SMTP -->
{{if .Source.IsSMTP}}
{{ $cfg:=.Source.Cfg }}
{{$cfg:=.Source.Cfg}}
<div class="inline required field">
<label>{{.locale.Tr "admin.auths.smtp_auth"}}</label>
<div class="ui selection type dropdown">
Expand Down Expand Up @@ -242,7 +242,7 @@

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

<!-- OAuth2 -->
{{if .Source.IsOAuth2}}
{{ $cfg:=.Source.Cfg }}
{{$cfg:=.Source.Cfg}}
<div class="inline required field">
<label>{{.locale.Tr "admin.auths.oauth2_provider"}}</label>
<div class="ui selection type dropdown">
Expand Down Expand Up @@ -337,7 +337,7 @@

<div class="field">
<label for="oauth2_scopes">{{.locale.Tr "admin.auths.oauth2_scopes"}}</label>
<input id="oauth2_scopes" name="oauth2_scopes" value="{{if $cfg.Scopes}}{{Join $cfg.Scopes "," }}{{end}}">
<input id="oauth2_scopes" name="oauth2_scopes" value="{{if $cfg.Scopes}}{{Join $cfg.Scopes ","}}{{end}}">
</div>
<div class="field">
<label for="oauth2_required_claim_name">{{.locale.Tr "admin.auths.oauth2_required_claim_name"}}</label>
Expand Down Expand Up @@ -365,7 +365,7 @@

<!-- SSPI -->
{{if .Source.IsSSPI}}
{{ $cfg:=.Source.Cfg }}
{{$cfg:=.Source.Cfg}}
<div class="field">
<div class="ui checkbox">
<label for="sspi_auto_create_users"><strong>{{.locale.Tr "admin.auths.sspi_auto_create_users"}}</strong></label>
Expand Down
8 changes: 4 additions & 4 deletions templates/admin/auth/new.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@
</div>

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

<!-- SMTP -->
{{ template "admin/auth/source/smtp" . }}
{{template "admin/auth/source/smtp" .}}

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

<!-- OAuth2 -->
{{ template "admin/auth/source/oauth" . }}
{{template "admin/auth/source/oauth" .}}

<!-- SSPI -->
{{ template "admin/auth/source/sspi" . }}
{{template "admin/auth/source/sspi" .}}

<div class="ldap field">
<div class="ui checkbox">
Expand Down
2 changes: 1 addition & 1 deletion templates/admin/user/edit.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
{{.CsrfTokenHtml}}
<div class="field {{if .Err_UserName}}error{{end}}">
<label for="user_name">{{.locale.Tr "username"}}</label>
<input id="user_name" name="user_name" value="{{.User.Name}}" autofocus {{if not .User.IsLocal }}disabled{{end}}>
<input id="user_name" name="user_name" value="{{.User.Name}}" autofocus {{if not .User.IsLocal}}disabled{{end}}>
</div>
<!-- Types and name -->
<div class="inline required field {{if .Err_LoginType}}error{{end}}">
Expand Down
2 changes: 1 addition & 1 deletion templates/admin/user/new.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@

<div class="inline field local{{if ne .login_type "0-0"}} hide{{end}}">
<div class="ui checkbox">
<label><strong>{{.locale.Tr "auth.allow_password_change" }}</strong></label>
<label><strong>{{.locale.Tr "auth.allow_password_change"}}</strong></label>
<input name="must_change_password" type="checkbox" checked>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion templates/mail/auth/activate.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<title>{{.locale.Tr "mail.activate_account.title" (.DisplayName|DotEscape)}}</title>
</head>

{{ $activate_url := printf "%suser/activate?code=%s" AppUrl (QueryEscape .Code)}}
{{$activate_url := printf "%suser/activate?code=%s" AppUrl (QueryEscape .Code)}}
<body>
<p>{{.locale.Tr "mail.activate_account.text_1" (.DisplayName|DotEscape) AppName | Str2html}}</p><br>
<p>{{.locale.Tr "mail.activate_account.text_2" .ActiveCodeLives | Str2html}}</p><p><a href="{{$activate_url}}">{{$activate_url}}</a></p><br>
Expand Down
2 changes: 1 addition & 1 deletion templates/mail/auth/activate_email.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<title>{{.locale.Tr "mail.activate_email.title" (.DisplayName|DotEscape)}}</title>
</head>

{{ $activate_url := printf "%suser/activate_email?code=%s&email=%s" AppUrl (QueryEscape .Code) (QueryEscape .Email)}}
{{$activate_url := printf "%suser/activate_email?code=%s&email=%s" AppUrl (QueryEscape .Code) (QueryEscape .Email)}}
<body>
<p>{{.locale.Tr "mail.hi_user_x" (.DisplayName|DotEscape) | Str2html}}</p><br>
<p>{{.locale.Tr "mail.activate_email.text" .ActiveCodeLives | Str2html}}</p><p><a href="{{$activate_url}}">{{$activate_url}}</a></p><br>
Expand Down
2 changes: 1 addition & 1 deletion templates/mail/auth/reset_passwd.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<title>{{.locale.Tr "mail.reset_password.title" (.DisplayName|DotEscape)}}</title>
</head>

{{ $recover_url := printf "%suser/recover_account?code=%s" AppUrl (QueryEscape .Code)}}
{{$recover_url := printf "%suser/recover_account?code=%s" AppUrl (QueryEscape .Code)}}
<body>
<p>{{.locale.Tr "mail.hi_user_x" (.DisplayName|DotEscape) | Str2html}}</p><br>
<p>{{.locale.Tr "mail.reset_password.text" .ResetPwdCodeLives | Str2html}}</p><p><a href="{{$recover_url}}">{{$recover_url}}</a></p><br>
Expand Down
4 changes: 2 additions & 2 deletions templates/org/member/members.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
{{template "base/alert" .}}

<div class="list">
{{ range .Members}}
{{range .Members}}
<div class="item ui grid">
<div class="ui four wide column" style="display: flex;">
{{avatar . 48}}
Expand All @@ -19,7 +19,7 @@
{{$.locale.Tr "org.members.membership_visibility"}}
</div>
<div class="meta">
{{ $isPublic := index $.MembersIsPublicMember .ID}}
{{$isPublic := index $.MembersIsPublicMember .ID}}
{{if $isPublic}}
<strong>{{$.locale.Tr "org.members.public"}}</strong>
{{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}}
Expand Down
2 changes: 1 addition & 1 deletion templates/package/shared/list.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
{{svg "octicon-package" 32}}
<h2>{{.locale.Tr "packages.empty"}}</h2>
{{if and .Repository .CanWritePackages}}
{{$packagesUrl := URLJoin .Owner.HTMLURL "-" "packages" }}
{{$packagesUrl := URLJoin .Owner.HTMLURL "-" "packages"}}
<p>{{.locale.Tr "packages.empty.repo" $packagesUrl | Safe}}</p>
{{end}}
<p>{{.locale.Tr "packages.empty.documentation" | Safe}}</p>
Expand Down
8 changes: 4 additions & 4 deletions templates/repo/diff/blob_excerpt.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down Expand Up @@ -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>
Expand Down
6 changes: 3 additions & 3 deletions templates/repo/diff/comment_form_datahandler.tmpl
Original file line number Diff line number Diff line change
@@ -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}}
12 changes: 6 additions & 6 deletions templates/repo/diff/comments.tmpl
Original file line number Diff line number Diff line change
@@ -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}}>
Expand All @@ -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}}
Expand All @@ -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>
Expand Down
8 changes: 4 additions & 4 deletions templates/repo/diff/compare.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -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 -}}
Expand Down Expand Up @@ -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>
Expand Down
16 changes: 8 additions & 8 deletions templates/repo/diff/image_diff.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand All @@ -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>
Expand All @@ -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>
Expand All @@ -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">
Expand Down
4 changes: 2 additions & 2 deletions templates/repo/diff/new_review.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
4 changes: 2 additions & 2 deletions templates/repo/diff/section_split.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
4 changes: 2 additions & 2 deletions templates/repo/diff/section_unified.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
Loading