misuzu/templates/user/profile.twig

165 lines
7.7 KiB
Twig
Raw Normal View History

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 %}
{% set manage_link = '/manage/users.php?v=view&u=' ~ profile.user_id %}
2018-03-22 02:56:41 +00: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 %}
<div class="profile" id="profile">
2018-09-17 00:36:46 +02:00
<div class="profile__header">
<div class="profile__header__details">
<div class="avatar profile__header__avatar" style="background-image:url('{{ image }}')"></div>
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
<!--div class="profile__header__details__relation">
Follows you
</div-->
2018-09-17 00:36:46 +02:00
</div>
<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-17 17:38:49 +02:00
{# else %}
<a href="#" class="profile__header__action">Add Friend</a>
<a href="#" class="profile__header__action profile__header__action--destroy">Unfriend</a>#}
{% endif %}
2018-09-17 00:36:46 +02:00
</div>
<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">
Joined
2018-05-18 03:20:27 +02:00
</div>
<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
{% 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') + 10 >= ''|date('U') ? 'just now' : profile.last_seen|time_diff }}
</time>
2018-09-17 00:53:42 +02:00
</div>
{% endif %}
2018-05-18 03:20:27 +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>
{% endif %}
2018-09-17 00:36:46 +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>
{% endif %}
2018-07-06 03:28:06 +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>
{% 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
<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
<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 %}
<div class="profile__accounts">
2018-09-17 00:36:46 +02:00
{% for name, data in profile_fields %}
<div class="profile__accounts__item">
<div class="profile__accounts__title">
{{ data.name }}
2018-09-17 00:36:46 +02:00
</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>
</div>
2018-09-17 00:36:46 +02:00
{% endfor %}
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>
<div class="profile__container__main">
</div>
</div>
2018-03-22 02:56:41 +00:00
</div>
{% endblock %}