This repository has been archived on 2024-06-26. You can view files and clone it, but cannot push or open issues or pull requests.
sakura/resources/views/yuuno/profile/friends.twig

27 lines
1 KiB
Twig

{% from 'macros.twig' import pagination %}
{% set friends = profile.friends(2)|batch(12) %}
<div class="new-profile-mode-title">
<h1>Friends</h1>
</div>
<div class="profile__friends">
{% if friends|length > 0 %}
{% for friend in friends[get.page|default(1) - 1] %}
<a class="friend-box" id="friendslist-friend-{{ friend.id }}" href="{{ route('user.profile', friend.id) }}">
<div class="avatar avatar--border friend-box__avatar" style="background-image: url('{{ route('user.avatar', friend.id) }}')"></div>
<div class="friend-box__name" style="color: {{ friend.colour }}">
{{ friend.username }}
</div>
</a>
{% endfor %}
<div class="clear"></div>
{% else %}
<h1 class="profile__friends--none">This user has no friends :(</h1>
{% endif %}
</div>
{% if friends|length > 1 %}
<div style="text-align: right;">
{{ pagination(route('user.profile', profile.id), friends, get.page|default(1)) }}
</div>
{% endif %}