forked from GNUsocial/gnu-social
Eliseu Amaro
e70acd5c3b
This little abstraction layer made it a bit easier to add a different title to a Note or Actor Feed Collection template, from whichever controller that uses it. Please, bear in mind, that abstract templates such as those found in Components\Collection, may act in a very 'declarative' way upon using them. This makes it difficult to dynamically choose what type of header is used without undergoing a mining operation in the likes of a pyramid of doom. Hence, this _little_ change.
84 lines
4.3 KiB
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() }}">{{ '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 %}
|