Use print
instead of printf
(#27093)
A bit more performant when we only use it for appending strings.
This commit is contained in:
parent
7cdbe65a2c
commit
f3f445862e
|
@ -36,7 +36,7 @@
|
||||||
</div>
|
</div>
|
||||||
{{if and .PageIsExploreRepositories .OnlyShowRelevant}}
|
{{if and .PageIsExploreRepositories .OnlyShowRelevant}}
|
||||||
<div class="ui message explore-relevancy-note">
|
<div class="ui message explore-relevancy-note">
|
||||||
<span data-tooltip-content="{{.locale.Tr "explore.relevant_repositories_tooltip"}}">{{.locale.Tr "explore.relevant_repositories" ((printf "%s%s" $.Link "?only_show_relevant=0")|Escape) | Safe}}</span>
|
<span data-tooltip-content="{{.locale.Tr "explore.relevant_repositories_tooltip"}}">{{.locale.Tr "explore.relevant_repositories" ((print $.Link "?only_show_relevant=0")|Escape) | Safe}}</span>
|
||||||
</div>
|
</div>
|
||||||
{{end}}
|
{{end}}
|
||||||
<div class="divider"></div>
|
<div class="divider"></div>
|
||||||
|
|
|
@ -4,17 +4,17 @@
|
||||||
<div class="ui container fluid padded">
|
<div class="ui container fluid padded">
|
||||||
{{$class := ""}}
|
{{$class := ""}}
|
||||||
{{if .Commit.Signature}}
|
{{if .Commit.Signature}}
|
||||||
{{$class = (printf "%s%s" $class " isSigned")}}
|
{{$class = (print $class " isSigned")}}
|
||||||
{{if .Verification.Verified}}
|
{{if .Verification.Verified}}
|
||||||
{{if eq .Verification.TrustStatus "trusted"}}
|
{{if eq .Verification.TrustStatus "trusted"}}
|
||||||
{{$class = (printf "%s%s" $class " isVerified")}}
|
{{$class = (print $class " isVerified")}}
|
||||||
{{else if eq .Verification.TrustStatus "untrusted"}}
|
{{else if eq .Verification.TrustStatus "untrusted"}}
|
||||||
{{$class = (printf "%s%s" $class " isVerifiedUntrusted")}}
|
{{$class = (print $class " isVerifiedUntrusted")}}
|
||||||
{{else}}
|
{{else}}
|
||||||
{{$class = (printf "%s%s" $class " isVerifiedUnmatched")}}
|
{{$class = (print $class " isVerifiedUnmatched")}}
|
||||||
{{end}}
|
{{end}}
|
||||||
{{else if .Verification.Warning}}
|
{{else if .Verification.Warning}}
|
||||||
{{$class = (printf "%s%s" $class " isWarning")}}
|
{{$class = (print $class " isWarning")}}
|
||||||
{{end}}
|
{{end}}
|
||||||
{{end}}
|
{{end}}
|
||||||
<div class="ui top attached header clearing segment gt-relative commit-header {{$class}}">
|
<div class="ui top attached header clearing segment gt-relative commit-header {{$class}}">
|
||||||
|
|
|
@ -28,17 +28,17 @@
|
||||||
<button class="ui button copy-commit-sha gt-df gt-ac" data-clipboard-text="{{.ID}}">{{svg "octicon-copy" 14}}</button>
|
<button class="ui button copy-commit-sha gt-df gt-ac" data-clipboard-text="{{.ID}}">{{svg "octicon-copy" 14}}</button>
|
||||||
{{$class := "ui sha label"}}
|
{{$class := "ui sha label"}}
|
||||||
{{if .Signature}}
|
{{if .Signature}}
|
||||||
{{$class = (printf "%s%s" $class " isSigned")}}
|
{{$class = (print $class " isSigned")}}
|
||||||
{{if .Verification.Verified}}
|
{{if .Verification.Verified}}
|
||||||
{{if eq .Verification.TrustStatus "trusted"}}
|
{{if eq .Verification.TrustStatus "trusted"}}
|
||||||
{{$class = (printf "%s%s" $class " isVerified")}}
|
{{$class = (print $class " isVerified")}}
|
||||||
{{else if eq .Verification.TrustStatus "untrusted"}}
|
{{else if eq .Verification.TrustStatus "untrusted"}}
|
||||||
{{$class = (printf "%s%s" $class " isVerifiedUntrusted")}}
|
{{$class = (print $class " isVerifiedUntrusted")}}
|
||||||
{{else}}
|
{{else}}
|
||||||
{{$class = (printf "%s%s" $class " isVerifiedUnmatched")}}
|
{{$class = (print $class " isVerifiedUnmatched")}}
|
||||||
{{end}}
|
{{end}}
|
||||||
{{else if .Verification.Warning}}
|
{{else if .Verification.Warning}}
|
||||||
{{$class = (printf "%s%s" $class " isWarning")}}
|
{{$class = (print $class " isWarning")}}
|
||||||
{{end}}
|
{{end}}
|
||||||
{{end}}
|
{{end}}
|
||||||
{{$commitShaLink := ""}}
|
{{$commitShaLink := ""}}
|
||||||
|
|
|
@ -17,17 +17,17 @@
|
||||||
{{template "repo/commit_statuses" dict "Status" .Status "Statuses" .Statuses "root" $.root}}
|
{{template "repo/commit_statuses" dict "Status" .Status "Statuses" .Statuses "root" $.root}}
|
||||||
{{$class := "ui sha label"}}
|
{{$class := "ui sha label"}}
|
||||||
{{if .Signature}}
|
{{if .Signature}}
|
||||||
{{$class = (printf "%s%s" $class " isSigned")}}
|
{{$class = (print $class " isSigned")}}
|
||||||
{{if .Verification.Verified}}
|
{{if .Verification.Verified}}
|
||||||
{{if eq .Verification.TrustStatus "trusted"}}
|
{{if eq .Verification.TrustStatus "trusted"}}
|
||||||
{{$class = (printf "%s%s" $class " isVerified")}}
|
{{$class = (print $class " isVerified")}}
|
||||||
{{else if eq .Verification.TrustStatus "untrusted"}}
|
{{else if eq .Verification.TrustStatus "untrusted"}}
|
||||||
{{$class = (printf "%s%s" $class " isVerifiedUntrusted")}}
|
{{$class = (print $class " isVerifiedUntrusted")}}
|
||||||
{{else}}
|
{{else}}
|
||||||
{{$class = (printf "%s%s" $class " isVerifiedUnmatched")}}
|
{{$class = (print $class " isVerifiedUnmatched")}}
|
||||||
{{end}}
|
{{end}}
|
||||||
{{else if .Verification.Warning}}
|
{{else if .Verification.Warning}}
|
||||||
{{$class = (printf "%s%s" $class " isWarning")}}
|
{{$class = (print $class " isWarning")}}
|
||||||
{{end}}
|
{{end}}
|
||||||
{{end}}
|
{{end}}
|
||||||
<a href="{{$commitLink}}" rel="nofollow" class="gt-ml-3 {{$class}}">
|
<a href="{{$commitLink}}" rel="nofollow" class="gt-ml-3 {{$class}}">
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
{{if not $.DisableMigrations}}
|
{{if not $.DisableMigrations}}
|
||||||
<p class="ui center">{{.locale.Tr "repo.new_repo_helper" ((printf "%s%s" AppSubUrl "/repo/migrate")|Escape) | Safe}}</p>
|
<p class="ui center">{{.locale.Tr "repo.new_repo_helper" ((print AppSubUrl "/repo/migrate")|Escape) | Safe}}</p>
|
||||||
{{end}}
|
{{end}}
|
||||||
|
|
|
@ -8,17 +8,17 @@
|
||||||
<span class="sha" id="{{$commit.ShortRev}}">
|
<span class="sha" id="{{$commit.ShortRev}}">
|
||||||
{{$class := "ui sha label"}}
|
{{$class := "ui sha label"}}
|
||||||
{{if $commit.Commit.Signature}}
|
{{if $commit.Commit.Signature}}
|
||||||
{{$class = (printf "%s%s" $class " isSigned")}}
|
{{$class = (print $class " isSigned")}}
|
||||||
{{if $commit.Verification.Verified}}
|
{{if $commit.Verification.Verified}}
|
||||||
{{if eq $commit.Verification.TrustStatus "trusted"}}
|
{{if eq $commit.Verification.TrustStatus "trusted"}}
|
||||||
{{$class = (printf "%s%s" $class " isVerified")}}
|
{{$class = (print $class " isVerified")}}
|
||||||
{{else if eq $commit.Verification.TrustStatus "untrusted"}}
|
{{else if eq $commit.Verification.TrustStatus "untrusted"}}
|
||||||
{{$class = (printf "%s%s" $class " isVerifiedUntrusted")}}
|
{{$class = (print $class " isVerifiedUntrusted")}}
|
||||||
{{else}}
|
{{else}}
|
||||||
{{$class = (printf "%s%s" $class " isVerifiedUnmatched")}}
|
{{$class = (print $class " isVerifiedUnmatched")}}
|
||||||
{{end}}
|
{{end}}
|
||||||
{{else if $commit.Verification.Warning}}
|
{{else if $commit.Verification.Warning}}
|
||||||
{{$class = (printf "%s%s" $class " isWarning")}}
|
{{$class = (print $class " isWarning")}}
|
||||||
{{end}}
|
{{end}}
|
||||||
{{end}}
|
{{end}}
|
||||||
<a href="{{$.RepoLink}}/commit/{{$commit.Rev|PathEscape}}" rel="nofollow" class="{{$class}}">
|
<a href="{{$.RepoLink}}/commit/{{$commit.Rev|PathEscape}}" rel="nofollow" class="{{$class}}">
|
||||||
|
|
|
@ -70,7 +70,7 @@
|
||||||
{{if ne .Repository.ID .BaseRepo.ID}}
|
{{if ne .Repository.ID .BaseRepo.ID}}
|
||||||
{{$cmpBranch = printf "%s/%s:" (.Repository.OwnerName|PathEscape) (.Repository.Name|PathEscape)}}
|
{{$cmpBranch = printf "%s/%s:" (.Repository.OwnerName|PathEscape) (.Repository.Name|PathEscape)}}
|
||||||
{{end}}
|
{{end}}
|
||||||
{{$cmpBranch = printf "%s%s" $cmpBranch (.BranchName|PathEscapeSegments)}}
|
{{$cmpBranch = print $cmpBranch (.BranchName|PathEscapeSegments)}}
|
||||||
{{$compareLink := printf "%s/compare/%s...%s" .BaseRepo.Link (.BaseRepo.DefaultBranch|PathEscapeSegments) $cmpBranch}}
|
{{$compareLink := printf "%s/compare/%s...%s" .BaseRepo.Link (.BaseRepo.DefaultBranch|PathEscapeSegments) $cmpBranch}}
|
||||||
<a id="new-pull-request" role="button" class="ui compact basic button" href="{{$compareLink}}"
|
<a id="new-pull-request" role="button" class="ui compact basic button" href="{{$compareLink}}"
|
||||||
data-tooltip-content="{{if .PullRequestCtx.Allowed}}{{.locale.Tr "repo.pulls.compare_changes"}}{{else}}{{.locale.Tr "action.compare_branch"}}{{end}}">
|
data-tooltip-content="{{if .PullRequestCtx.Allowed}}{{.locale.Tr "repo.pulls.compare_changes"}}{{else}}{{.locale.Tr "action.compare_branch"}}{{end}}">
|
||||||
|
|
Loading…
Reference in a new issue