Commit 8c5fac2e by Francisco Salazar

ocultar secciones

parent 8f7ea1b9
...@@ -20,4 +20,13 @@ return [ ...@@ -20,4 +20,13 @@ return [
"pagination" => 15, "pagination" => 15,
"otros" => 6 "otros" => 6
], ],
//Show elements
"show-form" => [
"subcategory" => true,
"description" => true,
"features" => true,
"specifications" => true,
"gallery" => true
],
]; ];
\ No newline at end of file
...@@ -58,7 +58,9 @@ ...@@ -58,7 +58,9 @@
<th>Categoría</th> <th>Categoría</th>
<th>Descripción</th> <th>Descripción</th>
<th>Productos</th> <th>Productos</th>
@if(config('product.show-form.subcategory'))
<th>Subcategorias</th> <th>Subcategorias</th>
@endif
<th></th> <th></th>
</tr> </tr>
@foreach ($categories as $category) @foreach ($categories as $category)
...@@ -73,12 +75,16 @@ ...@@ -73,12 +75,16 @@
</td> </td>
<td> {{$category->description}}</td> <td> {{$category->description}}</td>
<td class="text-center"> {{$category->products->count()}}</td> <td class="text-center"> {{$category->products->count()}}</td>
@if(config('product.show-form.subcategory'))
<td class="text-center"> {{$category->subcategories->count()}}</td> <td class="text-center"> {{$category->subcategories->count()}}</td>
@endif
<td class="text-center"> <td class="text-center">
@if(config('product.show-form.subcategory'))
<a class='btn btn-xs btn-success button-mb' href="{{route('admin.product.subcategory.index', $category->id)}}"> <a class='btn btn-xs btn-success button-mb' href="{{route('admin.product.subcategory.index', $category->id)}}">
<i class='fas fa-plus icon-special-size'></i> <i class='fas fa-plus icon-special-size'></i>
Subcategorías Subcategorías
</a> </a>
@endif
{!! Form::open(['route'=> ['admin.product.category.destroy',$category->id],'method'=>'DELETE'])!!} {!! Form::open(['route'=> ['admin.product.category.destroy',$category->id],'method'=>'DELETE'])!!}
<button class='btn btn-danger btn-xs button-mb' onclick="return confirm('¿Estás seguro de eliminar este elemento?');" type='submit'> <button class='btn btn-danger btn-xs button-mb' onclick="return confirm('¿Estás seguro de eliminar este elemento?');" type='submit'>
<i class='fas fa-trash-alt icon-special-size'></i> <i class='fas fa-trash-alt icon-special-size'></i>
......
...@@ -37,14 +37,14 @@ ...@@ -37,14 +37,14 @@
{!! Form::text('publication_date', null, ["class"=>"form-control", "required"=>"required", "id"=>"publication_date"]) !!} {!! Form::text('publication_date', null, ["class"=>"form-control", "required"=>"required", "id"=>"publication_date"]) !!}
</div> </div>
</div> </div>
@if(config('product.show-form.subcategory'))
<div class="col-md-6"> <div class="col-md-6">
<div class="form-group" > <div class="form-group" >
{!! Form::label('subcategory_id', 'Subcategoría', ['class'=>'control-label'])!!} {!! Form::label('subcategory_id', 'Subcategoría', ['class'=>'control-label'])!!}
{!! Form::select('subcategory_id', $subcategories, null, ["class"=>"form-control", "placeholder"=>"Selecciona una subcategoría"]) !!} {!! Form::select('subcategory_id', $subcategories, null, ["class"=>"form-control", "placeholder"=>"Selecciona una subcategoría"]) !!}
</div> </div>
</div> </div>
@endif
</div> </div>
<div class="row"> <div class="row">
<div class="col-md-6"> <div class="col-md-6">
...@@ -172,21 +172,27 @@ ...@@ -172,21 +172,27 @@
</div> </div>
<div class="row"> <div class="row">
@if(config('product.show-form.description'))
<div class="col-md-6"> <div class="col-md-6">
{!! Form::label('description', 'Detalles', ['class'=>'control-label'])!!} {!! Form::label('description', 'Detalles', ['class'=>'control-label'])!!}
{!! Form::textarea('description', null, ["class"=>"form-control", "required"=>"required", 'id'=>'body', 'rows'=>"30", 'cols'=>"80"]) !!} {!! Form::textarea('description', null, ["class"=>"form-control", "required"=>"required", 'id'=>'body', 'rows'=>"30", 'cols'=>"80"]) !!}
</div> </div>
@endif
@if(config('product.show-form.features'))
<div class="col-md-6"> <div class="col-md-6">
{!! Form::label('features', 'Características', ['class'=>'control-label'])!!} {!! Form::label('features', 'Características', ['class'=>'control-label'])!!}
{!! Form::textarea('features', null, ["class"=>"form-control", 'id'=>'body', 'rows'=>"30", 'cols'=>"80"]) !!} {!! Form::textarea('features', null, ["class"=>"form-control", 'id'=>'body', 'rows'=>"30", 'cols'=>"80"]) !!}
</div> </div>
@endif
</div> </div>
<div class="row"> <div class="row">
@if(config('product.show-form.specifications'))
<div class="col-md-6"> <div class="col-md-6">
{!! Form::label('specifications', 'Información adicional', ['class'=>'control-label'])!!} {!! Form::label('specifications', 'Información adicional', ['class'=>'control-label'])!!}
{!! Form::textarea('specifications', null, ["class"=>"form-control", 'id'=>'body', 'rows'=>"30", 'cols'=>"80"]) !!} {!! Form::textarea('specifications', null, ["class"=>"form-control", 'id'=>'body', 'rows'=>"30", 'cols'=>"80"]) !!}
</div> </div>
@endif
</div> </div>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment