Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

show special repo state if avatar is set #7387

Closed
wants to merge 2 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions templates/repo/header.tmpl
Expand Up @@ -11,6 +11,7 @@
<a href="{{AppSubUrl}}/{{.Owner.Name}}">{{.Owner.Name}}</a>
<div class="divider"> / </div>
<a href="{{$.RepoLink}}">{{.Name}}</a>
{{if and .RelAvatarLink .IsPrivate}}<i class="text gold octicon octicon-lock"></i>{{end}}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Two things I'm wondering...

  1. Should it always be on the right side, rather than only if there's an avatar? Then it would be consistent.
    a. Alternatively, should the icons just always show up on the left, next to the avatar if it exists?

  2. An icon should show regardless of whether it's private or not, similar to how it would look with no avatar. At least in my opinion.

Suggested change
{{if and .RelAvatarLink .IsPrivate}}<i class="text gold octicon octicon-lock"></i>{{end}}
{{if not .RelAvatarLink}}<i class="text gold octicon octicon-{{if .IsPrivate}}lock{{else if .IsMirror}}repo-clone{{else if .IsFork}}repo-forked{{else}}repo{{end}}"></i>{{end}}

Copy link
Contributor Author

@Cherrg Cherrg Jul 9, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My opinion

  • icon position:
    • I would place the small ones always on right side. So text will not jump around if there is something special on repository (special: private,mirror,fork,archived)
  • I would only show the small icons, when it is hidden by avatar.
    When no avatar is set then there would be a second icon with the same information
  • furthermore i would't show a symbol on right side if it is a normal repository
    • so you see with a short glance if it is a normal repo or not (i know, with no avatar the normal repo icon is shown, but the size is bigger.)
  • you're right i missed the other special icons, thanks for the hint. But the first condition in your proposal isn't correct. Your proposal would only be rendered if avatar is not set.
    -> I will add the other icons there

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, good catch on my suggestion.

{{if .IsArchived}}<i class="archive icon archived-icon"></i>{{end}}
{{if .IsMirror}}<div class="fork-flag">{{$.i18n.Tr "repo.mirror_from"}} <a target="_blank" rel="noopener noreferrer" href="{{$.Mirror.Address}}">{{$.Mirror.Address}}</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}}
Expand Down