<p ng-if="waitingrequests.length==0">
    <span class="fa fa-times-circle text-danger"></span> <span translate>Nothing to approve</span>
</p>


<div class="gadael-list-rows" ng-repeat="user in users">

    <div class="row list-group-item-info">
        <h2 class="col-xs-8">
            <img ng-src="{{user.id.imageUrl}}" ng-if="user.id.imageUrl" height="60" class="img-rounded" align="left" style="margin-right:.8em;" />
            {{user.name}}<br />
            <small>{{user.department}}</small>
        </h2>

        <div class="col-xs-4 text-right top30">
            <button class="btn btn-primary" type="button" ng-click="accept(user.requests)">
                <i class="fa fa-thumbs-up"></i>
                <span class="hidden-xs"> <span translate>Accept</span> <span class="badge">{{user.requests.length}}</span></span>
            </button>
            <button class="btn btn-danger" type="button" ng-click="reject(user.requests)">
                <i class="fa fa-thumbs-down"></i>
                <span  class="hidden-xs"> <span translate>Reject</span> <span class="badge">{{user.requests.length}}</span></span>
            </button>
        </div>
    </div>

    <div class="row" ng-repeat="request in user.requests">


        <div class="col-xs-1">
            <a ng-href="#/manager/waitingrequests/{{request._id}}" class="btn btn-info btn-xs hidden-print" role="button">
                <i class="fa fa-plus-circle"></i> <span class="hidden-xs" translate>View</span>
            </a>
        </div>

        <div class="col-xs-11">
                <div class="col-md-5" ng-if="request.absence.distribution.length == 1">
                    <i class="fa fa-asterisk" style="color:{{request.absence.distribution[0].right.type.color}}" title="{{request.absence.distribution[0].right.type.name}}"></i> <strong>{{request.absence.distribution[0].right.name}} </strong>

                    <div class="row">
                        <span class="col-xs-3" translate>From</span> {{request.events[0].dtstart|date:'medium'}}<br />
                        <span class="col-xs-3" translate>To</span> {{request.events[request.events.length-1].dtend|date:'medium'}}
                    </div>
                </div>

                <div class="col-md-5" ng-if="request.absence.distribution.length > 1 || request.absence.distribution.length == 0">
                    <strong>{{request.dispType}}</strong>

                    <div class="row">
                        <span class="col-xs-3" translate>From</span> {{request.events[0].dtstart|date:'medium'}}<br />
                        <span class="col-xs-3" translate>To</span> {{request.events[request.events.length-1].dtend|date:'medium'}}
                    </div>
                </div>

                <div class="col-md-4 hidden-xs hidden-sm">
                    <span translate>Created the</span><br />
                    {{request.timeCreated|date}}
                </div>

                <div class="col-md-3">
                    {{request.status.title}}
                    <span class="label label-primary">{{getStat(request).approval.position}} / {{getStat(request).approval.steps}}</span>
                </div>
        </div>
    </div>

</div>
