2015-11-15 21:43:39 +00:00
|
|
|
{% set friends = user.friends(-1)|batch(12) %}
|
|
|
|
|
|
|
|
{% set paginationPages = friends %}
|
|
|
|
{% set paginationUrl %}{{ urls.format('SETTING_MODE', ['friends', 'requests']) }}{% endset %}
|
|
|
|
|
2015-09-26 16:12:42 +00:00
|
|
|
{% 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 %}
|
|
|
|
|
2015-11-15 21:43:39 +00:00
|
|
|
{% 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">
|
2015-11-15 21:43:39 +00:00
|
|
|
{% for friend in friends[get.page|default(1) - 1] %}
|
2015-11-11 21:54:56 +00:00
|
|
|
<div class="friend-container" id="friend-{{ friend.id }}">
|
|
|
|
<a class="friends-list-data clean" href="/u/{{ friend.id }}">
|
|
|
|
<img src="/a/{{ 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>
|
|
|
|
<div class="friends-list-actions">
|
2015-11-11 21:54:56 +00:00
|
|
|
<a class="add fa fa-check" title="Add friend" href="/friends?add={{ friend.id }}&session={{ php.sessionid }}&time={{ php.time }}" id="friendslist-friend-action-add-{{ friend.id }}"></a>
|
|
|
|
<a class="remove fa fa-remove" title="Remove friend" href="/friends?remove={{ friend.id }}&session={{ php.sessionid }}&time={{ php.time }}" 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-07-31 21:18:14 +00:00
|
|
|
<div class="clear"></div>
|
|
|
|
</div>
|
2015-08-10 20:04:22 +00:00
|
|
|
{% if friends|length > 1 %}
|
|
|
|
<div>
|
2015-11-15 21:43:39 +00:00
|
|
|
{% include 'elements/pagination.tpl' %}
|
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 pending requests!</h1>
|
|
|
|
{% endif %}
|