diff options
author | Cirno the Strongest <1447794+CirnoT@users.noreply.github.com> | 2020-06-22 22:20:51 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-06-22 16:20:51 -0400 |
commit | d9aa007a9e84bd255b16bd02b9ab18719cb650a2 (patch) | |
tree | 90422e439d82ed0686de95f7630ec8f37a3a3ff1 /templates/repo/header.tmpl | |
parent | daf62841f645e77affa0a50701a79d942c612500 (diff) | |
download | gitea-d9aa007a9e84bd255b16bd02b9ab18719cb650a2.tar.gz gitea-d9aa007a9e84bd255b16bd02b9ab18719cb650a2.zip |
Use label to describe repository type (#11891)
* Use label instead of icon to describe repository type when repo avatar is set
* header_icon is not longer duplicated; move out of separate template
* handle archived case too
* use everywhere
* public template -> template
* bring back separate icon in better form
* definitely was overthinking this
* 32
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
Diffstat (limited to 'templates/repo/header.tmpl')
-rw-r--r-- | templates/repo/header.tmpl | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/templates/repo/header.tmpl b/templates/repo/header.tmpl index 713968dc21..c777d27fcd 100644 --- a/templates/repo/header.tmpl +++ b/templates/repo/header.tmpl @@ -11,10 +11,24 @@ <a href="{{AppSubUrl}}/{{.Owner.Name}}">{{.Owner.Name}}</a> <div class="divider"> / </div> <a href="{{$.RepoLink}}">{{.Name}}</a> - {{if .RelAvatarLink}} - {{template "repo/header_icon" .}} + {{if .IsTemplate}} + {{if .IsPrivate}} + <span class="ui basic label">{{$.i18n.Tr "repo.desc.private_template"}}</span> + {{else}} + {{if .Owner.Visibility.IsPrivate}} + <span class="ui basic label">{{$.i18n.Tr "repo.desc.internal_template"}}</span> + {{end}} + {{end}} + {{else}} + {{if .IsPrivate}} + <span class="ui basic label">{{$.i18n.Tr "repo.desc.private"}}</span> + {{else}} + {{if .Owner.Visibility.IsPrivate}} + <span class="ui basic label">{{$.i18n.Tr "repo.desc.internal"}}</span> + {{end}} + {{end}} {{end}} - {{if .IsArchived}}<i class="archive icon archived-icon"></i>{{end}} + {{if .IsArchived}}<span class="ui compact label">{{$.i18n.Tr "repo.desc.archived"}}</span>{{end}} {{if .IsMirror}}<div class="fork-flag">{{$.i18n.Tr "repo.mirror_from"}} <a target="_blank" rel="noopener noreferrer" href="{{if .SanitizedOriginalURL}}{{.SanitizedOriginalURL}}{{else}}{{MirrorAddress $.Mirror}}{{end}}">{{if .SanitizedOriginalURL}}{{.SanitizedOriginalURL}}{{else}}{{MirrorAddress $.Mirror}}{{end}}</a></div>{{end}} {{if .IsFork}}<div class="fork-flag">{{$.i18n.Tr "repo.forked_from"}} <a href="{{.BaseRepo.Link}}">{{SubStr .BaseRepo.RelLink 1 -1}}</a></div>{{end}} {{if .IsGenerated}}<div class="fork-flag">{{$.i18n.Tr "repo.generated_from"}} <a href="{{.TemplateRepo.Link}}">{{SubStr .TemplateRepo.RelLink 1 -1}}</a></div>{{end}} |