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

76 lines
3.8 KiB
Twig
Raw Normal View History

{% 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) %}
{% block profile_view %}
<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'] }}">
<section>
<a class="profile-info-url" href="{{ actor_url }}">
<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>
{% 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>
</section>
</div>
<div class="profile-stats">
<span class="profile-stats-subscriptions"
title="{% trans %} %actor_nickname%'s subscribed count{% endtrans %}">
<strong>
<a href="{{ actor.getSubscriptionsUrl() }}">{{ 'Subscribed' | trans }}</a>
</strong>{{ actor.getSubscribedCount() }}
</span>
<span class="profile-stats-subscribers"
title="{% trans %} %actor_nickname%'s subscribers count{% endtrans %}">
<strong>
<a href="{{ actor.getSubscribersUrl() }}">{{ 'Subscribers' | trans }}</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 %}