1
0
mirror of https://github.com/go-gitea/gitea.git synced 2024-11-04 08:17:24 -05:00

Use template context function for avatar rendering (#26385)

Introduce `AvatarUtils`, no need to pass `$.Context` to every
sub-template, and simplify the template helper functions.
This commit is contained in:
wxiaoguang 2023-08-10 11:19:39 +08:00 committed by GitHub
parent 36eb3c433a
commit a370efc13f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
54 changed files with 162 additions and 155 deletions

View File

@ -141,6 +141,7 @@ func Contexter() func(next http.Handler) http.Handler {
// TODO: "install.go" also shares the same logic, which should be refactored to a general function // TODO: "install.go" also shares the same logic, which should be refactored to a general function
ctx.TemplateContext = NewTemplateContext(ctx) ctx.TemplateContext = NewTemplateContext(ctx)
ctx.TemplateContext["Locale"] = ctx.Locale ctx.TemplateContext["Locale"] = ctx.Locale
ctx.TemplateContext["AvatarUtils"] = templates.NewAvatarUtils(ctx)
ctx.Data.MergeFrom(middleware.CommonTemplateContextData()) ctx.Data.MergeFrom(middleware.CommonTemplateContextData())
ctx.Data["Context"] = ctx // TODO: use "ctx" in template and remove this ctx.Data["Context"] = ctx // TODO: use "ctx" in template and remove this

View File

@ -53,10 +53,7 @@ func NewFuncMap() template.FuncMap {
// ----------------------------------------------------------------- // -----------------------------------------------------------------
// svg / avatar / icon // svg / avatar / icon
"svg": svg.RenderHTML, "svg": svg.RenderHTML,
"avatar": Avatar,
"avatarHTML": AvatarHTML, "avatarHTML": AvatarHTML,
"avatarByAction": AvatarByAction,
"avatarByEmail": AvatarByEmail,
"EntryIcon": base.EntryIcon, "EntryIcon": base.EntryIcon,
"MigrationIcon": MigrationIcon, "MigrationIcon": MigrationIcon,
"ActionIcon": ActionIcon, "ActionIcon": ActionIcon,

View File

@ -18,6 +18,14 @@ import (
"code.gitea.io/gitea/modules/setting" "code.gitea.io/gitea/modules/setting"
) )
type AvatarUtils struct {
ctx context.Context
}
func NewAvatarUtils(ctx context.Context) *AvatarUtils {
return &AvatarUtils{ctx: ctx}
}
// AvatarHTML creates the HTML for an avatar // AvatarHTML creates the HTML for an avatar
func AvatarHTML(src string, size int, class, name string) template.HTML { func AvatarHTML(src string, size int, class, name string) template.HTML {
sizeStr := fmt.Sprintf(`%d`, size) sizeStr := fmt.Sprintf(`%d`, size)
@ -30,44 +38,44 @@ func AvatarHTML(src string, size int, class, name string) template.HTML {
} }
// Avatar renders user avatars. args: user, size (int), class (string) // Avatar renders user avatars. args: user, size (int), class (string)
func Avatar(ctx context.Context, item any, others ...any) template.HTML { func (au *AvatarUtils) Avatar(item any, others ...any) template.HTML {
size, class := gitea_html.ParseSizeAndClass(avatars.DefaultAvatarPixelSize, avatars.DefaultAvatarClass, others...) size, class := gitea_html.ParseSizeAndClass(avatars.DefaultAvatarPixelSize, avatars.DefaultAvatarClass, others...)
switch t := item.(type) { switch t := item.(type) {
case *user_model.User: case *user_model.User:
src := t.AvatarLinkWithSize(ctx, size*setting.Avatar.RenderedSizeFactor) src := t.AvatarLinkWithSize(au.ctx, size*setting.Avatar.RenderedSizeFactor)
if src != "" { if src != "" {
return AvatarHTML(src, size, class, t.DisplayName()) return AvatarHTML(src, size, class, t.DisplayName())
} }
case *repo_model.Collaborator: case *repo_model.Collaborator:
src := t.AvatarLinkWithSize(ctx, size*setting.Avatar.RenderedSizeFactor) src := t.AvatarLinkWithSize(au.ctx, size*setting.Avatar.RenderedSizeFactor)
if src != "" { if src != "" {
return AvatarHTML(src, size, class, t.DisplayName()) return AvatarHTML(src, size, class, t.DisplayName())
} }
case *organization.Organization: case *organization.Organization:
src := t.AsUser().AvatarLinkWithSize(ctx, size*setting.Avatar.RenderedSizeFactor) src := t.AsUser().AvatarLinkWithSize(au.ctx, size*setting.Avatar.RenderedSizeFactor)
if src != "" { if src != "" {
return AvatarHTML(src, size, class, t.AsUser().DisplayName()) return AvatarHTML(src, size, class, t.AsUser().DisplayName())
} }
} }
return template.HTML("") return ""
} }
// AvatarByAction renders user avatars from action. args: action, size (int), class (string) // AvatarByAction renders user avatars from action. args: action, size (int), class (string)
func AvatarByAction(ctx context.Context, action *activities_model.Action, others ...any) template.HTML { func (au *AvatarUtils) AvatarByAction(action *activities_model.Action, others ...any) template.HTML {
action.LoadActUser(ctx) action.LoadActUser(au.ctx)
return Avatar(ctx, action.ActUser, others...) return au.Avatar(action.ActUser, others...)
} }
// AvatarByEmail renders avatars by email address. args: email, name, size (int), class (string) // AvatarByEmail renders avatars by email address. args: email, name, size (int), class (string)
func AvatarByEmail(ctx context.Context, email, name string, others ...any) template.HTML { func (au *AvatarUtils) AvatarByEmail(email, name string, others ...any) template.HTML {
size, class := gitea_html.ParseSizeAndClass(avatars.DefaultAvatarPixelSize, avatars.DefaultAvatarClass, others...) size, class := gitea_html.ParseSizeAndClass(avatars.DefaultAvatarPixelSize, avatars.DefaultAvatarClass, others...)
src := avatars.GenerateEmailAvatarFastLink(ctx, email, size*setting.Avatar.RenderedSizeFactor) src := avatars.GenerateEmailAvatarFastLink(au.ctx, email, size*setting.Avatar.RenderedSizeFactor)
if src != "" { if src != "" {
return AvatarHTML(src, size, class, name) return AvatarHTML(src, size, class, name)
} }
return template.HTML("") return ""
} }

View File

@ -235,6 +235,7 @@ func renderBlame(ctx *context.Context, blameParts []git.BlamePart, commitNames m
var lexerName string var lexerName string
avatarUtils := templates.NewAvatarUtils(ctx)
i := 0 i := 0
commitCnt := 0 commitCnt := 0
for _, part := range blameParts { for _, part := range blameParts {
@ -257,9 +258,9 @@ func renderBlame(ctx *context.Context, blameParts []git.BlamePart, commitNames m
var avatar string var avatar string
if commit.User != nil { if commit.User != nil {
avatar = string(templates.Avatar(ctx, commit.User, 18, "gt-mr-3")) avatar = string(avatarUtils.Avatar(commit.User, 18, "gt-mr-3"))
} else { } else {
avatar = string(templates.AvatarByEmail(ctx, commit.Author.Email, commit.Author.Name, 18, "gt-mr-3")) avatar = string(avatarUtils.AvatarByEmail(commit.Author.Email, commit.Author.Name, 18, "gt-mr-3"))
} }
br.Avatar = gotemplate.HTML(avatar) br.Avatar = gotemplate.HTML(avatar)

View File

@ -57,7 +57,7 @@
{{if and .IsSigned .MustChangePassword}} {{if and .IsSigned .MustChangePassword}}
<div class="ui dropdown jump item" data-tooltip-content="{{.locale.Tr "user_profile_and_more"}}"> <div class="ui dropdown jump item" data-tooltip-content="{{.locale.Tr "user_profile_and_more"}}">
<span class="text gt-df gt-ac"> <span class="text gt-df gt-ac">
{{avatar $.Context .SignedUser 24 "gt-mr-2"}} {{ctx.AvatarUtils.Avatar .SignedUser 24 "gt-mr-2"}}
<span class="mobile-only gt-ml-3">{{.SignedUser.Name}}</span> <span class="mobile-only gt-ml-3">{{.SignedUser.Name}}</span>
<span class="not-mobile">{{svg "octicon-triangle-down"}}</span> <span class="not-mobile">{{svg "octicon-triangle-down"}}</span>
</span> </span>
@ -143,7 +143,7 @@
<div class="ui dropdown jump item gt-mx-0 gt-pr-3" data-tooltip-content="{{.locale.Tr "user_profile_and_more"}}"> <div class="ui dropdown jump item gt-mx-0 gt-pr-3" data-tooltip-content="{{.locale.Tr "user_profile_and_more"}}">
<span class="text gt-df gt-ac"> <span class="text gt-df gt-ac">
{{avatar $.Context .SignedUser 24 "gt-mr-2"}} {{ctx.AvatarUtils.Avatar .SignedUser 24 "gt-mr-2"}}
<span class="mobile-only gt-ml-3">{{.SignedUser.Name}}</span> <span class="mobile-only gt-ml-3">{{.SignedUser.Name}}</span>
<span class="not-mobile">{{svg "octicon-triangle-down"}}</span> <span class="not-mobile">{{svg "octicon-triangle-down"}}</span>
</span> </span>

View File

@ -8,7 +8,7 @@
{{range .Users}} {{range .Users}}
<div class="flex-item flex-item-center"> <div class="flex-item flex-item-center">
<div class="flex-item-leading"> <div class="flex-item-leading">
{{avatar $.Context . 48}} {{ctx.AvatarUtils.Avatar . 48}}
</div> </div>
<div class="flex-item-main"> <div class="flex-item-main">
<div class="flex-item-title"> <div class="flex-item-title">

View File

@ -3,7 +3,7 @@
<div class="ui vertically grid head"> <div class="ui vertically grid head">
<div class="column"> <div class="column">
<div class="ui header"> <div class="ui header">
{{avatar $.Context . 100}} {{ctx.AvatarUtils.Avatar . 100}}
<span class="text thin grey"><a href="{{.HomeLink}}">{{.DisplayName}}</a></span> <span class="text thin grey"><a href="{{.HomeLink}}">{{.DisplayName}}</a></span>
<span class="org-visibility"> <span class="org-visibility">
{{if .Visibility.IsLimited}}<div class="ui medium basic horizontal label">{{$.locale.Tr "org.settings.visibility.limited_shortname"}}</div>{{end}} {{if .Visibility.IsLimited}}<div class="ui medium basic horizontal label">{{$.locale.Tr "org.settings.visibility.limited_shortname"}}</div>{{end}}

View File

@ -1,7 +1,7 @@
{{template "base/head" .}} {{template "base/head" .}}
<div role="main" aria-label="{{.Title}}" class="page-content organization profile"> <div role="main" aria-label="{{.Title}}" class="page-content organization profile">
<div class="ui container gt-df"> <div class="ui container gt-df">
{{avatar $.Context .Org 140 "org-avatar"}} {{ctx.AvatarUtils.Avatar .Org 140 "org-avatar"}}
<div id="org-info"> <div id="org-info">
<div class="ui header gt-df gt-fw"> <div class="ui header gt-df gt-fw">
{{.Org.DisplayName}} {{.Org.DisplayName}}
@ -61,7 +61,7 @@
{{$isMember := .IsOrganizationMember}} {{$isMember := .IsOrganizationMember}}
{{range .Members}} {{range .Members}}
{{if or $isMember (call $.IsPublicMember .ID)}} {{if or $isMember (call $.IsPublicMember .ID)}}
<a href="{{.HomeLink}}" title="{{.Name}}{{if .FullName}} ({{.FullName}}){{end}}">{{avatar $.Context . 48}}</a> <a href="{{.HomeLink}}" title="{{.Name}}{{if .FullName}} ({{.FullName}}){{end}}">{{ctx.AvatarUtils.Avatar . 48}}</a>
{{end}} {{end}}
{{end}} {{end}}
</div> </div>

View File

@ -9,7 +9,7 @@
{{$isPublic := index $.MembersIsPublicMember .ID}} {{$isPublic := index $.MembersIsPublicMember .ID}}
<div class="flex-item {{if $.PublicOnly}}flex-item-center{{end}}"> <div class="flex-item {{if $.PublicOnly}}flex-item-center{{end}}">
<div class="flex-item-leading"> <div class="flex-item-leading">
<a href="{{.HomeLink}}">{{avatar $.Context . 48}}</a> <a href="{{.HomeLink}}">{{ctx.AvatarUtils.Avatar . 48}}</a>
</div> </div>
<div class="flex-item-main"> <div class="flex-item-main">
<div class="flex-item-title"> <div class="flex-item-title">

View File

@ -4,7 +4,7 @@
{{template "base/alert" .}} {{template "base/alert" .}}
<div class="ui centered card"> <div class="ui centered card">
<div class="image"> <div class="image">
{{avatar $.Context .Organization 140}} {{ctx.AvatarUtils.Avatar .Organization 140}}
</div> </div>
<div class="content"> <div class="content">
<div class="header">{{.locale.Tr "org.teams.invite.title" .Team.Name .Organization.Name | Str2html}}</div> <div class="header">{{.locale.Tr "org.teams.invite.title" .Team.Name .Organization.Name | Str2html}}</div>

View File

@ -26,7 +26,7 @@
{{range .Team.Members}} {{range .Team.Members}}
<div class="flex-item flex-item-center"> <div class="flex-item flex-item-center">
<div class="flex-item-leading"> <div class="flex-item-leading">
<a href="{{.HomeLink}}">{{avatar $.Context . 32}}</a> <a href="{{.HomeLink}}">{{ctx.AvatarUtils.Avatar . 32}}</a>
</div> </div>
<div class="flex-item-main"> <div class="flex-item-main">
<div class="flex-item-title"> <div class="flex-item-title">

View File

@ -32,7 +32,7 @@
</div> </div>
<div class="ui attached segment members"> <div class="ui attached segment members">
{{range .Members}} {{range .Members}}
{{template "shared/user/avatarlink" dict "Context" $.Context "user" .}} {{template "shared/user/avatarlink" dict "user" .}}
{{end}} {{end}}
</div> </div>
<div class="ui bottom attached header"> <div class="ui bottom attached header">

View File

@ -234,7 +234,7 @@
{{end}} {{end}}
<div class="right floated"> <div class="right floated">
{{range .Assignees}} {{range .Assignees}}
<a target="_blank" href="{{.HomeLink}}" data-tooltip-content="{{$.locale.Tr "repo.projects.column.assigned_to"}} {{.Name}}">{{avatar $.Context . 28 "mini gt-mr-3"}}</a> <a target="_blank" href="{{.HomeLink}}" data-tooltip-content="{{$.locale.Tr "repo.projects.column.assigned_to"}} {{.Name}}">{{ctx.AvatarUtils.Avatar . 28 "mini gt-mr-3"}}</a>
{{end}} {{end}}
</div> </div>
</div> </div>

View File

@ -33,7 +33,7 @@
</a> </a>
{{range .Actors}} {{range .Actors}}
<a class="item{{if eq .ID $.CurActor}} active{{end}}" href="{{$.Link}}?workflow={{$.CurWorkflow}}&actor={{.ID}}&status={{$.CurStatus}}"> <a class="item{{if eq .ID $.CurActor}} active{{end}}" href="{{$.Link}}?workflow={{$.CurWorkflow}}&actor={{.ID}}&status={{$.CurStatus}}">
{{avatar $.Context . 20}} {{.GetDisplayName}} {{ctx.AvatarUtils.Avatar . 20}} {{.GetDisplayName}}
</a> </a>
{{end}} {{end}}
</div> </div>

View File

@ -27,7 +27,7 @@
<button class="btn interact-fg gt-p-3" data-clipboard-text="{{.DefaultBranchBranch.DBBranch.Name}}">{{svg "octicon-copy" 14}}</button> <button class="btn interact-fg gt-p-3" data-clipboard-text="{{.DefaultBranchBranch.DBBranch.Name}}">{{svg "octicon-copy" 14}}</button>
{{template "repo/commit_statuses" dict "Status" (index $.CommitStatus .DefaultBranchBranch.DBBranch.CommitID) "Statuses" (index $.CommitStatuses .DefaultBranchBranch.DBBranch.CommitID)}} {{template "repo/commit_statuses" dict "Status" (index $.CommitStatus .DefaultBranchBranch.DBBranch.CommitID) "Statuses" (index $.CommitStatuses .DefaultBranchBranch.DBBranch.CommitID)}}
</div> </div>
<p class="info gt-df gt-ac gt-my-2">{{svg "octicon-git-commit" 16 "gt-mr-2"}}<a href="{{.RepoLink}}/commit/{{PathEscape .DefaultBranchBranch.DBBranch.CommitID}}">{{ShortSha .DefaultBranchBranch.DBBranch.CommitID}}</a> · <span class="commit-message">{{RenderCommitMessage $.Context .DefaultBranchBranch.DBBranch.CommitMessage .RepoLink .Repository.ComposeMetas}}</span> · {{.locale.Tr "org.repo_updated"}} {{TimeSince .DefaultBranchBranch.DBBranch.CommitTime.AsTime .locale}}{{if .DefaultBranchBranch.DBBranch.Pusher}} &nbsp;{{template "shared/user/avatarlink" dict "Context" $.Context "user" .DefaultBranchBranch.DBBranch.Pusher}}{{template "shared/user/namelink" .DefaultBranchBranch.DBBranch.Pusher}}{{end}}</p> <p class="info gt-df gt-ac gt-my-2">{{svg "octicon-git-commit" 16 "gt-mr-2"}}<a href="{{.RepoLink}}/commit/{{PathEscape .DefaultBranchBranch.DBBranch.CommitID}}">{{ShortSha .DefaultBranchBranch.DBBranch.CommitID}}</a> · <span class="commit-message">{{RenderCommitMessage $.Context .DefaultBranchBranch.DBBranch.CommitMessage .RepoLink .Repository.ComposeMetas}}</span> · {{.locale.Tr "org.repo_updated"}} {{TimeSince .DefaultBranchBranch.DBBranch.CommitTime.AsTime .locale}}{{if .DefaultBranchBranch.DBBranch.Pusher}} &nbsp;{{template "shared/user/avatarlink" dict "user" .DefaultBranchBranch.DBBranch.Pusher}}{{template "shared/user/namelink" .DefaultBranchBranch.DBBranch.Pusher}}{{end}}</p>
</td> </td>
<td class="right aligned middle aligned overflow-visible"> <td class="right aligned middle aligned overflow-visible">
{{if and $.IsWriter (not $.Repository.IsArchived) (not .IsDeleted)}} {{if and $.IsWriter (not $.Repository.IsArchived) (not .IsDeleted)}}
@ -94,7 +94,7 @@
<button class="btn interact-fg gt-p-3" data-clipboard-text="{{.DBBranch.Name}}">{{svg "octicon-copy" 14}}</button> <button class="btn interact-fg gt-p-3" data-clipboard-text="{{.DBBranch.Name}}">{{svg "octicon-copy" 14}}</button>
{{template "repo/commit_statuses" dict "Status" (index $.CommitStatus .DBBranch.CommitID) "Statuses" (index $.CommitStatuses .DBBranch.CommitID)}} {{template "repo/commit_statuses" dict "Status" (index $.CommitStatus .DBBranch.CommitID) "Statuses" (index $.CommitStatuses .DBBranch.CommitID)}}
</div> </div>
<p class="info gt-df gt-ac gt-my-2">{{svg "octicon-git-commit" 16 "gt-mr-2"}}<a href="{{$.RepoLink}}/commit/{{PathEscape .DBBranch.CommitID}}">{{ShortSha .DBBranch.CommitID}}</a> · <span class="commit-message">{{RenderCommitMessage $.Context .DBBranch.CommitMessage $.RepoLink $.Repository.ComposeMetas}}</span> · {{$.locale.Tr "org.repo_updated"}} {{TimeSince .DBBranch.CommitTime.AsTime $.locale}}{{if .DBBranch.Pusher}} &nbsp;{{template "shared/user/avatarlink" dict "Context" $.Context "user" .DBBranch.Pusher}} &nbsp;{{template "shared/user/namelink" .DBBranch.Pusher}}{{end}}</p> <p class="info gt-df gt-ac gt-my-2">{{svg "octicon-git-commit" 16 "gt-mr-2"}}<a href="{{$.RepoLink}}/commit/{{PathEscape .DBBranch.CommitID}}">{{ShortSha .DBBranch.CommitID}}</a> · <span class="commit-message">{{RenderCommitMessage $.Context .DBBranch.CommitMessage $.RepoLink $.Repository.ComposeMetas}}</span> · {{$.locale.Tr "org.repo_updated"}} {{TimeSince .DBBranch.CommitTime.AsTime $.locale}}{{if .DBBranch.Pusher}} &nbsp;{{template "shared/user/avatarlink" dict "user" .DBBranch.Pusher}} &nbsp;{{template "shared/user/namelink" .DBBranch.Pusher}}{{end}}</p>
{{end}} {{end}}
</td> </td>
<td class="two wide ui"> <td class="two wide ui">

View File

@ -142,24 +142,24 @@
<div class="ui attached segment gt-df gt-ac gt-sb gt-py-2 commit-header-row gt-fw {{$class}}"> <div class="ui attached segment gt-df gt-ac gt-sb gt-py-2 commit-header-row gt-fw {{$class}}">
<div class="gt-df gt-ac author"> <div class="gt-df gt-ac author">
{{if .Author}} {{if .Author}}
{{avatar $.Context .Author 28 "gt-mr-3"}} {{ctx.AvatarUtils.Avatar .Author 28 "gt-mr-3"}}
{{if .Author.FullName}} {{if .Author.FullName}}
<a href="{{.Author.HomeLink}}"><strong>{{.Author.FullName}}</strong></a> <a href="{{.Author.HomeLink}}"><strong>{{.Author.FullName}}</strong></a>
{{else}} {{else}}
<a href="{{.Author.HomeLink}}"><strong>{{.Commit.Author.Name}}</strong></a> <a href="{{.Author.HomeLink}}"><strong>{{.Commit.Author.Name}}</strong></a>
{{end}} {{end}}
{{else}} {{else}}
{{avatarByEmail $.Context .Commit.Author.Email .Commit.Author.Email 28 "gt-mr-3"}} {{ctx.AvatarUtils.AvatarByEmail .Commit.Author.Email .Commit.Author.Email 28 "gt-mr-3"}}
<strong>{{.Commit.Author.Name}}</strong> <strong>{{.Commit.Author.Name}}</strong>
{{end}} {{end}}
<span class="text grey gt-ml-3" id="authored-time">{{TimeSince .Commit.Author.When $.locale}}</span> <span class="text grey gt-ml-3" id="authored-time">{{TimeSince .Commit.Author.When $.locale}}</span>
{{if or (ne .Commit.Committer.Name .Commit.Author.Name) (ne .Commit.Committer.Email .Commit.Author.Email)}} {{if or (ne .Commit.Committer.Name .Commit.Author.Name) (ne .Commit.Committer.Email .Commit.Author.Email)}}
<span class="text grey gt-mx-3">{{.locale.Tr "repo.diff.committed_by"}}</span> <span class="text grey gt-mx-3">{{.locale.Tr "repo.diff.committed_by"}}</span>
{{if ne .Verification.CommittingUser.ID 0}} {{if ne .Verification.CommittingUser.ID 0}}
{{avatar $.Context .Verification.CommittingUser 28 "gt-mx-3"}} {{ctx.AvatarUtils.Avatar .Verification.CommittingUser 28 "gt-mx-3"}}
<a href="{{.Verification.CommittingUser.HomeLink}}"><strong>{{.Commit.Committer.Name}}</strong></a> <a href="{{.Verification.CommittingUser.HomeLink}}"><strong>{{.Commit.Committer.Name}}</strong></a>
{{else}} {{else}}
{{avatarByEmail $.Context .Commit.Committer.Email .Commit.Committer.Name 28 "gt-mr-3"}} {{ctx.AvatarUtils.AvatarByEmail .Commit.Committer.Email .Commit.Committer.Name 28 "gt-mr-3"}}
<strong>{{.Commit.Committer.Name}}</strong> <strong>{{.Commit.Committer.Name}}</strong>
{{end}} {{end}}
{{end}} {{end}}
@ -196,12 +196,12 @@
{{else}} {{else}}
<span class="ui text gt-mr-3">{{.locale.Tr "repo.commits.signed_by_untrusted_user_unmatched"}}:</span> <span class="ui text gt-mr-3">{{.locale.Tr "repo.commits.signed_by_untrusted_user_unmatched"}}:</span>
{{end}} {{end}}
{{avatar $.Context .Verification.SigningUser 28 "gt-mr-3"}} {{ctx.AvatarUtils.Avatar .Verification.SigningUser 28 "gt-mr-3"}}
<a href="{{.Verification.SigningUser.HomeLink}}"><strong>{{.Verification.SigningUser.GetDisplayName}}</strong></a> <a href="{{.Verification.SigningUser.HomeLink}}"><strong>{{.Verification.SigningUser.GetDisplayName}}</strong></a>
{{else}} {{else}}
<span title="{{.locale.Tr "gpg.default_key"}}">{{svg "gitea-lock-cog" 16 "gt-mr-3"}}</span> <span title="{{.locale.Tr "gpg.default_key"}}">{{svg "gitea-lock-cog" 16 "gt-mr-3"}}</span>
<span class="ui text gt-mr-3">{{.locale.Tr "repo.commits.signed_by"}}:</span> <span class="ui text gt-mr-3">{{.locale.Tr "repo.commits.signed_by"}}:</span>
{{avatarByEmail $.Context .Verification.SigningEmail "" 28}} {{ctx.AvatarUtils.AvatarByEmail .Verification.SigningEmail "" 28}}
<strong>{{.Verification.SigningUser.GetDisplayName}}</strong> <strong>{{.Verification.SigningUser.GetDisplayName}}</strong>
{{end}} {{end}}
{{else}} {{else}}

View File

@ -18,9 +18,9 @@
{{if .User.FullName}} {{if .User.FullName}}
{{$userName = .User.FullName}} {{$userName = .User.FullName}}
{{end}} {{end}}
{{avatar $.Context .User 28 "gt-mr-2"}}<a href="{{.User.HomeLink}}">{{$userName}}</a> {{ctx.AvatarUtils.Avatar .User 28 "gt-mr-2"}}<a href="{{.User.HomeLink}}">{{$userName}}</a>
{{else}} {{else}}
{{avatarByEmail $.Context .Author.Email .Author.Name 28 "gt-mr-2"}} {{ctx.AvatarUtils.AvatarByEmail .Author.Email .Author.Name 28 "gt-mr-2"}}
{{$userName}} {{$userName}}
{{end}} {{end}}
</td> </td>

View File

@ -6,9 +6,9 @@
<div class="singular-commit" id="{{$tag}}"> <div class="singular-commit" id="{{$tag}}">
<span class="badge badge-commit">{{svg "octicon-git-commit"}}</span> <span class="badge badge-commit">{{svg "octicon-git-commit"}}</span>
{{if .User}} {{if .User}}
<a class="avatar" href="{{.User.HomeLink}}">{{avatar $.root.Context .User}}</a> <a class="avatar" href="{{.User.HomeLink}}">{{ctx.AvatarUtils.Avatar .User}}</a>
{{else}} {{else}}
{{avatarByEmail $.root.Context .Author.Email .Author.Name}} {{ctx.AvatarUtils.AvatarByEmail .Author.Email .Author.Name}}
{{end}} {{end}}
{{$commitLink:= printf "%s/commit/%s" $.comment.Issue.PullRequest.BaseRepo.Link (PathEscape .ID.String)}} {{$commitLink:= printf "%s/commit/%s" $.comment.Issue.PullRequest.BaseRepo.Link (PathEscape .ID.String)}}

View File

@ -21,18 +21,18 @@
<div class="ui selection owner dropdown"> <div class="ui selection owner dropdown">
<input type="hidden" id="uid" name="uid" value="{{.ContextUser.ID}}" required> <input type="hidden" id="uid" name="uid" value="{{.ContextUser.ID}}" required>
<span class="text truncated-item-container" title="{{.ContextUser.Name}}"> <span class="text truncated-item-container" title="{{.ContextUser.Name}}">
{{avatar $.Context .ContextUser 28 "mini"}} {{ctx.AvatarUtils.Avatar .ContextUser 28 "mini"}}
<span class="truncated-item-name">{{.ContextUser.ShortName 40}}</span> <span class="truncated-item-name">{{.ContextUser.ShortName 40}}</span>
</span> </span>
{{svg "octicon-triangle-down" 14 "dropdown icon"}} {{svg "octicon-triangle-down" 14 "dropdown icon"}}
<div class="menu"> <div class="menu">
<div class="item truncated-item-container" data-value="{{.SignedUser.ID}}" title="{{.SignedUser.Name}}"> <div class="item truncated-item-container" data-value="{{.SignedUser.ID}}" title="{{.SignedUser.Name}}">
{{avatar $.Context .SignedUser 28 "mini"}} {{ctx.AvatarUtils.Avatar .SignedUser 28 "mini"}}
<span class="truncated-item-name">{{.SignedUser.ShortName 40}}</span> <span class="truncated-item-name">{{.SignedUser.ShortName 40}}</span>
</div> </div>
{{range .Orgs}} {{range .Orgs}}
<div class="item truncated-item-container" data-value="{{.ID}}" title="{{.Name}}"> <div class="item truncated-item-container" data-value="{{.ID}}" title="{{.Name}}">
{{avatar $.Context . 28 "mini"}} {{ctx.AvatarUtils.Avatar . 28 "mini"}}
<span class="truncated-item-name">{{.ShortName 40}}</span> <span class="truncated-item-name">{{.ShortName 40}}</span>
</div> </div>
{{end}} {{end}}

View File

@ -5,7 +5,7 @@
{{if .OriginalAuthor}} {{if .OriginalAuthor}}
<span class="avatar"><img src="{{AppSubUrl}}/assets/img/avatar_default.png"></span> <span class="avatar"><img src="{{AppSubUrl}}/assets/img/avatar_default.png"></span>
{{else}} {{else}}
{{template "shared/user/avatarlink" dict "Context" $.root.Context "user" .Poster}} {{template "shared/user/avatarlink" dict "user" .Poster}}
{{end}} {{end}}
<div class="content comment-container"> <div class="content comment-container">
<div class="ui top attached header comment-header gt-df gt-ac gt-sb"> <div class="ui top attached header comment-header gt-df gt-ac gt-sb">

View File

@ -1,5 +1,5 @@
<div class="commit-form-wrapper"> <div class="commit-form-wrapper">
{{avatar $.Context .SignedUser 48 "commit-avatar"}} {{ctx.AvatarUtils.Avatar .SignedUser 48 "commit-avatar"}}
<div class="commit-form"> <div class="commit-form">
<h3>{{- if .CanCommitToBranch.WillSign}} <h3>{{- if .CanCommitToBranch.WillSign}}
<span title="{{.locale.Tr "repo.signing.will_sign" .CanCommitToBranch.SigningKey}}">{{svg "octicon-lock" 24}}</span> <span title="{{.locale.Tr "repo.signing.will_sign" .CanCommitToBranch.SigningKey}}">{{svg "octicon-lock" 24}}</span>

View File

@ -7,7 +7,7 @@
</h2> </h2>
{{range .Forks}} {{range .Forks}}
<div class="gt-df gt-ac gt-py-3"> <div class="gt-df gt-ac gt-py-3">
<span class="gt-mr-2">{{avatar $.Context .Owner}}</span> <span class="gt-mr-2">{{ctx.AvatarUtils.Avatar .Owner}}</span>
<a href="{{.Owner.HomeLink}}">{{.Owner.Name}}</a> / <a href="{{.Link}}">{{.Name}}</a> <a href="{{.Owner.HomeLink}}">{{.Owner.Name}}</a> / <a href="{{.Link}}">{{.Name}}</a>
</div> </div>
{{end}} {{end}}

View File

@ -64,10 +64,10 @@
{{if $commit.User.FullName}} {{if $commit.User.FullName}}
{{$userName = $commit.User.FullName}} {{$userName = $commit.User.FullName}}
{{end}} {{end}}
<span class="gt-mr-2">{{avatar $.Context $commit.User}}</span> <span class="gt-mr-2">{{ctx.AvatarUtils.Avatar $commit.User}}</span>
<a href="{{$commit.User.HomeLink}}">{{$userName}}</a> <a href="{{$commit.User.HomeLink}}">{{$userName}}</a>
{{else}} {{else}}
<span class="gt-mr-2">{{avatarByEmail $.Context $commit.Commit.Author.Email $userName}}</span> <span class="gt-mr-2">{{ctx.AvatarUtils.AvatarByEmail $commit.Commit.Author.Email $userName}}</span>
{{$userName}} {{$userName}}
{{end}} {{end}}
</span> </span>

View File

@ -146,7 +146,7 @@
<div class="divider"></div> <div class="divider"></div>
{{range .Assignees}} {{range .Assignees}}
<a class="{{if eq $.AssigneeID .ID}}active selected{{end}} item gt-df" href="{{$.Link}}?type={{$.ViewType}}&sort={{$.SortType}}&state={{$.State}}&labels={{$.SelectLabels}}&milestone={{$.MilestoneID}}&project={{$.ProjectID}}&assignee={{.ID}}&poster={{$.PosterID}}"> <a class="{{if eq $.AssigneeID .ID}}active selected{{end}} item gt-df" href="{{$.Link}}?type={{$.ViewType}}&sort={{$.SortType}}&state={{$.State}}&labels={{$.SelectLabels}}&milestone={{$.MilestoneID}}&project={{$.ProjectID}}&assignee={{.ID}}&poster={{$.PosterID}}">
{{avatar $.Context . 20}}{{template "repo/search_name" .}} {{ctx.AvatarUtils.Avatar . 20}}{{template "repo/search_name" .}}
</a> </a>
{{end}} {{end}}
</div> </div>

View File

@ -56,7 +56,7 @@
{{end}} {{end}}
<div class="right floated"> <div class="right floated">
{{range .Assignees}} {{range .Assignees}}
<a href="{{.HomeLink}}" data-tooltip-content="{{$.locale.Tr "repo.projects.column.assigned_to"}} {{.Name}}">{{avatar $.Context . 28 "mini gt-mr-3"}}</a> <a href="{{.HomeLink}}" data-tooltip-content="{{$.locale.Tr "repo.projects.column.assigned_to"}} {{.Name}}">{{ctx.AvatarUtils.Avatar . 28 "mini gt-mr-3"}}</a>
{{end}} {{end}}
</div> </div>
</div> </div>
@ -208,7 +208,7 @@
</div> </div>
{{range .Assignees}} {{range .Assignees}}
<div class="item issue-action" data-element-id="{{.ID}}" data-url="{{$.RepoLink}}/issues/assignee"> <div class="item issue-action" data-element-id="{{.ID}}" data-url="{{$.RepoLink}}/issues/assignee">
{{avatar $.Context . 20}} {{.GetDisplayName}} {{ctx.AvatarUtils.Avatar . 20}} {{.GetDisplayName}}
</div> </div>
{{end}} {{end}}
</div> </div>

View File

@ -8,7 +8,7 @@
<div class="issue-content-left"> <div class="issue-content-left">
<div class="ui comments"> <div class="ui comments">
<div class="comment"> <div class="comment">
{{avatar $.Context .SignedUser 40}} {{ctx.AvatarUtils.Avatar .SignedUser 40}}
<div class="ui segment content gt-my-0"> <div class="ui segment content gt-my-0">
<div class="field"> <div class="field">
<input name="title" id="issue_title" placeholder="{{.locale.Tr "repo.milestones.title"}}" value="{{if .TitleQuery}}{{.TitleQuery}}{{else if .IssueTemplateTitle}}{{.IssueTemplateTitle}}{{else}}{{.title}}{{end}}" tabindex="3" autofocus required maxlength="255" autocomplete="off"> <input name="title" id="issue_title" placeholder="{{.locale.Tr "repo.milestones.title"}}" value="{{if .TitleQuery}}{{.TitleQuery}}{{else if .IssueTemplateTitle}}{{.IssueTemplateTitle}}{{else}}{{.title}}{{end}}" tabindex="3" autofocus required maxlength="255" autocomplete="off">
@ -160,7 +160,7 @@
<a class="item muted" href="#" data-id="{{.ID}}" data-id-selector="#assignee_{{.ID}}"> <a class="item muted" href="#" data-id="{{.ID}}" data-id-selector="#assignee_{{.ID}}">
<span class="octicon-check invisible">{{svg "octicon-check"}}</span> <span class="octicon-check invisible">{{svg "octicon-check"}}</span>
<span class="text"> <span class="text">
{{avatar $.Context . 28 "gt-mr-3"}}{{template "repo/search_name" .}} {{ctx.AvatarUtils.Avatar . 28 "gt-mr-3"}}{{template "repo/search_name" .}}
</span> </span>
</a> </a>
{{end}} {{end}}
@ -173,7 +173,7 @@
<div class="selected"> <div class="selected">
{{range .Assignees}} {{range .Assignees}}
<a class="item gt-p-2 muted gt-hidden" id="assignee_{{.ID}}" href="{{$.RepoLink}}/issues?assignee={{.ID}}"> <a class="item gt-p-2 muted gt-hidden" id="assignee_{{.ID}}" href="{{$.RepoLink}}/issues?assignee={{.ID}}">
{{avatar $.Context . 28 "gt-mr-3 gt-vm"}}{{.GetDisplayName}} {{ctx.AvatarUtils.Avatar . 28 "gt-mr-3 gt-vm"}}{{.GetDisplayName}}
</a> </a>
{{end}} {{end}}
</div> </div>

View File

@ -16,7 +16,7 @@
</span> </span>
{{else}} {{else}}
<a class="timeline-avatar" {{if gt .Issue.Poster.ID 0}}href="{{.Issue.Poster.HomeLink}}"{{end}}> <a class="timeline-avatar" {{if gt .Issue.Poster.ID 0}}href="{{.Issue.Poster.HomeLink}}"{{end}}>
{{avatar $.Context .Issue.Poster 40}} {{ctx.AvatarUtils.Avatar .Issue.Poster 40}}
</a> </a>
{{end}} {{end}}
<div class="content comment-container"> <div class="content comment-container">
@ -35,7 +35,7 @@
</span> </span>
{{else}} {{else}}
<a class="inline-timeline-avatar" href="{{.Issue.Poster.HomeLink}}"> <a class="inline-timeline-avatar" href="{{.Issue.Poster.HomeLink}}">
{{avatar $.Context .Issue.Poster 24}} {{ctx.AvatarUtils.Avatar .Issue.Poster 24}}
</a> </a>
<span class="text grey muted-links"> <span class="text grey muted-links">
{{template "shared/user/authorlink" .Issue.Poster}} {{template "shared/user/authorlink" .Issue.Poster}}
@ -93,7 +93,7 @@
{{if and (or .IsRepoAdmin .HasIssuesOrPullsWritePermission (not .Issue.IsLocked)) (not .Repository.IsArchived)}} {{if and (or .IsRepoAdmin .HasIssuesOrPullsWritePermission (not .Issue.IsLocked)) (not .Repository.IsArchived)}}
<div class="timeline-item comment form"> <div class="timeline-item comment form">
<a class="timeline-avatar" href="{{.SignedUser.HomeLink}}"> <a class="timeline-avatar" href="{{.SignedUser.HomeLink}}">
{{avatar $.Context .SignedUser 40}} {{ctx.AvatarUtils.Avatar .SignedUser 40}}
</a> </a>
<div class="content"> <div class="content">
<form class="ui segment form form-fetch-action" id="comment-form" action="{{$.RepoLink}}/issues/{{.Issue.Index}}/comments" method="post"> <form class="ui segment form form-fetch-action" id="comment-form" action="{{$.RepoLink}}/issues/{{.Issue.Index}}/comments" method="post">

View File

@ -20,7 +20,7 @@
</span> </span>
{{else}} {{else}}
<a class="timeline-avatar"{{if gt .Poster.ID 0}} href="{{.Poster.HomeLink}}"{{end}}> <a class="timeline-avatar"{{if gt .Poster.ID 0}} href="{{.Poster.HomeLink}}"{{end}}>
{{avatar $.Context .Poster 40}} {{ctx.AvatarUtils.Avatar .Poster 40}}
</a> </a>
{{end}} {{end}}
<div class="content comment-container"> <div class="content comment-container">
@ -40,7 +40,7 @@
{{else}} {{else}}
{{if gt .Poster.ID 0}} {{if gt .Poster.ID 0}}
<a class="inline-timeline-avatar" href="{{.Poster.HomeLink}}"> <a class="inline-timeline-avatar" href="{{.Poster.HomeLink}}">
{{avatar $.Context .Poster 24}} {{ctx.AvatarUtils.Avatar .Poster 24}}
</a> </a>
{{end}} {{end}}
<span class="text grey muted-links"> <span class="text grey muted-links">
@ -94,7 +94,7 @@
{{else if eq .Type 1}} {{else if eq .Type 1}}
<div class="timeline-item event" id="{{.HashTag}}"> <div class="timeline-item event" id="{{.HashTag}}">
<span class="badge gt-bg-green gt-text-white">{{svg "octicon-dot-fill"}}</span> <span class="badge gt-bg-green gt-text-white">{{svg "octicon-dot-fill"}}</span>
{{template "shared/user/avatarlink" dict "Context" $.Context "user" .Poster}} {{template "shared/user/avatarlink" dict "user" .Poster}}
<span class="text grey muted-links"> <span class="text grey muted-links">
{{template "shared/user/authorlink" .Poster}} {{template "shared/user/authorlink" .Poster}}
{{if .Issue.IsPull}} {{if .Issue.IsPull}}
@ -107,7 +107,7 @@
{{else if eq .Type 2}} {{else if eq .Type 2}}
<div class="timeline-item event" id="{{.HashTag}}"> <div class="timeline-item event" id="{{.HashTag}}">
<span class="badge gt-bg-red gt-text-white">{{svg "octicon-circle-slash"}}</span> <span class="badge gt-bg-red gt-text-white">{{svg "octicon-circle-slash"}}</span>
{{template "shared/user/avatarlink" dict "Context" $.Context "user" .Poster}} {{template "shared/user/avatarlink" dict "user" .Poster}}
<span class="text grey muted-links"> <span class="text grey muted-links">
{{template "shared/user/authorlink" .Poster}} {{template "shared/user/authorlink" .Poster}}
{{if .Issue.IsPull}} {{if .Issue.IsPull}}
@ -120,7 +120,7 @@
{{else if eq .Type 28}} {{else if eq .Type 28}}
<div class="timeline-item event" id="{{.HashTag}}"> <div class="timeline-item event" id="{{.HashTag}}">
<span class="badge gt-bg-purple gt-text-white">{{svg "octicon-git-merge"}}</span> <span class="badge gt-bg-purple gt-text-white">{{svg "octicon-git-merge"}}</span>
{{template "shared/user/avatarlink" dict "Context" $.Context "user" .Poster}} {{template "shared/user/avatarlink" dict "user" .Poster}}
<span class="text grey muted-links"> <span class="text grey muted-links">
{{template "shared/user/authorlink" .Poster}} {{template "shared/user/authorlink" .Poster}}
{{$link := printf "%s/commit/%s" $.Repository.Link ($.Issue.PullRequest.MergedCommitID|PathEscape)}} {{$link := printf "%s/commit/%s" $.Repository.Link ($.Issue.PullRequest.MergedCommitID|PathEscape)}}
@ -147,7 +147,7 @@
{{$createdStr:= TimeSinceUnix .CreatedUnix $.locale}} {{$createdStr:= TimeSinceUnix .CreatedUnix $.locale}}
<div class="timeline-item event" id="{{.HashTag}}"> <div class="timeline-item event" id="{{.HashTag}}">
<span class="badge">{{svg "octicon-bookmark"}}</span> <span class="badge">{{svg "octicon-bookmark"}}</span>
{{template "shared/user/avatarlink" dict "Context" $.Context "user" .Poster}} {{template "shared/user/avatarlink" dict "user" .Poster}}
{{if eq .RefAction 3}}<del>{{end}} {{if eq .RefAction 3}}<del>{{end}}
<span class="text grey muted-links"> <span class="text grey muted-links">
{{template "shared/user/authorlink" .Poster}} {{template "shared/user/authorlink" .Poster}}
@ -162,7 +162,7 @@
{{else if eq .Type 4}} {{else if eq .Type 4}}
<div class="timeline-item event" id="{{.HashTag}}"> <div class="timeline-item event" id="{{.HashTag}}">
<span class="badge">{{svg "octicon-bookmark"}}</span> <span class="badge">{{svg "octicon-bookmark"}}</span>
{{template "shared/user/avatarlink" dict "Context" $.Context "user" .Poster}} {{template "shared/user/avatarlink" dict "user" .Poster}}
<span class="text grey muted-links"> <span class="text grey muted-links">
{{template "shared/user/authorlink" .Poster}} {{template "shared/user/authorlink" .Poster}}
{{$.locale.Tr "repo.issues.commit_ref_at" .EventTag $createdStr | Safe}} {{$.locale.Tr "repo.issues.commit_ref_at" .EventTag $createdStr | Safe}}
@ -176,7 +176,7 @@
{{if or .AddedLabels .RemovedLabels}} {{if or .AddedLabels .RemovedLabels}}
<div class="timeline-item event" id="{{.HashTag}}"> <div class="timeline-item event" id="{{.HashTag}}">
<span class="badge">{{svg "octicon-tag"}}</span> <span class="badge">{{svg "octicon-tag"}}</span>
{{template "shared/user/avatarlink" dict "Context" $.Context "user" .Poster}} {{template "shared/user/avatarlink" dict "user" .Poster}}
<span class="text grey muted-links"> <span class="text grey muted-links">
{{template "shared/user/authorlink" .Poster}} {{template "shared/user/authorlink" .Poster}}
{{if and .AddedLabels (not .RemovedLabels)}} {{if and .AddedLabels (not .RemovedLabels)}}
@ -192,7 +192,7 @@
{{else if eq .Type 8}} {{else if eq .Type 8}}
<div class="timeline-item event" id="{{.HashTag}}"> <div class="timeline-item event" id="{{.HashTag}}">
<span class="badge">{{svg "octicon-milestone"}}</span> <span class="badge">{{svg "octicon-milestone"}}</span>
{{template "shared/user/avatarlink" dict "Context" $.Context "user" .Poster}} {{template "shared/user/avatarlink" dict "user" .Poster}}
<span class="text grey muted-links"> <span class="text grey muted-links">
{{template "shared/user/authorlink" .Poster}} {{template "shared/user/authorlink" .Poster}}
{{if gt .OldMilestoneID 0}}{{if gt .MilestoneID 0}}{{$.locale.Tr "repo.issues.change_milestone_at" (.OldMilestone.Name|Escape) (.Milestone.Name|Escape) $createdStr | Safe}}{{else}}{{$.locale.Tr "repo.issues.remove_milestone_at" (.OldMilestone.Name|Escape) $createdStr | Safe}}{{end}}{{else if gt .MilestoneID 0}}{{$.locale.Tr "repo.issues.add_milestone_at" (.Milestone.Name|Escape) $createdStr | Safe}}{{end}} {{if gt .OldMilestoneID 0}}{{if gt .MilestoneID 0}}{{$.locale.Tr "repo.issues.change_milestone_at" (.OldMilestone.Name|Escape) (.Milestone.Name|Escape) $createdStr | Safe}}{{else}}{{$.locale.Tr "repo.issues.remove_milestone_at" (.OldMilestone.Name|Escape) $createdStr | Safe}}{{end}}{{else if gt .MilestoneID 0}}{{$.locale.Tr "repo.issues.add_milestone_at" (.Milestone.Name|Escape) $createdStr | Safe}}{{end}}
@ -203,7 +203,7 @@
<span class="badge">{{svg "octicon-person"}}</span> <span class="badge">{{svg "octicon-person"}}</span>
{{if gt .AssigneeID 0}} {{if gt .AssigneeID 0}}
{{if .RemovedAssignee}} {{if .RemovedAssignee}}
{{template "shared/user/avatarlink" dict "Context" $.Context "user" .Assignee}} {{template "shared/user/avatarlink" dict "user" .Assignee}}
<span class="text grey muted-links"> <span class="text grey muted-links">
{{template "shared/user/authorlink" .Assignee}} {{template "shared/user/authorlink" .Assignee}}
{{if eq .Poster.ID .Assignee.ID}} {{if eq .Poster.ID .Assignee.ID}}
@ -213,7 +213,7 @@
{{end}} {{end}}
</span> </span>
{{else}} {{else}}
{{template "shared/user/avatarlink" dict "Context" $.Context "user" .Assignee}} {{template "shared/user/avatarlink" dict "user" .Assignee}}
<span class="text grey muted-links"> <span class="text grey muted-links">
{{template "shared/user/authorlink" .Assignee}} {{template "shared/user/authorlink" .Assignee}}
{{if eq .Poster.ID .AssigneeID}} {{if eq .Poster.ID .AssigneeID}}
@ -228,7 +228,7 @@
{{else if eq .Type 10}} {{else if eq .Type 10}}
<div class="timeline-item event" id="{{.HashTag}}"> <div class="timeline-item event" id="{{.HashTag}}">
<span class="badge">{{svg "octicon-pencil"}}</span> <span class="badge">{{svg "octicon-pencil"}}</span>
{{template "shared/user/avatarlink" dict "Context" $.Context "user" .Poster}} {{template "shared/user/avatarlink" dict "user" .Poster}}
<span class="text grey muted-links"> <span class="text grey muted-links">
{{template "shared/user/authorlink" .Poster}} {{template "shared/user/authorlink" .Poster}}
{{$.locale.Tr "repo.issues.change_title_at" (.OldTitle|RenderEmoji $.Context) (.NewTitle|RenderEmoji $.Context) $createdStr | Safe}} {{$.locale.Tr "repo.issues.change_title_at" (.OldTitle|RenderEmoji $.Context) (.NewTitle|RenderEmoji $.Context) $createdStr | Safe}}
@ -237,7 +237,7 @@
{{else if eq .Type 11}} {{else if eq .Type 11}}
<div class="timeline-item event" id="{{.HashTag}}"> <div class="timeline-item event" id="{{.HashTag}}">
<span class="badge">{{svg "octicon-git-branch"}}</span> <span class="badge">{{svg "octicon-git-branch"}}</span>
{{template "shared/user/avatarlink" dict "Context" $.Context "user" .Poster}} {{template "shared/user/avatarlink" dict "user" .Poster}}
<span class="text grey muted-links"> <span class="text grey muted-links">
{{template "shared/user/authorlink" .Poster}} {{template "shared/user/authorlink" .Poster}}
{{$.locale.Tr "repo.issues.delete_branch_at" (.OldRef|Escape) $createdStr | Safe}} {{$.locale.Tr "repo.issues.delete_branch_at" (.OldRef|Escape) $createdStr | Safe}}
@ -246,7 +246,7 @@
{{else if eq .Type 12}} {{else if eq .Type 12}}
<div class="timeline-item event" id="{{.HashTag}}"> <div class="timeline-item event" id="{{.HashTag}}">
<span class="badge">{{svg "octicon-clock"}}</span> <span class="badge">{{svg "octicon-clock"}}</span>
{{template "shared/user/avatarlink" dict "Context" $.Context "user" .Poster}} {{template "shared/user/avatarlink" dict "user" .Poster}}
<span class="text grey muted-links"> <span class="text grey muted-links">
{{template "shared/user/authorlink" .Poster}} {{template "shared/user/authorlink" .Poster}}
{{$.locale.Tr "repo.issues.start_tracking_history" $createdStr | Safe}} {{$.locale.Tr "repo.issues.start_tracking_history" $createdStr | Safe}}
@ -255,7 +255,7 @@
{{else if eq .Type 13}} {{else if eq .Type 13}}
<div class="timeline-item event" id="{{.HashTag}}"> <div class="timeline-item event" id="{{.HashTag}}">
<span class="badge">{{svg "octicon-clock"}}</span> <span class="badge">{{svg "octicon-clock"}}</span>
{{template "shared/user/avatarlink" dict "Context" $.Context "user" .Poster}} {{template "shared/user/avatarlink" dict "user" .Poster}}
<span class="text grey muted-links"> <span class="text grey muted-links">
{{template "shared/user/authorlink" .Poster}} {{template "shared/user/authorlink" .Poster}}
{{$.locale.Tr "repo.issues.stop_tracking_history" $createdStr | Safe}} {{$.locale.Tr "repo.issues.stop_tracking_history" $createdStr | Safe}}
@ -274,7 +274,7 @@
{{else if eq .Type 14}} {{else if eq .Type 14}}
<div class="timeline-item event" id="{{.HashTag}}"> <div class="timeline-item event" id="{{.HashTag}}">
<span class="badge">{{svg "octicon-clock"}}</span> <span class="badge">{{svg "octicon-clock"}}</span>
{{template "shared/user/avatarlink" dict "Context" $.Context "user" .Poster}} {{template "shared/user/avatarlink" dict "user" .Poster}}
<span class="text grey muted-links"> <span class="text grey muted-links">
{{template "shared/user/authorlink" .Poster}} {{template "shared/user/authorlink" .Poster}}
{{$.locale.Tr "repo.issues.add_time_history" $createdStr | Safe}} {{$.locale.Tr "repo.issues.add_time_history" $createdStr | Safe}}
@ -293,7 +293,7 @@
{{else if eq .Type 15}} {{else if eq .Type 15}}
<div class="timeline-item event" id="{{.HashTag}}"> <div class="timeline-item event" id="{{.HashTag}}">
<span class="badge">{{svg "octicon-clock"}}</span> <span class="badge">{{svg "octicon-clock"}}</span>
{{template "shared/user/avatarlink" dict "Context" $.Context "user" .Poster}} {{template "shared/user/avatarlink" dict "user" .Poster}}
<span class="text grey muted-links"> <span class="text grey muted-links">
{{template "shared/user/authorlink" .Poster}} {{template "shared/user/authorlink" .Poster}}
{{$.locale.Tr "repo.issues.cancel_tracking_history" $createdStr | Safe}} {{$.locale.Tr "repo.issues.cancel_tracking_history" $createdStr | Safe}}
@ -302,7 +302,7 @@
{{else if eq .Type 16}} {{else if eq .Type 16}}
<div class="timeline-item event" id="{{.HashTag}}"> <div class="timeline-item event" id="{{.HashTag}}">
<span class="badge">{{svg "octicon-clock"}}</span> <span class="badge">{{svg "octicon-clock"}}</span>
{{template "shared/user/avatarlink" dict "Context" $.Context "user" .Poster}} {{template "shared/user/avatarlink" dict "user" .Poster}}
<span class="text grey muted-links"> <span class="text grey muted-links">
{{template "shared/user/authorlink" .Poster}} {{template "shared/user/authorlink" .Poster}}
{{$.locale.Tr "repo.issues.due_date_added" (DateTime "long" .Content) $createdStr | Safe}} {{$.locale.Tr "repo.issues.due_date_added" (DateTime "long" .Content) $createdStr | Safe}}
@ -311,7 +311,7 @@
{{else if eq .Type 17}} {{else if eq .Type 17}}
<div class="timeline-item event" id="{{.HashTag}}"> <div class="timeline-item event" id="{{.HashTag}}">
<span class="badge">{{svg "octicon-clock"}}</span> <span class="badge">{{svg "octicon-clock"}}</span>
{{template "shared/user/avatarlink" dict "Context" $.Context "user" .Poster}} {{template "shared/user/avatarlink" dict "user" .Poster}}
<span class="text grey muted-links"> <span class="text grey muted-links">
{{template "shared/user/authorlink" .Poster}} {{template "shared/user/authorlink" .Poster}}
{{$parsedDeadline := StringUtils.Split .Content "|"}} {{$parsedDeadline := StringUtils.Split .Content "|"}}
@ -325,7 +325,7 @@
{{else if eq .Type 18}} {{else if eq .Type 18}}
<div class="timeline-item event" id="{{.HashTag}}"> <div class="timeline-item event" id="{{.HashTag}}">
<span class="badge">{{svg "octicon-clock"}}</span> <span class="badge">{{svg "octicon-clock"}}</span>
{{template "shared/user/avatarlink" dict "Context" $.Context "user" .Poster}} {{template "shared/user/avatarlink" dict "user" .Poster}}
<span class="text grey muted-links"> <span class="text grey muted-links">
{{template "shared/user/authorlink" .Poster}} {{template "shared/user/authorlink" .Poster}}
{{$.locale.Tr "repo.issues.due_date_remove" (DateTime "long" .Content) $createdStr | Safe}} {{$.locale.Tr "repo.issues.due_date_remove" (DateTime "long" .Content) $createdStr | Safe}}
@ -334,7 +334,7 @@
{{else if eq .Type 19}} {{else if eq .Type 19}}
<div class="timeline-item event" id="{{.HashTag}}"> <div class="timeline-item event" id="{{.HashTag}}">
<span class="badge">{{svg "octicon-package-dependents"}}</span> <span class="badge">{{svg "octicon-package-dependents"}}</span>
{{template "shared/user/avatarlink" dict "Context" $.Context "user" .Poster}} {{template "shared/user/avatarlink" dict "user" .Poster}}
<span class="text grey muted-links"> <span class="text grey muted-links">
{{template "shared/user/authorlink" .Poster}} {{template "shared/user/authorlink" .Poster}}
{{$.locale.Tr "repo.issues.dependency.added_dependency" $createdStr | Safe}} {{$.locale.Tr "repo.issues.dependency.added_dependency" $createdStr | Safe}}
@ -357,7 +357,7 @@
{{else if eq .Type 20}} {{else if eq .Type 20}}
<div class="timeline-item event" id="{{.HashTag}}"> <div class="timeline-item event" id="{{.HashTag}}">
<span class="badge">{{svg "octicon-package-dependents"}}</span> <span class="badge">{{svg "octicon-package-dependents"}}</span>
{{template "shared/user/avatarlink" dict "Context" $.Context "user" .Poster}} {{template "shared/user/avatarlink" dict "user" .Poster}}
<span class="text grey muted-links"> <span class="text grey muted-links">
{{template "shared/user/authorlink" .Poster}} {{template "shared/user/authorlink" .Poster}}
{{$.locale.Tr "repo.issues.dependency.removed_dependency" $createdStr | Safe}} {{$.locale.Tr "repo.issues.dependency.removed_dependency" $createdStr | Safe}}
@ -386,7 +386,7 @@
bubble. The condition depends on review type and for positive reviews whether bubble. The condition depends on review type and for positive reviews whether
there is a comment element or not */}} there is a comment element or not */}}
<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}}> <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}} {{ctx.AvatarUtils.Avatar .Poster 40}}
</a> </a>
{{end}} {{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> <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>
@ -423,7 +423,7 @@
<div class="comment-header-left gt-df gt-ac"> <div class="comment-header-left gt-df gt-ac">
{{if gt .Poster.ID 0}} {{if gt .Poster.ID 0}}
<a class="inline-timeline-avatar" href="{{.Poster.HomeLink}}"> <a class="inline-timeline-avatar" href="{{.Poster.HomeLink}}">
{{avatar $.Context .Poster 24}} {{ctx.AvatarUtils.Avatar .Poster 24}}
</a> </a>
{{end}} {{end}}
<span class="text grey muted-links"> <span class="text grey muted-links">
@ -549,7 +549,7 @@
<div class="comment-header-left gt-df gt-ac"> <div class="comment-header-left gt-df gt-ac">
{{if not .OriginalAuthor}} {{if not .OriginalAuthor}}
<a class="avatar"> <a class="avatar">
{{avatar $.Context .Poster 20}} {{ctx.AvatarUtils.Avatar .Poster 20}}
</a> </a>
{{end}} {{end}}
<span class="text grey muted-links"> <span class="text grey muted-links">
@ -644,7 +644,7 @@
{{else if eq .Type 23}} {{else if eq .Type 23}}
<div class="timeline-item event" id="{{.HashTag}}"> <div class="timeline-item event" id="{{.HashTag}}">
<span class="badge">{{svg "octicon-lock"}}</span> <span class="badge">{{svg "octicon-lock"}}</span>
{{template "shared/user/avatarlink" dict "Context" $.Context "user" .Poster}} {{template "shared/user/avatarlink" dict "user" .Poster}}
{{if .Content}} {{if .Content}}
<span class="text grey muted-links"> <span class="text grey muted-links">
{{template "shared/user/authorlink" .Poster}} {{template "shared/user/authorlink" .Poster}}
@ -660,7 +660,7 @@
{{else if eq .Type 24}} {{else if eq .Type 24}}
<div class="timeline-item event" id="{{.HashTag}}"> <div class="timeline-item event" id="{{.HashTag}}">
<span class="badge">{{svg "octicon-key"}}</span> <span class="badge">{{svg "octicon-key"}}</span>
{{template "shared/user/avatarlink" dict "Context" $.Context "user" .Poster}} {{template "shared/user/avatarlink" dict "user" .Poster}}
<span class="text grey muted-links"> <span class="text grey muted-links">
{{template "shared/user/authorlink" .Poster}} {{template "shared/user/authorlink" .Poster}}
{{$.locale.Tr "repo.issues.unlock_comment" $createdStr | Safe}} {{$.locale.Tr "repo.issues.unlock_comment" $createdStr | Safe}}
@ -669,7 +669,7 @@
{{else if eq .Type 25}} {{else if eq .Type 25}}
<div class="timeline-item event"> <div class="timeline-item event">
<span class="badge">{{svg "octicon-git-branch"}}</span> <span class="badge">{{svg "octicon-git-branch"}}</span>
{{template "shared/user/avatarlink" dict "Context" $.Context "user" .Poster}} {{template "shared/user/avatarlink" dict "user" .Poster}}
<span class="text grey muted-links"> <span class="text grey muted-links">
<a{{if gt .Poster.ID 0}} href="{{.Poster.HomeLink}}"{{end}}>{{.Poster.Name}}</a> <a{{if gt .Poster.ID 0}} href="{{.Poster.HomeLink}}"{{end}}>{{.Poster.Name}}</a>
{{$.locale.Tr "repo.pulls.change_target_branch_at" (.OldRef|Escape) (.NewRef|Escape) $createdStr | Safe}} {{$.locale.Tr "repo.pulls.change_target_branch_at" (.OldRef|Escape) (.NewRef|Escape) $createdStr | Safe}}
@ -678,7 +678,7 @@
{{else if eq .Type 26}} {{else if eq .Type 26}}
<div class="timeline-item event" id="{{.HashTag}}"> <div class="timeline-item event" id="{{.HashTag}}">
<span class="badge">{{svg "octicon-clock"}}</span> <span class="badge">{{svg "octicon-clock"}}</span>
{{template "shared/user/avatarlink" dict "Context" $.Context "user" .Poster}} {{template "shared/user/avatarlink" dict "user" .Poster}}
<span class="text grey muted-links"> <span class="text grey muted-links">
{{template "shared/user/authorlink" .Poster}} {{template "shared/user/authorlink" .Poster}}
@ -697,7 +697,7 @@
{{else if eq .Type 27}} {{else if eq .Type 27}}
<div class="timeline-item event" id="{{.HashTag}}"> <div class="timeline-item event" id="{{.HashTag}}">
<span class="badge">{{svg "octicon-eye"}}</span> <span class="badge">{{svg "octicon-eye"}}</span>
{{template "shared/user/avatarlink" dict "Context" $.Context "user" .Poster}} {{template "shared/user/avatarlink" dict "user" .Poster}}
<span class="text grey muted-links"> <span class="text grey muted-links">
{{template "shared/user/authorlink" .Poster}} {{template "shared/user/authorlink" .Poster}}
{{if (gt .AssigneeID 0)}} {{if (gt .AssigneeID 0)}}
@ -752,7 +752,7 @@
{{if not $.UnitProjectsGlobalDisabled}} {{if not $.UnitProjectsGlobalDisabled}}
<div class="timeline-item event" id="{{.HashTag}}"> <div class="timeline-item event" id="{{.HashTag}}">
<span class="badge">{{svg "octicon-project"}}</span> <span class="badge">{{svg "octicon-project"}}</span>
{{template "shared/user/avatarlink" dict "Context" $.Context "user" .Poster}} {{template "shared/user/avatarlink" dict "user" .Poster}}
<span class="text grey muted-links"> <span class="text grey muted-links">
{{template "shared/user/authorlink" .Poster}} {{template "shared/user/authorlink" .Poster}}
{{$oldProjectDisplayHtml := "Unknown Project"}} {{$oldProjectDisplayHtml := "Unknown Project"}}
@ -799,7 +799,7 @@
<div class="ui top attached header comment-header-left gt-df gt-ac arrow-top"> <div class="ui top attached header comment-header-left gt-df gt-ac arrow-top">
{{if gt .Poster.ID 0}} {{if gt .Poster.ID 0}}
<a class="inline-timeline-avatar" href="{{.Poster.HomeLink}}"> <a class="inline-timeline-avatar" href="{{.Poster.HomeLink}}">
{{avatar $.Context .Poster 24}} {{ctx.AvatarUtils.Avatar .Poster 24}}
</a> </a>
{{end}} {{end}}
<span class="text grey muted-links"> <span class="text grey muted-links">
@ -822,7 +822,7 @@
{{else if eq .Type 33}} {{else if eq .Type 33}}
<div class="timeline-item event" id="{{.HashTag}}"> <div class="timeline-item event" id="{{.HashTag}}">
<span class="badge">{{svg "octicon-git-branch"}}</span> <span class="badge">{{svg "octicon-git-branch"}}</span>
{{template "shared/user/avatarlink" dict "Context" $.Context "user" .Poster}} {{template "shared/user/avatarlink" dict "user" .Poster}}
<span class="text grey muted-links"> <span class="text grey muted-links">
{{template "shared/user/authorlink" .Poster}} {{template "shared/user/authorlink" .Poster}}
{{if and .OldRef .NewRef}} {{if and .OldRef .NewRef}}
@ -846,7 +846,7 @@
{{else if or (eq .Type 36) (eq .Type 37)}} {{else if or (eq .Type 36) (eq .Type 37)}}
<div class="timeline-item event" id="{{.HashTag}}"> <div class="timeline-item event" id="{{.HashTag}}">
<span class="badge">{{svg "octicon-pin" 16}}</span> <span class="badge">{{svg "octicon-pin" 16}}</span>
{{template "shared/user/avatarlink" dict "Context" $.Context "user" .Poster}} {{template "shared/user/avatarlink" dict "user" .Poster}}
<span class="text grey muted-links"> <span class="text grey muted-links">
{{template "shared/user/authorlink" .Poster}} {{template "shared/user/authorlink" .Poster}}
{{if eq .Type 36}}{{$.locale.Tr "repo.issues.pin_comment" $createdStr | Safe}} {{if eq .Type 36}}{{$.locale.Tr "repo.issues.pin_comment" $createdStr | Safe}}

View File

@ -22,7 +22,7 @@
<a class="{{if not .CanChange}}ui{{end}} item {{if .Checked}}checked{{end}} {{if not .CanChange}}ban-change{{end}}" href="#" data-id="{{.ItemID}}" data-id-selector="#review_request_{{.ItemID}}" {{if not .CanChange}} data-tooltip-content="{{$.locale.Tr "repo.issues.remove_request_review_block"}}"{{end}}> <a class="{{if not .CanChange}}ui{{end}} item {{if .Checked}}checked{{end}} {{if not .CanChange}}ban-change{{end}}" href="#" data-id="{{.ItemID}}" data-id-selector="#review_request_{{.ItemID}}" {{if not .CanChange}} data-tooltip-content="{{$.locale.Tr "repo.issues.remove_request_review_block"}}"{{end}}>
<span class="octicon-check {{if not .Checked}}invisible{{end}}">{{svg "octicon-check"}}</span> <span class="octicon-check {{if not .Checked}}invisible{{end}}">{{svg "octicon-check"}}</span>
<span class="text"> <span class="text">
{{avatar $.Context .User 28 "gt-mr-3"}}{{template "repo/search_name" .User}} {{ctx.AvatarUtils.Avatar .User 28 "gt-mr-3"}}{{template "repo/search_name" .User}}
</span> </span>
</a> </a>
{{end}} {{end}}
@ -51,7 +51,7 @@
<div class="item gt-df gt-ac gt-py-3"> <div class="item gt-df gt-ac gt-py-3">
<div class="gt-df gt-ac gt-f1"> <div class="gt-df gt-ac gt-f1">
{{if .User}} {{if .User}}
<a class="muted sidebar-item-link" href="{{.User.HomeLink}}">{{avatar $.Context .User 20 "gt-mr-3"}}{{.User.GetDisplayName}}</a> <a class="muted sidebar-item-link" href="{{.User.HomeLink}}">{{ctx.AvatarUtils.Avatar .User 20 "gt-mr-3"}}{{.User.GetDisplayName}}</a>
{{else if .Team}} {{else if .Team}}
<span class="text">{{svg "octicon-people" 20 "gt-mr-3"}}{{$.Issue.Repo.OwnerName}}/{{.Team.Name}}</span> <span class="text">{{svg "octicon-people" 20 "gt-mr-3"}}{{$.Issue.Repo.OwnerName}}/{{.Team.Name}}</span>
{{end}} {{end}}
@ -231,7 +231,7 @@
{{end}} {{end}}
<span class="octicon-check {{if not $checked}}invisible{{end}}">{{svg "octicon-check"}}</span> <span class="octicon-check {{if not $checked}}invisible{{end}}">{{svg "octicon-check"}}</span>
<span class="text"> <span class="text">
{{avatar $.Context . 20 "gt-mr-3"}}{{template "repo/search_name" .}} {{ctx.AvatarUtils.Avatar . 20 "gt-mr-3"}}{{template "repo/search_name" .}}
</span> </span>
</a> </a>
{{end}} {{end}}
@ -243,7 +243,7 @@
{{range .Issue.Assignees}} {{range .Issue.Assignees}}
<div class="item"> <div class="item">
<a class="muted sidebar-item-link" href="{{$.RepoLink}}/{{if $.Issue.IsPull}}pulls{{else}}issues{{end}}?assignee={{.ID}}"> <a class="muted sidebar-item-link" href="{{$.RepoLink}}/{{if $.Issue.IsPull}}pulls{{else}}issues{{end}}?assignee={{.ID}}">
{{avatar $.Context . 28 "gt-mr-3"}} {{ctx.AvatarUtils.Avatar . 28 "gt-mr-3"}}
{{.GetDisplayName}} {{.GetDisplayName}}
</a> </a>
</div> </div>
@ -258,7 +258,7 @@
<div class="ui list gt-df gt-fw"> <div class="ui list gt-df gt-fw">
{{range .Participants}} {{range .Participants}}
<a {{if gt .ID 0}}href="{{.HomeLink}}"{{end}} data-tooltip-content="{{.GetDisplayName}}"> <a {{if gt .ID 0}}href="{{.HomeLink}}"{{end}} data-tooltip-content="{{.GetDisplayName}}">
{{avatar $.Context . 28 "gt-my-1 gt-mr-2"}} {{ctx.AvatarUtils.Avatar . 28 "gt-my-1 gt-mr-2"}}
</a> </a>
{{end}} {{end}}
</div> </div>
@ -347,7 +347,7 @@
{{range $user, $trackedtime := .WorkingUsers}} {{range $user, $trackedtime := .WorkingUsers}}
<div class="comment gt-mt-3"> <div class="comment gt-mt-3">
<a class="avatar"> <a class="avatar">
{{avatar $.Context $user}} {{ctx.AvatarUtils.Avatar $user}}
</a> </a>
<div class="content"> <div class="content">
{{template "shared/user/authorlink" $user}} {{template "shared/user/authorlink" $user}}

View File

@ -62,18 +62,18 @@
<div class="ui selection owner dropdown"> <div class="ui selection owner dropdown">
<input type="hidden" id="uid" name="uid" value="{{.ContextUser.ID}}" required> <input type="hidden" id="uid" name="uid" value="{{.ContextUser.ID}}" required>
<span class="text truncated-item-container" title="{{.ContextUser.Name}}"> <span class="text truncated-item-container" title="{{.ContextUser.Name}}">
{{avatar $.Context .ContextUser 28 "mini"}} {{ctx.AvatarUtils.Avatar .ContextUser 28 "mini"}}
<span class="truncated-item-name">{{.ContextUser.ShortName 40}}</span> <span class="truncated-item-name">{{.ContextUser.ShortName 40}}</span>
</span> </span>
{{svg "octicon-triangle-down" 14 "dropdown icon"}} {{svg "octicon-triangle-down" 14 "dropdown icon"}}
<div class="menu" title="{{.SignedUser.Name}}"> <div class="menu" title="{{.SignedUser.Name}}">
<div class="item truncated-item-container" data-value="{{.SignedUser.ID}}"> <div class="item truncated-item-container" data-value="{{.SignedUser.ID}}">
{{avatar $.Context .SignedUser 28 "mini"}} {{ctx.AvatarUtils.Avatar .SignedUser 28 "mini"}}
<span class="truncated-item-name">{{.SignedUser.ShortName 40}}</span> <span class="truncated-item-name">{{.SignedUser.ShortName 40}}</span>
</div> </div>
{{range .Orgs}} {{range .Orgs}}
<div class="item truncated-item-container" data-value="{{.ID}}" title="{{.Name}}"> <div class="item truncated-item-container" data-value="{{.ID}}" title="{{.Name}}">
{{avatar $.Context . 28 "mini"}} {{ctx.AvatarUtils.Avatar . 28 "mini"}}
<span class="truncated-item-name">{{.ShortName 40}}</span> <span class="truncated-item-name">{{.ShortName 40}}</span>
</div> </div>
{{end}} {{end}}

View File

@ -36,18 +36,18 @@
<div class="ui selection owner dropdown"> <div class="ui selection owner dropdown">
<input type="hidden" id="uid" name="uid" value="{{.ContextUser.ID}}" required> <input type="hidden" id="uid" name="uid" value="{{.ContextUser.ID}}" required>
<span class="text truncated-item-container" title="{{.ContextUser.Name}}"> <span class="text truncated-item-container" title="{{.ContextUser.Name}}">
{{avatar $.Context .ContextUser}} {{ctx.AvatarUtils.Avatar .ContextUser}}
<span class="truncated-item-name">{{.ContextUser.ShortName 40}}</span> <span class="truncated-item-name">{{.ContextUser.ShortName 40}}</span>
</span> </span>
{{svg "octicon-triangle-down" 14 "dropdown icon"}} {{svg "octicon-triangle-down" 14 "dropdown icon"}}
<div class="menu" title="{{.SignedUser.Name}}"> <div class="menu" title="{{.SignedUser.Name}}">
<div class="item truncated-item-container" data-value="{{.SignedUser.ID}}"> <div class="item truncated-item-container" data-value="{{.SignedUser.ID}}">
{{avatar $.Context .SignedUser}} {{ctx.AvatarUtils.Avatar .SignedUser}}
<span class="truncated-item-name">{{.SignedUser.ShortName 40}}</span> <span class="truncated-item-name">{{.SignedUser.ShortName 40}}</span>
</div> </div>
{{range .Orgs}} {{range .Orgs}}
<div class="item truncated-item-container" data-value="{{.ID}}" title="{{.Name}}"> <div class="item truncated-item-container" data-value="{{.ID}}" title="{{.Name}}">
{{avatar $.Context .}} {{ctx.AvatarUtils.Avatar .}}
<span class="truncated-item-name">{{.ShortName 40}}</span> <span class="truncated-item-name">{{.ShortName 40}}</span>
</div> </div>
{{end}} {{end}}

View File

@ -78,18 +78,18 @@
<div class="ui selection owner dropdown"> <div class="ui selection owner dropdown">
<input type="hidden" id="uid" name="uid" value="{{.ContextUser.ID}}" required> <input type="hidden" id="uid" name="uid" value="{{.ContextUser.ID}}" required>
<span class="text truncated-item-container" title="{{.ContextUser.Name}}"> <span class="text truncated-item-container" title="{{.ContextUser.Name}}">
{{avatar $.Context .ContextUser 28 "mini"}} {{ctx.AvatarUtils.Avatar .ContextUser 28 "mini"}}
<span class="truncated-item-name">{{.ContextUser.ShortName 40}}</span> <span class="truncated-item-name">{{.ContextUser.ShortName 40}}</span>
</span> </span>
{{svg "octicon-triangle-down" 14 "dropdown icon"}} {{svg "octicon-triangle-down" 14 "dropdown icon"}}
<div class="menu" title="{{.SignedUser.Name}}"> <div class="menu" title="{{.SignedUser.Name}}">
<div class="item truncated-item-container" data-value="{{.SignedUser.ID}}"> <div class="item truncated-item-container" data-value="{{.SignedUser.ID}}">
{{avatar $.Context .SignedUser 28 "mini"}} {{ctx.AvatarUtils.Avatar .SignedUser 28 "mini"}}
<span class="truncated-item-name">{{.SignedUser.ShortName 40}}</span> <span class="truncated-item-name">{{.SignedUser.ShortName 40}}</span>
</div> </div>
{{range .Orgs}} {{range .Orgs}}
<div class="item truncated-item-container" data-value="{{.ID}}" title="{{.Name}}"> <div class="item truncated-item-container" data-value="{{.ID}}" title="{{.Name}}">
{{avatar $.Context . 28 "mini"}} {{ctx.AvatarUtils.Avatar . 28 "mini"}}
<span class="truncated-item-name">{{.ShortName 40}}</span> <span class="truncated-item-name">{{.ShortName 40}}</span>
</div> </div>
{{end}} {{end}}

View File

@ -74,18 +74,18 @@
<div class="ui selection owner dropdown"> <div class="ui selection owner dropdown">
<input type="hidden" id="uid" name="uid" value="{{.ContextUser.ID}}" required> <input type="hidden" id="uid" name="uid" value="{{.ContextUser.ID}}" required>
<span class="text truncated-item-container" title="{{.ContextUser.Name}}"> <span class="text truncated-item-container" title="{{.ContextUser.Name}}">
{{avatar $.Context .ContextUser}} {{ctx.AvatarUtils.Avatar .ContextUser}}
<span class="truncated-item-name">{{.ContextUser.ShortName 40}}</span> <span class="truncated-item-name">{{.ContextUser.ShortName 40}}</span>
</span> </span>
{{svg "octicon-triangle-down" 14 "dropdown icon"}} {{svg "octicon-triangle-down" 14 "dropdown icon"}}
<div class="menu" title="{{.SignedUser.Name}}"> <div class="menu" title="{{.SignedUser.Name}}">
<div class="item truncated-item-container" data-value="{{.SignedUser.ID}}"> <div class="item truncated-item-container" data-value="{{.SignedUser.ID}}">
{{avatar $.Context .SignedUser}} {{ctx.AvatarUtils.Avatar .SignedUser}}
<span class="truncated-item-name">{{.SignedUser.ShortName 40}}</span> <span class="truncated-item-name">{{.SignedUser.ShortName 40}}</span>
</div> </div>
{{range .Orgs}} {{range .Orgs}}
<div class="item truncated-item-container" data-value="{{.ID}}" title="{{.Name}}"> <div class="item truncated-item-container" data-value="{{.ID}}" title="{{.Name}}">
{{avatar $.Context .}} {{ctx.AvatarUtils.Avatar .}}
<span class="truncated-item-name">{{.ShortName 40}}</span> <span class="truncated-item-name">{{.ShortName 40}}</span>
</div> </div>
{{end}} {{end}}

View File

@ -76,18 +76,18 @@
<div class="ui selection owner dropdown"> <div class="ui selection owner dropdown">
<input type="hidden" id="uid" name="uid" value="{{.ContextUser.ID}}" required> <input type="hidden" id="uid" name="uid" value="{{.ContextUser.ID}}" required>
<span class="text truncated-item-container" title="{{.ContextUser.Name}}"> <span class="text truncated-item-container" title="{{.ContextUser.Name}}">
{{avatar $.Context .ContextUser 28 "mini"}} {{ctx.AvatarUtils.Avatar .ContextUser 28 "mini"}}
<span class="truncated-item-name">{{.ContextUser.ShortName 40}}</span> <span class="truncated-item-name">{{.ContextUser.ShortName 40}}</span>
</span> </span>
{{svg "octicon-triangle-down" 14 "dropdown icon"}} {{svg "octicon-triangle-down" 14 "dropdown icon"}}
<div class="menu" title="{{.SignedUser.Name}}"> <div class="menu" title="{{.SignedUser.Name}}">
<div class="item truncated-item-container" data-value="{{.SignedUser.ID}}"> <div class="item truncated-item-container" data-value="{{.SignedUser.ID}}">
{{avatar $.Context .SignedUser 28 "mini"}} {{ctx.AvatarUtils.Avatar .SignedUser 28 "mini"}}
<span class="truncated-item-name">{{.SignedUser.ShortName 40}}</span> <span class="truncated-item-name">{{.SignedUser.ShortName 40}}</span>
</div> </div>
{{range .Orgs}} {{range .Orgs}}
<div class="item truncated-item-container" data-value="{{.ID}}" title="{{.Name}}"> <div class="item truncated-item-container" data-value="{{.ID}}" title="{{.Name}}">
{{avatar $.Context . 28 "mini"}} {{ctx.AvatarUtils.Avatar . 28 "mini"}}
<span class="truncated-item-name">{{.ShortName 40}}</span> <span class="truncated-item-name">{{.ShortName 40}}</span>
</div> </div>
{{end}} {{end}}

View File

@ -73,18 +73,18 @@
<div class="ui selection owner dropdown"> <div class="ui selection owner dropdown">
<input type="hidden" id="uid" name="uid" value="{{.ContextUser.ID}}" required> <input type="hidden" id="uid" name="uid" value="{{.ContextUser.ID}}" required>
<span class="text truncated-item-container" title="{{.ContextUser.Name}}"> <span class="text truncated-item-container" title="{{.ContextUser.Name}}">
{{avatar $.Context .ContextUser 28 "mini"}} {{ctx.AvatarUtils.Avatar .ContextUser 28 "mini"}}
<span class="truncated-item-name">{{.ContextUser.ShortName 40}}</span> <span class="truncated-item-name">{{.ContextUser.ShortName 40}}</span>
</span> </span>
{{svg "octicon-triangle-down" 14 "dropdown icon"}} {{svg "octicon-triangle-down" 14 "dropdown icon"}}
<div class="menu" title="{{.SignedUser.Name}}"> <div class="menu" title="{{.SignedUser.Name}}">
<div class="item truncated-item-container" data-value="{{.SignedUser.ID}}"> <div class="item truncated-item-container" data-value="{{.SignedUser.ID}}">
{{avatar $.Context .SignedUser 28 "mini"}} {{ctx.AvatarUtils.Avatar .SignedUser 28 "mini"}}
<span class="truncated-item-name">{{.SignedUser.ShortName 40}}</span> <span class="truncated-item-name">{{.SignedUser.ShortName 40}}</span>
</div> </div>
{{range .Orgs}} {{range .Orgs}}
<div class="item truncated-item-container" data-value="{{.ID}}" title="{{.Name}}"> <div class="item truncated-item-container" data-value="{{.ID}}" title="{{.Name}}">
{{avatar $.Context . 28 "mini"}} {{ctx.AvatarUtils.Avatar . 28 "mini"}}
<span class="truncated-item-name">{{.ShortName 40}}</span> <span class="truncated-item-name">{{.ShortName 40}}</span>
</div> </div>
{{end}} {{end}}

View File

@ -76,18 +76,18 @@
<div class="ui selection owner dropdown"> <div class="ui selection owner dropdown">
<input type="hidden" id="uid" name="uid" value="{{.ContextUser.ID}}" required> <input type="hidden" id="uid" name="uid" value="{{.ContextUser.ID}}" required>
<span class="text truncated-item-container" title="{{.ContextUser.Name}}"> <span class="text truncated-item-container" title="{{.ContextUser.Name}}">
{{avatar $.Context .ContextUser}} {{ctx.AvatarUtils.Avatar .ContextUser}}
<span class="truncated-item-name">{{.ContextUser.ShortName 40}}</span> <span class="truncated-item-name">{{.ContextUser.ShortName 40}}</span>
</span> </span>
{{svg "octicon-triangle-down" 14 "dropdown icon"}} {{svg "octicon-triangle-down" 14 "dropdown icon"}}
<div class="menu" title="{{.SignedUser.Name}}"> <div class="menu" title="{{.SignedUser.Name}}">
<div class="item truncated-item-container" data-value="{{.SignedUser.ID}}"> <div class="item truncated-item-container" data-value="{{.SignedUser.ID}}">
{{avatar $.Context .SignedUser}} {{ctx.AvatarUtils.Avatar .SignedUser}}
<span class="truncated-item-name">{{.SignedUser.ShortName 40}}</span> <span class="truncated-item-name">{{.SignedUser.ShortName 40}}</span>
</div> </div>
{{range .Orgs}} {{range .Orgs}}
<div class="item truncated-item-container" data-value="{{.ID}}" title="{{.Name}}"> <div class="item truncated-item-container" data-value="{{.ID}}" title="{{.Name}}">
{{avatar $.Context .}} {{ctx.AvatarUtils.Avatar .}}
<span class="truncated-item-name">{{.ShortName 40}}</span> <span class="truncated-item-name">{{.ShortName 40}}</span>
</div> </div>
{{end}} {{end}}

View File

@ -62,18 +62,18 @@
<div class="ui selection owner dropdown"> <div class="ui selection owner dropdown">
<input type="hidden" id="uid" name="uid" value="{{.ContextUser.ID}}" required> <input type="hidden" id="uid" name="uid" value="{{.ContextUser.ID}}" required>
<span class="text truncated-item-container" title="{{.ContextUser.Name}}"> <span class="text truncated-item-container" title="{{.ContextUser.Name}}">
{{avatar $.Context .ContextUser 28 "mini"}} {{ctx.AvatarUtils.Avatar .ContextUser 28 "mini"}}
<span class="truncated-item-name">{{.ContextUser.ShortName 40}}</span> <span class="truncated-item-name">{{.ContextUser.ShortName 40}}</span>
</span> </span>
{{svg "octicon-triangle-down" 14 "dropdown icon"}} {{svg "octicon-triangle-down" 14 "dropdown icon"}}
<div class="menu" title="{{.SignedUser.Name}}"> <div class="menu" title="{{.SignedUser.Name}}">
<div class="item truncated-item-container" data-value="{{.SignedUser.ID}}"> <div class="item truncated-item-container" data-value="{{.SignedUser.ID}}">
{{avatar $.Context .SignedUser 28 "mini"}} {{ctx.AvatarUtils.Avatar .SignedUser 28 "mini"}}
<span class="truncated-item-name">{{.SignedUser.ShortName 40}}</span> <span class="truncated-item-name">{{.SignedUser.ShortName 40}}</span>
</div> </div>
{{range .Orgs}} {{range .Orgs}}
<div class="item truncated-item-container" data-value="{{.ID}}" title="{{.Name}}"> <div class="item truncated-item-container" data-value="{{.ID}}" title="{{.Name}}">
{{avatar $.Context . 28 "mini"}} {{ctx.AvatarUtils.Avatar . 28 "mini"}}
<span class="truncated-item-name">{{.ShortName 40}}</span> <span class="truncated-item-name">{{.ShortName 40}}</span>
</div> </div>
{{end}} {{end}}

View File

@ -243,7 +243,7 @@
{{end}} {{end}}
<div class="right floated"> <div class="right floated">
{{range .Assignees}} {{range .Assignees}}
<a target="_blank" href="{{.HomeLink}}" data-tooltip-content="{{$.locale.Tr "repo.projects.column.assigned_to"}} {{.Name}}">{{avatar $.Context . 28 "mini gt-mr-3"}}</a> <a target="_blank" href="{{.HomeLink}}" data-tooltip-content="{{$.locale.Tr "repo.projects.column.assigned_to"}} {{.Name}}">{{ctx.AvatarUtils.Avatar . 28 "mini gt-mr-3"}}</a>
{{end}} {{end}}
</div> </div>
</div> </div>

View File

@ -14,20 +14,20 @@
<div class="ui selection owner dropdown"> <div class="ui selection owner dropdown">
<input type="hidden" id="uid" name="uid" value="{{.ContextUser.ID}}" required> <input type="hidden" id="uid" name="uid" value="{{.ContextUser.ID}}" required>
<span class="text truncated-item-container" title="{{.ContextUser.Name}}"> <span class="text truncated-item-container" title="{{.ContextUser.Name}}">
{{avatar $.Context .ContextUser 28 "mini"}} {{ctx.AvatarUtils.Avatar .ContextUser 28 "mini"}}
<span class="truncated-item-name">{{.ContextUser.ShortName 40}}</span> <span class="truncated-item-name">{{.ContextUser.ShortName 40}}</span>
</span> </span>
{{svg "octicon-triangle-down" 14 "dropdown icon"}} {{svg "octicon-triangle-down" 14 "dropdown icon"}}
<div class="menu"> <div class="menu">
{{if .CanForkToUser}} {{if .CanForkToUser}}
<div class="item truncated-item-container" data-value="{{.SignedUser.ID}}" title="{{.SignedUser.Name}}"> <div class="item truncated-item-container" data-value="{{.SignedUser.ID}}" title="{{.SignedUser.Name}}">
{{avatar $.Context .SignedUser 28 "mini"}} {{ctx.AvatarUtils.Avatar .SignedUser 28 "mini"}}
<span class="truncated-item-name">{{.SignedUser.ShortName 40}}</span> <span class="truncated-item-name">{{.SignedUser.ShortName 40}}</span>
</div> </div>
{{end}} {{end}}
{{range .Orgs}} {{range .Orgs}}
<div class="item truncated-item-container" data-value="{{.ID}}" title="{{.Name}}"> <div class="item truncated-item-container" data-value="{{.ID}}" title="{{.Name}}">
{{avatar $.Context . 28 "mini"}} {{ctx.AvatarUtils.Avatar . 28 "mini"}}
<span class="truncated-item-name">{{.ShortName 40}}</span> <span class="truncated-item-name">{{.ShortName 40}}</span>
</div> </div>
{{end}} {{end}}

View File

@ -38,7 +38,7 @@
<p class="text grey"> <p class="text grey">
{{if gt .Publisher.ID 0}} {{if gt .Publisher.ID 0}}
<span class="author"> <span class="author">
{{avatar $.Context .Publisher 20}} {{ctx.AvatarUtils.Avatar .Publisher 20}}
<a href="{{.Publisher.HomeLink}}">{{.Publisher.Name}}</a> <a href="{{.Publisher.HomeLink}}">{{.Publisher.Name}}</a>
</span> </span>
<span class="released"> <span class="released">
@ -57,7 +57,7 @@
{{if .OriginalAuthor}} {{if .OriginalAuthor}}
{{svg "octicon-mark-github" 16 "gt-mr-2"}}{{.OriginalAuthor}} {{svg "octicon-mark-github" 16 "gt-mr-2"}}{{.OriginalAuthor}}
{{else if .Publisher}} {{else if .Publisher}}
{{avatar $.Context .Publisher 20}} {{ctx.AvatarUtils.Avatar .Publisher 20}}
<a href="{{.Publisher.HomeLink}}">{{.Publisher.GetDisplayName}}</a> <a href="{{.Publisher.HomeLink}}">{{.Publisher.GetDisplayName}}</a>
{{else}} {{else}}
Ghost Ghost

View File

@ -9,7 +9,7 @@
{{range .Collaborators}} {{range .Collaborators}}
<div class="flex-item flex-item-center"> <div class="flex-item flex-item-center">
<div class="flex-item-leading"> <div class="flex-item-leading">
<a href="{{.HomeLink}}">{{avatar $.Context . 32}}</a> <a href="{{.HomeLink}}">{{ctx.AvatarUtils.Avatar . 32}}</a>
</div> </div>
<div class="flex-item-main"> <div class="flex-item-main">
<div class="flex-item-title"> <div class="flex-item-title">

View File

@ -31,7 +31,7 @@
</td> </td>
<td> <td>
<a href="{{$.Owner.HomeLink}}"> <a href="{{$.Owner.HomeLink}}">
{{avatar $.Context $.Owner}} {{ctx.AvatarUtils.Avatar $.Owner}}
{{$.Owner.DisplayName}} {{$.Owner.DisplayName}}
</a> </a>
</td> </td>

View File

@ -55,7 +55,7 @@
<div class="menu"> <div class="menu">
{{range .Users}} {{range .Users}}
<div class="item" data-value="{{.ID}}"> <div class="item" data-value="{{.ID}}">
{{avatar $.Context . 28 "mini"}}{{template "repo/search_name" .}} {{ctx.AvatarUtils.Avatar . 28 "mini"}}{{template "repo/search_name" .}}
</div> </div>
{{end}} {{end}}
</div> </div>
@ -116,7 +116,7 @@
<div class="menu"> <div class="menu">
{{range .Users}} {{range .Users}}
<div class="item" data-value="{{.ID}}"> <div class="item" data-value="{{.ID}}">
{{avatar $.Context . 28 "mini"}}{{template "repo/search_name" .}} {{ctx.AvatarUtils.Avatar . 28 "mini"}}{{template "repo/search_name" .}}
</div> </div>
{{end}} {{end}}
</div> </div>
@ -206,7 +206,7 @@
<div class="menu"> <div class="menu">
{{range .Users}} {{range .Users}}
<div class="item" data-value="{{.ID}}"> <div class="item" data-value="{{.ID}}">
{{avatar $.Context . 28 "mini"}}{{template "repo/search_name" .}} {{ctx.AvatarUtils.Avatar . 28 "mini"}}{{template "repo/search_name" .}}
</div> </div>
{{end}} {{end}}
</div> </div>

View File

@ -32,7 +32,7 @@
<div class="menu"> <div class="menu">
{{range .Users}} {{range .Users}}
<div class="item" data-value="{{.ID}}"> <div class="item" data-value="{{.ID}}">
{{avatar $.Context . 28 "mini"}}{{template "repo/search_name" .}} {{ctx.AvatarUtils.Avatar . 28 "mini"}}{{template "repo/search_name" .}}
</div> </div>
{{end}} {{end}}
</div> </div>
@ -89,7 +89,7 @@
{{$userIDs := .AllowlistUserIDs}} {{$userIDs := .AllowlistUserIDs}}
{{range $.Users}} {{range $.Users}}
{{if SliceUtils.Contains $userIDs .ID}} {{if SliceUtils.Contains $userIDs .ID}}
<a class="ui basic label" href="{{.HomeLink}}">{{avatar $.Context . 26}} {{.GetDisplayName}}</a> <a class="ui basic label" href="{{.HomeLink}}">{{ctx.AvatarUtils.Avatar . 26}} {{.GetDisplayName}}</a>
{{end}} {{end}}
{{end}} {{end}}
{{if $.Owner.IsOrganization}} {{if $.Owner.IsOrganization}}

View File

@ -3,10 +3,10 @@
<div title="{{if eq .verification.TrustStatus "trusted"}}{{else if eq .verification.TrustStatus "untrusted"}}{{$.root.locale.Tr "repo.commits.signed_by_untrusted_user"}}: {{else}}{{$.root.locale.Tr "repo.commits.signed_by_untrusted_user_unmatched"}}: {{end}}{{.verification.Reason}}"> <div title="{{if eq .verification.TrustStatus "trusted"}}{{else if eq .verification.TrustStatus "untrusted"}}{{$.root.locale.Tr "repo.commits.signed_by_untrusted_user"}}: {{else}}{{$.root.locale.Tr "repo.commits.signed_by_untrusted_user_unmatched"}}: {{end}}{{.verification.Reason}}">
{{if ne .verification.SigningUser.ID 0}} {{if ne .verification.SigningUser.ID 0}}
{{svg "gitea-lock"}} {{svg "gitea-lock"}}
{{avatar $.root.Context .verification.SigningUser 28 "signature"}} {{ctx.AvatarUtils.Avatar .verification.SigningUser 28 "signature"}}
{{else}} {{else}}
<span title="{{$.root.locale.Tr "gpg.default_key"}}">{{svg "gitea-lock-cog"}}</span> <span title="{{$.root.locale.Tr "gpg.default_key"}}">{{svg "gitea-lock-cog"}}</span>
{{avatarByEmail $.root.Context .verification.SigningEmail "" 28 "signature"}} {{ctx.AvatarUtils.AvatarByEmail .verification.SigningEmail "" 28 "signature"}}
{{end}} {{end}}
</div> </div>
{{else}} {{else}}

View File

@ -8,7 +8,7 @@
{{range .Cards}} {{range .Cards}}
<li class="item ui segment"> <li class="item ui segment">
<a href="{{.HomeLink}}"> <a href="{{.HomeLink}}">
{{avatar $.Context .}} {{ctx.AvatarUtils.Avatar .}}
</a> </a>
<h3 class="name"><a href="{{.HomeLink}}">{{.DisplayName}}</a></h3> <h3 class="name"><a href="{{.HomeLink}}">{{.DisplayName}}</a></h3>

View File

@ -6,7 +6,7 @@
<div class="ui active tiny slow centered inline">…</div> <div class="ui active tiny slow centered inline">…</div>
{{else}} {{else}}
{{if .LatestCommitUser}} {{if .LatestCommitUser}}
{{avatar $.Context .LatestCommitUser 24}} {{ctx.AvatarUtils.Avatar .LatestCommitUser 24}}
{{if .LatestCommitUser.FullName}} {{if .LatestCommitUser.FullName}}
<a class="muted author-wrapper" title="{{.LatestCommitUser.FullName}}" href="{{.LatestCommitUser.HomeLink}}"><strong>{{.LatestCommitUser.FullName}}</strong></a> <a class="muted author-wrapper" title="{{.LatestCommitUser.FullName}}" href="{{.LatestCommitUser.HomeLink}}"><strong>{{.LatestCommitUser.FullName}}</strong></a>
{{else}} {{else}}
@ -14,7 +14,7 @@
{{end}} {{end}}
{{else}} {{else}}
{{if .LatestCommit.Author}} {{if .LatestCommit.Author}}
{{avatarByEmail $.Context .LatestCommit.Author.Email .LatestCommit.Author.Name 24}} {{ctx.AvatarUtils.AvatarByEmail .LatestCommit.Author.Email .LatestCommit.Author.Name 24}}
<span class="author-wrapper" title="{{.LatestCommit.Author.Name}}"><strong>{{.LatestCommit.Author.Name}}</strong></span> <span class="author-wrapper" title="{{.LatestCommit.Author.Name}}"><strong>{{.LatestCommit.Author.Name}}</strong></span>
{{end}} {{end}}
{{end}} {{end}}

View File

@ -37,7 +37,7 @@
<div class="text grey"> <div class="text grey">
{{range .Assignees}} {{range .Assignees}}
<a class="ui assignee gt-no-underline" href="{{.HomeLink}}" data-tooltip-content="{{.GetDisplayName}}"> <a class="ui assignee gt-no-underline" href="{{.HomeLink}}" data-tooltip-content="{{.GetDisplayName}}">
{{avatar $.Context . 20}} {{ctx.AvatarUtils.Avatar . 20}}
</a> </a>
{{end}} {{end}}
</div> </div>

View File

@ -1 +1 @@
<a class="avatar"{{if gt .user.ID 0}} href="{{.user.HomeLink}}"{{end}}>{{avatar $.Context .user}}</a> <a class="avatar"{{if gt .user.ID 0}} href="{{.user.HomeLink}}"{{end}}>{{ctx.AvatarUtils.Avatar .user}}</a>

View File

@ -3,7 +3,7 @@
<div class="ui vertically grid head"> <div class="ui vertically grid head">
<div class="column"> <div class="column">
<div class="ui header"> <div class="ui header">
{{avatar $.Context . 100}} {{ctx.AvatarUtils.Avatar . 100}}
<span class="text thin grey"><a href="{{.HomeLink}}">{{.DisplayName}}</a></span> <span class="text thin grey"><a href="{{.HomeLink}}">{{.DisplayName}}</a></span>
<span class="org-visibility"> <span class="org-visibility">
{{if .Visibility.IsLimited}}<div class="ui medium basic horizontal label">{{$.locale.Tr "org.settings.visibility.limited_shortname"}}</div>{{end}} {{if .Visibility.IsLimited}}<div class="ui medium basic horizontal label">{{$.locale.Tr "org.settings.visibility.limited_shortname"}}</div>{{end}}

View File

@ -3,11 +3,11 @@
{{if eq .SignedUserID .ContextUser.ID}} {{if eq .SignedUserID .ContextUser.ID}}
<a class="image" href="{{AppSubUrl}}/user/settings" data-tooltip-content="{{.locale.Tr "user.change_avatar"}}"> <a class="image" href="{{AppSubUrl}}/user/settings" data-tooltip-content="{{.locale.Tr "user.change_avatar"}}">
{{/* the size doesn't take affect (and no need to take affect), image size(width) should be controlled by the parent container since this is not a flex layout*/}} {{/* the size doesn't take affect (and no need to take affect), image size(width) should be controlled by the parent container since this is not a flex layout*/}}
{{avatar $.Context .ContextUser 256}} {{ctx.AvatarUtils.Avatar .ContextUser 256}}
</a> </a>
{{else}} {{else}}
<span class="image"> <span class="image">
{{avatar $.Context .ContextUser 256}} {{ctx.AvatarUtils.Avatar .ContextUser 256}}
</span> </span>
{{end}} {{end}}
</div> </div>
@ -86,7 +86,7 @@
{{if (or .Visibility.IsPublic (and ($.SignedUser) (or .Visibility.IsLimited (and (.HasMemberWithUserID $.SignedUserID) .Visibility.IsPrivate) ($.IsAdmin))))}} {{if (or .Visibility.IsPublic (and ($.SignedUser) (or .Visibility.IsLimited (and (.HasMemberWithUserID $.SignedUserID) .Visibility.IsPrivate) ($.IsAdmin))))}}
<li> <li>
<a href="{{.HomeLink}}" data-tooltip-content="{{.Name}}"> <a href="{{.HomeLink}}" data-tooltip-content="{{.Name}}">
{{avatar $.Context .}} {{ctx.AvatarUtils.Avatar .}}
</a> </a>
</li> </li>
{{end}} {{end}}

View File

@ -2,7 +2,7 @@
{{range .Feeds}} {{range .Feeds}}
<div class="flex-item"> <div class="flex-item">
<div class="flex-item-leading"> <div class="flex-item-leading">
{{avatarByAction $.Context .}} {{ctx.AvatarUtils.AvatarByAction .}}
</div> </div>
<div class="flex-item-main gt-gap-3"> <div class="flex-item-main gt-gap-3">
<div> <div>

View File

@ -3,7 +3,7 @@
<div class="item"> <div class="item">
<div class="ui floating dropdown jump"> <div class="ui floating dropdown jump">
<span class="text truncated-item-container"> <span class="text truncated-item-container">
{{avatar $.Context .ContextUser}} {{ctx.AvatarUtils.Avatar .ContextUser}}
<span class="truncated-item-name">{{.ContextUser.ShortName 40}}</span> <span class="truncated-item-name">{{.ContextUser.ShortName 40}}</span>
<span class="org-visibility"> <span class="org-visibility">
{{if .ContextUser.Visibility.IsLimited}}<div class="ui basic tiny horizontal label">{{.locale.Tr "org.settings.visibility.limited_shortname"}}</div>{{end}} {{if .ContextUser.Visibility.IsLimited}}<div class="ui basic tiny horizontal label">{{.locale.Tr "org.settings.visibility.limited_shortname"}}</div>{{end}}
@ -17,7 +17,7 @@
</div> </div>
<div class="scrolling menu items"> <div class="scrolling menu items">
<a class="{{if eq .ContextUser.ID .SignedUser.ID}}active selected{{end}} item truncated-item-container" href="{{AppSubUrl}}/{{if .PageIsIssues}}issues{{else if .PageIsPulls}}pulls{{else if .PageIsMilestonesDashboard}}milestones{{end}}"> <a class="{{if eq .ContextUser.ID .SignedUser.ID}}active selected{{end}} item truncated-item-container" href="{{AppSubUrl}}/{{if .PageIsIssues}}issues{{else if .PageIsPulls}}pulls{{else if .PageIsMilestonesDashboard}}milestones{{end}}">
{{avatar $.Context .SignedUser}} {{ctx.AvatarUtils.Avatar .SignedUser}}
<span class="truncated-item-name">{{.SignedUser.ShortName 40}}</span> <span class="truncated-item-name">{{.SignedUser.ShortName 40}}</span>
<span class="org-visibility"> <span class="org-visibility">
{{if .SignedUser.Visibility.IsLimited}}<div class="ui basic tiny horizontal label">{{$.locale.Tr "org.settings.visibility.limited_shortname"}}</div>{{end}} {{if .SignedUser.Visibility.IsLimited}}<div class="ui basic tiny horizontal label">{{$.locale.Tr "org.settings.visibility.limited_shortname"}}</div>{{end}}
@ -26,7 +26,7 @@
</a> </a>
{{range .Orgs}} {{range .Orgs}}
<a class="{{if eq $.ContextUser.ID .ID}}active selected{{end}} item truncated-item-container" title="{{.Name}}" href="{{.OrganisationLink}}/{{if $.PageIsIssues}}issues{{else if $.PageIsPulls}}pulls{{else if $.PageIsMilestonesDashboard}}milestones{{else}}dashboard{{end}}"> <a class="{{if eq $.ContextUser.ID .ID}}active selected{{end}} item truncated-item-container" title="{{.Name}}" href="{{.OrganisationLink}}/{{if $.PageIsIssues}}issues{{else if $.PageIsPulls}}pulls{{else if $.PageIsMilestonesDashboard}}milestones{{else}}dashboard{{end}}">
{{avatar $.Context .}} {{ctx.AvatarUtils.Avatar .}}
<span class="truncated-item-name">{{.ShortName 40}}</span> <span class="truncated-item-name">{{.ShortName 40}}</span>
<span class="org-visibility"> <span class="org-visibility">
{{if .Visibility.IsLimited}}<div class="ui basic tiny horizontal label">{{$.locale.Tr "org.settings.visibility.limited_shortname"}}</div>{{end}} {{if .Visibility.IsLimited}}<div class="ui basic tiny horizontal label">{{$.locale.Tr "org.settings.visibility.limited_shortname"}}</div>{{end}}

View File

@ -14,7 +14,7 @@
{{range .Orgs}} {{range .Orgs}}
<div class="flex-item"> <div class="flex-item">
<div class="flex-item-leading"> <div class="flex-item-leading">
{{avatar $.Context . 28 "mini"}} {{ctx.AvatarUtils.Avatar . 28 "mini"}}
</div> </div>
<div class="flex-item-main"> <div class="flex-item-main">
<div class="flex-item-title">{{template "shared/user/name" .}}</div> <div class="flex-item-title">{{template "shared/user/name" .}}</div>