friends.blade.php 2.31 KB
@extends('layouts.profile')

@section('title', 'Profile Friends')

@section('profile')
	<div id="friends_list_filter_menu">
		<ul>
			<li class="friends_list_filter_item" id="filter_all">All Friends</li>
			@if ($isVisitorProfile)
				|<li class="friends_list_filter_item" id="filter_pending">Pending Requests</li>
			@endif
		</ul>
	</div>

		<ul id="all_friends" class="friend_list {{ $filter === 'pending'? 'displayno' : '' }}" ng-controller="FriendsPaginationCtrl" ng-init="init('accepted');">
		<li class="friend_list_row clearfix" ng-repeat="friend in friends" ng-show="friend" ng-cloak>
			<div class="friend_list_pic">
				<img ng-src="@{{friend.image}}" height="50" width="50" class="avatar">
			</div>
			<div class="friend_list_name">
				<a ng-href="/profile/@{{friend.username}}">@{{friend.username}}</a>
			</div>
			@if ($isVisitorProfile)
				<div class="friend_list_buttons_area">
					<button class="friend_list_button btn btn-danger" ng-click="removeFriend(friend.user_id)">x</button>
				</div>
			@endif
		</li>
		<div class="friend_list_pagination">
			<pagination items-per-page="itemsPerPage" total-items="totalItems" ng-model="currentPage" ng-change="pageChanged()" ng-show="totalItems > 0" max-size="10" boundary-links="true"></pagination>
		</div>
	</ul>  

	@if ($isVisitorProfile)
		<ul id="pending_friends" class="friend_list {{ $filter === 'pending'? '' : 'displayno' }}" ng-controller="FriendsPaginationCtrl" ng-init="init('pending')">
			<li class="friend_list_row clearfix" ng-repeat="friend in friends" ng-show="friend" ng-cloak>
				<div class="friend_list_pic">
					<img ng-src="@{{friend.image}}" height="50" width="50" class="avatar">
				</div>
				<div class="friend_list_name">
					<a ng-href="/profile/@{{friend.username}}">@{{friend.username}}</a>
				</div>
				<div class="friend_list_buttons_area">
					<button class="friend_list_button btn btn-primary" ng-click="acceptFriend(friend.user_id)">Confirm</button>
					<button class="friend_list_button btn btn-warning" ng-click="ignoreFriend(friend.user_id)">Ignore</button>
				</div>
			</li>
			<div class="friend_list_pagination">
				<pagination items-per-page="itemsPerPage" total-items="totalItems" ng-model="currentPage" ng-change="pageChanged()" ng-show="totalItems > 0" max-size="5" boundary-links="true"></pagination>
			</div>
		</ul> 
	@endif
@endsection