
<?php \Laravel\Section::start('content'); ?>
	<div class="container">
		<div class="page-header">
			<h1>Couleurs</h1>
		</div>
		<div style="margin-bottom: 15px;">
			<a class="btn" href="<?php echo  URL::to_route('new_couleur') ; ?>"><i class="icon-plus"></i> Ajouter une nouvelle couleur</a>
		</div>
		<?php echo  BHelpers::notification() ; ?>
		<?php if($couleurs): ?>
		<table class="table table-striped table-hover datatable">
			<thead>
				<tr>
					<th>#</th>
					<th>Intitulé couleur</th>
					<th>Couleur</th>
					<th><?php echo __('admin.date_creation'); ?></th>
					<th><?php echo __('admin.derniere_modification'); ?></th>
					<th style="text-align:right;"><?php echo __('admin.action'); ?></th>
				</tr>
			</thead>
			<tbody>
				<?php foreach($couleurs as $p): ?>
				<tr>
					<td><?php echo  $p->id ; ?></td>
					<td>#<?php echo  $p->couleur ; ?></td>
					<td><span class="label" style="background-color:#<?php echo $p->couleur; ?>;border:1px solid #D8D8D8;">&nbsp;&nbsp;&nbsp;</span></td>
					<td><?php echo  $p->created_at ; ?></td>
					<td><?php echo  $p->updated_at ; ?></td>
					<td style="padding: 4px 8px; text-align:right;">
						<?php echo  Form::open(URL::to_route('delete_couleur', $p->id), 'DELETE', array('id' => 'form_'.$p->id, 'style' => 'margin:0;')) ; ?>
						<div class="btn-group">
							
							<a class="btn btn-small" href="<?php echo  URL::to_route('edit_couleur', array($p->id)) ; ?>"><i class="icon-pencil"></i> <?php echo __('admin.modifier'); ?></a>
							<a class="btn btn-small btn-danger" href="javascript:delete_entry(<?php echo $p->id ?>);"><i class="icon-remove icon-white"></i> <?php echo __('admin.supprimer'); ?></a>
							
						</div>
						<?php echo  Form::close() ; ?>
					</td>
				</tr>
				<?php endforeach; ?>
			</tbody>
		</table>
		<?php else: ?>
			<em>Aucune couleur pour le moment.</em>
		<?php endif; ?>
	</div>
	<script type="text/javascript">
	function delete_entry(id)
	{
		if(confirm("<?php echo __('admin.etes_vous_sur'); ?>"))
			$('#form_'+id).submit();
		else
			return false;
	}
	</script>
<?php \Laravel\Section::stop(); ?>
<?php echo view('backend::template_default')->with(get_defined_vars())->render(); ?>