<?php $__env->startSection('content'); ?>
	
	<h2>Static Pages</h2>
	<div class="buttons">
		<a href="<?php echo URL::route('admin.pages.create'); ?>" class="btn btn-primary"><i class="glyphicon glyphicon-plus"></i> Add a new Page</a>
	</div>
	
	
	<table class="table table-bordered table-striped">
		<thead>
			<tr>
				<th class="text-center">ID</th>
				<th class="col-md-4">Title</th>
				<th class="col-md-4 text-center">Slug</th>				
				<th class="text-center">Last Updated</th>
				<th class="text-center" colspan="2">Actions</th>
			</tr>
		</thead>
		
		<?php if($pages): ?>
		<tbody>
			<?php foreach($pages as $page): ?>
			<tr>
				<td class="text-center"><?php echo $page->page_id; ?></td>
				<td><?php echo $page->title; ?></td>
				<td><?php echo $page->slug; ?></td>
				<td class="text-center"><?php echo date('M d, Y \a\t g:i A',strtotime($page->updated_at)); ?></td>
				<td class="text-center"><a href="<?php echo URL::route('admin.pages.edit', $page->page_id); ?>" title="Edit">Edit</a></td>
				<td class="text-center">
					<?php echo Form::open(array('route' => array('admin.pages.destroy', $page->page_id), 'method' => 'DELETE')); ?>
					<button type="submit" onclick="return confirm('Are you sure?')" class="btn btn-link"  title="Delete">Delete</button>
					<?php echo Form::close(); ?>
				</td>
			</tr>
			<?php endforeach; ?>
		</tbody>
		<?php if($pages->getTotal() > 20): ?>
		<tfoot>	
			<tr>
				<td colspan="7"><div class="pagination"><?php echo $pages->links(); ?></div></td>
			</tr>
		</tfoot>
		<?php endif; ?>
		<?php else: ?>
			<tr>
				<td colspan="7">No pages yet.</td>
			</tr>
		<?php endif; ?>
		
	</table>

<?php $__env->stopSection(); ?>