summaryrefslogtreecommitdiffstats
path: root/templates
diff options
context:
space:
mode:
authorsilverwind <me@silverwind.io>2023-05-14 16:15:59 +0200
committerGitHub <noreply@github.com>2023-05-14 14:15:59 +0000
commitb92c142c97c3add1aed736a0a7c7ab044588662d (patch)
tree48e288869deab0664189cf7beab0ab486eace02c /templates
parent3af2c8e4ab4dca53a16ead9940a0ac4752072045 (diff)
downloadgitea-b92c142c97c3add1aed736a0a7c7ab044588662d.tar.gz
gitea-b92c142c97c3add1aed736a0a7c7ab044588662d.zip
Clean up various avatar dimensions (#24701)
Clean up a few cases where avatar dimensions were overwritten via CSS, which were no longer needed or were possible to set via HTML width. Also included are two small fixes: - Fix one more case of incorrect avatar offset on review timeline - Vertically center avatars in review sidebar There is more to be done here, but some of the work depends on Fomantic `comment` module removal, or in the case of org member lists, a refactor of the `avatarlink` template to accept a size. <img width="371" alt="image" src="https://github.com/go-gitea/gitea/assets/115237/9c5902fb-2b89-4a7d-a152-60e74c3b2c56"> <img width="306" alt="image" src="https://github.com/go-gitea/gitea/assets/115237/c8d92e2a-91c9-4f4a-a7de-6ae1a6bc0479"> --------- Co-authored-by: Giteabot <teabot@gitea.io>
Diffstat (limited to 'templates')
-rw-r--r--templates/repo/commits_list_small.tmpl4
-rw-r--r--templates/repo/issue/view_content.tmpl10
-rw-r--r--templates/repo/issue/view_content/comments.tmpl22
-rw-r--r--templates/repo/issue/view_content/pull.tmpl2
-rw-r--r--templates/shared/issuelist.tmpl2
5 files changed, 22 insertions, 18 deletions
diff --git a/templates/repo/commits_list_small.tmpl b/templates/repo/commits_list_small.tmpl
index 5bc159de81..900d853601 100644
--- a/templates/repo/commits_list_small.tmpl
+++ b/templates/repo/commits_list_small.tmpl
@@ -15,7 +15,7 @@
{{$commitLink:= printf "%s/commit/%s" $.comment.Issue.PullRequest.BaseRepo.Link (PathEscape .ID.String)}}
- <span class="ui float right shabox">
+ <span class="ui float right shabox gt-df gt-ac">
{{template "repo/commit_statuses" dict "Status" .Status "Statuses" .Statuses "root" $.root}}
{{$class := "ui sha label"}}
{{if .Signature}}
@@ -32,7 +32,7 @@
{{$class = (printf "%s%s" $class " isWarning")}}
{{end}}
{{end}}
- <a href="{{$commitLink}}" rel="nofollow" class="{{$class}}">
+ <a href="{{$commitLink}}" rel="nofollow" class="gt-ml-3 {{$class}}">
<span class="shortsha">{{ShortSha .ID.String}}</span>
{{if .Signature}}
{{template "repo/shabox_badge" dict "root" $.root "verification" .Verification}}
diff --git a/templates/repo/issue/view_content.tmpl b/templates/repo/issue/view_content.tmpl
index e9a82425ba..c54b29dcd6 100644
--- a/templates/repo/issue/view_content.tmpl
+++ b/templates/repo/issue/view_content.tmpl
@@ -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">
@@ -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}}
@@ -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">
diff --git a/templates/repo/issue/view_content/comments.tmpl b/templates/repo/issue/view_content/comments.tmpl
index ab499f346a..32ce8bad94 100644
--- a/templates/repo/issue/view_content/comments.tmpl
+++ b/templates/repo/issue/view_content/comments.tmpl
@@ -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">
@@ -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">
@@ -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>
@@ -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">
@@ -482,7 +484,7 @@
{{range $filename, $lines := .Review.CodeComments}}
{{range $line, $comms := $lines}}
<div class="ui segments">
- <div class="ui segment gt-py-3 gt-df gt-ac gt-sb">
+ <div class="ui segment collapsible-comment-box gt-py-3 gt-df gt-ac gt-sb">
{{$invalid := (index $comms 0).Invalidated}}
{{$resolved := (index $comms 0).IsResolved}}
{{$resolveDoer := (index $comms 0).ResolveDoer}}
@@ -541,7 +543,7 @@
<div class="comment-header-left gt-df gt-ac">
{{if not .OriginalAuthor}}
<a class="avatar">
- {{avatar $.Context .Poster}}
+ {{avatar $.Context .Poster 20}}
</a>
{{end}}
<span class="text grey muted-links">
@@ -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}}
@@ -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">
diff --git a/templates/repo/issue/view_content/pull.tmpl b/templates/repo/issue/view_content/pull.tmpl
index 907ee19857..5325c710b4 100644
--- a/templates/repo/issue/view_content/pull.tmpl
+++ b/templates/repo/issue/view_content/pull.tmpl
@@ -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}}
diff --git a/templates/shared/issuelist.tmpl b/templates/shared/issuelist.tmpl
index 3b35471081..71d9059c1e 100644
--- a/templates/shared/issuelist.tmpl
+++ b/templates/shared/issuelist.tmpl
@@ -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>