aboutsummaryrefslogtreecommitdiffstats
path: root/templates/shared/user/profile_big_avatar.tmpl
blob: 50d707176d544197543dd7afe2a93478cc33955a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
<div id="profile-avatar-card" class="ui card">
	<div id="profile-avatar" class="content tw-flex">
	{{if eq .SignedUserID .ContextUser.ID}}
		<a class="image" href="{{AppSubUrl}}/user/settings" data-tooltip-content="{{ctx.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*/}}
			{{ctx.AvatarUtils.Avatar .ContextUser 256}}
		</a>
	{{else}}
		<span class="image">
			{{ctx.AvatarUtils.Avatar .ContextUser 256}}
		</span>
	{{end}}
	</div>
	<div class="content tw-break-anywhere profile-avatar-name">
		{{if .ContextUser.FullName}}<span class="header text center">{{.ContextUser.FullName}}</span>{{end}}
		<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>
		<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>
			{{if .EnableFeed}}
				<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>
			{{end}}
		</div>
	</div>
	<div class="extra content tw-break-anywhere">
		<ul>
			{{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}}
			{{if .ContextUser.Location}}
				<li>
					{{svg "octicon-location"}}
					<span class="tw-flex-1">{{.ContextUser.Location}}</span>
					{{if .ContextUserLocationMapURL}}
						<a href="{{.ContextUserLocationMapURL}}" rel="nofollow noreferrer" data-tooltip-content="{{ctx.Locale.Tr "user.show_on_map"}}">
							{{svg "octicon-link-external"}}
						</a>
					{{end}}
				</li>
			{{end}}
			{{if (eq .SignedUserID .ContextUser.ID)}}
				<li>
					{{svg "octicon-mail"}}
					<a class="tw-flex-1" href="mailto:{{.ContextUser.Email}}" rel="nofollow">{{.ContextUser.Email}}</a>
					<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")}}
					</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}}</div>
				</li>
			{{end}}
			{{range .OpenIDs}}
				{{if .Show}}
					<li>
						{{svg "fontawesome-openid"}}
						<a target="_blank" rel="noopener noreferrer" href="{{.URI}}">{{.URI}}</a>
					</li>
				{{end}}
			{{end}}
			<li>{{svg "octicon-calendar"}} <span>{{ctx.Locale.Tr "user.joined_on" (DateTime "short" .ContextUser.CreatedUnix)}}</span></li>
			{{if and .Orgs .HasOrgsVisible}}
			<li>
				<ul class="user-orgs">
				{{range .Orgs}}
					{{if (or .Visibility.IsPublic (and ($.SignedUser) (or .Visibility.IsLimited (and (.HasMemberWithUserID ctx $.SignedUserID) .Visibility.IsPrivate) ($.IsAdmin))))}}
					<li>
						<a href="{{.HomeLink}}" data-tooltip-content="{{.Name}}">
							{{ctx.AvatarUtils.Avatar .}}
						</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)}}
				{{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>
				{{end}}
				<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>
			{{end}}
		</ul>
	</div>
</div>

{{template "shared/user/block_user_dialog" .}}