Skip to content

Commit 6c4688e

Browse files
authored
Add whitespace removal inside template curly brackes (#20853)
1 parent 27ac65a commit 6c4688e

30 files changed

+110
-102
lines changed

Makefile

+10-2
Original file line numberDiff line numberDiff line change
@@ -242,8 +242,10 @@ clean:
242242

243243
.PHONY: fmt
244244
fmt:
245-
@echo "Running gitea-fmt (with gofumpt)..."
246245
@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))
247+
@# strip whitespace after '{{' and before `}}` unless there is only whitespace before it
248+
@$(SED_INPLACE) -e 's/{{[ ]\{1,\}/{{/g' -e '/^[ ]\{1,\}}}/! s/[ ]\{1,\}}}/}}/g' $(TEMPLATES)
247249

248250
.PHONY: vet
249251
vet:
@@ -288,13 +290,19 @@ errcheck:
288290

289291
.PHONY: fmt-check
290292
fmt-check:
291-
# get all go files and run gitea-fmt (with gofmt) on them
293+
@# get all go files and run gitea-fmt (with gofmt) on them
292294
@diff=$$(MISSPELL_PACKAGE=$(MISSPELL_PACKAGE) GOFUMPT_PACKAGE=$(GOFUMPT_PACKAGE) $(GO) run build/code-batch-process.go gitea-fmt -l '{file-list}'); \
293295
if [ -n "$$diff" ]; then \
294296
echo "Please run 'make fmt' and commit the result:"; \
295297
echo "$${diff}"; \
296298
exit 1; \
297299
fi
300+
@diff2=$$(git diff templates); \
301+
if [ -n "$$diff2" ]; then \
302+
echo "Please run 'make fmt' and commit the result:"; \
303+
echo "$${diff2}"; \
304+
exit 1; \
305+
fi
298306

299307
.PHONY: checks
300308
checks: checks-frontend checks-backend

templates/admin/config.tmpl

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
<dt>{{.locale.Tr "admin.config.reverse_auth_user"}}</dt>
5151
<dd>{{.ReverseProxyAuthUser}}</dd>
5252

53-
{{if .EnvVars }}
53+
{{if .EnvVars}}
5454
<div class="ui divider"></div>
5555
{{range .EnvVars}}
5656
<dt>{{.Name}}</dt>

templates/admin/cron.tmpl

+2-2
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@
2222
<td>{{$.locale.Tr (printf "admin.dashboard.%s" .Name)}}</td>
2323
<td>{{.Spec}}</td>
2424
<td>{{DateFmtLong .Next}}</td>
25-
<td>{{if gt .Prev.Year 1 }}{{DateFmtLong .Prev}}{{else}}N/A{{end}}</td>
25+
<td>{{if gt .Prev.Year 1}}{{DateFmtLong .Prev}}{{else}}N/A{{end}}</td>
2626
<td>{{.ExecTimes}}</td>
27-
<td {{if ne .Status ""}}class="tooltip" data-content="{{.FormatLastMessage $.locale}}"{{end}} >{{if eq .Status "" }}—{{else if eq .Status "finished"}}{{svg "octicon-check" 16}}{{else}}{{svg "octicon-x" 16}}{{end}}</td>
27+
<td {{if ne .Status ""}}class="tooltip" data-content="{{.FormatLastMessage $.locale}}"{{end}} >{{if eq .Status ""}}—{{else if eq .Status "finished"}}{{svg "octicon-check" 16}}{{else}}{{svg "octicon-x" 16}}{{end}}</td>
2828
</tr>
2929
{{end}}
3030
</tbody>

templates/admin/notice.tmpl

+3-3
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
</tr>
3535
{{end}}
3636
</tbody>
37-
{{ if .Notices }}
37+
{{if .Notices}}
3838
<tfoot class="full-width">
3939
<tr>
4040
<th></th>
@@ -65,11 +65,11 @@
6565
</th>
6666
</tr>
6767
</tfoot>
68-
{{ end }}
68+
{{end}}
6969
</table>
7070
</div>
7171

72-
{{ template "base/paginate" . }}
72+
{{template "base/paginate" .}}
7373
</div>
7474
</div>
7575

templates/admin/process-row.tmpl

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<div class="item">
22
<div class="df ac">
3-
<div class="icon ml-3 mr-3">{{if eq .Process.Type "request"}}{{svg "octicon-globe" 16 }}{{else if eq .Process.Type "system"}}{{svg "octicon-cpu" 16 }}{{else}}{{svg "octicon-terminal" 16 }}{{end}}</div>
3+
<div class="icon ml-3 mr-3">{{if eq .Process.Type "request"}}{{svg "octicon-globe" 16}}{{else if eq .Process.Type "system"}}{{svg "octicon-cpu" 16}}{{else}}{{svg "octicon-terminal" 16}}{{end}}</div>
44
<div class="content f1">
55
<div class="header">{{.Process.Description}}</div>
66
<div class="description"><span title="{{DateFmtLong .Process.Start}}">{{TimeSince .Process.Start .root.locale}}</span></div>

templates/admin/queue.tmpl

+4-4
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,12 @@
3030
</tbody>
3131
</table>
3232
</div>
33-
{{if lt $sum 0 }}
33+
{{if lt $sum 0}}
3434
<h4 class="ui top attached header">
3535
{{.locale.Tr "admin.monitor.queue.nopool.title"}}
3636
</h4>
3737
<div class="ui attached segment">
38-
{{if eq .Queue.Type "wrapped" }}
38+
{{if eq .Queue.Type "wrapped"}}
3939
<p>{{.locale.Tr "admin.monitor.queue.wrapped.desc"}}</p>
4040
{{else if eq .Queue.Type "persistable-channel"}}
4141
<p>{{.locale.Tr "admin.monitor.queue.persistable-channel.desc"}}</p>
@@ -58,7 +58,7 @@
5858
</div>
5959
<div class="inline field">
6060
<label for="timeout">{{.locale.Tr "admin.monitor.queue.settings.timeout"}}</label>
61-
<input name="timeout" type="text" placeholder="{{.locale.Tr "admin.monitor.queue.settings.timeout.placeholder" .Queue.BoostTimeout }}">
61+
<input name="timeout" type="text" placeholder="{{.locale.Tr "admin.monitor.queue.settings.timeout.placeholder" .Queue.BoostTimeout}}">
6262
</div>
6363
<div class="inline field">
6464
<label for="number">{{.locale.Tr "admin.monitor.queue.settings.numberworkers"}}</label>
@@ -166,7 +166,7 @@
166166
</tr>
167167
{{else}}
168168
<tr>
169-
<td colspan="4">{{.locale.Tr "admin.monitor.queue.pool.workers.none" }}
169+
<td colspan="4">{{.locale.Tr "admin.monitor.queue.pool.workers.none"}}
170170
</tr>
171171
{{end}}
172172
</tbody>

templates/admin/stacktrace-row.tmpl

+7-7
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,21 @@
22
<div class="df ac">
33
<div class="icon ml-3 mr-3">
44
{{if eq .Process.Type "request"}}
5-
{{svg "octicon-globe" 16 }}
5+
{{svg "octicon-globe" 16}}
66
{{else if eq .Process.Type "system"}}
7-
{{svg "octicon-cpu" 16 }}
7+
{{svg "octicon-cpu" 16}}
88
{{else if eq .Process.Type "normal"}}
9-
{{svg "octicon-terminal" 16 }}
9+
{{svg "octicon-terminal" 16}}
1010
{{else}}
11-
{{svg "octicon-code" 16 }}
11+
{{svg "octicon-code" 16}}
1212
{{end}}
1313
</div>
1414
<div class="content f1">
1515
<div class="header">{{.Process.Description}}</div>
1616
<div class="description">{{if ne .Process.Type "none"}}<span title="{{DateFmtLong .Process.Start}}">{{TimeSince .Process.Start .root.locale}}</span>{{end}}</div>
1717
</div>
1818
<div>
19-
{{if or (eq .Process.Type "request") (eq .Process.Type "normal") }}
19+
{{if or (eq .Process.Type "request") (eq .Process.Type "normal")}}
2020
<a class="delete-button icon" href="" data-url="{{.root.Link}}/cancel/{{.Process.PID}}" data-id="{{.Process.PID}}" data-name="{{.Process.Description}}">{{svg "octicon-trash" 16 "text-red"}}</a>
2121
{{end}}
2222
</div>
@@ -29,7 +29,7 @@
2929
<summary>
3030
<div class="dif content">
3131
<div class="header ml-3">
32-
<span class="icon mr-3">{{svg "octicon-code" 16 }}</span>{{.Description}}{{if gt .Count 1}} * {{.Count}}{{end}}
32+
<span class="icon mr-3">{{svg "octicon-code" 16}}</span>{{.Description}}{{if gt .Count 1}} * {{.Count}}{{end}}
3333
</div>
3434
<div class="description">
3535
{{range .Labels}}
@@ -41,7 +41,7 @@
4141
<div class="list">
4242
{{range .Entry}}
4343
<div class="item df ac">
44-
<span class="icon mr-4">{{svg "octicon-dot-fill" 16 }}</span>
44+
<span class="icon mr-4">{{svg "octicon-dot-fill" 16}}</span>
4545
<div class="content f1">
4646
<div class="header"><code>{{.Function}}</code></div>
4747
<div class="description"><code>{{.File}}:{{.Line}}</code></div>

templates/base/footer.tmpl

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
<!-- Third-party libraries -->
1717
{{if .EnableCaptcha}}
1818
{{if eq .CaptchaType "recaptcha"}}
19-
<script src='{{ URLJoin .RecaptchaURL "api.js"}}' async></script>
19+
<script src='{{URLJoin .RecaptchaURL "api.js"}}' async></script>
2020
{{end}}
2121
{{if eq .CaptchaType "hcaptcha"}}
2222
<script src='https://hcaptcha.com/1/api.js' async></script>

templates/base/head.tmpl

+2-2
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,8 @@
6565
<meta property="og:description" content="{{MetaDescription}}">
6666
{{end}}
6767
<meta property="og:site_name" content="{{AppName}}">
68-
{{if .IsSigned }}
69-
{{ if ne .SignedUser.Theme "gitea" }}
68+
{{if .IsSigned}}
69+
{{if ne .SignedUser.Theme "gitea"}}
7070
<link rel="stylesheet" href="{{AssetUrlPrefix}}/css/theme-{{.SignedUser.Theme | PathEscape}}.css?v={{AssetVersion}}">
7171
{{end}}
7272
{{else if ne DefaultTheme "gitea"}}

templates/base/head_script.tmpl

+6-6
Original file line numberDiff line numberDiff line change
@@ -21,18 +21,18 @@ If you introduce mistakes in it, Gitea JavaScript code wouldn't run correctly.
2121
enableTimeTracking: {{EnableTimetracking}},
2222
{{if .RequireTribute}}
2323
tributeValues: Array.from(new Map([
24-
{{ range .Participants }}
24+
{{range .Participants}}
2525
['{{.Name}}', {key: '{{.Name}} {{.FullName}}', value: '{{.Name}}',
2626
name: '{{.Name}}', fullname: '{{.FullName}}', avatar: '{{.AvatarLink}}'}],
27-
{{ end }}
28-
{{ range .Assignees }}
27+
{{end}}
28+
{{range .Assignees}}
2929
['{{.Name}}', {key: '{{.Name}} {{.FullName}}', value: '{{.Name}}',
3030
name: '{{.Name}}', fullname: '{{.FullName}}', avatar: '{{.AvatarLink}}'}],
31-
{{ end }}
32-
{{ range .MentionableTeams }}
31+
{{end}}
32+
{{range .MentionableTeams}}
3333
['{{$.MentionableTeamsOrg}}/{{.Name}}', {key: '{{$.MentionableTeamsOrg}}/{{.Name}}', value: '{{$.MentionableTeamsOrg}}/{{.Name}}',
3434
name: '{{$.MentionableTeamsOrg}}/{{.Name}}', avatar: '{{$.MentionableTeamsOrgAvatar}}'}],
35-
{{ end }}
35+
{{end}}
3636
]).values()),
3737
{{end}}
3838
mermaidMaxSourceCharacters: {{MermaidMaxSourceCharacters}},

templates/explore/code.tmpl

+6-6
Original file line numberDiff line numberDiff line change
@@ -4,27 +4,27 @@
44
<div class="ui container">
55
<form class="ui form ignore-dirty" style="max-width: 100%">
66
<div class="ui fluid action input">
7-
<input name="q" value="{{.Keyword}}"{{if .CodeIndexerUnavailable }} disabled{{end}} placeholder="{{.locale.Tr "explore.search"}}..." autofocus>
8-
<div class="ui dropdown selection{{if .CodeIndexerUnavailable }} disabled{{end}}">
9-
<input name="t" type="hidden" value="{{.queryType}}"{{if .CodeIndexerUnavailable }} disabled{{end}}>{{svg "octicon-triangle-down" 14 "dropdown icon"}}
7+
<input name="q" value="{{.Keyword}}"{{if .CodeIndexerUnavailable}} disabled{{end}} placeholder="{{.locale.Tr "explore.search"}}..." autofocus>
8+
<div class="ui dropdown selection{{if .CodeIndexerUnavailable}} disabled{{end}}">
9+
<input name="t" type="hidden" value="{{.queryType}}"{{if .CodeIndexerUnavailable}} disabled{{end}}>{{svg "octicon-triangle-down" 14 "dropdown icon"}}
1010
<div class="text">{{.locale.Tr (printf "explore.search.%s" (or .queryType "fuzzy"))}}</div>
1111
<div class="menu transition hidden" tabindex="-1" style="display: block !important;">
1212
<div class="item" data-value="">{{.locale.Tr "explore.search.fuzzy"}}</div>
1313
<div class="item" data-value="match">{{.locale.Tr "explore.search.match"}}</div>
1414
</div>
1515
</div>
16-
<button class="ui primary button"{{if .CodeIndexerUnavailable }} disabled{{end}}>{{.locale.Tr "explore.search"}}</button>
16+
<button class="ui primary button"{{if .CodeIndexerUnavailable}} disabled{{end}}>{{.locale.Tr "explore.search"}}</button>
1717
</div>
1818
</form>
1919
<div class="ui divider"></div>
2020
<div class="ui user list">
21-
{{if .CodeIndexerUnavailable }}
21+
{{if .CodeIndexerUnavailable}}
2222
<div class="ui error message">
2323
<p>{{$.locale.Tr "explore.code_search_unavailable"}}</p>
2424
</div>
2525
{{else if .SearchResults}}
2626
<h3>
27-
{{.locale.Tr "explore.code_search_results" (.Keyword|Escape) | Str2html }}
27+
{{.locale.Tr "explore.code_search_results" (.Keyword|Escape) | Str2html}}
2828
</h3>
2929
<div class="df ac fw">
3030
{{range $term := .SearchResultLanguages}}

templates/explore/repo_list.tmpl

+6-6
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
{{$avatar}}
99
{{end}}
1010
<a class="name" href="{{.Link}}">
11-
{{if or $.PageIsExplore $.PageIsProfileStarList }}{{if .Owner}}{{.Owner.Name}} / {{end}}{{end}}{{.Name}}
11+
{{if or $.PageIsExplore $.PageIsProfileStarList}}{{if .Owner}}{{.Owner.Name}} / {{end}}{{end}}{{.Name}}
1212
</a>
1313
<div class="labels df ac fw">
1414
{{if .IsArchived}}
@@ -39,9 +39,9 @@
3939
</div>
4040
</div>
4141
<div class="metas df ac">
42-
{{if .PrimaryLanguage }}
42+
{{if .PrimaryLanguage}}
4343
<a href="{{$.Link}}?q={{$.Keyword}}&sort={{$.SortType}}&language={{.PrimaryLanguage.Language}}">
44-
<span class="text grey df ac mr-3"><i class="color-icon mr-3" style="background-color: {{.PrimaryLanguage.Color}}"></i>{{ .PrimaryLanguage.Language }}</span>
44+
<span class="text grey df ac mr-3"><i class="color-icon mr-3" style="background-color: {{.PrimaryLanguage.Color}}"></i>{{.PrimaryLanguage.Language}}</span>
4545
</a>
4646
{{end}}
4747
{{if not $.DisableStars}}
@@ -51,12 +51,12 @@
5151
</div>
5252
</div>
5353
<div class="description">
54-
{{ $description := .DescriptionHTML $.Context}}
54+
{{$description := .DescriptionHTML $.Context}}
5555
{{if $description}}<p>{{$description}}</p>{{end}}
56-
{{if .Topics }}
56+
{{if .Topics}}
5757
<div class="ui tags">
5858
{{range .Topics}}
59-
{{if ne . "" }}<a href="{{AppSubUrl}}/explore/repos?q={{.}}&topic=1"><div class="ui small label topic">{{.}}</div></a>{{end}}
59+
{{if ne . ""}}<a href="{{AppSubUrl}}/explore/repos?q={{.}}&topic=1"><div class="ui small label topic">{{.}}</div></a>{{end}}
6060
{{end}}
6161
</div>
6262
{{end}}

templates/mail/release.tmpl

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
</head>
1313

14-
{{$release_url := printf "<a href='%s'>%s</a>" (.Release.HTMLURL | Escape) (.Release.TagName | Escape) }}
14+
{{$release_url := printf "<a href='%s'>%s</a>" (.Release.HTMLURL | Escape) (.Release.TagName | Escape)}}
1515
{{$repo_url := printf "<a href='%s'>%s</a>" (.Release.Repo.HTMLURL | Escape) (.Release.Repo.FullName | Escape)}}
1616
<body>
1717
<p>

templates/repo/activity.tmpl

+9-9
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
<a class="table-cell tiny background light grey"></a>
4242
</div>
4343
{{end}}
44-
{{.locale.TrN .Activity.ActivePRCount "repo.activity.active_prs_count_1" "repo.activity.active_prs_count_n" .Activity.ActivePRCount | Safe }}
44+
{{.locale.TrN .Activity.ActivePRCount "repo.activity.active_prs_count_1" "repo.activity.active_prs_count_n" .Activity.ActivePRCount | Safe}}
4545
</div>
4646
{{end}}
4747
{{if .Permission.CanRead $.UnitTypeIssues}}
@@ -56,7 +56,7 @@
5656
<a class="table-cell tiny background light grey"></a>
5757
</div>
5858
{{end}}
59-
{{.locale.TrN .Activity.ActiveIssueCount "repo.activity.active_issues_count_1" "repo.activity.active_issues_count_n" .Activity.ActiveIssueCount | Safe }}
59+
{{.locale.TrN .Activity.ActiveIssueCount "repo.activity.active_issues_count_1" "repo.activity.active_issues_count_n" .Activity.ActiveIssueCount | Safe}}
6060
</div>
6161
{{end}}
6262
</div>
@@ -87,25 +87,25 @@
8787
{{if .Permission.CanRead $.UnitTypeCode}}
8888
{{if eq .Activity.Code.CommitCountInAllBranches 0}}
8989
<div class="ui center aligned segment">
90-
<h4 class="ui header">{{.locale.Tr "repo.activity.no_git_activity" }}</h4>
90+
<h4 class="ui header">{{.locale.Tr "repo.activity.no_git_activity"}}</h4>
9191
</div>
9292
{{end}}
9393
{{if gt .Activity.Code.CommitCountInAllBranches 0}}
9494
<div class="ui attached segment horizontal segments">
9595
<div class="ui attached segment text">
96-
{{.locale.Tr "repo.activity.git_stats_exclude_merges" }}
96+
{{.locale.Tr "repo.activity.git_stats_exclude_merges"}}
9797
<strong>{{.locale.TrN .Activity.Code.AuthorCount "repo.activity.git_stats_author_1" "repo.activity.git_stats_author_n" .Activity.Code.AuthorCount}}</strong>
9898
{{.locale.TrN .Activity.Code.AuthorCount "repo.activity.git_stats_pushed_1" "repo.activity.git_stats_pushed_n"}}
9999
<strong>{{.locale.TrN .Activity.Code.CommitCount "repo.activity.git_stats_commit_1" "repo.activity.git_stats_commit_n" .Activity.Code.CommitCount}}</strong>
100-
{{.locale.Tr "repo.activity.git_stats_push_to_branch" .Repository.DefaultBranch }}
100+
{{.locale.Tr "repo.activity.git_stats_push_to_branch" .Repository.DefaultBranch}}
101101
<strong>{{.locale.TrN .Activity.Code.CommitCountInAllBranches "repo.activity.git_stats_commit_1" "repo.activity.git_stats_commit_n" .Activity.Code.CommitCountInAllBranches}}</strong>
102-
{{.locale.Tr "repo.activity.git_stats_push_to_all_branches" }}
103-
{{.locale.Tr "repo.activity.git_stats_on_default_branch" .Repository.DefaultBranch }}
102+
{{.locale.Tr "repo.activity.git_stats_push_to_all_branches"}}
103+
{{.locale.Tr "repo.activity.git_stats_on_default_branch" .Repository.DefaultBranch}}
104104
<strong>{{.locale.TrN .Activity.Code.ChangedFiles "repo.activity.git_stats_file_1" "repo.activity.git_stats_file_n" .Activity.Code.ChangedFiles}}</strong>
105105
{{.locale.TrN .Activity.Code.ChangedFiles "repo.activity.git_stats_files_changed_1" "repo.activity.git_stats_files_changed_n"}}
106-
{{.locale.Tr "repo.activity.git_stats_additions" }}
106+
{{.locale.Tr "repo.activity.git_stats_additions"}}
107107
<strong class="text green">{{.locale.TrN .Activity.Code.Additions "repo.activity.git_stats_addition_1" "repo.activity.git_stats_addition_n" .Activity.Code.Additions}}</strong>
108-
{{.locale.Tr "repo.activity.git_stats_and_deletions" }}
108+
{{.locale.Tr "repo.activity.git_stats_and_deletions"}}
109109
<strong class="text red">{{.locale.TrN .Activity.Code.Deletions "repo.activity.git_stats_deletion_1" "repo.activity.git_stats_deletion_n" .Activity.Code.Deletions}}</strong>.
110110
</div>
111111
<div class="ui attached segment">

templates/repo/commit_page.tmpl

+2-2
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@
8787
{{.CsrfTokenHtml}}
8888
<div class="field">
8989
<label>
90-
{{.locale.Tr "repo.branch.new_branch_from" "<span class=\"text\" id=\"modal-create-branch-from-span\"></span>" | Safe }}
90+
{{.locale.Tr "repo.branch.new_branch_from" "<span class=\"text\" id=\"modal-create-branch-from-span\"></span>" | Safe}}
9191
</label>
9292
</div>
9393
<div class="required field">
@@ -112,7 +112,7 @@
112112
<input type="hidden" name="create_tag" value="true">
113113
<div class="field">
114114
<label>
115-
{{.locale.Tr "repo.tag.create_tag_from" "<span class=\"text\" id=\"modal-create-tag-from-span\"></span>" | Safe }}
115+
{{.locale.Tr "repo.tag.create_tag_from" "<span class=\"text\" id=\"modal-create-tag-from-span\"></span>" | Safe}}
116116
</label>
117117
</div>
118118
<div class="required field">

templates/repo/commits_list.tmpl

+2-2
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,8 @@
6262
<span class="message-wrapper">
6363
{{if $.PageIsWiki}}
6464
<span class="commit-summary {{if gt .ParentCount 1}} grey text{{end}}" title="{{.Summary}}">{{.Summary | RenderEmoji}}</span>
65-
{{else }}
66-
{{ $commitLink:= printf "%s/commit/%s" $commitRepoLink (PathEscape .ID.String) }}
65+
{{else}}
66+
{{$commitLink:= printf "%s/commit/%s" $commitRepoLink (PathEscape .ID.String)}}
6767
<span class="commit-summary {{if gt .ParentCount 1}} grey text{{end}}" title="{{.Summary}}">{{RenderCommitMessageLinkSubject $.Context .Message $commitRepoLink $commitLink $.Repository.ComposeMetas}}</span>
6868
{{end}}
6969
</span>

templates/repo/commits_list_small.tmpl

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
{{ $index := 0}}
1+
{{$index := 0}}
22
<div class="timeline-item commits-list">
33
{{range .comment.Commits}}
4-
{{ $tag := printf "%s-%d" $.comment.HashTag $index }}
5-
{{ $index = Add $index 1}}
4+
{{$tag := printf "%s-%d" $.comment.HashTag $index}}
5+
{{$index = Add $index 1}}
66
<div class="singular-commit" id="{{$tag}}">
77
<span class="badge badge-commit">{{svg "octicon-git-commit"}}</span>
88
{{if .User}}
@@ -46,7 +46,7 @@
4646
{{end}}
4747
</span>
4848

49-
{{ $commitLink:= printf "%s/commit/%s" $.comment.Issue.PullRequest.BaseRepo.Link (PathEscape .ID.String) }}
49+
{{$commitLink:= printf "%s/commit/%s" $.comment.Issue.PullRequest.BaseRepo.Link (PathEscape .ID.String)}}
5050
<span class="mono commit-summary {{if gt .ParentCount 1}} grey text{{end}}" title="{{.Summary}}">{{RenderCommitMessageLinkSubject $.root.Context .Message ($.comment.Issue.PullRequest.BaseRepo.Link|Escape) $commitLink $.comment.Issue.PullRequest.BaseRepo.ComposeMetas}}</span>
5151
{{if IsMultilineCommitMessage .Message}}
5252
<button class="ui button ellipsis-button" aria-expanded="false">...</button>

templates/repo/commits_table.tmpl

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
{{if or .PageIsCommits (gt .CommitCount 0)}}
44
{{.CommitCount}} {{.locale.Tr "repo.commits.commits"}} {{if .RefName}}({{.RefName}}){{end}}
55
{{else if .IsNothingToCompare}}
6-
{{.locale.Tr "repo.commits.nothing_to_compare" }} {{if .RefName}}({{.RefName}}){{end}}
6+
{{.locale.Tr "repo.commits.nothing_to_compare"}} {{if .RefName}}({{.RefName}}){{end}}
77
{{else}}
88
{{.locale.Tr "repo.commits.no_commits" $.BaseBranch $.HeadBranch}} {{if .RefName}}({{.RefName}}){{end}}
99
{{end}}

0 commit comments

Comments
 (0)