<link rel="stylesheet" href="{{ IncludeAsset('assets/lib/datatables/css/DT_bootstrap.css') }}">
<link rel="stylesheet" href="{{ IncludeAsset('assets/lib/datatables/css/datatables.responsive.css') }}">

<!--Begin Datatables-->
<div class="row">
	<div class="col-lg-12">
		<div class="box">
			<header>
				<div class="icons">
					<i class="fa fa-table"></i>
				</div>
				<h5>{{ @lang_ad_groups }}</h5>
			</header>
			<div id="collapse4" class="body">
				<table id="dataTable" class="table table-bordered table-condensed table-hover table-striped">
					<thead>
					<tr>
						<th data-class="expand">{{ @lang_group }}</th>
						<th data-hide="phone,tablet">{{ @lang_last_updated }}</th>
						<th data-hide="phone">{{ @lang_ads }}</th>
						<th data-hide="phone">{{ @lang_impressions }}</th>
						<th>{{ @lang_commands }}</th>
					</tr>
					</thead>
					<tbody>
					<repeat group="{{ @res_groups }}" value="{{ @res_group }}">
						<tr>
							<td>{{ @res_group.title | raw }}</td>
							<td>{{ @res_group.last_updated }}</td>
							<td>
								<check if ="{{ @res_group.ads }}">
									<true>
										<repeat group="{{ @res_group.ads }}" value="{{ @res_ad }}">
											<i class="fa fa-caret-right"></i> <a href="index.php?ads&edit&{{ @res_ad->_id }}" title="Edit">{{ @res_ad->title }}</a><br />
										</repeat>
									</true>
									<false>
										n/a
									</false>
								</check>
							</td>
							<td>{{ @res_group.impressions }}</td>
							<td><a class="delete" href="index.php?groups&delete&{{ @res_group.id }}" title="{{ @lang_delete }}" data-toggle="modal" data-target="#deleteModal" data-id="{{ @res_group.id }}"><i class="fontsize15 fa fa-times"></i> </a><a class="edit" href="index.php?groups&edit&{{ @res_group.id }}" title="{{ @lang_edit }}"><i class="fontsize15 fa fa-pencil"></i></a> <a class="code" href="index.php?groups&code&{{ @res_group.id }}" title="{{ @lang_ad_code }}"><i class="fontsize15 fa fa-cloud-upload"></i></a></td>
						</tr>
					</repeat>

					</tbody>
				</table>
			</div>
		</div>
	</div>
</div><!-- /.row -->

<!--End Datatables-->

<!-- Modal -->
<div class="modal fade" id="deleteModal" tabindex="-1" role="dialog" aria-labelledby="{{ @lang_delete }}" aria-hidden="true" data-id="" data-row="">
	<div class="modal-dialog">
		<div class="modal-content">
			<div class="modal-header">
				<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
				<h4 class="modal-title" id="deleteModalLabel">{{ @lang_delete }}</h4>
			</div>
			<div class="modal-body">
				{{ @lang_are_you_sure_you_want_to_delete_it }}?
			</div>
			<div class="modal-footer">
				<button type="button" class="btn btn-default" data-dismiss="modal">{{ @lang_cancel }}</button>
				<button type="button" class="btn btn-danger" id="delete">{{ @lang_delete }}</button>
			</div>
		</div>
	</div>
</div>
