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

Clean up various avatar dimensions #24701

Merged
merged 10 commits into from
May 14, 2023
10 changes: 6 additions & 4 deletions templates/repo/issue/view_content.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,12 @@
<div class="ui timeline">
<div id="{{.Issue.HashTag}}" class="timeline-item comment first">
{{if .Issue.OriginalAuthor}}
<span class="timeline-avatar"><img src="{{AppSubUrl}}/assets/img/avatar_default.png"></span>
<span class="timeline-avatar">
<img src="{{AppSubUrl}}/assets/img/avatar_default.png" width="40" height="40">
</span>
{{else}}
<a class="timeline-avatar" {{if gt .Issue.Poster.ID 0}}href="{{.Issue.Poster.HomeLink}}"{{end}}>
{{avatar $.Context .Issue.Poster}}
{{avatar $.Context .Issue.Poster 40}}
</a>
{{end}}
<div class="content comment-container">
Expand All @@ -33,7 +35,7 @@
</span>
{{else}}
<a class="inline-timeline-avatar" href="{{.Issue.Poster.HomeLink}}">
{{avatar $.Context .Issue.Poster}}
{{avatar $.Context .Issue.Poster 24}}
</a>
<span class="text grey">
{{template "shared/user/authorlink" .Issue.Poster}}
Expand Down Expand Up @@ -93,7 +95,7 @@
{{if and (or .IsRepoAdmin .HasIssuesOrPullsWritePermission (not .Issue.IsLocked)) (not .Repository.IsArchived)}}
<div class="timeline-item comment form">
<a class="timeline-avatar" href="{{.SignedUser.HomeLink}}">
{{avatar $.Context .SignedUser}}
{{avatar $.Context .SignedUser 40}}
</a>
<div class="content">
<form class="ui segment form" id="comment-form" action="{{$.RepoLink}}/issues/{{.Issue.Index}}/comments" method="post">
Expand Down
18 changes: 10 additions & 8 deletions templates/repo/issue/view_content/comments.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,12 @@
{{if eq .Type 0}}
<div class="timeline-item comment" id="{{.HashTag}}">
{{if .OriginalAuthor}}
<span class="timeline-avatar"><img src="{{AppSubUrl}}/assets/img/avatar_default.png"></span>
<span class="timeline-avatar">
<img src="{{AppSubUrl}}/assets/img/avatar_default.png" width="40" height="40">
</span>
{{else}}
<a class="timeline-avatar"{{if gt .Poster.ID 0}} href="{{.Poster.HomeLink}}"{{end}}>
{{avatar $.Context .Poster}}
{{avatar $.Context .Poster 40}}
</a>
{{end}}
<div class="content comment-container">
Expand All @@ -38,7 +40,7 @@
{{else}}
{{if gt .Poster.ID 0}}
<a class="inline-timeline-avatar" href="{{.Poster.HomeLink}}">
{{avatar $.Context .Poster}}
{{avatar $.Context .Poster 24}}
</a>
{{end}}
<span class="text grey muted-links">
Expand Down Expand Up @@ -375,8 +377,8 @@
{{/* Some timeline avatars need a offset to correctly allign with their speech
bubble. The condition depends on review type and for positive reviews whether
there is a comment element or not */}}
<a class="timeline-avatar{{if or (and (eq .Review.Type 1) (or .Content .Attachments)) (eq .Review.Type 2) (eq .Review.Type 3)}} timeline-avatar-offset{{end}}"{{if gt .Poster.ID 0}} href="{{.Poster.HomeLink}}"{{end}}>
{{avatar $.Context .Poster}}
<a class="timeline-avatar{{if or (and (eq .Review.Type 1) (or .Content .Attachments)) (and (eq .Review.Type 2) (or .Content .Attachments)) (eq .Review.Type 3)}} timeline-avatar-offset{{end}}"{{if gt .Poster.ID 0}} href="{{.Poster.HomeLink}}"{{end}}>
{{avatar $.Context .Poster 40}}
</a>
{{end}}
<span class="badge{{if eq .Review.Type 1}} gt-bg-green gt-text-white{{else if eq .Review.Type 3}} gt-bg-red gt-text-white{{end}}">{{svg (printf "octicon-%s" .Review.Type.Icon)}}</span>
Expand Down Expand Up @@ -413,7 +415,7 @@
<div class="comment-header-left gt-df gt-ac">
{{if gt .Poster.ID 0}}
<a class="inline-timeline-avatar" href="{{.Poster.HomeLink}}">
{{avatar $.Context .Poster}}
{{avatar $.Context .Poster 24}}
</a>
{{end}}
<span class="text grey muted-links">
Expand Down Expand Up @@ -768,7 +770,7 @@
<div class="timeline-item-group">
<div class="timeline-item event" id="{{.HashTag}}">
<a class="timeline-avatar"{{if gt .Poster.ID 0}} href="{{.Poster.HomeLink}}"{{end}}>
<img src="{{.Poster.AvatarLink $.Context}}">
<img src="{{.Poster.AvatarLink $.Context}}" width="40" height="40">
</a>
<span class="badge grey">{{svg "octicon-x" 16}}</span>
{{template "shared/user/avatarlink" dict "Context" $.Context "user" .Poster}}
Expand All @@ -789,7 +791,7 @@
<div class="ui top attached header comment-header-left gt-df gt-ac arrow-top">
{{if gt .Poster.ID 0}}
<a class="inline-timeline-avatar" href="{{.Poster.HomeLink}}">
{{avatar $.Context .Poster}}
{{avatar $.Context .Poster 24}}
</a>
{{end}}
<span class="text grey muted-links">
Expand Down
2 changes: 1 addition & 1 deletion templates/repo/issue/view_content/pull.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@
{{- else if .Issue.PullRequest.IsChecking}}yellow
{{- else if .Issue.PullRequest.IsEmpty}}grey
{{- else if .Issue.PullRequest.CanAutoMerge}}green
{{- else}}red{{end}}">{{svg "octicon-git-merge" 32}}</a>
{{- else}}red{{end}}">{{svg "octicon-git-merge" 40}}</a>
<div class="content">
{{template "repo/pulls/status" .}}
{{$showGeneralMergeForm := false}}
Expand Down
2 changes: 1 addition & 1 deletion templates/shared/issuelist.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@
<div class="issue-item-icon-right text grey">
{{range .Assignees}}
<a class="ui assignee gt-tdn" href="{{.HomeLink}}" data-tooltip-content="{{.GetDisplayName}}">
{{avatar $.Context .}}
{{avatar $.Context . 20}}
</a>
{{end}}
</div>
Expand Down
5 changes: 0 additions & 5 deletions web_src/css/base.css
Original file line number Diff line number Diff line change
Expand Up @@ -1903,11 +1903,6 @@ img.ui.avatar,
color: var(--color-text-light);
}

.repo-title .avatar {
width: 32px !important;
height: 32px !important;
}

.repo-title .labels {
margin-left: 0.5rem;
}
Expand Down
2 changes: 1 addition & 1 deletion web_src/css/organization.css
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@

.organization.members .list .item .ui.avatar {
width: 48px;
height: auto;
height: 48px;
margin-right: 1rem;
align-self: flex-start;
}
Expand Down
20 changes: 9 additions & 11 deletions web_src/css/repository.css
Original file line number Diff line number Diff line change
Expand Up @@ -788,18 +788,14 @@
left: -68px;
}

.repository.view.issue .comment-list .timeline-item .timeline-avatar img {
width: 40px !important;
height: 40px !important;
}

/* Don't show the mobile oriented avatar ".inline-timeline-avatar" on desktop. Desktop uses the avatar with class ".timeline-avatar" */
.repository.view.issue .comment-list .timeline-item .inline-timeline-avatar {
display: none;
}

.repository.view.issue .comment-list .timeline-item img.avatar,
.repository.view.issue .comment-list .timeline-item .avatar img {
/* size adjustment is necessary until fomantic comment module removal */
.repository.view.issue .comment-list .timeline-item .comment-code-cloud img.avatar,
.repository.view.issue .comment-list .timeline-item .comment-code-cloud .avatar img {
width: 20px;
height: 20px;
vertical-align: middle;
Expand Down Expand Up @@ -1094,6 +1090,7 @@
margin-left: 3em;
}

/* size adjustment is necessary until fomantic comment module removal */
.repository.view.issue .comment-code-cloud .comment-list .code-comment img.avatar,
.repository.view.issue .comment-code-cloud .comment-list .comment img.avatar {
width: 28px;
Expand Down Expand Up @@ -1150,6 +1147,10 @@
text-decoration: line-through;
}

.ui.comments .comment .avatar {
margin: 0;
}

.repository .comment.form .ui.comments {
margin-top: -12px;
max-width: 100%;
Expand Down Expand Up @@ -3085,6 +3086,7 @@ td.blob-excerpt {
}

.sidebar-item-link {
display: inline-flex;
align-items: center;
word-break: break-all;
}
Expand Down Expand Up @@ -3260,10 +3262,6 @@ td.blob-excerpt {
margin-left: 6px;
margin-right: 2px;
}
.repository.view.issue .comment-list .timeline .inline-timeline-avatar img.avatar {
height: 24px;
width: 24px;
}
.repository.view.issue .comment-list .timeline .comment-header {
padding-left: 4px;
}
Expand Down
2 changes: 0 additions & 2 deletions web_src/css/shared/issuelist.css
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,6 @@
}

.issue.list > .item .assignee img {
width: 20px;
height: 20px;
margin-right: 2px;
}

Expand Down