diff options
author | Denys Konovalov <kontakt@denyskon.de> | 2023-10-16 23:06:15 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-10-16 23:06:15 +0200 |
commit | 0271114e6400fc003d96c8499f0c8e43bbb441f9 (patch) | |
tree | f2c666f02ee0a02c1b3cde1e2389889d9b8849f3 /templates | |
parent | 6c501b149809a7015e58d9627e84bfd593702f95 (diff) | |
download | gitea-0271114e6400fc003d96c8499f0c8e43bbb441f9.tar.gz gitea-0271114e6400fc003d96c8499f0c8e43bbb441f9.zip |
cleanup repo details icons/labels (#27644)
Fix #27596
Change confusing behavior when showing information about a repo via
labels and icons. Implement changes proposed by @lng2020 in
https://github.com/go-gitea/gitea/pull/27627#pullrequestreview-1678787673.
Diffstat (limited to 'templates')
-rw-r--r-- | templates/admin/repo/list.tmpl | 29 | ||||
-rw-r--r-- | templates/explore/repo_list.tmpl | 26 | ||||
-rw-r--r-- | templates/repo/header.tmpl | 25 | ||||
-rw-r--r-- | templates/repo/icon.tmpl | 4 |
4 files changed, 27 insertions, 57 deletions
diff --git a/templates/admin/repo/list.tmpl b/templates/admin/repo/list.tmpl index c23b6a1b63..2581864547 100644 --- a/templates/admin/repo/list.tmpl +++ b/templates/admin/repo/list.tmpl @@ -55,29 +55,22 @@ <td> <a href="{{.Link}}">{{.Name}}</a> {{if .IsArchived}} - <span class="ui basic mini label">{{ctx.Locale.Tr "repo.desc.archived"}}</span> + <span class="ui basic label">{{ctx.Locale.Tr "repo.desc.archived"}}</span> {{end}} - {{if .IsTemplate}} - {{if .IsPrivate}} - <span class="ui basic mini label">{{ctx.Locale.Tr "repo.desc.private_template"}}</span> - {{else}} - {{if .Owner.Visibility.IsPrivate}} - <span class="ui basic mini label">{{ctx.Locale.Tr "repo.desc.internal_template"}}</span> - {{end}} - {{end}} + {{if .IsPrivate}} + <span class="ui basic label">{{ctx.Locale.Tr "repo.desc.private"}}</span> {{else}} - {{if .IsPrivate}} - <span class="ui basic mini label">{{ctx.Locale.Tr "repo.desc.private"}}</span> - {{else}} - {{if .Owner.Visibility.IsPrivate}} - <span class="ui basic mini label">{{ctx.Locale.Tr "repo.desc.internal"}}</span> - {{end}} + {{if .Owner.Visibility.IsPrivate}} + <span class="ui basic label">{{ctx.Locale.Tr "repo.desc.internal"}}</span> {{end}} {{end}} - {{if .IsFork}} - {{svg "octicon-repo-forked"}} - {{else if .IsMirror}} + {{if .IsTemplate}} + <span class="ui basic label">{{ctx.Locale.Tr "repo.desc.template"}}</span> + {{end}} + {{if .IsMirror}} {{svg "octicon-mirror"}} + {{else if .IsFork}} + {{svg "octicon-repo-forked"}} {{end}} </td> <td>{{.NumWatches}}</td> diff --git a/templates/explore/repo_list.tmpl b/templates/explore/repo_list.tmpl index 3583908743..1976ed5a15 100644 --- a/templates/explore/repo_list.tmpl +++ b/templates/explore/repo_list.tmpl @@ -14,29 +14,17 @@ {{if .IsArchived}} <span class="ui basic label">{{ctx.Locale.Tr "repo.desc.archived"}}</span> {{end}} - {{if .IsTemplate}} - {{if .IsPrivate}} - <span class="ui basic label">{{ctx.Locale.Tr "repo.desc.private_template"}}</span> - {{else}} - {{if .Owner.Visibility.IsPrivate}} - <span class="ui basic label">{{ctx.Locale.Tr "repo.desc.internal_template"}}</span> - {{end}} - {{end}} + {{if .IsPrivate}} + <span class="ui basic label">{{ctx.Locale.Tr "repo.desc.private"}}</span> {{else}} - {{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}} + {{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}} </span> - {{if .IsFork}} - <span data-tooltip-content="{{ctx.Locale.Tr "repo.fork"}}">{{svg "octicon-repo-forked"}}</span> - {{else if .IsMirror}} - <span data-tooltip-content="{{ctx.Locale.Tr "mirror"}}">{{svg "octicon-mirror"}}</span> - {{end}} </div> <div class="flex-item-trailing"> {{if .PrimaryLanguage}} diff --git a/templates/repo/header.tmpl b/templates/repo/header.tmpl index 2eb9014cdd..895d18d6fd 100644 --- a/templates/repo/header.tmpl +++ b/templates/repo/header.tmpl @@ -11,25 +11,18 @@ <div class="gt-mx-2">/</div> <a href="{{$.RepoLink}}">{{.Name}}</a> <div class="labels gt-df gt-ac gt-fw"> - {{if .IsTemplate}} - {{if .IsPrivate}} - <span class="ui basic label">{{ctx.Locale.Tr "repo.desc.private_template"}}</span> - {{else}} - {{if .Owner.Visibility.IsPrivate}} - <span class="ui basic label">{{ctx.Locale.Tr "repo.desc.internal_template"}}</span> - {{end}} - {{end}} + {{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 .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}} + {{if .Owner.Visibility.IsPrivate}} + <span class="ui basic label">{{ctx.Locale.Tr "repo.desc.internal"}}</span> {{end}} {{end}} - {{if .IsArchived}} - <span class="ui basic label">{{ctx.Locale.Tr "repo.desc.archived"}}</span> + {{if .IsTemplate}} + <span class="ui basic label">{{ctx.Locale.Tr "repo.desc.template"}}</span> {{end}} </div> {{if $.EnableFeed}} diff --git a/templates/repo/icon.tmpl b/templates/repo/icon.tmpl index 8ad9a77b19..5a80b959d0 100644 --- a/templates/repo/icon.tmpl +++ b/templates/repo/icon.tmpl @@ -1,10 +1,6 @@ {{$avatarLink := (.RelAvatarLink ctx)}} {{if $avatarLink}} <img class="ui avatar gt-vm" src="{{$avatarLink}}" width="32" height="32" alt="{{.FullName}}"> -{{else if $.IsTemplate}} - {{svg "octicon-repo-template" 32}} -{{else if $.IsPrivate}} - {{svg "octicon-lock" 32}} {{else if $.IsMirror}} {{svg "octicon-mirror" 32}} {{else if $.IsFork}} |