@extends('layouts.app')
@section('content')
    <div class="panel panel-primary">
        <div class="panel-heading">Vytvořte recenzi ubytování: {{$accommodation->accommodation_name}}</div>
        <div class="panel-body">
            @include('flash::message')

            {{ Form::open(['url'=>['reviews_list/'.$accommodation->accommodation_id],'method'=>'post', 'class' => 'form-horizontal']) }}
            Recenzi mohou vytvořit pouze osoby, které byli v daném zařízení ubytovány. Kontrola se provádí pomocí e-mailu.

            <!-- EMAIL -->
            {{Form::hidden('accommodation_id',$accommodation->accommodation_id)}}
            <div class="form-group{{ $errors->has('email') ? ' has-error' : '' }}">
                <label class="col-md-4 control-label">E-mail</label>
                <div class="col-md-6">
                    {{ Form::text('email', null, ['class'=>'form-control']) }} @if ($errors->has('email'))
                        <span class="help-block">
                            <strong>{{ $errors->first('email') }}</strong>
                        </span>
                    @endif
                </div>
            </div>

            <!-- REVIEW -->
            <div class="form-group{{ $errors->has('review') ? ' has-error' : '' }}">
                <label class="col-md-4 control-label">Vaše recenze</label>
                <div class="col-md-6">
                    {{Form::textarea('review', null,  ['size' => '30x5', 'class' => 'form-control']) }} @if ($errors->has('review'))
                        <span class="help-block">
                            <strong>{{ $errors->first('review') }}</strong>
                        </span>
                    @endif
                </div>
            </div>

            <div class="form-group{{ $errors->has('rating') ? ' has-error' : '' }}">
                <label class="col-md-4 control-label">Celkové hodnocení (5 - nejlepší)</label>
                <div class="col-md-6">
                    {{ Form::selectRange('rating', 1, 5, 1, ['class' => 'form-control float_right']) }} @if ($errors->has('rating'))
                        <span class="help-block">
                            <strong>{{ $errors->first('rating') }}</strong>
                        </span>
                    @endif
                </div>
            </div>

            <div class="form-group">
                <div class="col-md-6 col-md-offset-4">
                    {{ Form::submit('Vytvořit recenzi', array('class'=>'btn btn-primary')) }}
                </div>
            </div>
            {{ Form::close() }}
        </div>
    </div>
@endsection
