@extends('layouts.web')

@section('page-title', "Agregar archivo")

@section('content')

<section class="page-header">
  <div class="page-header__bg" style="background-image: url({{asset('assets/images/header.jpg')}});"></div>
  <div class="container">
    <h2>Agregar archivos</h2>
    <ul class="thm-breadcrumb list-unstyled">
        <li class="text-white"><a href="{{url('/')}}">Inicio</a></li>
    </ul>
  </div>
</section>

<div class="container" style="left: 40; padding:2em;">

  <h3>
    {{$content->title}} <br>
    <small>
      Formatos admitidos: Imágenes( JPG, PNG, BMP), Archivos (PDF, Excel).
    </small>
  </h3>

  <div class="panel panel-primary">
    <div class="panel-heading">
      <div class="panel-body dz-text-color">
        {{-- {!! Form::open(['url' => route('archivos.store'), 'files'=>true, 'id'=>'user-form']) !!} --}}
        {!! Form::open(['route' => 'archivos.store', 'files' => true, 'id' => 'user-form']) !!}
          {{ Form::hidden('id', $content->id) }}

          <?php $nameInput='name'; $nameObj='Nombre de Archivo'; ?>
          <div class="form-group col-xs-12 list-group-item @if($errors->first($nameInput)) has-error @endif  ">
            {{Form::label($nameInput, $nameObj,['class'=>'control-label'])}}
            {{Form::text($nameInput, $content->title, ['id'=>$nameInput,'placeholder'=>$nameObj,'class'=>'form-control'])}}
            @if($errors->first($nameInput))<div class="label label-danger">{{ $errors->first($nameInput) }} </div>@endif
          </div>

          <?php $nameInput='description'; $nameObj='Descripción del Archivo'; ?>
          <div class="form-group col-xs-12 list-group-item @if($errors->first($nameInput)) has-error @endif  ">
            {{Form::label($nameInput, $nameObj,['class'=>'control-label'])}}
            {{Form::textarea($nameInput, '', ['id'=>$nameInput,'placeholder'=>$nameObj,'class'=>'form-control file-path validate materialize-textarea'])}}
            @if($errors->first($nameInput))<div class="label label-danger">{{ $errors->first($nameInput) }} </div>@endif
          </div>

          <?php $nameInput='files'; $nameObj='Adjuntar Archivo'; ?>
          <div class="form-group col-xs-12 list-group-item file-field input-field @if($errors->first($nameInput)) has-error @endif  ">
            <div class="file-field input-field">
              <div class="btn">
                <span>{{$nameObj}}</span>
                {{Form::file($nameInput , ['id'=>$nameInput,'placeholder'=>$nameObj,'class'=>'form-control'])}}
              </div>
              <div class="file-path-wrapper">
                <input class="file-path validate" type="text" placeholder="Seleccionar archivo">
              </div>
            </div>
            @if($errors->first($nameInput))<div class="label label-danger">{{ $errors->first($nameInput) }} </div>@endif
          </div>

          <div class="row">
            <div class="col-md-12">
              <button type="submit" class="btn btn-primary btn-lg btn-block waves-effect waves-light">
                <i class="fa fa-save"></i> Guardar Archivo Sellecionado
              </button>
            </div>
          </div>

        {!! (Form::close()); !!}
      </div>
    </div>
  </div>

</div>

@stop

@section('scripts')

@stop
