{{ define "tpl" }}
{{ if .UserID }} {{ $gqm := atoi (.Gin.Query "mode") }} {{ $global := . }} {{ with (.Get "users/full?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 }} {{ $sarah := has .id 1193 }} {{ $alicia := has .id 1000 }} {{ $catherine := has .id 999 }} {{ $super := has .privileges 7340031 }} {{ $dev := has .privileges 11534335 }} {{ $donor := has .privileges 7 }} {{ $admin := has .privileges 3049983 }} {{ $chatmod := has .privileges 786763 }} {{ $bn := has .privileges 267 }} {{ 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 }}

{{ $user := . }} {{ if $user.clan}} {{ $user.clan.tag }} {{ end }} {{ if $super }}
{{ .username }}
{{else if $donor}}
{{ .username }}
{{ else }} {{ .username }} {{ end }}

{{ if .username_aka }}
{{ $global.T "(aka %s)" (.username_aka | htmlescaper) | html }}
{{ end }} {{ with bget "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 "Unknown" }}{{ 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 := . }}
{{if $super }} {{ $global.T "%s " .username | html }} is an Owner {{ $global.T " from %s." (country .country true) | html }} {{else if $dev}} {{ $global.T "%s " .username | html }} is a Developer {{ $global.T " from %s." (country .country true) | html }} {{else if $admin}} {{ $global.T "%s " .username | html }} is an Administrator {{ $global.T " from %s." (country .country true) | html }} {{else if $chatmod}} {{ $global.T "%s " .username | html }} is a Chat Mod {{ $global.T " from %s." (country .country true) | html }} {{else if $bn}} {{ $global.T "%s " .username | html }} is a Nominator {{ $global.T " from %s." (country .country true) | html }} {{else if $donor }} {{ $global.T "%s " .username | html }} is a Supporter {{ $global.T " from %s." (country .country true) | html }} {{ else }} {{ $global.T "%s is a player from %s." .username (country .country true) | html }} {{ end }}
{{ $global.T "They signed up on Yozora %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 }}
{{ 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) }}
{{ 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 "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 }}