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

<div class="content-padding">

	<h1 class="title box-title left"><i class="fa fa-comments-o"></i>Support : Issue #{{ticket.id_support}}</h1>

	<div class="right">
		<div class="ticket-chat-link">
			<a href ng-click="triggerViewTicket(ticket)"><i class="fa fa-comment-o"></i></a>&nbsp;
			<a href ng-click="triggerViewTicket(ticket)">Chat</a>
		</div>

		<div class="ticket-status-top">
			<div class="ticket-status-open" ng-if="ticket.status=='open'" ng-click="openCloseTicket()">Open</div>
			<div class="ticket-status-closed" ng-if="ticket.status=='closed'">Closed</div>
			<span class="tag tag-red" ng-if="ticket.type == 'EMAIL'">Email Ticket</span>
		</div>
	</div>

	<div class="divider"></div>

	<div class="bar-loader bar-loader-search bar-loader-boxes-top" ng-class="{'bar-loader-loading': loading}"></div>

	<div class="support-boxes">

		<div class="support-box-wrap box-content2" ng-if="ticket.type == 'WARNING' && !ticket.order.id_order" class="support-box-wrap">
			<div class="support-box-wrap-header">
				<h1>Internal Warning</h1>
				<div class="divider"></div>
			</div>

			<div class="no-box-content-color">
				<br>No action is required.
			</div>
		</div>

		<div class="support-box-wrap box-content2" ng-if="ticket.type == 'EMAIL'" class="support-box-wrap">
			<div class="support-box-wrap-header">
				<h1>Email Ticket</h1>
				<div class="divider"></div>
			</div>

			<div class="no-box-content-color">
				<div class="field-container">
					<div class="field-row">
						<div class="field-key">Name</div>
						<div class="field-value">{{ticket.name}}</div>
					</div>
					<div class="field-row">
						<div class="field-key">Email</div>
						<div class="field-value">{{ticket.email}}</div>
					</div>
				</div>
			</div>
		</div>

		<div class="support-box-wrap box-content2" class="support-box-wrap" ng-if="!ticket.staff && !ticket.user">
			<div class="support-box-wrap-header">
				<h1>New User or Driver</h1>
				<div class="divider"></div>
			</div>
		</div>

		<div class="support-box-wrap box-content2" ng-if="ticket.order.id_order">
			<div class="support-box-wrap-header">
				<h1>Order #{{ticket.order.id_order}}</h1>
				<div class="support-box-header-actions-wrap">
					<div class="support-box-header-actions" ng-if="ticket.show_details">
						<a href="/order/{{ticket.order.id_order}}"><button class="button button-small button-empty button-green"><i class="fa fa-eye"></i>&nbsp;&nbsp;View</button></a>
					</div>
				</div>
				<div class="divider"></div>
			</div>

			<div class="no-box-content-color">
				<div class="field-container">
					<div class="field-row">
						<div class="field-key">Pay / Type</div>
						<div class="field-value">{{ticket.order.pay_type | capitalize}} / {{ticket.order.delivery_type | capitalize}}</div>
					</div>
					<div class="field-row">
						<div class="field-key">Placed At</div>
						<div class="field-value">{{ticket.order.date | localtime | timestamp | date: "MM/dd hh:mm a"}} (<span am-time-ago="ticket.order.date"></span>)</div>
					</div>
					<div class="field-row">
						<div class="field-key">Status</div>
						<div class="field-value">
							<span ng-if="ticket.order.status"><b>{{ticket.order.status.status}}</b> <span am-time-ago="ticket.order.status.timestamp*1000"></span></span>
							<span ng-if="!ticket.order.status">{{ticket.order.confirmed ? 'Confirmed' : 'Placed'}}</span>
						</div>
					</div>
					<div class="field-row" ng-if="ticket.order.date_delivery">
						<div class="field-key">Desired Delivery Time</div>
						<div class="field-value">
							<span ng-if="ticket.restaurant.timezone != account.user.timezone">
								{{ticket.order.date_delivery | convertimeformat:ticket.restaurant.timezone:'MMMM Do YYYY, h:mm:ss a'}}
								&nbsp;(<span class="listview-bold">{{ticket.order.date_delivery | convertimeformat:ticket.restaurant.timezone:'z'}}</span>)
								<br>
							</span>
							{{ticket.order.date_delivery | convertimeformat:account.user.timezone:'MMMM Do YYYY, h:mm:ss a'}}
							&nbsp;(<span class="listview-bold">{{ticket.order.date_delivery | convertimeformat:account.user.timezone:'z'}}</span>)
							<span class="tag tag-purple" ng-if="ticket.order.date_delivery">Pre ordered</span>
						</div>
					</div>
					<div class="field-row" ng-if="ticket.order.status.status != 'delivered' && eta.time">
						<div class="field-key">ETA</div>
						<div class="field-value">
							{{eta.time | formatPrice}} minutes
						</div>
					</div>

					<div class="field-row" ng-if="ticket.order.refunded">
						<div class="field-key">Refunded</div>
						<div class="field-value">
							<span class="tag tag-green">Yes</span>
						</div>
					</div>
					<div ng-if="ticket.order.delivery_service && ticket.order.refunded" class="field-row link no-underline">
						<div class="field-key">
							Do Not Pay Driver Anything
						</div>
						<div class="field-value">
							<label class="switch-wrap">
								<input type="checkbox" ng-click="do_not_pay_driver()" class="switch" ng-model="ticket.order.do_not_pay_driver"/><div></div>
							</label>
						</div>
					</div>
					<div class="field-row link no-underline" ng-if="ticket.order.refunded">
						<div class="field-key">
							Pay restaurant despite refund <br>(e.g. this refund was our fault)
						</div>
						<div class="field-value">
							<label class="switch-wrap">
								<input type="checkbox" ng-click="do_not_pay_restaurant()" class="switch" ng-model="ticket.order.do_not_pay_restaurant"/><div></div>
							</label>
						</div>
					</div>
				</div>
				<br>



				<br><br>
				<div class="tripple-cols">

					<button class="button button-empty button-border button-orange" ng-if="ticket.user.id_user" ng-class="{'button-disabled': isRefunding || ticket.order.refunded || ticket.order.pay_type == 'cash'  }" ng-click="refund()"><i class="fa fa-heart"></i>&nbsp;&nbsp;Refund</button>

					<button title="Resend Driver Notifiction" ng-click="resend_notification_drivers();" class="button button-empty button-border button-green" ng-class="{'button-disabled': isDriverNotifying || !ticket.order.delivery_service || (ticket.order.delivery_service && ( ticket.order.status.status == 'pickedup' || ticket.order.status.status == 'accepted' || ticket.order.status.status == 'delivered' || ticket.order.status.status == 'transfered' ))}"><i class="fa fa-car"></i><span class="label">&nbsp;&nbsp;Notify</span></button>

					<button title="Resend Restaurant Notification" ng-click="resend_notification();" class="button button-empty button-border button-blue" ng-class="{'button-disabled': isRestaurantNotifying || ticket.order.confirmed || (ticket.restaurant.delivery_service && !ticket.restaurant.formal_relationship && !ticket.restaurant.order_notifications_sent)}"><i class="fa fa-coffee"></i><span class="label">&nbsp;&nbsp;Notify</span></button>


				</div>
				<div class="divider"></div>


			</div>
		</div>


		<div class="support-box-wrap box-content2" ng-show="!ticket.order.geomatched && ticket.order._address && !ticket.order._address.approved">
			<div class="support-box-wrap-header">
				<h1>Address #{{ticket.order._address.id_address}}</h1>
				<div class="divider"></div>
			</div>
			<div class="divider"></div>
			<div class="no-box-content-color">
				<br>
				<p>{{ticket.order._address.address}}</p>
			</div>
			<div class="no-box-content-color">
				<div class="field-container">
					<div class="field-row" ng-hide="ticket.order.campus_cash_charged && ticket.order.campus_cash_charged_info">
						<div class="field-key">
							Approve this address
						</div>
						<div class="field-value">
							<label class="switch-wrap">
								<input type="checkbox" ng-click="approve_address()" class="switch" ng-disabled="ticket.order._address.approved" ng-model="ticket.order._address.approved"/><div></div>
							</label>
						</div>
					</div>
				</div>
			</div>
			<div class="divider"></div>
		</div>

		<div class="support-box-wrap box-content2" ng-show="ticket.order.campus_cash">
			<div class="support-box-wrap-header">
				<h1>Campus Cash <span ng-show="ticket.order.campus_cash_charged"> Already Charged</span></h1>
				<div class="divider"></div>
			</div>
			<div class="divider"></div>
			<div class="no-box-content-color">
				<div class="field-container">
					<div class="field-row" ng-show="ticket.order.campus_cash_charged && ticket.order.campus_cash_charged_info">
						<div class="field-key">{{ticket.order.campus_cash_charged_info.name}}</div>
						<div class="field-value">
							by {{ticket.order.campus_cash_charged_info.date}}
						</div>
					</div>
					<div class="field-row" ng-hide="ticket.order.campus_cash_charged && ticket.order.campus_cash_charged_info">
						<div class="field-key">
							Mark as already charged
						</div>
						<div class="field-value">
							<label class="switch-wrap">
								<input type="checkbox" ng-click="mark_cash_card_charged()" class="switch" ng-disabled="ticket.order.campus_cash_charged" ng-model="ticket.order.campus_cash_charged"/><div></div>
							</label>
						</div>
					</div>
				</div>
				<br>
				<div ng-hide="ticket.order.campus_cash_charged">
					<button class="button button-empty button-border button-blue" ng-click="campus_cash()">
						<i class="fa fa-credit-card" ng-show="!campus_cash_retrieving"></i>
						<i class="fa fa-spinner fa-pulse" ng-show="campus_cash_retrieving"></i>
						<span class="label">&nbsp;&nbsp;Show Student ID</span>
					</button>
					<br>
				</div>
				<br>
			</div>


			<div class="divider"></div>
		</div>

		<div class="support-box-wrap box-content2" ng-if="ticket.staff.id_admin" class="support-box-wrap">
			<div class="support-box-wrap-header">
				<h1>Staff #{{ticket.staff.id_admin}}</h1>
				<div class="support-box-header-actions-wrap">
					<div class="support-box-header-actions" ng-if="ticket.show_details">
						<a href="/staff/{{ticket.staff.login}}"><button class="button button-small button-empty button-green"><i class="fa fa-eye"></i>&nbsp;&nbsp;View</button></a>
					</div>
				</div>
				<div class="divider"></div>
			</div>

			<div class="no-box-content-color">
				<div class="field-container">
					<div class="field-row">
						<div class="field-key">Name</div>
						<div class="field-value">{{ticket.staff.name}}</div>
					</div>
					<div class="field-row">
						<div class="field-key">Phone</div>
						<div class="field-value"><a href ng-click="callText(ticket.staff.phone)">{{ticket.staff.phone | formatPhone}}</a></div>
					</div>
					<div class="field-row">
						<div class="field-key">Community</div>
						<div class="field-value">
							<div ng-repeat="community in ticket.staff.communities">
								{{community}}
							</div>
						</div>
					</div>

					<div class="field-row" ng-if="ticket.staff.email">
						<div class="field-key">Email</div>
						<div class="field-value">
							<a href="mailto:{{ticket.staff.email}}:">{{ticket.staff.email}}</a>
						</div>
					</div>

					<div class="field-row" ng-if="ticket.staff.is_driver">
						<div class="field-key">Driver</div>
						<div class="field-value">
							<span class="tag tag-green">Yes</span>
						</div>
					</div>

					<div class="field-row" ng-if="ticket.staff.is_marketing_rep">
						<div class="field-key">Brand Representative</div>
						<div class="field-value">
							<span class="tag tag-green">Yes</span>
						</div>
					</div>
					<div class="field-row" ng-if="ticket.staff.is_campus_manager">
						<div class="field-key">Community Manager</div>
						<div class="field-value">
							<span class="tag tag-green">Yes</span>
						</div>
					</div>
					<div class="field-row" ng-if="ticket.staff.is_support">
						<div class="field-key">Customer Service</div>
						<div class="field-value">
							<span class="tag tag-green">Yes</span>
						</div>
					</div>
					<div class="field-row">
						<div class="field-key">Is Working</div>
						<div class="field-value">
							<span ng-if="ticket.staff.is_working" class="tag tag-green">Yes</span>
							<span ng-if="!ticket.staff.is_working" class="tag tag-red">No</span>
						</div>
					</div>
				</div>
				<br>
			</div>
		</div>

		<div class="support-box-wrap box-content2" ng-if="ticket.user.id_user" class="support-box-wrap">
			<div class="support-box-wrap-header">
				<h1>Customer #{{ticket.user.id_user}}</h1>
				<div class="support-box-header-actions-wrap">
					<div class="support-box-header-actions" ng-if="ticket.show_details">
						<a href="/customer/{{ticket.user.id_user}}"><button class="button button-small button-empty button-green"><i class="fa fa-eye"></i>&nbsp;&nbsp;View</button></a>
					</div>
				</div>
				<div class="divider"></div>
			</div>

			<div class="no-box-content-color">
				<div class="field-container">
					<div class="field-row">
						<div class="field-key">Name</div>
						<div class="field-value">{{ticket.user.name}}</div>
					</div>
					<div class="field-row">
						<div class="field-key">Phone</div>
						<div class="field-value"><a href ng-click="callText(ticket.user.phone)">{{ticket.user.phone | formatPhone}}</a></div>
					</div>
					<div class="field-row">
						<div class="field-key">Address</div>
						<div class="field-value"><a href ng-click="routeAddress(ticket.user.address)">{{ticket.user.address}}</a></div>
					</div>
					<div class="field-row" ng-if="ticket.user.email">
						<div class="field-key">Email</div>
						<div class="field-value">
							<a href="mailto:{{ticket.user.email}}:">{{ticket.user.email}}</a>
						</div>
					</div>
				</div>
				<br>
				<button ng-if="ticket.show_details" ng-click="creditDialog( ticket.user.id_user );" ng-if="ticket.user.id_user && !account.user.isCustomerDirector" class="button button-empty button-border button-orange"><i class="fa fa-gift"></i>&nbsp;&nbsp;Gift Card</button>
			</div>
		</div>

		<div class="support-box-wrap box-content2" ng-if="ticket.staff.delivering" class="support-box-wrap">
			<div class="support-box-wrap-header">
				<h1>Delivering</h1>
				<div class="support-box-header-actions-wrap">
					<div class="support-box-header-actions" ng-if="ticket.show_details">
						<a href="/orders?limit=20&page=1&fullcount=false&search=&restaurant=&community=&driver={{ticket.staff.id_admin}}&date=&view=list&datestart=&dateend=&user=&phone="><button class="button button-small button-empty button-green"><i class="fa fa-car"></i>&nbsp;&nbsp;All Orders Delivered by This Driver</button></a>
					</div>
				</div>
				<div class="divider"></div>
				<div class="divider"></div>
			</div>

			<div class="no-box-content-color">
				<table align="right" class="basic-table detail">
					<tr>
						<td class="topitem itemname">Order</td>
						<td class="topitem itemprice tb-small">Status</td>
						<td class="topitem order-contents-item-qty">Time</td>
					</tr>
					<tr ng-repeat="order in ticket.staff.delivering.deliveries">
						<td class="fooditem dish-name">
							<a href="/order/{{order.id_order}}">#{{order.id_order}}</a><br>
						</td>
						<td class="fooditem dish-name tb-small tb-v-center" nowrap="nowrap">
							<span class="tag tag-red no-wrap" ng-if="order.status == 'delivery-rejected'">Rejected</span>
							<span class="tag tag-black no-wrap" ng-if="order.status == 'delivery-canceled'">Canceled</span>
							<span class="tag tag-green no-wrap" ng-if="order.status == 'delivery-accepted'">Accepted</span>
							<span class="tag tag-blue no-wrap" ng-if="order.status == 'delivery-pickedup'">Pickedup</span>
							<span class="tag tag-purple no-wrap" ng-if="order.status == 'delivery-delivered'">Delivered</span>
						</td>
						<td class="fooditem dish-name" nowrap="nowrap">
								{{order.update | convertimeformat:account.user.timezone:'h:mm:ss a'}}
							&nbsp;(<span class="listview-bold">{{order.update | convertimeformat:account.user.timezone:'z'}}</span>)
						</td>
					</tr>
					<tr><td>	</td></tr>
				</table>
			</div>
		</div>

		<div class="support-box-wrap box-content2" ng-if="ticket.restaurant.id_restaurant" class="support-box-wrap">
			<div class="support-box-wrap-header">
				<h1>Restaurant #{{ticket.restaurant.id_restaurant}}</h1>
				<div class="support-box-header-actions-wrap">
					<div class="support-box-header-actions" ng-if="ticket.show_details">
						<a href="/restaurant/{{ticket.restaurant.id_restaurant}}"><button class="button button-small button-empty button-green"><i class="fa fa-eye"></i>&nbsp;&nbsp;View</button></a>
					</div>
				</div>
				<div class="divider"></div>
			</div>

			<div class="no-box-content-color">
				<div class="field-container">
					<div class="field-row">
						<div class="field-key">Name</div>
						<div class="field-value">{{ticket.restaurant.name}}</div>
					</div>
					<div class="field-row">
						<div class="field-key">Phone</div>
						<div class="field-value"><a href ng-click="callText(ticket.restaurant.phone)">{{ticket.restaurant.phone | formatPhone}}</a></div>
					</div>
					<div class="field-row">
						<div class="field-key">Address</div>
						<div class="field-value"><a href ng-click="routeAddress(ticket.restaurant.address)">{{ticket.restaurant.address}}</a></div>
					</div>
					<div class="field-row">
						<div class="field-key">Delivery by</div>
						<div class="field-value">{{ticket.restaurant.delivery_service ? 'Crunchbutton' : 'Restaurant'}}</div>
					</div>
					<div class="field-row">
						<div class="field-key">Relationship</div>
						<div class="field-value">{{ticket.restaurant.formal_relationship ? 'Formal' : 'Informal'}}</div>
					</div>
					<div class="field-row">
						<div class="field-key">Notification Sent</div>
						<div class="field-value">{{ticket.restaurant.order_notifications_sent ? 'Yes' : 'No'}}</div>
					</div>
				</div>

				<br>

				<button ng-show="ticket.restaurant && !ticket.restaurant.closed_for_today" class="button button-empty button-border button-orange" ng-click="closeForToday();"><i class="fa fa-times"></i>&nbsp;&nbsp;Close This Restaurant For Rest of Today</button>
				<button ng-show="ticket.restaurant && ticket.restaurant.closed_for_today" class="button button-border button-empty button-green" ng-click="forceReopenForToday();"><i class="fa fa-times"></i>&nbsp;&nbsp;Remove "Close for Today"</button>
			</div>
		</div>

		<ng-include src="'/assets/view/orders-order-contents.html'"></ng-include>

		<div class="support-box-wrap box-content2" ng-if="ticket.community.id_community" class="support-box-wrap">
			<div class="support-box-wrap-header">
				<h1>Community #{{ticket.community.id_community}}</h1>
				<div class="support-box-header-actions-wrap">
					<div class="support-box-header-actions">
						<a ng-if="ticket.show_details" href="/community/{{ticket.community.permalink}}"><button class="button button-small button-empty button-green"><i class="fa fa-eye"></i>&nbsp;&nbsp;View</button></a>
						<a href ng-click="openClosingTimeContainer()"><button class="button button-small button-small button-empty button-green"><i class="fa fa-power-off"></i>&nbsp;&nbsp;Switch</button></a>
						<a href ng-click="openCommunityNoteContainer()"><button class="button button-small button-empty button-green"><i class="fa fa-file"></i>&nbsp;&nbsp;Add Note</button></a>

					</div>
				</div>
				<div class="divider"></div>
			</div>

			<div class="no-box-content-color">
				<div class="field-container">
					<div class="field-row">
						<div class="field-key">Name</div>
						<div class="field-value">{{ticket.community.name}}</div>
					</div>
					<div class="field-row" ng-if="ticket.community.note">
						<div class="field-key">Last note</div>
						<div class="field-value">
							<a href="/communities/notes?limit=20&page=1&fullcount=false&search=&community={{ticket.community.id_community}}">
								{{ticket.community.note.text}}
							</a>
						</div>
					</div>

					<div class="field-row">
						<div class="field-key">Is Auto Closed</div>
						<div class="field-value">
							<span class="tag tag-red" ng-if="ticket.community.is_auto_closed">Yes</span>
							<span class="tag tag-green" ng-if="!ticket.community.is_auto_closed">No</span>
						</div>
					</div>
					<div class="field-row">
						<div class="field-key">All Restaurants</div>
						<div class="field-value">
							<span class="tag tag-red" ng-if="ticket.community.close_all_restaurants">Closed</span>
							<span class="tag tag-green" ng-if="!ticket.community.close_all_restaurants">Open</span>
						</div>
					</div>

					<div class="field-row">
						<div class="field-key">3rd Party Restaurants</div>
						<div class="field-value">
							<span class="tag tag-red" ng-if="ticket.community.close_3rd_party_delivery_restaurants">Closed</span>
							<span class="tag tag-green" ng-if="!ticket.community.close_3rd_party_delivery_restaurants">Open</span>
						</div>
					</div>

				</div>
			</div>
		</div>

		<div class="support-box-wrap box-content2" ng-if="ticket.order.driver.id_admin" class="support-box-wrap">
			<div class="support-box-wrap-header">
				<h1>Driver #{{ticket.order.driver.id_admin}}</h1>
				<div class="support-box-header-actions-wrap">
					<div class="support-box-header-actions" ng-if="ticket.show_details">
						<a href="/staff/{{ticket.order.driver.id_admin}}"><button class="button button-small button-empty button-green"><i class="fa fa-eye"></i>&nbsp;&nbsp;View</button></a>
						<a href ng-click="openStaffNoteContainer(ticket.order.driver.id_admin)"><button class="button button-small button-empty button-green"><i class="fa fa-file"></i>&nbsp;&nbsp;Add Note</button></a>
					</div>
				</div>
				<div class="divider"></div>

			</div>

			<div class="no-box-content-color">
				<div class="field-container">
					<div class="field-row">
						<div class="field-key">Name</div>
						<div class="field-value">{{ticket.order.driver.name}}</div>
					</div>
					<div class="field-row">
						<div class="field-key">Phone</div>
						<div class="field-value"><a href ng-click="callText(ticket.order.driver.phone)">{{ticket.order.driver.phone | formatPhone}}</a></div>
					</div>
					<div class="field-row">
						<div class="field-key">Delivering</div>
						<div class="field-value">
							&nbsp;<span ng-if="ticket.order.driver.deliveries.length">{{ticket.order.driver.deliveries.length}}</span>
							&nbsp;<span ng-if="!ticket.order.driver.deliveries.length">0</span>
						</div>
					</div>
					<div class="field-row">
						<div class="field-key">Shift ends in</div>
						<div class="field-value">
							<span ng-if="ticket.order.driver.working" title="{{ticket.order.driver.shift_ends_formatted}}">{{ticket.order.driver.shift_ends}}</span>
							<span ng-if="!ticket.order.driver.working">Shift ended</span>
						</div>
					</div>
					<div class="field-row" ng-if="ticket.order.status.status == 'accepted' || ticket.order.status.status == 'pickedup'">
						<div class="field-key">Distance</div>
						<div class="field-value">
							{{eta.distance | formatPrice}} miles
						</div>
					</div>
					<div class="field-row" ng-if="ticket.driver.note">
						<div class="field-key">Last note</div>
						<div class="field-value">
							<a href="/staff/notes?limit=20&page=1&fullcount=false&search=&admin={{ticket.driver.id_admin}}">
								{{ticket.driver.note.text}}
							</a>
						</div>
					</div>
					<div class="field-row" ng-if="ticket.show_details">
						<div class="field-key">
							<a href="http://dev.la/orders?limit=20&page=1&fullcount=false&search=&restaurant=&community={{ticket.order.id_community}}&driver=&date=&view=list&datestart=&dateend=&user=&phone=&type=all">
								View All Orders From Driver's Community
							</a>
						</div>
						<div class="field-value"></div>
					</div>
				</div>
			</div>
		</div>

	<div class="support-box-wrap box-content2" ng-if="ticket.show_details">
			<div class="support-box-wrap-header">
				<h1>Shifts</h1>
				<div class="support-box-header-actions-wrap">
					<div class="support-box-header-actions">
						<a href="/staff/{{ticket.order.driver.id_admin}}"><button class="button button-small button-empty button-green"><i class="fa fa-eye"></i>&nbsp;&nbsp;View</button></a>
						<a href ng-click="openStaffNoteContainer(ticket.order.driver.id_admin)"><button class="button button-small button-empty button-green"><i class="fa fa-file"></i>&nbsp;&nbsp;Add Note</button></a>
					</div>
				</div>
				<div class="divider"></div>
			</div>


			<div class="no-box-content-color box-content-table" ng-if="ticket.driver.shifts.length || ticket.driver.last_checkins.length">
				<table class="tb-zebra">
					<tr>
						<th>Time</th>
						<th>Community</th>
						<th>Confirmed</th>
					</tr>
					<tbody ng-if="ticket.driver.shifts.length">
						<tr ng-repeat="shift in ticket.driver.shifts">
							<td>
								<span class="listview-smaller">
									<a href="/shifts/schedule?date={{shift.date}}&communities={{shift.id_community}}&id_community_shift={{shift.id_community_shift}}">
										<span class="listview-bold">Start</span>: {{shift.date_start | localtime | timestamp | date:'MM/dd hh:mm a'}}<br>
										<span class="listview-bold">End</span>: {{shift.date_end | localtime | timestamp | date:'MM/dd hh:mm a'}}
									</a>
								</span>
							</td>
							<td><a href="/community/{{shift.id_community}}">{{shift.community_name}}</a></td>
							<td>
								<span class="tag tag-red" ng-if="!shift.confirmed">Not confirmed</span>
								<span class="tag tag-green" ng-if="shift.confirmed">Checked in</span>
							</td>
						</tr>
					</tbody>
					<tbody ng-if="ticket.driver.last_checkins.length">
						<tr ng-repeat="shift in ticket.driver.last_checkins">
							<td>
								<span class="listview-smaller">
									<a href="/shifts/schedule?date={{shift.date}}&communities={{shift.id_community}}&id_community_shift={{shift.id_community_shift}}">
										<span class="listview-bold">Start</span>: {{shift.date_start | localtime | timestamp | date:'MM/dd hh:mm a'}}<br>
										<span class="listview-bold">End</span>: {{shift.date_end | localtime | timestamp | date:'MM/dd hh:mm a'}}
									</a>
								</span>
							</td>
							<td><a href="/community/{{shift.id_community}}">{{shift.community_name}}</a></td>
							<td>
								<span class="tag tag-red" ng-if="!shift.confirmed">Not confirmed</span>
								<span class="tag tag-green" ng-if="shift.confirmed">Checked in</span>
							</td>
						</tr>
					</tbody>
				</table>
			</div>

		</div>

		<div class="support-box-wrap box-content2" ng-if="ticket.id_support" class="support-box-wrap">
			<div class="support-box-wrap-header">
				<h1 style="float:none">Comments</h1>
			</div>

			<div class="no-box-content-color">
				<div class="field-container">
					<div class="field-row" ng-repeat="comment in ticket.comments">
						<div class="field-key"><span class="listview-bold">{{comment.name}}</span>: <span title="{{comment.date}}">{{comment.hour}}</span></div>
						<div class="field-value">{{comment.body}}</div>
					</div>
				</div>
				<br><br>
				<div class="field-container">
					<div class="field-row field-container">
						<div colspan="2">
							<div class="comments-box">
								<textarea id="support-comment" ng-model="comment.text" class="support-comment"></textarea>
							</div>
						</div>
					</div>
				</div>

				<div class="double-cols">
					<button ng-click="close_and_comment();" class="button button-border button-empty button-orange" ng-class="{ 'button-disabled': ticket.status == 'closed'}">
						<span ng-if="!isClosing">
							<span ng-if="comment.text && ticket.status == 'open'">Comment &amp; </span>Close
						</span>
						<span ng-if="isClosing"><i class="fa fa-spinner fa-spin"></i> Closing</span>
					</button>
					<button ng-click="comment();" class="button button-empty button-border button-green" ng-class="{'button-disabled': !comment.text}">
						<span ng-if="!isCommenting">Comment</span>
						<span ng-if="isCommenting"><i class="fa fa-spinner fa-spin"></i> Commenting</span>
					</button>
				</div>

			</div>

		</div>

	</div>

<ng-include src="'/assets/view/communities-community-open-close-form.html'"></ng-include>

	<div class="support-box-wrap box-content2" class="support-box-wrap" ng-if="ticket.order.driver && ticket.order.driver.location">
		<div class="support-box-wrap-header">
			<h1>Location</h1>
			<div class="support-box-header-actions-wrap">
				<div class="support-box-header-actions">
					<span class="tag tag-red">BETA</span>
				</div>
			</div>
			<div class="divider"></div>
		</div>
		<map center="false" zoom="12" class="maps-map" map-type-control="false" style="height: 230px;" options="{streetViewControl: false}"></map>
	</div>
</div>
