2018-08-15 03:12:58 +02:00
{% extends 'user/master.twig' %}
{% from 'macros.twig' import navigation %}
2018-03-22 02:56:41 +00:00
2018-04-14 04:58:53 +02:00
{% set image = '/profile.php?u=' ~ profile .user_id ~ '&m=avatar' %}
{% set canonical_url = '/profile.php?u=' ~ profile .user_id %}
2018-03-22 02:56:41 +00:00
{% set title = 'Profile of ' ~ profile .username %}
2018-04-23 05:00:55 +02:00
{% set manage_link = '/manage/users.php?v=view&u=' ~ profile .user_id %}
2018-03-22 02:56:41 +00:00
2018-09-16 03:37:32 +02:00
{% if has_background %}
{% set site_background_url = '/profile.php?m=background&u=' ~ profile .user_id %}
{% endif %}
2018-03-22 02:56:41 +00:00
{% block content %}
2018-08-12 20:49:21 +02:00
<div class="profile" id="profile">
2018-09-17 00:36:46 +02:00
<div class="profile__header">
<div class="profile__header__details">
2018-09-19 08:51:52 +02:00
<div class="avatar avatar--new profile__header__avatar" style="background-image:url(' {{ image }} ')"></div>
2018-04-17 23:01:49 +02:00
2018-09-17 00:36:46 +02:00
<div class="profile__header__details__content">
<div class="profile__header__username" style=" {{ profile .user_colour | html_colour ( {
'color': '%s',
'text-shadow': '0 0 5px %s',
}) }}">
{{ profile .username }}
</div>
{% if profile .user_title is not empty %}
<div class="profile__header__title">
{{ profile .user_title }}
2018-03-22 02:56:41 +00:00
</div>
2018-09-17 00:36:46 +02:00
{% endif %}
2018-03-22 02:56:41 +00:00
2018-09-17 00:36:46 +02:00
<div class="profile__header__country">
<div class="flag flag-- {{ profile .user_country | lower }} "></div>
<div class="profile__header__country__name">
{{ profile .user_country | country_name }}
</div>
</div>
</div>
2018-09-17 17:38:49 +02:00
2018-09-19 00:16:29 +02:00
{% if friend_info is defined and ( friend_info .profile_relation is not null or friend_info .visitor_relation is not null ) %}
<div class="profile__header__details__relation" title="Since {{ friend_info .relation_created | date ( 'r' ) }} ">
{% if friend_info .profile_relation and friend_info .visitor_relation %}
Mutual Friends
{% elseif friend_info .visitor_relation %}
You Follow
{% elseif friend_info .profile_relation %}
Follows You
{% endif %}
</div>
{% endif %}
2018-09-17 00:36:46 +02:00
</div>
2018-04-17 23:01:49 +02:00
2018-09-17 11:20:15 +02:00
<div class="profile__header__options">
<div class="profile__header__actions">
{% if current_user .user_id | default ( 0 ) == profile .user_id %}
<a href="/settings.php" class="profile__header__action">Edit Profile</a>
2018-09-19 00:16:29 +02:00
{% elseif current_user is defined %}
2018-09-19 00:41:38 +02:00
{% if friend_info .visitor_relation == constant ( 'MSZ_USER_RELATION_FOLLOW' ) %}
<a href="/relations.php?u= {{ profile .user_id }} &m=remove" class="profile__header__action profile__header__action--destroy"> {{ friend_info .profile_relation == constant ( 'MSZ_USER_RELATION_FOLLOW' ) ? 'Unfriend' : 'Unfollow' }} </a>
2018-09-19 00:16:29 +02:00
{% else %}
2018-09-19 00:41:38 +02:00
<a href="/relations.php?u= {{ profile .user_id }} &m=add&t=follow" class="profile__header__action"> {{ friend_info .profile_relation == constant ( 'MSZ_USER_RELATION_FOLLOW' ) ? 'Add as Friend' : 'Follow' }} </a>
2018-09-19 00:16:29 +02:00
{% endif %}
2018-09-17 11:20:15 +02:00
{% endif %}
2018-09-17 00:36:46 +02:00
</div>
2018-09-17 11:20:15 +02:00
<div class="profile__header__stats">
<div class="profile__header__stat profile__header__stat--date" title=" {{ profile .created_at | date ( 'r' ) }} ">
2018-09-17 00:36:46 +02:00
<div class="profile__header__stat__name">
2018-09-17 11:20:15 +02:00
Joined
2018-05-18 03:20:27 +02:00
</div>
2018-09-17 11:20:15 +02:00
<time class="profile__header__stat__value" datetime=" {{ profile .created_at | date ( 'c' ) }} ">
{{ profile .created_at | time_diff }}
2018-09-17 00:36:46 +02:00
</time>
</div>
2018-05-18 03:20:27 +02:00
2018-09-17 11:20:15 +02:00
{% if profile .last_seen is not null %}
<div class="profile__header__stat profile__header__stat--date" title=" {{ profile .last_seen | date ( 'r' ) }} ">
<div class="profile__header__stat__name">
Last seen
</div>
<time class="profile__header__stat__value" datetime=" {{ profile .last_seen | date ( 'c' ) }} ">
{{ profile .last_seen | date ( 'U' ) + 1 0 >= '' | date ( 'U' ) ? 'just now' : profile .last_seen | time_diff }}
</time>
2018-09-17 00:53:42 +02:00
</div>
2018-09-17 11:20:15 +02:00
{% endif %}
2018-05-18 03:20:27 +02:00
2018-09-17 11:20:15 +02:00
{% if profile .forum_topic_count > 0 %}
<div class="profile__header__stat">
<div class="profile__header__stat__name">
Topics
</div>
<div class="profile__header__stat__value">
{{ profile .forum_topic_count | number_format }}
</div>
2018-09-17 00:53:42 +02:00
</div>
2018-09-17 11:20:15 +02:00
{% endif %}
2018-09-17 00:36:46 +02:00
2018-09-17 11:20:15 +02:00
{% if profile .forum_post_count > 0 %}
<div class="profile__header__stat">
<div class="profile__header__stat__name">
Posts
</div>
<div class="profile__header__stat__value">
{{ profile .forum_post_count | number_format }}
</div>
2018-03-22 02:56:41 +00:00
</div>
2018-09-17 11:20:15 +02:00
{% endif %}
2018-07-06 03:28:06 +02:00
2018-09-17 11:20:15 +02:00
{% if profile .comments_count > 0 %}
<div class="profile__header__stat">
<div class="profile__header__stat__name">
Comments
</div>
<div class="profile__header__stat__value">
{{ profile .comments_count | number_format }}
</div>
2018-09-17 00:36:46 +02:00
</div>
2018-09-17 11:20:15 +02:00
{% endif %}
{% if profile .changelog_count > 0 %}
<a class="profile__header__stat" href="/changelog.php?u= {{ profile .user_id }} ">
<div class="profile__header__stat__name">
Changes
</div>
<div class="profile__header__stat__value">
{{ profile .changelog_count | number_format }}
</div>
</a>
{% endif %}
</div>
2018-09-17 00:36:46 +02:00
</div>
</div>
2018-08-12 15:35:50 +02:00
2018-09-17 20:39:46 +02:00
<div class="profile__container__placeholder">
<div class="profile__container__placeholder__content">
The profile pages are still under much construction, more things will eventually populate the area where this container current exists.
</div>
</div>
2018-09-17 00:36:46 +02:00
2018-09-17 20:39:46 +02:00
<div class="profile__container">
<div class="profile__container__side">
{% if current_user is not defined %}
<div class="profile__accounts">
<div class="profile__accounts__notice">
You must <a href="/auth.php?m=login" class="profile__accounts__link">log in</a> to view full profiles!
</div>
</div>
{% elseif profile_fields | default ( [ ] ) | length > 0 %}
2018-09-19 20:58:13 +02:00
<div class="container container--new">
<div class="container__title">
Elsewhere
</div>
<div class="profile__accounts">
{% for name , data in profile_fields %}
<div class="profile__accounts__item">
<div class="profile__accounts__title">
{{ data .name }}
</div>
<div class="profile__accounts__value"
{% if data .tooltip is defined %} title=" {{ data .tooltip | format ( data .value ) | raw }} " {% endif %} >
{% set profile_field_value = ( data .format is defined ? data .format : '%s' ) | format ( data .value ) %}
{% if data .link is defined %}
{{ data .link | format ( data .value ) | html_link ( profile_field_value , 'profile__accounts__link' ) | raw }}
{% else %}
{{ profile_field_value }}
{% endif %}
</div>
2018-09-17 20:39:46 +02:00
</div>
2018-09-19 20:58:13 +02:00
{% endfor %}
</div>
2018-03-23 01:27:46 +01:00
</div>
2018-09-17 00:36:46 +02:00
{% endif %}
2018-03-22 02:56:41 +00:00
</div>
2018-09-17 20:39:46 +02:00
<div class="profile__container__main">
2018-09-19 20:58:13 +02:00
{% if profile .user_about_content | length > 0 %}
<div class="container container--new profile__about" id="about">
<div class="container__title profile__about__title">
About {{ profile .username }}
</div>
<div class="container__content profile__about__content">
{% if profile .user_about_parser == 2 %}
{{ profile .user_about_content | escape | parse_text ( 'md' ) | raw }}
{% elseif profile .user_about_parser == 1 %}
{{ profile .user_about_content | escape | parse_text ( 'bb' ) | raw }}
{% else %}
{{ profile .user_about_content | escape }}
{% endif %}
</div>
</div>
{% endif %}
2018-09-17 20:39:46 +02:00
</div>
</div>
2018-03-22 02:56:41 +00:00
</div>
{% endblock %}