<div class="card card-info card-outline">
	<div class="card-header">
		<h5 class="m-0">Pages
			<form method="post" class="float-right">
				{{ csrf() }}
				<input type="hidden" name="action" value="new" />
				<button type="submit" class="btn btn-sm btn-success">New</button>
			</form>
		</h5>
	</div>
	<div class="card-body">
		<table class="table table-striped table-bordered table-responsive d-md-table" id="tb_pages">
			<thead>
			<tr>
				<th>Name</th>
				<th>Title</th>
				<th>PHP</th>
				<th style="width: 150px;">Options</th>
			</tr>
			</thead>
			<tbody>
			{% for page in pages %}
				<tr>
					<td>{{ page.link|raw }}</td>
					<td><i>{{ page.title }}</i></td>
					<td>{% if page.php %}Yes{% else %}No{% endif %}</td>
					<td>
						<div class="btn-group">
							<form method="post">
								{{ csrf() }}
								<input type="hidden" name="action" value="edit" />
								<input type="hidden" name="id" value="{{ page.id }}" />
								<button type="submit" class="btn btn-success btn-sm" title="Edit"><i class="fas fa-pencil-alt"></i></button>
							</form>

							<form method="post">
								{{ csrf() }}
								<input type="hidden" name="action" value="delete" />
								<input type="hidden" name="id" value="{{ page.id }}" />
								<button type="submit" class="btn btn-danger btn-sm" title="Delete" onclick="return confirm('Are you sure?');"><i class="fas fa-pencil-alt"></i></button>
							</form>

							<form method="post">
								{{ csrf() }}
								<input type="hidden" name="action" value="hide" />
								<input type="hidden" name="id" value="{{ page.id }}" />
								<button type="submit" class="btn btn-{{ (page.hide != 1) ? 'info' : 'default' }} btn-sm" title="{% if page.hide != 1 %}Hide{% else %}Show{% endif %}"><i class="fas fa-eye{{ (log.hide != 1) ? '' : '-slash' }}"></i></button>
							</form>
						</div>
					</td>
				</tr>
			{% endfor %}
			</tbody>
		</table>
	</div>
</div>
<script>
	$(function () {
		$('#tb_pages').DataTable()
	})
</script>
