{{ define "tpl" }}
{{ if .UserID }} {{ $aoba := eq .UserID 1000 }} {{ $gqm := atoi (.Gin.Query "mode") }} {{ $global := . }} {{ with (.Get "users/rxfull?id=%d" .UserID) }} {{ $favouritemode := _or $gqm .favourite_mode }} {{ if after .silence_info.end }}
{{ $global.T "User is silenced for %s, expires %s." (.silence_info.reason | htmlescaper) (time .silence_info.end) | html }}
{{ end }} {{ if hasAdmin $global.Context.User.Privileges }} {{ $restr := not (has .privileges 1) }} {{ $disab := not (has .privileges 2) }} {{ $pend := has .privileges 1048576 }} {{ if and $disab $restr }} {{ if $pend }}
{{ $global.T "User is %s" "pending verification" | html }}.
{{ else }}
{{ $global.T "User is %s" "banned" | html }}.
{{ end }} {{ else if $restr }}
{{ $global.T "User is %s" "restricted" | html }}.
{{ else if $disab }}
{{ $global.T "User is %s" "locked" | html }}.
{{ end }} {{ end }} {{ with $global.Get "users/userpage?id=%.0f" .id }} {{ if .userpage }} {{ with parseUserpage .userpage }}
{{ html . }}
{{ end }} {{ end }} {{ end }}
{{ if eq $global.UserID $global.Context.User.ID }} {{ end }} avatar {{ if eq $global.UserID $global.Context.User.ID }} {{ end }}

{{ if $aoba }} {{ else }} {{ .username }} {{ end }}

{{ $oof := . }} {{ if eq $oof.clan.name "" }} {{ $global.T "Clan: None" }} {{ else }} {{ $global.T "Clan: %s" ($oof.clan.name) }} {{ end }} {{ if .username_aka }}
{{ $global.T "(aka %s)" (.username_aka | htmlescaper) | html }}
{{ end }} {{ with bgetv1 "isOnline?id=%.0f" .id }}
{{ if .result }}{{ $global.T "Online" }}{{ else }}{{ $global.T "Offline" }}{{ end }}
{{ end }}
{{ range $k, $v := (slice .std .taiko .ctb .mania) }}

{{ with and $v $v.global_leaderboard_rank }}#{{ . }}{{ else }}{{ $global.T "Not ranked" }}{{ end }}

{{ end }}
{{ if and (ne $global.Context.User.ID $global.UserID) (ne $global.Context.User.ID 0) }} {{ end }} {{ if eq $global.Context.User.ID $global.UserID }} {{ end }} {{ if hasAdmin $global.Context.User.Privileges }} {{ end }}
{{ $user := . }}
{{ $global.T "%s is a" .username | html}} {{ $owner := (has .privileges 3145727) }} {{ $cm := (has .privileges 2883911) }} {{ $admin := (has .privileges 1048575) }} {{ $dev := (has .privileges 1043995) }} {{ $bat := (has .privileges 267) }} {{ $member := (has .privileges 3) }} {{ if $owner }} {{ $global.T "osu!Ainu %s" "Owner" }} {{ else }} {{ if $cm }} {{ $global.T "osu!Ainu %s" "Community Manager" }} {{ else }} {{ if $admin }} {{ $global.T "osu!Ainu %s" "Admin" }} {{ else }} {{ if $dev }} {{ $global.T "osu!Ainu %s" "Developer" }} {{ else }} {{ if $bat }} {{ $global.T "osu!Ainu %s" "BAT" }} {{ else }} {{ if $member }} {{ $global.T "osu!Ainu %s" "Player" }} {{ else }} {{end}}{{end}}{{end}}{{end}}{{end}}{{end}} {{ $global.T "from %s." (country .country true) | html }}
{{ $global.T "They signed up on osu!Ainu %s." (time $user.registered_on) | html }}
{{ $global.T "Last seen: %s." (time $user.latest_activity) | html }}
{{ with playstyle .play_style $global }}{{ $global.T "They play with %s." . }}{{ end }}
%s" .username}} /> %s is a osu!Ainu player from %s." .username (country .country true)}} />
{{ if and (not .badges) (not .custom_badge) }} {{ $global.T "This user hasn't got any badges!" }} {{ else }}
{{ range .badges }}

{{ .name }}
{{ end }} {{ with .custom_badge }}

{{ .name }}
{{ end }}
{{ end }}
{{ range $k, $v := (slice .std .taiko .ctb .mania) }} {{ $maxcombo := qb "SELECT FORMAT(scores_relax.max_combo,0) AS combo FROM scores_relax WHERE userid = ? ORDER BY max_combo DESC;" $.UserID}}
{{ with .global_leaderboard_rank }} {{ end }} {{ with .country_leaderboard_rank }} {{ end }}
{{ $global.T "Global rank" }} #{{ . }}
{{ $global.T "Country rank" }}  {{ country $user.country false }} #{{ . }}
{{ $global.T "PP" }} {{ humanize .pp }}
{{ $global.T "Ranked score" }} {{ humanize .ranked_score }}
{{ $global.T "Total score" }} {{ humanize .total_score }}
{{ $global.T "Playcount" }} {{ humanize .playcount }}
{{ $global.T "Max combo" }} {{ $maxcombo.combo }}
{{ $global.T "Followers" }} {{ with $.Get "users/followers?userid=%d" $.UserID }} {{ .subscount }} {{ end }}
{{ $global.T "Replays watched" }} {{ humanize .replays_watched }}
{{ $global.T "Total hits" }} {{ humanize .total_hits }}
{{ $global.T "Accuracy" }} {{ printf "%.2f" .accuracy }}%
{{ levelPercent .level }}%
{{ $global.T "Level %s" (level .level) }}
{{ end }}
{{ range _range 4 }}
{{ end }}

{{ $global.T "Achievements" }}

{{ end }} {{ end }}
{{ end }}