mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2024-11-14 05:41:27 +01:00
847f03b6a6
Unify all but a few search boxes to use uniform style, uniform translations and shared templates where possible. Remove a few duplicated search templates, e. g. code search. <details><summary>Example after screenshots:</summary> ![grafik](https://github.com/go-gitea/gitea/assets/47871822/e20e7d6b-c6be-4a47-b132-672766f41421) ![grafik](https://github.com/go-gitea/gitea/assets/47871822/d5b11b9c-c12f-4a29-8fb0-24e5aa511d18) ![grafik](https://github.com/go-gitea/gitea/assets/47871822/d86bb444-36c7-426d-9cf1-c634963dffb1) ![grafik](https://github.com/go-gitea/gitea/assets/47871822/a76c0319-0518-484a-a840-563d02b61198) </details> Also includes #29700 Co-authored-by: 6543 <6543@obermui.de> --------- Co-authored-by: 6543 <m.huber@kithara.com> Co-authored-by: 6543 <6543@obermui.de> Co-authored-by: silverwind <me@silverwind.io> Co-authored-by: Giteabot <teabot@gitea.io> Conflicts: routers/web/repo/search.go templates/repo/home.tmpl templates/repo/search.tmpl templates/shared/repo_search.tmpl
66 lines
2.7 KiB
Go HTML Template
66 lines
2.7 KiB
Go HTML Template
<div class="flex-list">
|
|
{{range .Repos}}
|
|
<div class="flex-item">
|
|
<div class="flex-item-leading">
|
|
{{template "repo/icon" .}}
|
|
</div>
|
|
<div class="flex-item-main">
|
|
<div class="flex-item-header">
|
|
<div class="flex-item-title">
|
|
{{if and (or $.PageIsExplore $.PageIsProfileStarList) .Owner}}
|
|
<a class="text primary name" href="{{.Owner.HomeLink}}">{{.Owner.Name}}</a>/
|
|
{{end}}
|
|
<a class="text primary name" href="{{.Link}}">{{.Name}}</a>
|
|
<span class="label-list">
|
|
{{if .IsArchived}}
|
|
<span class="ui basic label">{{ctx.Locale.Tr "repo.desc.archived"}}</span>
|
|
{{end}}
|
|
{{if .IsPrivate}}
|
|
<span class="ui basic label">{{ctx.Locale.Tr "repo.desc.private"}}</span>
|
|
{{else}}
|
|
{{if .Owner.Visibility.IsPrivate}}
|
|
<span class="ui basic label">{{ctx.Locale.Tr "repo.desc.internal"}}</span>
|
|
{{end}}
|
|
{{end}}
|
|
{{if .IsTemplate}}
|
|
<span class="ui basic label">{{ctx.Locale.Tr "repo.desc.template"}}</span>
|
|
{{end}}
|
|
{{if eq .ObjectFormatName "sha256"}}
|
|
<span class="ui basic label">{{ctx.Locale.Tr "repo.desc.sha256"}}</span>
|
|
{{end}}
|
|
</span>
|
|
</div>
|
|
<div class="flex-item-trailing">
|
|
{{if .PrimaryLanguage}}
|
|
<a class="muted" href="{{$.Link}}?q={{$.Keyword}}&sort={{$.SortType}}&language={{.PrimaryLanguage.Language}}{{if $.TabName}}&tab={{$.TabName}}{{end}}">
|
|
<span class="flex-text-inline"><i class="color-icon gt-mr-3" style="background-color: {{.PrimaryLanguage.Color}}"></i>{{.PrimaryLanguage.Language}}</span>
|
|
</a>
|
|
{{end}}
|
|
{{if not $.DisableStars}}
|
|
<a class="text grey flex-text-inline" href="{{.Link}}/stars" aria-label="{{ctx.Locale.TrN .NumStars "explore.stars_one" "explore.stars_few" .NumStars}}">{{svg "octicon-star" 16}}{{.NumStars}}</a>
|
|
{{end}}
|
|
{{if not $.DisableForks}}
|
|
<a class="text grey flex-text-inline" href="{{.Link}}/forks" aria-label="{{ctx.Locale.TrN .NumForks "explore.forks_one" "explore.forks_few" .NumForks}}">{{svg "octicon-git-branch" 16}}{{.NumForks}}</a>
|
|
{{end}}
|
|
</div>
|
|
</div>
|
|
{{$description := .DescriptionHTML $.Context}}
|
|
{{if $description}}
|
|
<div class="flex-item-body">{{$description}}</div>
|
|
{{end}}
|
|
{{if .Topics}}
|
|
<div class="label-list">
|
|
{{range .Topics}}
|
|
{{if ne . ""}}<a class="ui label" href="{{AppSubUrl}}/explore/repos?q={{.}}&topic=1">{{.}}</a>{{end}}
|
|
{{end}}
|
|
</div>
|
|
{{end}}
|
|
<div class="flex-item-body">{{ctx.Locale.Tr "org.repo_updated"}} {{TimeSinceUnix .UpdatedUnix ctx.Locale}}</div>
|
|
</div>
|
|
</div>
|
|
{{else}}
|
|
<div>
|
|
{{ctx.Locale.Tr "search.no_results"}}
|
|
</div>
|
|
{{end}}
|
|
</div>
|