2024-01-30 22:45:54 +08:00
|
|
|
<div id="profile-avatar-card" class="ui card">
|
2024-03-22 21:45:10 +08:00
|
|
|
<div id="profile-avatar" class="content tw-flex">
|
2023-07-07 02:59:24 +08:00
|
|
|
{{if eq .SignedUserID .ContextUser.ID}}
|
2023-09-25 16:56:50 +08:00
|
|
|
<a class="image" href="{{AppSubUrl}}/user/settings" data-tooltip-content="{{ctx.Locale.Tr "user.change_avatar"}}">
|
2023-07-07 02:59:24 +08: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 11:19:39 +08:00
|
|
|
{{ctx.AvatarUtils.Avatar .ContextUser 256}}
|
2023-07-07 02:59:24 +08:00
|
|
|
</a>
|
|
|
|
{{else}}
|
|
|
|
<span class="image">
|
2023-08-10 11:19:39 +08:00
|
|
|
{{ctx.AvatarUtils.Avatar .ContextUser 256}}
|
2023-07-07 02:59:24 +08:00
|
|
|
</span>
|
|
|
|
{{end}}
|
|
|
|
</div>
|
2024-06-04 21:57:11 +08:00
|
|
|
<div class="content tw-break-anywhere profile-avatar-name">
|
2023-07-07 02:59:24 +08:00
|
|
|
{{if .ContextUser.FullName}}<span class="header text center">{{.ContextUser.FullName}}</span>{{end}}
|
2023-10-08 10:48:32 +08: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>
|
Migrate margin and padding helpers to tailwind (#30043)
This will conclude the refactor of 1:1 class replacements to tailwind,
except `gt-hidden`. Commands ran:
```bash
perl -p -i -e 's#gt-(p|m)([lrtbxy])?-0#tw-$1$2-0#g' {web_src/js,templates,routers,services}/**/*
perl -p -i -e 's#gt-(p|m)([lrtbxy])?-1#tw-$1$2-0.5#g' {web_src/js,templates,routers,services}/**/*
perl -p -i -e 's#gt-(p|m)([lrtbxy])?-2#tw-$1$2-1#g' {web_src/js,templates,routers,services}/**/*
perl -p -i -e 's#gt-(p|m)([lrtbxy])?-3#tw-$1$2-2#g' {web_src/js,templates,routers,services}/**/*
perl -p -i -e 's#gt-(p|m)([lrtbxy])?-4#tw-$1$2-4#g' {web_src/js,templates,routers,services}/**/*
perl -p -i -e 's#gt-(p|m)([lrtbxy])?-5#tw-$1$2-8#g' {web_src/js,templates,routers,services}/**/*
```
2024-03-25 00:42:49 +08:00
|
|
|
<div class="tw-mt-2">
|
|
|
|
<a class="muted" href="{{.ContextUser.HomeLink}}?tab=followers">{{svg "octicon-person" 18 "tw-mr-1"}}{{.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 19:06:59 +08:00
|
|
|
{{if .EnableFeed}}
|
Migrate margin and padding helpers to tailwind (#30043)
This will conclude the refactor of 1:1 class replacements to tailwind,
except `gt-hidden`. Commands ran:
```bash
perl -p -i -e 's#gt-(p|m)([lrtbxy])?-0#tw-$1$2-0#g' {web_src/js,templates,routers,services}/**/*
perl -p -i -e 's#gt-(p|m)([lrtbxy])?-1#tw-$1$2-0.5#g' {web_src/js,templates,routers,services}/**/*
perl -p -i -e 's#gt-(p|m)([lrtbxy])?-2#tw-$1$2-1#g' {web_src/js,templates,routers,services}/**/*
perl -p -i -e 's#gt-(p|m)([lrtbxy])?-3#tw-$1$2-2#g' {web_src/js,templates,routers,services}/**/*
perl -p -i -e 's#gt-(p|m)([lrtbxy])?-4#tw-$1$2-4#g' {web_src/js,templates,routers,services}/**/*
perl -p -i -e 's#gt-(p|m)([lrtbxy])?-5#tw-$1$2-8#g' {web_src/js,templates,routers,services}/**/*
```
2024-03-25 00:42:49 +08:00
|
|
|
<a href="{{.ContextUser.HomeLink}}.rss"><i class="ui text grey tw-ml-2" data-tooltip-content="{{ctx.Locale.Tr "rss_feed"}}">{{svg "octicon-rss" 18}}</i></a>
|
2023-09-03 19:06:59 +08:00
|
|
|
{{end}}
|
2023-07-07 02:59:24 +08:00
|
|
|
</div>
|
|
|
|
</div>
|
2024-06-04 21:57:11 +08:00
|
|
|
<div class="extra content tw-break-anywhere">
|
2023-07-07 02:59:24 +08:00
|
|
|
<ul>
|
2024-03-04 16:16:03 +08:00
|
|
|
{{if .UserBlocking}}
|
|
|
|
<li class="text red">{{svg "octicon-circle-slash"}} {{ctx.Locale.Tr "user.block.blocked"}}</li>
|
|
|
|
{{if .UserBlocking.Note}}
|
|
|
|
<li class="text small red">{{ctx.Locale.Tr "user.block.note"}}: {{.UserBlocking.Note}}</li>
|
|
|
|
{{end}}
|
|
|
|
{{end}}
|
2023-07-07 02:59:24 +08:00
|
|
|
{{if .ContextUser.Location}}
|
2023-07-31 16:44:45 +08:00
|
|
|
<li>
|
|
|
|
{{svg "octicon-location"}}
|
2024-03-22 21:45:10 +08:00
|
|
|
<span class="tw-flex-1">{{.ContextUser.Location}}</span>
|
2024-02-18 17:52:02 +08:00
|
|
|
{{if .ContextUserLocationMapURL}}
|
|
|
|
<a href="{{.ContextUserLocationMapURL}}" rel="nofollow noreferrer" data-tooltip-content="{{ctx.Locale.Tr "user.show_on_map"}}">
|
2023-07-31 16:44:45 +08:00
|
|
|
{{svg "octicon-link-external"}}
|
|
|
|
</a>
|
|
|
|
{{end}}
|
|
|
|
</li>
|
2023-07-07 02:59:24 +08:00
|
|
|
{{end}}
|
|
|
|
{{if (eq .SignedUserID .ContextUser.ID)}}
|
|
|
|
<li>
|
|
|
|
{{svg "octicon-mail"}}
|
2024-03-22 21:45:10 +08:00
|
|
|
<a class="tw-flex-1" href="mailto:{{.ContextUser.Email}}" rel="nofollow">{{.ContextUser.Email}}</a>
|
2024-06-12 12:06:12 +08:00
|
|
|
<a class="flex-text-inline" href="{{AppSubUrl}}/user/settings#privacy-user-settings" data-tooltip-content="{{ctx.Locale.Tr (Iif .ShowUserEmail "user.email_visibility.limited" "user.email_visibility.private")}}">
|
|
|
|
{{svg (Iif .ShowUserEmail "octicon-unlock" "octicon-lock")}}
|
2023-07-07 02:59:24 +08:00
|
|
|
</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>
|
2024-03-01 15:11:51 +08:00
|
|
|
<div class="render-content markup">{{$.RenderedDescription}}</div>
|
2023-07-07 02:59:24 +08:00
|
|
|
</li>
|
|
|
|
{{end}}
|
|
|
|
{{range .OpenIDs}}
|
|
|
|
{{if .Show}}
|
|
|
|
<li>
|
|
|
|
{{svg "fontawesome-openid"}}
|
|
|
|
<a target="_blank" rel="noopener noreferrer" href="{{.URI}}">{{.URI}}</a>
|
|
|
|
</li>
|
|
|
|
{{end}}
|
|
|
|
{{end}}
|
2024-02-23 01:02:33 +08:00
|
|
|
<li>{{svg "octicon-calendar"}} <span>{{ctx.Locale.Tr "user.joined_on" (DateTime "short" .ContextUser.CreatedUnix)}}</span></li>
|
2023-07-07 02:59:24 +08:00
|
|
|
{{if and .Orgs .HasOrgsVisible}}
|
|
|
|
<li>
|
|
|
|
<ul class="user-orgs">
|
|
|
|
{{range .Orgs}}
|
2023-10-04 10:11:01 +08:00
|
|
|
{{if (or .Visibility.IsPublic (and ($.SignedUser) (or .Visibility.IsLimited (and (.HasMemberWithUserID ctx $.SignedUserID) .Visibility.IsPrivate) ($.IsAdmin))))}}
|
2023-07-07 02:59:24 +08:00
|
|
|
<li>
|
|
|
|
<a href="{{.HomeLink}}" data-tooltip-content="{{.Name}}">
|
2023-08-10 11:19:39 +08:00
|
|
|
{{ctx.AvatarUtils.Avatar .}}
|
2023-07-07 02:59:24 +08: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-03-04 16:16:03 +08:00
|
|
|
{{if not .UserBlocking}}
|
|
|
|
<li class="follow" hx-target="#profile-avatar-card" hx-indicator="#profile-avatar-card">
|
|
|
|
{{if $.IsFollowing}}
|
|
|
|
<button hx-post="{{.ContextUser.HomeLink}}?action=unfollow" class="ui basic red button">
|
|
|
|
{{svg "octicon-person"}} {{ctx.Locale.Tr "user.unfollow"}}
|
|
|
|
</button>
|
|
|
|
{{else}}
|
|
|
|
<button hx-post="{{.ContextUser.HomeLink}}?action=follow" class="ui basic primary button">
|
|
|
|
{{svg "octicon-person"}} {{ctx.Locale.Tr "user.follow"}}
|
|
|
|
</button>
|
|
|
|
{{end}}
|
|
|
|
</li>
|
2023-07-07 02:59:24 +08:00
|
|
|
{{end}}
|
2024-03-04 16:16:03 +08:00
|
|
|
<li>
|
|
|
|
{{if not .UserBlocking}}
|
|
|
|
<a class="muted show-modal" href="#" data-modal="#block-user-modal" data-modal-modal-blockee="{{.ContextUser.Name}}" data-modal-modal-blockee-name="{{.ContextUser.GetDisplayName}}" data-modal-modal-form.action="{{AppSubUrl}}/user/settings/blocked_users">{{ctx.Locale.Tr "user.block.block.user"}}</a>
|
|
|
|
{{else}}
|
|
|
|
<a class="muted" href="{{AppSubUrl}}/user/settings/blocked_users">{{ctx.Locale.Tr "user.block.unblock"}}</a>
|
|
|
|
{{end}}
|
|
|
|
</li>
|
2023-07-07 02:59:24 +08:00
|
|
|
{{end}}
|
|
|
|
</ul>
|
|
|
|
</div>
|
|
|
|
</div>
|
2024-03-04 16:16:03 +08:00
|
|
|
|
|
|
|
{{template "shared/user/block_user_dialog" .}}
|