{% extends 'master.twig' %}
{% from 'user/profile_macros.twig' import profile_image_changer %}
{% set title = 'Profile of ' ~ profile.username %}
{% set description = 'Everything you ever wanted to know about ' ~ profile.username ~ '!' %}
{% set icon = route('user.avatar', profile.id, true) %}
{% set youtubeIsChannelId = profile.youtube|slice(0, 2) == 'UC' and profile.youtube|length == 24 %}
{% set possessiveUsername = profile.username ~ "'" ~ (profile.username[-1:] == 's' ? '' : 's') %}
{% if user.perms.viewUserLinks or user.perms.viewUserDetails %}
{% set fields = {
"website": {
"title": "Website",
"value": profile.website,
"link": "%s",
},
"twitter": {
"title": "Twitter",
"value": profile.twitter,
"link": "https://twitter.com/%s",
"disp": "@%s",
},
"github": {
"title": "GitHub",
"value": profile.github,
"link": "https://github.com/%s",
},
"skype": {
"title": "Skype",
"value": profile.skype,
"link": "skype:%s?userinfo",
},
"discord": {
"title": "Discord",
"value": profile.discord,
},
"youtube": {
"title": "YouTube",
"value": profile.youtube,
"link": "https://youtube.com/" ~ (youtubeIsChannelId ? 'channel/' : '') ~ "%s",
"disp": youtubeIsChannelId ? possessiveUsername ~ " channel" : "%s",
},
"steam": {
"title": "Steam",
"value": profile.steam,
"link": "https://steamcommunity.com/id/%s",
},
"osu": {
"title": "osu!",
"value": profile.osu,
"link": "https://osu.ppy.sh/u/%s",
},
"lastfm": {
"title": "Last.fm",
"value": profile.lastfm,
"link": "http://last.fm/user/%s",
},
"email": {
"title": "E-mail address",
"value": user.perms.viewUserDetails ? profile.email : null,
"link": "mailto:%s"
},
"registerip": {
"title": "Register IP",
"value": user.perms.viewUserDetails ? profile.registerIp : null,
},
"lastip": {
"title": "Last IP",
"value": user.perms.viewUserDetails ? profile.lastIp : null,
},
} %}
{% endif %}
{% set sections = {
"userpage": {
"icon": "fa-file-text-o",
"title": possessiveUsername ~ " user page",
"display": profile.userPage|length > 0
},
"friends": {
"icon": "fa-list",
"title": possessiveUsername ~ " topics",
"display": true
},
"groups": {
"icon": "fa-users",
"title": "Groups " ~ profile.username ~ " is part of",
"display": false
},
"topics": {
"icon": "fa-reply",
"title": possessiveUsername ~ " posts",
"display": true
},
"posts": {
"icon": "fa-star",
"title": possessiveUsername ~ " friends",
"display": true
},
"comments": {
"icon": "fa-comments-o",
"title": possessiveUsername ~ " profile comments",
"display": true
},
} %}
{% block content %}
{% if (user.id == profile.id and not user.restricted and user.activated and user.perms.changeBackground) or user.perms.manageProfileImages %}
{{ profile_image_changer(route('user.background', profile.id), '.container') }}
{% endif %}
{% include 'user/profile_header.twig' %}
{% if profile.lastfm %}
{% endif %}
{% for name, data in sections %}
{% include 'profile/' ~ name ~ '.twig' %}
{% endfor %}
Topics |
{{ profile.countTopics }} |
Posts |
{{ profile.countPosts }} |
Friends |
{{ profile.friends(2)|length }} |
{% if user.perms.viewUserLinks or user.perms.viewUserDetails %}
{% elseif user.id == 0 %}
Log in to view the full profile!
{% else %}
You aren't allowed to view profile details!
{% endif %}
Account Standing
{% if not profile.activated %}
Inactive
{% elseif profile.restricted %}
Restricted
{% elseif false %}
Bad
{% else %}
Good
{% endif %}
{% endblock %}