Skip to content
This repository has been archived by the owner on Feb 8, 2022. It is now read-only.

Commit

Permalink
Clean form DOM
Browse files Browse the repository at this point in the history
  • Loading branch information
victorhqc committed Aug 10, 2019
1 parent b28e650 commit f11d089
Showing 1 changed file with 105 additions and 69 deletions.
174 changes: 105 additions & 69 deletions resources/views/add_product.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,75 +15,111 @@

@section('content')
<div class="container">
<div class="d-flex justify-content-center">
<form
method="post"
action="{{ action('ProductsController@submitProduct') }}"
enctype="multipart/form-data"
>
@csrf
<h1>Agregar Productos</h1>
<ul class="list-group list-group-flush">
<li class="list-group-item">
<strong>Nombre:</strong>
<input
class="form-control"
type="text"
name="product_name"
required
/>
</li>
<li class="list-group-item">
<strong>Descripción:</strong>
<input
class="form-control"
type="text"
name="product_description"
required
/>
</li>
<li class="list-group-item">
<strong>Tipo de producto:</strong>
<select name="product_type" class="form-control" required>
<option value="">Seleccione una opción</option>
@foreach($productsTypes as $type)
<option value="{{$type['id']}}">
{{$type['name']}}
</option>
@endforeach
</select>
</li>
<li class="list-group-item">
<strong>Marca de producto:</strong>
<select name="product_brand" class="form-control" required>
<option value="">Seleccione una opción</option>
@foreach($brands as $brand)
<option value="{{$brand['id']}}">
{{$brand['name']}}
</option>
@endforeach
</select>
</li>
<li class="list-group-item">
<strong>Selecciona una imagen:</strong><br>
<input
type="file"
class="upload_file btn btn-warning"
name="upload_file"
required
>
</li>
<li class="list-group-item">
<button
type="submit"
class="btn btn-success"
>
<h1 class="mt-sm-3 mb-sm-5">Agregar Producto</h1>
<form
method="post"
action="{{ action('ProductsController@submitProduct') }}"
enctype="multipart/form-data"
>
@csrf
<div class="form-group row">
<label
for="product_name"
class="col-sm-2 col-form-label">
Nombre
</label>
<div class="col-sm-6">
<input
type="text"
name="product_name"
class="form-control"
id="product_name"
required
/>
</div>
</div>
<div class="form-group row">
<label
for="product_description"
class="col-sm-2 col-form-label">
Descripción
</label>
<div class="col-sm-6">
<input
type="text"
name="product_description"
id="product_description"
class="form-control"
required
/>
</div>
</div>
<div class="form-group row">
<label
for="product_type"
class="col-sm-2 col-form-label">
Tipo de producto
</label>
<div class="col-sm-6">
<select
name="product_type"
id="product_type"
class="form-control"
required>
<option value="">Seleccione una opción</option>
@foreach($productsTypes as $type)
<option value="{{$type['id']}}">
{{$type['name']}}
</option>
@endforeach
</select>
</div>
</div>
<div class="form-group row">
<label
for="product_brand"
class="col-sm-2 col-form-label">
Marca
</label>
<div class="col-sm-6">
<select
name="product_brand"
id="product_brand"
class="form-control"
required>
<option value="">Seleccione una opción</option>
@foreach($brands as $brand)
<option value="{{$brand['id']}}">
{{$brand['name']}}
</option>
@endforeach
</select>
</div>
</div>
<div class="form-group row">
<label
for="upload_file"
class="col-sm-2 col-form-label">
Subir imagen
</label>
<div class="col-sm-6">
<input
type="file"
class="upload_file"
name="upload_file"
id="upload_file"
required
/>
</div>
</div>
<div class="row">
<div class="col-sm-8">
<button type="submit" class="btn btn-success pull-right">
<i class="fa fa-plus-square" aria-hidden="true"></i>
Agregar
</button>
</li>
</ul>
</form>
</div>
Crear producto
</button>
</div>
</div>
</form>
</div>
@endsection

0 comments on commit f11d089

Please sign in to comment.