2024-01-30 23:45:54 +09:00
< div id = "profile-avatar-card" class = "ui card" >
2023-07-07 03:59:24 +09:00
< div id = "profile-avatar" class = "content gt-df" >
{{ if eq .SignedUserID .ContextUser.ID }}
2023-09-25 17:56:50 +09:00
< a class = "image" href = " {{ AppSubUrl }} /user/settings" data-tooltip-content = " {{ ctx .Locale.Tr "user.change_avatar" }} " >
2023-07-07 03:59:24 +09:00
{{/* 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*/}}
2023-08-10 12:19:39 +09:00
{{ ctx .AvatarUtils.Avatar .ContextUser 256 }}
2023-07-07 03:59:24 +09:00
< / a >
{{ else }}
< span class = "image" >
2023-08-10 12:19:39 +09:00
{{ ctx .AvatarUtils.Avatar .ContextUser 256 }}
2023-07-07 03:59:24 +09:00
< / span >
{{ end }}
< / div >
< div class = "content gt-word-break profile-avatar-name" >
{{ if .ContextUser.FullName }} < span class = "header text center" > {{ .ContextUser.FullName }} </ span > {{ end }}
2023-10-08 11:48:32 +09:00
< span class = "username text center" > {{ .ContextUser.Name }} {{ if .IsAdmin }}
< a class = "muted" href = " {{ AppSubUrl }} /admin/users/ {{ .ContextUser.ID }} " data-tooltip-content = " {{ ctx .Locale.Tr "admin.users.details" }} " >
{{ svg "octicon-gear" 18 }}
< / a >
{{ end }} </ span >
2023-07-07 03:59:24 +09:00
< div class = "gt-mt-3" >
2023-09-25 21:42:40 +09:00
< a class = "muted" href = " {{ .ContextUser.HomeLink }} ?tab=followers" > {{ svg "octicon-person" 18 "gt-mr-2" }}{{ .NumFollowers }} {{ ctx .Locale.Tr "user.followers" }} </ a > · < a class = "muted" href = " {{ .ContextUser.HomeLink }} ?tab=following" > {{ .NumFollowing }} {{ ctx .Locale.Tr "user.following" }} </ a >
2023-09-03 20:06:59 +09:00
{{ if .EnableFeed }}
2023-09-25 17:56:50 +09:00
< a href = " {{ .ContextUser.HomeLink }} .rss" >< i class = "ui text grey gt-ml-3" data-tooltip-content = " {{ ctx .Locale.Tr "rss_feed" }} " > {{ svg "octicon-rss" 18 }} </ i ></ a >
2023-09-03 20:06:59 +09:00
{{ end }}
2023-07-07 03:59:24 +09:00
< / div >
< / div >
< div class = "extra content gt-word-break" >
< ul >
{{ if .ContextUser.Location }}
2023-07-31 17:44:45 +09:00
< li >
{{ svg "octicon-location" }}
< span class = "gt-f1" > {{ .ContextUser.Location }} </ span >
{{ if .UserLocationMapURL }}
{{/* We presume that the UserLocationMapURL is safe, as it is provided by the site administrator. */}}
2023-09-25 17:56:50 +09:00
< a href = " {{ .UserLocationMapURL | Safe }}{{ .ContextUser.Location | QueryEscape }} " rel = "nofollow noreferrer" data-tooltip-content = " {{ ctx .Locale.Tr "user.show_on_map" }} " >
2023-07-31 17:44:45 +09:00
{{ svg "octicon-link-external" }}
< / a >
{{ end }}
< / li >
2023-07-07 03:59:24 +09:00
{{ end }}
{{ if ( eq .SignedUserID .ContextUser.ID ) }}
< li >
{{ svg "octicon-mail" }}
2023-07-31 17:44:45 +09:00
< a class = "gt-f1" href = "mailto: {{ .ContextUser.Email }} " rel = "nofollow" > {{ .ContextUser.Email }} </ a >
2023-08-12 02:40:38 +09:00
< a href = " {{ AppSubUrl }} /user/settings#privacy-user-settings" >
2023-07-07 03:59:24 +09:00
{{ if .ShowUserEmail }}
2023-09-25 17:56:50 +09:00
< i data-tooltip-content = " {{ ctx .Locale.Tr "user.email_visibility.limited" }} " >
2023-07-07 03:59:24 +09:00
{{ svg "octicon-unlock" }}
< / i >
{{ else }}
2023-09-25 17:56:50 +09:00
< i data-tooltip-content = " {{ ctx .Locale.Tr "user.email_visibility.private" }} " >
2023-07-07 03:59:24 +09:00
{{ svg "octicon-lock" }}
< / i >
{{ end }}
< / a >
< / li >
{{ else }}
{{ if .ShowUserEmail }}
< li >
{{ svg "octicon-mail" }}
< a href = "mailto: {{ .ContextUser.Email }} " rel = "nofollow" > {{ .ContextUser.Email }} </ a >
< / li >
{{ end }}
{{ end }}
{{ if .ContextUser.Website }}
< li >
{{ svg "octicon-link" }}
< a target = "_blank" rel = "noopener noreferrer me" href = " {{ .ContextUser.Website }} " > {{ .ContextUser.Website }} </ a >
< / li >
{{ end }}
{{ if $.RenderedDescription }}
< li >
< div class = "render-content markup" > {{ $.RenderedDescription | Str2html }} </ div >
< / li >
{{ end }}
{{ range .OpenIDs }}
{{ if .Show }}
< li >
{{ svg "fontawesome-openid" }}
< a target = "_blank" rel = "noopener noreferrer" href = " {{ .URI }} " > {{ .URI }} </ a >
< / li >
{{ end }}
{{ end }}
2023-09-25 17:56:50 +09:00
< li > {{ svg "octicon-calendar" }} < span > {{ ctx .Locale.Tr "user.joined_on" ( DateTime "short" .ContextUser.CreatedUnix ) | Safe }} </ span ></ li >
2023-07-07 03:59:24 +09:00
{{ if and .Orgs .HasOrgsVisible }}
< li >
< ul class = "user-orgs" >
{{ range .Orgs }}
2023-10-04 11:11:01 +09:00
{{ if ( or .Visibility.IsPublic ( and ( $.SignedUser ) ( or .Visibility.IsLimited ( and ( .HasMemberWithUserID ctx $.SignedUserID ) .Visibility.IsPrivate ) ( $.IsAdmin )))) }}
2023-07-07 03:59:24 +09:00
< li >
< a href = " {{ .HomeLink }} " data-tooltip-content = " {{ .Name }} " >
2023-08-10 12:19:39 +09:00
{{ ctx .AvatarUtils.Avatar . }}
2023-07-07 03:59:24 +09:00
< / a >
< / li >
{{ end }}
{{ end }}
< / ul >
< / li >
{{ end }}
{{ if .Badges }}
< li >
< ul class = "user-badges" >
{{ range .Badges }}
< li >
< img width = "64" height = "64" src = " {{ .ImageURL }} " alt = " {{ .Description }} " data-tooltip-content = " {{ .Description }} " >
< / li >
{{ end }}
< / ul >
< / li >
{{ end }}
{{ if and .IsSigned ( ne .SignedUserID .ContextUser.ID ) }}
2024-01-30 23:45:54 +09:00
< li class = "follow" hx-target = "#profile-avatar-card" hx-indicator = "#profile-avatar-card" >
2023-07-07 03:59:24 +09:00
{{ if $.IsFollowing }}
2024-01-30 23:45:54 +09:00
< button hx-post = " {{ .ContextUser.HomeLink }} ?action=unfollow" class = "ui basic red button" >
2023-09-25 17:56:50 +09:00
{{ svg "octicon-person" }} {{ ctx .Locale.Tr "user.unfollow" }}
2023-07-08 00:27:12 +09:00
< / button >
2023-07-07 03:59:24 +09:00
{{ else }}
2024-01-30 23:45:54 +09:00
< button hx-post = " {{ .ContextUser.HomeLink }} ?action=follow" class = "ui basic primary button" >
2023-09-25 17:56:50 +09:00
{{ svg "octicon-person" }} {{ ctx .Locale.Tr "user.follow" }}
2023-07-08 00:27:12 +09:00
< / button >
2023-07-07 03:59:24 +09:00
{{ end }}
< / li >
{{ end }}
< / ul >
< / div >
< / div >