<?php $__env->startSection('content'); ?>
	 
    <p class="head_inner_nav">
        <a href="<?php echo URL::to('admin/offerings'); ?>">Offerings</a><span>></span> Docs
    </p> 

	<div class="row">
		<div class="col-xs-6">
			<h2>"<?php echo $offering->name; ?>" Offering - Docs</h2>
		</div>
		<div class="col-xs-6">
			<div class="buttons" id="right-buttons">
				<a href="<?php echo URL::to('admin/offerings/'.$offering->offering_id.'/docs/create'); ?>" class="btn btn-primary"><i class="glyphicon glyphicon-plus"></i> Add a new doc</a>
			</div>
		</div>
	</div>
	
	<table class="table table-bordered table-striped">
		<thead>
			<tr>
				<th class="text-center">ID</th>
				<th class="col-md-4">Name</th>
				<th class="text-center">File</th>
				<th class="text-center">Last Updated</th>
				<th class="text-center" colspan="2">Actions</th>
			</tr>
		</thead>
		<tbody>
		<?php if($docs): ?>
			<?php foreach($docs as $doc): ?>
			<tr>
				<td class="text-center"><?php echo $doc->doc_id; ?></td>
				<td><?php echo $doc->title; ?></td>
				<td><?php echo $doc->file_name; ?></td>
				<td class="text-center"><?php echo date('M d, Y, g:ia',strtotime($doc->updated_at)); ?></td>
				<td><a href="<?php echo URL::to('admin/offerings/'.$offering->offering_id.'/docs/'.$doc->doc_id.'/edit'); ?>" title="Edit"><i class="glyphicon glyphicon-pencil"></i></a></td>
				<td>
					<?php echo Form::open(array('route' => array('admin.offerings.'.$offering->offering_id.'.docs.destroy', $doc->doc_id), 'method' => 'DELETE')); ?>
					<button type="submit" onclick="return confirm('Are you sure?')" class="btn btn-link"  title="Delete"><i class="glyphicon glyphicon-trash"></i></button>
					<?php echo Form::close(); ?>
				</td>
			</tr>
			<?php endforeach; ?>
		<?php else: ?>
			<tr>
				<td colspan="6">No docs yet.</td>
			</tr>
		<?php endif; ?>
		</tbody>
	</table>
    
     <?php echo $docs->appends(array('query' => Input::get('query')))->links(); ?>
	
<?php $__env->stopSection(); ?>