<?php $__env->startSection('content'); ?>
	
	<div class="row">
		<div class="col-xs-6">
			<h2>Pages</h2>
		</div>
		<div class="col-xs-6">
			<div class="buttons" id="right-buttons">
				<a href="<?php echo URL::to('admin/pages/create'); ?>" class="btn btn-primary"><i class="glyphicon glyphicon-plus"></i> Create new Page</a>
			</div>
		</div>
	</div>
	
	<table class="table table-bordered table-striped">
		<thead>
			<tr>
				<th class="col-md-1 text-center">ID</th>
				<th class="col-md-4">Title</th>
				<th class="col-md-3">Url</th>
				<th>Last Updated</th>
				<th class="text-center" colspan="2">Actions</th>
			</tr>
		</thead>
		<tbody>
		<?php if($pages): ?>
			<?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->alias; ?></td>
				<td><?php echo date('M d, Y, g:ia',strtotime($page->updated_at)); ?></td>
				<td><a href="<?php echo URL::to('admin/pages/'.$page->page_id.'/edit'); ?>" class="btn btn-link">Edit</a></td>
				<td>
					<?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">Delete</button>
					<?php echo Form::close(); ?>
				</td>
			</tr>
			<?php endforeach; ?>
		<?php else: ?>
			<tr>
				<td colspan="6">No pages yet.</td>
			</tr>
		<?php endif; ?>
		</tbody>
	</table>
    
    <?php echo $pages->appends(array('query' => Input::get('query')))->links(); ?>

<?php $__env->stopSection(); ?>