mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2026-05-12 22:10:25 +00:00
* migrate 17 strings related to repository migrations from INI to JSON
* changed templates to get rid of unhelpful prefix `repo`
* migrate 4 strings related to counters
* also changed templates to get rid of `repo`, but it had to be done anyway to use `TrPluralString`
* Unhardcode the header on migraiton type selector page, which I haven't noticed in https://codeberg.org/forgejo/forgejo/pulls/6795 or in two other PRs I did on this template since
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/11879
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Reviewed-by: Beowulf <beowulf@beocode.eu>
49 lines
2.2 KiB
Go HTML Template
49 lines
2.2 KiB
Go HTML Template
{{if and (not .HideRepoInfo) (not .IsBlame)}}
|
|
<div class="ui segments repository-summary tw-mt-1 tw-mb-0">
|
|
<div class="ui segment repository-menu">
|
|
{{if and (.Permission.CanRead $.UnitTypeCode) (not .IsEmptyRepo)}}
|
|
<a class="item muted {{if .PageIsCommits}}active{{end}}" href="{{.RepoLink}}/commits/{{.BranchNameSubURL}}">
|
|
{{svg "octicon-history"}} {{ctx.Locale.TrPluralString .CommitsCount "counters.n_commits" (printf "<b>%s</b>" (ctx.Locale.PrettyNumber .CommitsCount) | TrustHTML)}}
|
|
</a>
|
|
<a class="item muted {{if .PageIsBranches}}active{{end}}" href="{{.RepoLink}}/branches">
|
|
{{svg "octicon-git-branch"}} {{ctx.Locale.TrPluralString .BranchesCount "counters.n_branches" (printf "<b>%s</b>" (ctx.Locale.PrettyNumber .BranchesCount) | TrustHTML)}}
|
|
</a>
|
|
{{if $.Permission.CanRead $.UnitTypeCode}}
|
|
<a class="item muted {{if .PageIsTagList}}active{{end}}" href="{{.RepoLink}}/tags">
|
|
{{svg "octicon-tag"}} {{ctx.Locale.TrPluralString .NumTags "counters.n_tags" (printf "<b>%s</b>" (ctx.Locale.PrettyNumber .NumTags) | TrustHTML)}}
|
|
</a>
|
|
{{end}}
|
|
<span class="item" {{if not (eq .Repository.Size 0)}}data-tooltip-content="{{.Repository.SizeDetailsString ctx.Locale}}"{{end}}>
|
|
{{$fileSizeFields := ctx.Locale.TrSize .Repository.Size}}
|
|
{{svg "octicon-database"}} <b>{{$fileSizeFields.PrettyNumber}}</b> {{$fileSizeFields.TranslatedUnit}}
|
|
</span>
|
|
{{end}}
|
|
</div>
|
|
{{if and (.Permission.CanRead $.UnitTypeCode) (not .IsEmptyRepo) .LanguageStats}}
|
|
<details class="stats" id="language-stats">
|
|
<summary>
|
|
<stats-bar>
|
|
{{range .LanguageStats}}
|
|
<div class="slice" style="width: {{.Percentage}}%; background-color: {{.Color}}" data-tooltip-placement="top" data-tooltip-content={{.Language}} data-tooltip-follow-cursor="horizontal"></div>
|
|
{{end}}
|
|
</stats-bar>
|
|
</summary>
|
|
<ul>
|
|
{{range .LanguageStats}}
|
|
<li>
|
|
<i class="color-icon" style="background-color: {{.Color}}"></i>
|
|
<span>
|
|
{{if eq .Language "other"}}
|
|
{{ctx.Locale.Tr "repo.language_other"}}
|
|
{{else}}
|
|
{{.Language}}
|
|
{{end}}
|
|
</span>
|
|
{{.Percentage}}%
|
|
</li>
|
|
{{end}}
|
|
</ul>
|
|
</details>
|
|
{{end}}
|
|
</div>
|
|
{{end}}
|