2024-01-30 20:15:54 +05:30
< div id = "profile-avatar-card" class = "ui card" >
2023-07-07 00:29:24 +05:30
< div id = "profile-avatar" class = "content gt-df" >
{{ if eq .SignedUserID .ContextUser.ID }}
2023-09-25 14:26:50 +05:30
< a class = "image" href = " {{ AppSubUrl }} /user/settings" data-tooltip-content = " {{ ctx .Locale.Tr "user.change_avatar" }} " >
2023-07-07 00:29:24 +05:30
{{/* 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 08:49:39 +05:30
{{ ctx .AvatarUtils.Avatar .ContextUser 256 }}
2023-07-07 00:29:24 +05:30
< / a >
{{ else }}
< span class = "image" >
2023-08-10 08:49:39 +05:30
{{ ctx .AvatarUtils.Avatar .ContextUser 256 }}
2023-07-07 00:29:24 +05:30
< / 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 08:18:32 +05:30
< 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 00:29:24 +05:30
< div class = "gt-mt-3" >
2023-09-25 18:12:40 +05:30
< 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 16:36:59 +05:30
{{ if .EnableFeed }}
2023-09-25 14:26:50 +05:30
< 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 16:36:59 +05:30
{{ end }}
2023-07-07 00:29:24 +05:30
< / div >
< / div >
< div class = "extra content gt-word-break" >
< ul >
{{ if .ContextUser.Location }}
2023-07-31 14:14:45 +05:30
< 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 14:26:50 +05:30
< a href = " {{ .UserLocationMapURL | Safe }}{{ .ContextUser.Location | QueryEscape }} " rel = "nofollow noreferrer" data-tooltip-content = " {{ ctx .Locale.Tr "user.show_on_map" }} " >
2023-07-31 14:14:45 +05:30
{{ svg "octicon-link-external" }}
< / a >
{{ end }}
< / li >
2023-07-07 00:29:24 +05:30
{{ end }}
{{ if ( eq .SignedUserID .ContextUser.ID ) }}
< li >
{{ svg "octicon-mail" }}
2023-07-31 14:14:45 +05:30
< a class = "gt-f1" href = "mailto: {{ .ContextUser.Email }} " rel = "nofollow" > {{ .ContextUser.Email }} </ a >
2023-08-11 23:10:38 +05:30
< a href = " {{ AppSubUrl }} /user/settings#privacy-user-settings" >
2023-07-07 00:29:24 +05:30
{{ if .ShowUserEmail }}
2023-09-25 14:26:50 +05:30
< i data-tooltip-content = " {{ ctx .Locale.Tr "user.email_visibility.limited" }} " >
2023-07-07 00:29:24 +05:30
{{ svg "octicon-unlock" }}
< / i >
{{ else }}
2023-09-25 14:26:50 +05:30
< i data-tooltip-content = " {{ ctx .Locale.Tr "user.email_visibility.private" }} " >
2023-07-07 00:29:24 +05:30
{{ 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 14:26:50 +05:30
< li > {{ svg "octicon-calendar" }} < span > {{ ctx .Locale.Tr "user.joined_on" ( DateTime "short" .ContextUser.CreatedUnix ) | Safe }} </ span ></ li >
2023-07-07 00:29:24 +05:30
{{ if and .Orgs .HasOrgsVisible }}
< li >
< ul class = "user-orgs" >
{{ range .Orgs }}
2023-10-04 07:41:01 +05:30
{{ if ( or .Visibility.IsPublic ( and ( $.SignedUser ) ( or .Visibility.IsLimited ( and ( .HasMemberWithUserID ctx $.SignedUserID ) .Visibility.IsPrivate ) ( $.IsAdmin )))) }}
2023-07-07 00:29:24 +05:30
< li >
< a href = " {{ .HomeLink }} " data-tooltip-content = " {{ .Name }} " >
2023-08-10 08:49:39 +05:30
{{ ctx .AvatarUtils.Avatar . }}
2023-07-07 00:29:24 +05:30
< / 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 20:15:54 +05:30
< li class = "follow" hx-target = "#profile-avatar-card" hx-indicator = "#profile-avatar-card" >
2023-07-07 00:29:24 +05:30
{{ if $.IsFollowing }}
2024-01-30 20:15:54 +05:30
< button hx-post = " {{ .ContextUser.HomeLink }} ?action=unfollow" class = "ui basic red button" >
2023-09-25 14:26:50 +05:30
{{ svg "octicon-person" }} {{ ctx .Locale.Tr "user.unfollow" }}
2023-07-07 20:57:12 +05:30
< / button >
2023-07-07 00:29:24 +05:30
{{ else }}
2024-01-30 20:15:54 +05:30
< button hx-post = " {{ .ContextUser.HomeLink }} ?action=follow" class = "ui basic primary button" >
2023-09-25 14:26:50 +05:30
{{ svg "octicon-person" }} {{ ctx .Locale.Tr "user.follow" }}
2023-07-07 20:57:12 +05:30
< / button >
2023-07-07 00:29:24 +05:30
{{ end }}
< / li >
{{ end }}
< / ul >
< / div >
< / div >