2016-07-31 19:36:13 +00:00
|
|
|
{% extends 'master.twig' %}
|
2016-07-29 19:31:36 +00:00
|
|
|
|
2016-12-18 22:00:24 +00:00
|
|
|
{% from 'user/profile_macros.twig' import profile_image_changer %}
|
|
|
|
|
|
|
|
{% set title = 'Profile of ' ~ profile.username %}
|
2016-12-18 22:22:41 +00:00
|
|
|
{% set description = 'Everything you ever wanted to know about ' ~ profile.username ~ '!' %}
|
|
|
|
{% set icon = route('user.avatar', profile.id, true) %}
|
2016-08-03 17:47:46 +00:00
|
|
|
{% set youtubeIsChannelId = profile.youtube|slice(0, 2) == 'UC' and profile.youtube|length == 24 %}
|
2016-12-18 22:22:41 +00:00
|
|
|
{% set possessiveUsername = profile.username ~ "'" ~ (profile.username[-1:] == 's' ? '' : 's') %}
|
2016-08-03 17:47:46 +00:00
|
|
|
|
2016-12-07 14:32:08 +00:00
|
|
|
{% 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",
|
2016-12-18 22:00:24 +00:00
|
|
|
"disp": youtubeIsChannelId ? possessiveUsername ~ " channel" : "%s",
|
2016-12-07 14:32:08 +00:00
|
|
|
},
|
|
|
|
"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 %}
|
2016-07-29 19:31:36 +00:00
|
|
|
|
2016-12-18 22:00:24 +00:00
|
|
|
{% 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
|
|
|
|
},
|
|
|
|
} %}
|
2016-11-04 19:48:17 +00:00
|
|
|
|
2016-12-18 22:00:24 +00:00
|
|
|
{% block js %}
|
|
|
|
{% include 'user/profile_javascript.twig' %}
|
2016-07-29 19:31:36 +00:00
|
|
|
{% endblock %}
|
|
|
|
|
|
|
|
{% block content %}
|
2016-12-18 22:00:24 +00:00
|
|
|
{% 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 %}
|
|
|
|
|
|
|
|
<div class="content profile">
|
|
|
|
<div class="profile__container">
|
|
|
|
{% include 'user/profile_header.twig' %}
|
|
|
|
<div class="profile__content">
|
|
|
|
<div class="profile__mode">
|
|
|
|
{% if profile.lastfm %}
|
2016-11-09 18:32:23 +00:00
|
|
|
<div class="profile__now-playing">
|
2016-09-19 15:33:52 +00:00
|
|
|
<div class="np-icon">
|
|
|
|
<span class="fa fa-music"></span>
|
|
|
|
</div>
|
|
|
|
<div class="np-text">
|
|
|
|
<span class="fa fa-ellipsis-h" id="np-state"></span>
|
2016-11-09 18:32:23 +00:00
|
|
|
<a href="#" id="np-track" class="profile__now-playing-link"></a>
|
2016-09-19 15:33:52 +00:00
|
|
|
<span id="np-by" class="hidden">by</span>
|
2016-11-09 18:32:23 +00:00
|
|
|
<a href="#" id="np-artist" class="profile__now-playing-link"></a>
|
2016-09-19 15:33:52 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
2016-12-18 22:00:24 +00:00
|
|
|
{% endif %}
|
|
|
|
<noscript><h1 style="text-align: center;">Please enable Javascript!</h1></noscript>
|
|
|
|
{% for name, data in sections %}
|
|
|
|
<div id="profile-mode-{{ name }}" class="hidden">
|
|
|
|
{% include 'profile/' ~ name ~ '.twig' %}
|
2016-07-29 19:31:36 +00:00
|
|
|
</div>
|
2016-12-18 22:00:24 +00:00
|
|
|
{% endfor %}
|
|
|
|
</div>
|
|
|
|
<div class="profile__data">
|
|
|
|
<table style="width: 100%;">
|
|
|
|
<tr>
|
|
|
|
<td style="text-align: left; font-weight: bold;">Topics</td>
|
|
|
|
<td style="text-align: right;">{{ profile.forumStats.topics }}</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td style="text-align: left; font-weight: bold;">Posts</td>
|
|
|
|
<td style="text-align: right;">{{ profile.forumStats.posts }}</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td style="text-align: left; font-weight: bold;">Friends</td>
|
|
|
|
<td style="text-align: right;">{{ profile.friends(2)|length }}</td>
|
|
|
|
</tr>
|
|
|
|
</table>
|
|
|
|
<hr>
|
|
|
|
{% if user.perms.viewUserLinks or user.perms.viewUserDetails %}
|
2016-07-29 19:31:36 +00:00
|
|
|
<table style="width: 100%;">
|
2016-12-18 22:00:24 +00:00
|
|
|
{% for id, data in fields %}
|
|
|
|
{% if data.value != null %}
|
|
|
|
<tr>
|
|
|
|
<td style="text-align: left; font-weight: bold;">
|
|
|
|
{{ data.title }}
|
|
|
|
</td>
|
|
|
|
<td style="text-align: right;">
|
|
|
|
{% if data.link is defined %}
|
|
|
|
<a href="{{ data.link|format(data.value) }}">{{ (data.disp is defined ? data.disp : '%s')|format(data.value) }}</a>
|
|
|
|
{% else %}
|
|
|
|
{{ (data.disp is defined ? data.disp : '%s')|format(data.value) }}
|
|
|
|
{% endif %}
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
{% endif %}
|
|
|
|
{% endfor %}
|
2016-07-29 19:31:36 +00:00
|
|
|
</table>
|
2016-12-18 22:00:24 +00:00
|
|
|
{% elseif user.id == 0 %}
|
|
|
|
<div><b>Log in to view the full profile!</b></div>
|
|
|
|
{% else %}
|
|
|
|
<div><b>You aren't allowed to view profile details!</b></div>
|
|
|
|
{% endif %}
|
|
|
|
<b>Account Standing</b>
|
|
|
|
{% if not profile.activated %}
|
|
|
|
<h2 style="color: #888; text-shadow: 0 0 7px #888; margin-top: 0;">Inactive</h2>
|
|
|
|
{% elseif profile.restricted %}
|
|
|
|
<h2 style="color: #222; text-shadow: 0 0 7px #800; margin-top: 0;">Restricted</h2>
|
|
|
|
{% elseif false %}
|
|
|
|
<h2 style="color: #A00; text-shadow: 0 0 7px #A00; margin-top: 0;">Bad</h2>
|
|
|
|
{% else %}
|
|
|
|
<h2 style="color: #080; text-shadow: 0 0 7px #080; margin-top: 0;">Good</h2>
|
|
|
|
{% endif %}
|
2016-07-29 19:31:36 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
2016-12-18 22:00:24 +00:00
|
|
|
</div>
|
2016-07-29 19:31:36 +00:00
|
|
|
{% endblock %}
|