<ol class="breadcrumb">
	<li><a href="#/">Dashboard</a></li>
	<li class="active">Batch Messages</li>
</ol>

<div class="container-fluid">
	<div class="row">
		<div class="col-md-12">
			<div class="panel panel-midnightblue">
				<div class="panel-heading">
					<h2>Batch Messages</h2>
					<div class="panel-ctrls">
						<a class="button-icon" ng-click="vm._downloadCSV()" title="Download CSV"><i class="ti ti-save"></i></a>
						<a class="button-icon" ng-click="vm._reload()" title="Reload"><i class="ti ti-reload"></i></a>
						<a href="#/batch-messages/new" class="button-icon" title="New Batch Message"><i class="ti ti-plus"></i></a>
					</div>
				</div>
				<div class="panel-body">
					<p><input type="text" class="form-control" ng-model="searchInput" placeholder="Search here..."></p>
					<table class="table table-striped">
						<thead>
							<tr>
								<th>From</th>
								<th>Subject</th>
								<th>Date</th>
								<th width="15%">Actions</th>
							</tr>
						</thead>
						<tbody>
							<tr dir-paginate="batch_message in vm.batch_messages | filter: searchInput | itemsPerPage: 10">
								<td>
									<a href="#/employees/{{batch_message.employee_id}}">
										{{batch_message.employee.name}}
									</a>
								</td>
								<td>
									<a href="#/batch-messages/{{batch_message.id}}">
										{{batch_message.subject}}
									</a>
								</td>
								<td>{{batch_message.created_at_formatted}}</td>
								<td>
									<div class="btn-group">
										<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
											<i class="ti ti-settings"></i>&nbsp;&nbsp;<span class="caret"></span>
										</button>
										<ul class="dropdown-menu" role="menu">
											<li><a ng-click="vm._destroy(batch_message.id)">Delete</a></li>
										</ul>
									</div>
								</td>
							</tr>
						</tbody>
					</table>
					<p class="text-center" ng-show="vm.batch_messages.length == 0">No records found</p>
					<div class="row">
						<div class="col-sm-12 text-center">
							<dir-pagination-controls></dir-pagination-controls>
						</div>
					</div>
				</div>
			</div>
		</div>
	</div>
</div>
