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/templates/yuuno/settings/friends.listing.twig

50 lines
1.9 KiB
Twig
Raw Normal View History

{% set friends = user.friends(1)|batch(12) %}
{% set paginationPages = friends %}
{% set paginationUrl %}{{ urls.format('SETTING_MODE', ['friends', 'listing']) }}{% endset %}
{% block js %}
<script type="text/javascript">
window.addEventListener("load", function() {
var friendsListActions = document.querySelectorAll('[id^="friendslist-friend-action-"]');
for (var i in friendsListActions) {
prepareAjaxLink(friendsListActions[i], 'submitPost', ', true, "Please wait.."');
}
});
</script>
{% endblock %}
{% block css %}
<style type="text/css">
.pagination {
float: right;
}
</style>
{% endblock %}
2015-08-10 20:04:22 +00:00
{% if friends|length %}
<div class="friends-list">
{% for friend in friends[get.page|default(1) - 1] %}
<div class="friend-container" id="friendslist-friend-{{ friend.id }}">
2016-03-19 15:29:47 +00:00
<a class="friends-list-data clean" href="{{ route('user.profile', friend.id) }}">
<img src="{{ route('file.avatar', friend.id) }}" alt="{{ friend.username }}" class="friends-list-avatar default-avatar-setting" style="width: 150px; height: 150px;" />
<div class="friends-list-name" style="color: {{ friend.colour }};">{{ friend.username }}</div>
2015-08-10 20:04:22 +00:00
</a>
2016-03-19 15:29:47 +00:00
<div class="friends-list-actions"><!-- urls -->
2016-03-27 22:15:51 +00:00
<a class="remove fill fa fa-remove" title="Remove friend" href="/friends?remove={{ friend.id }}&amp;session={{ session_id() }}&amp;time={{ date().timestamp }}" id="friendslist-friend-action-remove-{{ friend.id }}"></a>
2015-07-31 21:18:14 +00:00
<div class="clear"></div>
</div>
2015-08-10 20:04:22 +00:00
</div>
{% endfor %}
2015-06-22 17:44:14 +00:00
<div class="clear"></div>
</div>
2015-08-10 20:04:22 +00:00
{% if friends|length > 1 %}
<div>
2016-01-04 20:14:09 +00:00
{% include 'elements/pagination.twig' %}
2015-08-10 20:04:22 +00:00
</div>
{% endif %}
{% else %}
<h1 class="stylised" style="margin: 2em auto; text-align: center;">You don't have any friends yet!</h1>
{% endif %}