2023-07-06 14:59:24 -04:00
|
|
|
<div class="ui card">
|
|
|
|
<div id="profile-avatar" class="content gt-df">
|
|
|
|
{{if eq .SignedUserID .ContextUser.ID}}
|
|
|
|
<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*/}}
|
2023-08-09 23:19:39 -04:00
|
|
|
{{ctx.AvatarUtils.Avatar .ContextUser 256}}
|
2023-07-06 14:59:24 -04:00
|
|
|
</a>
|
|
|
|
{{else}}
|
|
|
|
<span class="image">
|
2023-08-09 23:19:39 -04:00
|
|
|
{{ctx.AvatarUtils.Avatar .ContextUser 256}}
|
2023-07-06 14:59:24 -04: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}}
|
|
|
|
<span class="username text center">{{.ContextUser.Name}}</span>
|
|
|
|
<div class="gt-mt-3">
|
|
|
|
<a class="muted" href="{{.ContextUser.HomeLink}}?tab=followers">{{svg "octicon-person" 18 "gt-mr-2"}}{{.NumFollowers}} {{.locale.Tr "user.followers"}}</a> · <a class="muted" href="{{.ContextUser.HomeLink}}?tab=following">{{.NumFollowing}} {{.locale.Tr "user.following"}}</a>
|
2023-09-03 07:06:59 -04:00
|
|
|
{{if .EnableFeed}}
|
|
|
|
<a href="{{.ContextUser.HomeLink}}.rss"><i class="ui text grey gt-ml-3" data-tooltip-content="{{.locale.Tr "rss_feed"}}">{{svg "octicon-rss" 18}}</i></a>
|
|
|
|
{{end}}
|
2023-07-06 14:59:24 -04:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="extra content gt-word-break">
|
|
|
|
<ul>
|
|
|
|
{{if .ContextUser.Location}}
|
2023-07-31 04:44:45 -04: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. */}}
|
|
|
|
<a href="{{.UserLocationMapURL | Safe}}{{.ContextUser.Location | QueryEscape}}" rel="nofollow noreferrer" data-tooltip-content="{{.locale.Tr "user.show_on_map"}}">
|
|
|
|
{{svg "octicon-link-external"}}
|
|
|
|
</a>
|
|
|
|
{{end}}
|
|
|
|
</li>
|
2023-07-06 14:59:24 -04:00
|
|
|
{{end}}
|
|
|
|
{{if (eq .SignedUserID .ContextUser.ID)}}
|
|
|
|
<li>
|
|
|
|
{{svg "octicon-mail"}}
|
2023-07-31 04:44:45 -04:00
|
|
|
<a class="gt-f1" href="mailto:{{.ContextUser.Email}}" rel="nofollow">{{.ContextUser.Email}}</a>
|
2023-08-11 13:40:38 -04:00
|
|
|
<a href="{{AppSubUrl}}/user/settings#privacy-user-settings">
|
2023-07-06 14:59:24 -04:00
|
|
|
{{if .ShowUserEmail}}
|
2023-07-31 04:44:45 -04:00
|
|
|
<i data-tooltip-content="{{.locale.Tr "user.email_visibility.limited"}}">
|
2023-07-06 14:59:24 -04:00
|
|
|
{{svg "octicon-unlock"}}
|
|
|
|
</i>
|
|
|
|
{{else}}
|
2023-07-31 04:44:45 -04:00
|
|
|
<i data-tooltip-content="{{.locale.Tr "user.email_visibility.private"}}">
|
2023-07-06 14:59:24 -04: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-07-31 04:44:45 -04:00
|
|
|
<li>{{svg "octicon-calendar"}} <span>{{.locale.Tr "user.joined_on" (DateTime "short" .ContextUser.CreatedUnix) | Safe}}</span></li>
|
2023-07-06 14:59:24 -04:00
|
|
|
{{if and .Orgs .HasOrgsVisible}}
|
|
|
|
<li>
|
|
|
|
<ul class="user-orgs">
|
|
|
|
{{range .Orgs}}
|
|
|
|
{{if (or .Visibility.IsPublic (and ($.SignedUser) (or .Visibility.IsLimited (and (.HasMemberWithUserID $.SignedUserID) .Visibility.IsPrivate) ($.IsAdmin))))}}
|
|
|
|
<li>
|
|
|
|
<a href="{{.HomeLink}}" data-tooltip-content="{{.Name}}">
|
2023-08-09 23:19:39 -04:00
|
|
|
{{ctx.AvatarUtils.Avatar .}}
|
2023-07-06 14:59:24 -04: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)}}
|
|
|
|
<li class="follow">
|
|
|
|
{{if $.IsFollowing}}
|
2023-07-07 11:27:12 -04:00
|
|
|
<button class="ui basic red button link-action" data-url="{{.ContextUser.HomeLink}}?action=unfollow">
|
|
|
|
{{svg "octicon-person"}} {{.locale.Tr "user.unfollow"}}
|
|
|
|
</button>
|
2023-07-06 14:59:24 -04:00
|
|
|
{{else}}
|
2023-09-18 18:05:31 -04:00
|
|
|
<button class="ui basic primary button link-action" data-url="{{.ContextUser.HomeLink}}?action=follow">
|
2023-07-07 11:27:12 -04:00
|
|
|
{{svg "octicon-person"}} {{.locale.Tr "user.follow"}}
|
|
|
|
</button>
|
2023-07-06 14:59:24 -04:00
|
|
|
{{end}}
|
|
|
|
</li>
|
|
|
|
{{end}}
|
|
|
|
</ul>
|
|
|
|
</div>
|
|
|
|
</div>
|