<div class="top-pad"></div>

<div class="content-padding" ng-show="ready">

	<h1 class="title left"><i class="fa fa-automobile"></i><span>Driver Onboarding: Documents</span></h1>
	<div class="divider"></div>

	<div ng-if="count">
		<table class="tb-grid">
			<thead>
				<tr>
					<td>Name</td>
					<td>Document</td>
					<td>Community</td>
					<td>Date</td>
					<td>Download</td>
					<td>Status</td>
				</tr>
			</thead>
			<tbody>
				<tr ng-repeat="doc in documents">
					<td>
						<div class="link" ng-click="edit(doc.id_admin)">
							{{doc.name}}
						</div>
						{{doc.login}}
					</td>
					<td>{{doc.doc}}</span></td>
					<td><span ng-repeat="community in doc.communities">{{community}}</span></td>
					<td>{{doc.date}}<br>{{doc.time}}</td>
					<td><span class="link orange" ng-click="download( doc.id_driver_document_status)" title="Sent at {{doc.status.date_formated}}">Download</span></td>
					<td>
						<div ng-if="doc.approving">
							<i class="fa fa-circle-o-notch fa-spin"></i>
						</div>
						<div ng-if="!doc.approving" class="pointer" ng-click="approve(doc);doc.approving = true;">
							<span ng-if="doc.approved">
								<i class="fa fa-check-square-o"></i> {{doc.approved}}
							</span>
							<span ng-if="!doc.approved">
								<i class="fa fa-square-o"></i>
							</span>
						</div>
						<div ng-if="doc.completed">Completed</div>
						<div ng-if="!doc.completed">In Progress</div>
					</td>
				</tr>
			</tbody>
		</table>

		<table class="tb-pagination" ng-if="pages > 1">
			<tbody>
				<tr>
					<td class="td-prev"><button class="button orange" ng-show="prev" ng-click="prevPage()">prev</button></td>
					<td class="td-info">Page {{page}} of {{pages}}</td>
					<td class="td-next"><button class="button orange" ng-show="next" ng-click="nextPage()">next</button></td>
				</tr>
			</tbody>
		</table>
	</div>

	<div></div>

	<div ng-if="!count" class="box-content">
		No documents.
	</div>

</div>

<spinner-loading></spinner-loading>
<hack-expand-content></hack-expand-content>