-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
Conversation
add lock icon lige in repo list suggested in, fix go-gitea#7384 Signed-off-by: Michael Gnehr <michael@gnehr.de>
templates/repo/header.tmpl
Outdated
@@ -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}} |
There was a problem hiding this comment.
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...
-
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? -
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.
{{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}} |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
add missing icons Signed-off-by: Michael Gnehr <michael@gnehr.de>
Codecov Report
@@ Coverage Diff @@
## master #7387 +/- ##
==========================================
- Coverage 41.19% 41.18% -0.01%
==========================================
Files 469 469
Lines 63536 63536
==========================================
- Hits 26172 26167 -5
- Misses 33944 33948 +4
- Partials 3420 3421 +1
Continue to review full report at Codecov.
|
|
You could add a helper to this file if needed: https://github.com/go-gitea/gitea/blob/master/modules/templates/helper.go |
How about always put lock icon right of the repositories' name on repository view page? |
I agree with @lunny about placing it always right as it is easier and more consistent |
Would also suggest increasing the size of right-side icons a bit and try to vertically center them with the text. |
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs during the next 2 months. Thank you for your contributions. |
add icons like on repo list
suggested in, fix #7384
#Images