<ul class="nav nav-tabs" id="myTab">
	<li class="active"><a href="#generalinfo" data-toggle="tab"><i class="icon-link"></i> Caractéristiques</a></li>
	<?php foreach($languages as $l): ?>
	<li><a href="#div<?php echo  $l->short ; ?>" data-toggle="tab"><img src="<?php echo  URL::to_asset('image/flag_'.strtoupper($l->short)); ?>.png" title="<?php echo $l->short; ?>" style="margin-bottom:2px;" alt=""> <?php echo  $l->name ; ?></a></li>
	<?php endforeach; ?>
</ul>
<div class="tab-content">
	<div class="tab-pane active" id="generalinfo">
	
		<div style="margin-bottom: 30px;">
			<div class="alert alert-info">
				<button type="button" class="close" data-dismiss="alert">×</button>
				<i class="icon-info-sign"></i> Note :
				Veuillez uploader ici la <b>miniature</b> correspondante à cette catégorie. <b>Format JPEG/JPG</b>.
			</div>
		</div>
		
		<table class="table table-striped">
			<tr <?php if($errors->first('parent_id')) echo 'class="error"'; ?>>
				<td style="width:300px"><?php echo __('admin.categorie_parente'); ?></td>
				<td>
					<?php echo  Form::select('parent_id', $categories, Input::old('parent_id', (isset($category) ? $category->parent_id : NULL))); ; ?>
					<?php echo  $errors->first('parent_id', '<span class="help-inline">:message</span>') ; ?>
				</td>
			</tr>
			<tr <?php if($errors->first('miniature')) echo 'class="error"'; ?>>
				<td style="width:200px">
					<?php if($miniature): ?>
						Modifier la miniature
					<?php else: ?>
						Ajouter une miniature
					<?php endif; ?>
				</td>
				<td>
					<div class="fileupload fileupload-new" data-provides="fileupload">
						<div class="input-append">
							<div class="uneditable-input span3"><i class="icon-file fileupload-exists"></i> <span class="fileupload-preview"></span></div>
							<span class="btn btn-file">
								<span class="fileupload-new"><?php echo __('admin.choisir_fichier'); ?></span><span class="fileupload-exists"><?php echo __('admin.changer'); ?></span>
								<input type="file" name="miniature" />
							</span>
							<a href="#" class="btn fileupload-exists" data-dismiss="fileupload"><?php echo __('admin.retirer'); ?></a>
						</div>
					</div>
					<span class="help-inline">Important : Format JPG/JPEG seulement.</span>
			     	<?php echo  $errors->first('miniature', '<span class="help-inline">:message</span>') ; ?>
			    </td>
			</tr>
			<?php if($category && $category->photo!=''): ?>
				<tr>
					<td>Miniature actuelle</td>
					<td><img src="<?php echo $miniature; ?>" alt="" title="" /></td>
				</tr>
			<?php else: ?>
				<?php if($category): ?>
				<tr>
					<td>Miniature actuelle</td>
					<td><b>Aucune miniature pour le moment.</b></td>
				</tr>
				<?php endif; ?>
			<?php endif; ?>
		</table>
	</div>
	<?php foreach($languages as $l): ?>
	<div class="tab-pane" id="div<?php echo  $l->short ; ?>">
	<table class="table table-striped">
		<tr <?php if($errors->first($l->short.'_name')) echo 'class="error"'; ?>>
			<td style="width:300px"><?php echo __('admin.nom_categorie'); ?> (<?php echo  $l->name ; ?>)</td>
			<td>
				<?php echo  Form::text($l->short.'_name', Input::old($l->short.'_name', (isset($category) ? $category->desc[$l->id - 1]->name : NULL)),array('style'=>'width:500px;')) ; ?>
				<?php echo  $errors->first($l->short.'_name', '<span class="help-inline">:message</span>') ; ?>
			</td>
		</tr>
		<tr <?php if($errors->first($l->short.'_slogan')) echo 'class="error"'; ?>>
			<td style="width:300px">Slogan de la catégorie (<?php echo  $l->name ; ?>)</td>
			<td>
				<?php echo  Form::textarea($l->short.'_slogan', Input::old($l->short.'_slogan', (isset($category) ? $category->desc[$l->id - 1]->slogan : NULL)),array('style'=>'width:80%;height:60px;')) ; ?>
				<?php echo  $errors->first($l->short.'_slogan', '<span class="help-inline">:message</span>') ; ?>
			</td>
		</tr>
	</table>
	</div>
	<?php endforeach; ?>
</div>