<?php $__env->startSection('content'); ?>
<div class="container-fluid">
	<div class="row">
		<div class="col-md-8 col-md-offset-2">
			<div class="panel panel-default">
				<div class="panel-heading">Milestones
                    <div class="muted pull-right">
                        <a href="<?php echo e(URL('/milestones/create/')); ?>" class="btn btn-success btn-xs">Add Milestone</a>
                     </div>
                </div>
				<div class="panel-body">
					<?php if(count($errors) > 0): ?>
						<div class="alert alert-danger">
							<strong>Whoops!</strong> There were some problems with your input.<br><br>
							<ul>
								<?php foreach($errors->all() as $error): ?>
									<li><?php echo e($error); ?></li>
								<?php endforeach; ?>
							</ul>
						</div>
					<?php endif; ?>

				 <?php if(Session::has('message')): ?>
						<div class="alert alert-success">
							<strong>  <?php echo e(Session('message')); ?> </strong>
        				</div>
					<?php endif; ?>


                     <?php if(count($milestones) > 0): ?>


                     <table class="table table-hover sortable">
                     <thead>
                         <tr>
                            <th>Id</th>
                            <th>Milestone</th>
                            <th>Group</th>
                            <th></th>
                         </tr>
                     </thead>
                     <tbody>
                      <?php foreach($milestones as $milestone): ?>
                     <tr>
                            <td><?php echo e($milestone->id); ?></td>
                            <td><?php echo e($milestone->milestone); ?></td>
                            <td><?php echo e($milestone->group->category); ?></td>
                            <td>
<a class="btn btn-info btn-xs"  href="<?php echo e(URL::to('milestones/edit/' . $milestone->id)); ?>"><span class="glyphicon glyphicon-pencil" aria-hidden="true"></span> Edit</a>&nbsp;<a class="btn btn-xs btn-danger" data-toggle="tooltip" data-placement="top" title="Warning: Milestone Deletion will delete all tasks under the milestone" href="<?php echo e(URL::to('milestones/delete/' . $milestone->id)); ?>" onclick="return confirm('Warning: Milestone Deletion will delete all tasks under the milestone. Are your sure?')"><span class="glyphicon glyphicon-trash" aria-hidden="true"></span> Delete</a>&nbsp;<a class="btn btn-default btn-xs"  href="<?php echo e(URL::to('milestones/tasks/' . $milestone->id)); ?>"><span class="glyphicon glyphicon-th" aria-hidden="true"></span> View Tasks</a>
                           </td>
                        </tr>
                         <?php endforeach; ?>
                     </tbody>

                     </table>
                       <?php echo str_replace('/?', '?', $milestones->render()); ?>


                    <?php else: ?>
                       <h3>Oops! No milestones Found!</h3>
                    <?php endif; ?>


				</div>
			</div>
		</div>
	</div>
</div>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('app', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>