<div class="box-content2 box-content-table">
	<div sticky-header>
		<table class="thead">
			<tr>
				<th>Name</th>
				<th>Schedule</th>
				<th>Note</th>
				<th nowrap="nowrap" class="tb-center">
					Text
					<span class="link orange no-underline" title="Send sms about schedule?">*</span>
				</th>
				<th class="tb-small tb-center">Payment</th>
				<th class="tb-small tb-center">Docs</th>
				<th class="tb-small"> </th>
			</tr>
		</table>
		<div class="tbody">
			<table class="tb-zebra">
				<tr ng-repeat="driver in drivers" ng-init="$last ? ngRepeatFinished() : null" ng-attr-tabindex="{{$index+1}}" tab-select="/drivers/onboarding/{{driver.id_admin}}">
					<td nowrap="">
						<span class="listview-bold">{{driver.name}}</span>
						<br><span class="listview-smaller">{{driver.login}}</span>
						<br><a href ng-click="callText(s.phone)" class="listview-smaller">{{driver.phone | formatPhone}}</a>
						<div>
								<span class="tag tag-empty tag-green" ng-if="driver.active">Active</span>
								<span class="tag tag-empty tag-red" ng-if="!driver.active">Inactive</span>

								<span class="tag tag-empty tag-orange" ng-if="driver.vehicle == 'car'">Car</span>
								<span class="tag tag-empty tag-purple" ng-if="driver.vehicle == 'bike'">Bike</span>
								<span class="tag tag-empty tag-darkgreen" ng-if="driver.vehicle == 'rollerblades'">Rollerblades</span>
								<span class="tag tag-empty tag-lightblue" ng-if="driver.vehicle == 'rickshaw'">Rickshaw</span>
								<span class="tag tag-empty tag-yellow" ng-if="driver.vehicle == 'skateboard'">Skateboard</span>
								<span class="tag tag-empty tag-grey" ng-if="!driver.vehicle">None</span>

								<span class="tag tag-empty tag-blue" ng-if="driver.payment_type == 'orders'">
									Commission
									<span ng-if="driver.amount_per_order">${{driver.amount_per_order | formatPrice}}/o</span>
								</span>
								<span class="tag tag-empty tag-purple" ng-if="driver.payment_type == 'hours'">
									Hourly w/ tips
									<span ng-if="driver.hour_rate">${{driver.hour_rate | formatPrice}}</span>/h
								</span>
								<span class="tag tag-empty tag-orange" ng-if="driver.payment_type == 'hours_without_tips'">
									Hourly w/o tips
									<span ng-if="driver.hour_rate">${{driver.hour_rate | formatPrice}}</span>/h
								</span>
								<span class="tag tag-empty tag-yellow" ng-if="driver.payment_type == 'making_whole'">
									Whole
									<span ng-if="driver.hour_rate">${{driver.hour_rate | formatPrice}}/h</span>
									<span ng-if="driver.hour_rate && driver.amount_per_order"> | </span>
									<span ng-if="driver.amount_per_order">${{driver.amount_per_order | formatPrice}}/o</span>
								</span>
								<span class="tag tag-empty tag-grey" ng-if="!driver.payment_type">Missing</span>

						</div>
						<div>
							<span class="listview-smaller" ng-repeat="community in driver.communities">
								{{community}}
							</span>
						</div>
					</td>
					<td nowrap="nowrap">
						<span class="tag tag-green" ng-if="driver.shift_status.completed == 1">Complete</span>
						<span class="tag tag-red" ng-if="!driver.shift_status.completed == 1">Incomplete</span><br>
						<span class="listview-smaller">
							Want: <strong>{{driver.shift_status.shifts}}</strong><br>
							Assigned: <strong>{{driver.total_shifts}}</strong>
						</span>
					</td>
					<td>
						<div class="listview-smaller" ng-if="driver.note.text">
							{{driver.note.text}}
							<br>
							<span class="italic">
								by {{driver.note.added_by}}
								<span class="no-wrap">{{driver.note.date_utc | localtime | timestamp | date:'MM/dd @ HH:mm'}}</span>
								<button class="button button-small button-empty button-green" ng-click="last_note(driver.id_admin);"><i class="fa fa-pencil"></i></button>
							</span>
						</div>
						<div ng-if="!driver.note.text" class="listview-smaller">
							<span class="italic">Add note</span>
							<button class="button button-small button-empty button-green" ng-click="last_note(driver.id_admin);"><i class="fa fa-pencil"></i></button>
						</div>
					</td>
					<td class="tb-center tb-v-center">
						<span class="listview-smaller">
							<label class="switch-wrap">
								<input type="checkbox" class="switch" ng-change="send_text_about_schedule( driver.id_admin, driver.send_text_about_schedule );" ng-model="driver.send_text_about_schedule"/><div></div>
							</label>
						</span>
					</td>
					<td class="tb-center tb-v-center tb-small">
						<span class="tag tag-green" ng-if="driver.status.payment">OK</span>
						<span class="tag tag-red" ng-if="!driver.status.payment">Missing</span>
					</td>
					<td class="tb-center tb-v-center tb-small">
						<span class="tag tag-green" ng-if="driver.sent_all_docs">OK</span>
						<span class="tag tag-red" ng-if="!driver.sent_all_docs">Missing</span>
					</td>
					<td nowrap class="tb-v-center tb-right">
						<a href="/staff/{{driver.login}}"><button class="button button-small button-empty button-green"><i class="fa fa-car"></i>&nbsp;&nbsp;View</button></a>
					</td>
				</tr>
			</table>
		</div>
	</div>
</div>
