mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2024-11-14 05:56:14 +01:00
78b2a1cc36
And simplify the "repo/icon" code
72 lines
2.7 KiB
Go HTML Template
72 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">
|
|
<a class="text primary name" href="{{.Link}}">
|
|
{{if or $.PageIsExplore $.PageIsProfileStarList}}{{if .Owner}}{{.Owner.Name}} / {{end}}{{end}}{{.Name}}
|
|
</a>
|
|
<span class="label-list">
|
|
{{if .IsArchived}}
|
|
<span class="ui basic label">{{$.locale.Tr "repo.desc.archived"}}</span>
|
|
{{end}}
|
|
{{if .IsTemplate}}
|
|
{{if .IsPrivate}}
|
|
<span class="ui basic label">{{$.locale.Tr "repo.desc.private_template"}}</span>
|
|
{{else}}
|
|
{{if .Owner.Visibility.IsPrivate}}
|
|
<span class="ui basic label">{{$.locale.Tr "repo.desc.internal_template"}}</span>
|
|
{{end}}
|
|
{{end}}
|
|
{{else}}
|
|
{{if .IsPrivate}}
|
|
<span class="ui basic label">{{$.locale.Tr "repo.desc.private"}}</span>
|
|
{{else}}
|
|
{{if .Owner.Visibility.IsPrivate}}
|
|
<span class="ui basic label">{{$.locale.Tr "repo.desc.internal"}}</span>
|
|
{{end}}
|
|
{{end}}
|
|
{{end}}
|
|
</span>
|
|
{{if .IsFork}}
|
|
<span data-tooltip-content="{{$.locale.Tr "repo.fork"}}">{{svg "octicon-repo-forked"}}</span>
|
|
{{else if .IsMirror}}
|
|
<span data-tooltip-content="{{$.locale.Tr "mirror"}}">{{svg "octicon-mirror"}}</span>
|
|
{{end}}
|
|
</div>
|
|
<div class="flex-item-trailing">
|
|
{{if .PrimaryLanguage}}
|
|
<a class="muted" href="{{$.Link}}?q={{$.Keyword}}&sort={{$.SortType}}&language={{.PrimaryLanguage.Language}}">
|
|
<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">{{svg "octicon-star" 16}}{{.NumStars}}</a>
|
|
{{end}}
|
|
<a class="text grey flex-text-inline" href="{{.Link}}/forks">{{svg "octicon-git-branch" 16}}{{.NumForks}}</a>
|
|
</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">{{$.locale.Tr "org.repo_updated"}} {{TimeSinceUnix .UpdatedUnix $.locale}}</div>
|
|
</div>
|
|
</div>
|
|
{{else}}
|
|
<div>
|
|
{{$.locale.Tr "explore.repo_no_results"}}
|
|
</div>
|
|
{{end}}
|
|
</div>
|