misuzu/templates/user/_layout/header.twig

80 lines
3.8 KiB
Twig

<div class="profile__header">
<div class="profile__header__details">
<div class="avatar avatar--new profile__header__avatar" style="background-image:url('{{ image }}')"></div>
<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 }}
</div>
{% endif %}
<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>
{% 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 %}
</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="input__button input__button--new">Edit Profile</a>
{% elseif current_user is defined %}
{% if friend_info.visitor_relation == constant('MSZ_USER_RELATION_FOLLOW') %}
<a href="/relations.php?u={{ profile.user_id }}&amp;m=remove" class="input__button input__button--new input__button--destroy">{{ friend_info.profile_relation == constant('MSZ_USER_RELATION_FOLLOW') ? 'Unfriend' : 'Unfollow' }}</a>
{% else %}
<a href="/relations.php?u={{ profile.user_id }}&amp;m=add&amp;t=follow" class="input__button input__button--new">{{ friend_info.profile_relation == constant('MSZ_USER_RELATION_FOLLOW') ? 'Add as Friend' : 'Follow' }}</a>
{% endif %}
{% endif %}
</div>
{% if stats is defined %}
<div class="profile__header__stats">
{% for stat in stats %}
{% if stat.value|default(false) %}
{% set is_date = stat.is_date|default(false) %}
<div class="profile__header__stat{% if is_date %} profile__header__stat--date{% endif %}"
title="{{ stat.value|date('r') }}">
<div class="profile__header__stat__name">
{{ stat.title }}
</div>
{% if is_date %}
<time class="profile__header__stat__value" datetime="{{ stat.value|date('c') }}">
{{ stat.value|time_diff }}
</time>
{% else %}
<div class="profile__header__stat__value">
{{ stat.value|number_format }}
</div>
{% endif %}
</div>
{% endif %}
{% endfor %}
</div>
{% endif %}
</div>
</div>