gnu-social/templates/cards/blocks/profile.html.twig

84 lines
4.3 KiB
Twig

{% block profile_view %}
{% set actor_fullname = actor.getFullname() %}
{% set actor_nickname = actor.getNickname() %}
{% set actor_avatar = actor.getAvatarUrl() %}
{% set actor_avatar_dimensions = actor.getAvatarDimensions() %}
{% set actor_tags = actor.getSelfTags() %}
{% set actor_has_bio = actor.hasBio() %}
{% set actor_uri = actor.getUri() %}
{% set actor_url = actor.getUrl() %}
{% set actor_is_local = actor.getIsLocal() %}
{% set mention = mention(actor) %}
<section id='profile-{{ actor.id }}' class='profile'
title="{% trans %} %actor_nickname%'s profile information{% endtrans %}">
<header>
<div class="profile-info">
<img src="{{ actor_avatar }}" class="profile-avatar avatar"
alt="{% trans %} %actor_nickname%'s avatar{% endtrans %}"
title="{% trans %} %actor_nickname%'s avatar{% endtrans %}"
width="{{ actor_avatar_dimensions['width'] }}"
height="{{ actor_avatar_dimensions['height'] }}">
<div>
<a class="profile-info-url" href="{{ actor_url }}">
{% if profile_card_type is defined and profile_card_type starts with 'main' %}
<h1 class="profile-info-url-nickname"
title="{% trans %} %actor_nickname%'s profile {% endtrans %}">
{% if actor_fullname is not null %}{{ actor_fullname }}{% else %}{{ actor_nickname }}{% endif %}
</h1>
{% else %}
<strong class="profile-info-url-nickname"
title="{% trans %} %actor_nickname%'s profile {% endtrans %}">
{% if actor_fullname is not null %}{{ actor_fullname }}{% else %}{{ actor_nickname }}{% endif %}
</strong>
{% endif %}
{% if not actor_is_local %}
<span class="profile-info-url-remote">
<a href="{{ actor_uri }}" class="u-url" title="{% trans %} %actor_nickname%'s permalink {% endtrans %}">{{ mention }}</a>
</span>
{% endif %}
</a>
<ul class="profile-info-actions">
{% for current_action in get_profile_actions(actor) %}
<li>
<a title="{{ current_action["title"] | trans }}"
class="{{ current_action["classes"] }}"
href="{{ current_action["url"] }}"></a>
</li>
{% endfor %}
</ul>
</div>
</div>
<div class="profile-stats">
<span class="profile-stats-subscriptions"
title="{% trans %} %actor_nickname%'s subscribed count{% endtrans %}">
<strong>
<a href="{{ actor.getSubscriptionsUrl() }}">{% trans %}Subscribed{% endtrans %}</a>
</strong>{{ actor.getSubscribedCount() }}
</span>
<span class="profile-stats-subscribers"
title="{% trans %} %actor_nickname%'s subscribers count{% endtrans %}">
<strong>
<a href="{{ actor.getSubscribersUrl() }}">{% trans %}Subscribers{% endtrans %}</a>
</strong>{{ actor.getSubscribersCount() }}
</span>
</div>
</header>
<div>
<section class="profile-bio" title="{% trans %} %actor_nickname%'s bio{% endtrans %}">
<span>{{ actor.getBio() }}</span>
</section>
<nav class="profile-tags" title="{% trans %} %actor_nickname%'s actor tags{% endtrans %}">
{% for tag in actor_tags %}
{% include 'cards/blocks/tag_actor.html.twig' with { 'tag': tag, 'actor': actor } %}
{% endfor %}
</nav>
</div>
{% for block in handle_event('AppendCardProfile', { 'actor': actor }) %}
{{ block | raw }}
{% endfor %}
</section>
{% endblock profile_view %}