@extends('beers.create.layout') @section('main_content') {!! Form::model($beer, ['route' => 'beer.create.beer_information.post', 'class' => 'margin-right', 'method' => 'post', 'files' => true]) !!}

{{ trans('beers.create.title') }}

@if ($errors->any())
{{ trans('beers.create.errors') }}
@endif
{{ trans('beers.general_information') }}
{{ Form::label('name', trans('beers.name'), ['class' => 'control-label']) }} {{ Form::text('name', $errors->has('name') ? null : Session::get('beerData.name'), ['class' => 'form-control']) }} @if ($errors->has('name')) {{ $errors->first('name') }} @endif
{{ Form::label('alcohol_level', trans('beers.alcohol_level'), ['class' => 'control-label']) }} {{ Form::text('alcohol_level', $errors->has('alcohol_level') ? null : Session::get('beerData.alcohol_level'), ['class' => 'form-control']) }} @if ($errors->has('alcohol_level')) {{ $errors->first('alcohol_level') }} @endif
{{ Form::label('color', trans('beers.color'), ['class' => 'control-label']) }} {{ Form::select('color', [null => trans('beers.select_color')] + $colors, $errors->has('color') ? null : Session::get('beerData.color'), ['class' => 'form-control']) }} @if ($errors->has('color')) {{ $errors->first('color') }} @endif
{{ Form::label('fermentation', trans('beers.fermentation'), ['class' => 'control-label']) }}
@foreach ($fermentations as $fermentationKey => $fermentation)
{!! Form::radio('fermentation', $fermentationKey, ($errors->has('fermentation') ? null : (Session::get('beerData.fermentation') === $fermentationKey)), ['id' => 'fermentation_' . $fermentationKey]) !!} {!! Form::label('fermentation_' . $fermentationKey, $fermentation) !!}
@endforeach @if ($errors->has('fermentation')) {{ $errors->first('fermentation') }} @endif
{{ Form::label('type', trans('beers.type'), ['class' => 'control-label']) }} {{ Form::select('type', [null => trans('beers.select_type')] + $types, $errors->has('type') ? null : Session::get('beerData.type'), ['class' => 'form-control']) }} @if ($errors->has('type')) {{ $errors->first('type') }} @endif
{{ Form::label('transparency', trans('beers.transparency'), ['class' => 'control-label']) }}
@foreach ($transparencies as $transparencyKey => $transparency)
{!! Form::radio('transparency', $transparencyKey, ($errors->has('transparency') ? null : (Session::get('beerData.transparency') === $transparencyKey)), ['id' => 'transparency_' . $transparencyKey]) !!} {!! Form::label('transparency_' . $transparencyKey, $transparency) !!}
@endforeach @if ($errors->has('transparency')) {{ $errors->first('transparency') }} @endif
{{ Form::label('avatar', trans('beers.avatar'), ['class' => ' control-label']) }}
{{ Form::file('avatar', ['class'=>'form-control inputfile'] ) }}
@if ($errors->has('avatar')) {{ $errors->first('avatar') }} @endif
{{ trans('beers.composition_taste') }}
{{ Form::label('tastes', trans('beers.tastes'), ['class' => 'control-label']) }} {{ Form::select('tastes[]', $tastes, $errors->has('tastes') ? null : Session::get('beerData.tastes'), ['multiple' => 'multiple', 'class' => 'select2-multiple form-control']) }} @if ($errors->has('tastes')) {{ $errors->first('tastes') }} @endif
{{ Form::label('ibu', trans('beers.ibu'), ['class' => 'control-label']) }} {{ Form::text('ibu', $errors->has('ibu') ? null : Session::get('beerData.ibu'), ['class' => 'form-control']) }} @if ($errors->has('ibu')) {{ $errors->first('ibu') }} @endif
{{ Form::label('hop_type', trans('beers.hop_type'), ['class' => 'control-label']) }} {{ Form::select('hop_type', [null => trans('beers.select_hop_type')] + $hopTypes, $errors->has('hop_type') ? null : Session::get('beerData.hop_type'), ['class' => 'form-control']) }} @if ($errors->has('hop_type')) {{ $errors->first('hop_type') }} @endif
{{ Form::label('malt_type', trans('beers.malt_type'), ['class' => 'control-label']) }} {{ Form::select('malt_type', [null => trans('beers.select_malt_type')] + $maltTypes, $errors->has('malt_type') ? null : Session::get('beerData.malt_type'), ['class' => 'form-control']) }} @if ($errors->has('malt_type')) {{ $errors->first('malt_type') }} @endif
@if(Auth::user()->hasRole(['admin', 'admin_vox']))
{{ trans('beers.conditioning_methods') }}
{{ Form::label('conditioning_methods', trans('beers.conditioning_methods'), ['class' => 'control-label']) }} {{ Form::select('conditioning_methods[]', $conditioningMethods, $errors->has('conditioning_methods') ? null : Session::get('beerData.conditioning_methods'), ['multiple' => 'multiple', 'class' => 'select2-multiple form-control']) }} @if ($errors->has('conditioning_methods')) {{ $errors->first('conditioning_methods') }} @endif
{{ trans('beers.how_to_enjoy_it') }}
{{ Form::label('glass', trans('beers.glass'), ['class' => 'control-label']) }} {{ Form::select('glass', [null => trans('beers.select_glass')] + $glasses, $errors->has('glass') ? null : Session::get('beerData.glass'), ['class' => 'form-control']) }} @if ($errors->has('glass')) {{ $errors->first('glass') }} @endif
{{ Form::label('temperature', trans('beers.temperature'), ['class' => 'control-label']) }} {{ Form::text('temperature', $errors->has('temperature') ? null : Session::get('beerData.temperature'), ['class' => 'form-control']) }} @if ($errors->has('temperature')) {{ $errors->first('temperature') }} @endif
{{ trans('beers.labels') }}
@foreach($labels as $label)
{{ Form::checkbox('labels[]', $label->id, in_array($label->id, $errors->has('labels') ? null : Session::get('beerData.labels', [])), ['id' => 'label_' . $label->id] ) }} {{ Form::label('label_' . $label->id, trans($label->label)) }}
@endforeach @if ($errors->has('labels')) {{ $errors->first('labels') }} @endif
{{ trans('beers.awards') }}
{{ Form::label('awards', trans('beers.awards'), ['class' => 'control-label']) }}
{{ Form::file('awards[]', ['multiple' => 'multiple', 'class'=>'form-control inputfile', 'data-multiple-caption'=>"{count} files selected"] ) }}
@if ($errors->has('awards')) {{ $errors->first('awards') }} @endif
@endif
{{ trans('common.cancel') }}
{{ Form::submit(trans('common.next'), ['class' => 'btn btn-success']) }}
{{ Form::close() }} @endsection @section('bottom_js') @parent @endsection