mirror of
https://github.com/go-gitea/gitea
synced 2025-07-22 18:28:37 +00:00
Direct avatar rendering (#13649)
* Direct avatar rendering This adds new template helpers for avatar rendering which output image elements with direct links to avatars which makes them cacheable by the browsers. This should be a major performance improvment for pages with many avatars. * fix avatars of other user's profile pages * fix top border on user avatar name * uncircle avatars * remove old incomplete avatar selector * use title attribute for name and add it back on blame * minor refactor * tweak comments * fix url path join and adjust test to new result * dedupe functions
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
{{range .Feeds}}
|
||||
<div class="news">
|
||||
<div class="ui left">
|
||||
<img class="ui avatar image" src="{{.GetActAvatar}}" alt="">
|
||||
{{avatar .ActUser}}
|
||||
</div>
|
||||
<div class="ui grid">
|
||||
<div class="ui fourteen wide column">
|
||||
@@ -84,7 +84,13 @@
|
||||
{{if $push.Commits}}
|
||||
{{range $push.Commits}}
|
||||
{{ $commitLink := printf "%s/commit/%s" $repoLink .Sha1}}
|
||||
<li><img class="img-8" src="{{$push.AvatarLink .AuthorEmail}}"> <a class="commit-id" href="{{$commitLink}}">{{ShortSha .Sha1}}</a> <span class="text truncate light grey">{{RenderCommitMessage .Message $repoLink $.ComposeMetas}}</span></li>
|
||||
<li>
|
||||
{{avatarByEmail .AuthorEmail .AuthorName 28 "img-8 mr-2"}}
|
||||
<a class="commit-id mr-2" href="{{$commitLink}}">{{ShortSha .Sha1}}</a>
|
||||
<span class="text truncate light grey">
|
||||
{{RenderCommitMessage .Message $repoLink $.ComposeMetas}}
|
||||
</span>
|
||||
</li>
|
||||
{{end}}
|
||||
{{end}}
|
||||
{{if and (gt $push.Len 1) $push.CompareURL}}<li><a href="{{AppSubUrl}}/{{$push.CompareURL}}">{{$.i18n.Tr "action.compare_commits" $push.Len}} »</a></li>{{end}}
|
||||
|
@@ -3,7 +3,7 @@
|
||||
<div class="item">
|
||||
<div class="ui floating dropdown link jump">
|
||||
<span class="text">
|
||||
<img class="ui avatar image" src="{{.ContextUser.RelAvatarLink}}" title="{{.ContextUser.Name}}" width="28" height="28">
|
||||
{{avatar .ContextUser}}
|
||||
{{.ContextUser.ShortName 20}}
|
||||
{{if .ContextUser.IsOrganization}}
|
||||
<span class="org-visibility">
|
||||
@@ -19,12 +19,11 @@
|
||||
</div>
|
||||
<div class="scrolling menu items">
|
||||
<a class="{{if eq .ContextUser.ID .SignedUser.ID}}active selected{{end}} item" href="{{AppSubUrl}}/{{if .PageIsIssues}}issues{{else if .PageIsPulls}}pulls{{else if .PageIsMilestonesDashboard}}milestones{{end}}">
|
||||
<img class="ui avatar image" src="{{.SignedUser.RelAvatarLink}}" width="28" height="28">
|
||||
{{.SignedUser.Name}}
|
||||
{{avatar .SignedUser}}
|
||||
</a>
|
||||
{{range .Orgs}}
|
||||
<a class="{{if eq $.ContextUser.ID .ID}}active selected{{end}} item" title="{{.Name}}" href="{{AppSubUrl}}/org/{{.Name}}/{{if $.PageIsIssues}}issues{{else if $.PageIsPulls}}pulls{{else if $.PageIsMilestonesDashboard}}milestones{{else}}dashboard{{end}}">
|
||||
<img class="ui avatar image" src="{{.RelAvatarLink}}" width="28" height="28">
|
||||
{{avatar .}}
|
||||
{{.ShortName 20}}
|
||||
<span class="org-visibility">
|
||||
{{if .Visibility.IsLimited}}<div class="ui orange tiny horizontal label">{{$.i18n.Tr "org.settings.visibility.limited_shortname"}}</div>{{end}}
|
||||
|
Reference in New Issue
Block a user