
<div class="box-content2 box-content-table">
	<div sticky-header>
		<table class="thead">
			<tr>
				<th></th>
				<th>Restaurant</th>
				<th>Contact</th>
				<th class="tb-center">Orders</th>
				<th class="tb-small">Status</th>
				<th class="tb-small">Open</th>
				<th class="tb-small">Payment</th>
				<th ng-if="current_page == 'community'" title="Notes for Drivers">Notes</th>
				<th class="tb-small"></th>
			</tr>
		</table>
		<div class="tbody">
			<table class="tb-zebra">
				<tr ng-repeat="restaurant in restaurants track by $index" ng-class="{ 'delivery_it_self': restaurant.delivery_it_self }" ng-attr-tabindex="{{$index+1}}" ng-init="$last ? ngRepeatFinished() : null" tab-select="/restaurant/{{restaurant.permalink}}">
					<td class="tb-image-row">
					<a href="/restaurant/{{restaurant.permalink}}">
						<div class="customer-image-crop" img-list-view-src="restaurant.images.thumb" img-null="restaurant-image-null"></div>
					</a></td>
					<td>
						<span class="listview-bold">{{restaurant.name}}</span><br>
						<span ng-if="!community">
							<span class="staff-community-repeat listview-smaller" ng-repeat="community in restaurant.communities">
								<a href="/community/{{community.permalink}}" class="truncate-small">{{community.name}}</a>
							</span>
						</span>
						<br>
						<span class="tag tag-empty tag-orange" ng-if="restaurant.delivery && restaurant.delivery_service">3rd</span>
						<span class="tag tag-empty tag-blue" ng-if="restaurant.delivery && !restaurant.delivery_service">1st</span>
						<span class="tag tag-empty tag-lightgrey" ng-if="restaurant.takeout && !restaurant.delivery">Takeout</span>
						<span class="tag tag-empty tag-lightgrey" ng-if="!restaurant.takeout && !restaurant.delivery">None</span>
					</td>
					<td>
						<span class="listview-smaller">
							<a href ng-click="callText(restaurant.phone)">{{restaurant.phone | formatPhone}}</a>
						</span>
						<br>
						<span class="listview-smaller">
							{{restaurant.address | formatAddress}}
						</span>
					</td>
					<td class="tb-center tb-v-center">
						<a href="/orders?restaurant={{restaurant.id_restaurant}}" ng-if="restaurant.orders != '0'">{{restaurant.orders}}</a>
						<span ng-if="restaurant.orders == '0'">0</span>
						<br>
						<span ng-if="restaurant._order_date" class="listview-smallest"><span am-time-ago="restaurant._order_date | localtime | timestamp"></span></span>
					</td>
					<td class="tb-center tb-small tb-v-center" nowrap="nowrap">
						<span class="tag tag-empty tag-green" ng-if="restaurant.active">Active</span>
						<span class="tag tag-empty tag-red" ng-if="!restaurant.active">Inactive</span>
					</td>
					<td class="tb-center tb-v-center tb-small">
						<span class="tag tag-red" ng-if="!restaurant.open_for_business">Closed</span>
							<span ng-if="restaurant.open_for_business">
							<span class="tag tag-green" ng-if="restaurant.open">Open</span>
							<span class="tag tag-red" ng-if="!restaurant.open">Closed</span>
						</span>
					</td>
					<td class="tb-center tb-v-center" nowrap="nowrap">
						<span class="tag tag-empty tag-orange" ng-if="restaurant.payment_method && restaurant.payment_method == 'check'">Check</span>
						<span class="tag tag-empty tag-purple" ng-if="restaurant.payment_method && restaurant.payment_method == 'deposit'">Deposit</span>
						<span class="tag tag-empty tag-blue" ng-if="restaurant.payment_method && restaurant.payment_method == 'no payment'">Does Not Need Payment</span>
						<span class="tag tag-empty tag-black" ng-if="!restaurant.payment_method || restaurant.payment_method == ''">Empty</span>
					</td>
					<td ng-if="current_page == 'community'" class="tb-small">
						<div class="listview-text-block" ng-if="restaurant.notes_to_driver">
							{{restaurant.notes_to_driver}}
						</div> <button class="button button-small button-empty button-green" title="Edit notes to driver" ng-click="notes_to_driver_edit(restaurant.id_restaurant);"><i class="fa fa-pencil"></i></button>
					</td>
					<td nowrap class="tb-v-center tb-right">
						<a href="/restaurant/{{restaurant.permalink}}"><button class="button button-small button-empty button-green"><i class="fa fa-eye"></i>&nbsp;&nbsp;View</button></a>
						<button ng-if="current_page == 'community'" ng-click="restaurantForceCloseContainer(restaurant.permalink);" class="button button-small button-empty button-green"><i class="fa fa-power-off"></i>&nbsp;&nbsp;Switch</button>
					</td>
				</tr>
			</table>
		</div>
	</div>
</div>
<ng-include src="'/assets/view/restaurants-force-close-form.html'"></ng-include>
<div class="notes-to-drivers-container zoom-anim-dialog mfp-hide dialog">
	<div ng-controller="RestaurantNotesToDriverCtrl">
		<h2 class="title left"><span>Notes to Driver: {{restaurant.name}}</span></h2>
		<div class="divider"></div>
		<form name="formNote" novalidate>
			<ul ng-class="{'submitted':formNoteSubmitted}" class="ul-inputs">
				<li class="li-input">
					<div class="label">Note:</div>
					<div class="input">
						<textarea name="notesToDriver" class="big" ng-model="restaurant.notes_to_driver"></textarea>
					</div>
				</li>
				<li class="li-input" ng-show="!isSavingNote">
					<button class="button save" ng-click="save_notes_to_driver();">Save</button>
				</li>
			</ul>
		</form>
	</div>
</div>
