@extends('breweries.edit.layout') @section('main_content') {!! Form::model($brewery, ['route' => ['brewery.edit.post', $brewery->username], 'class' => 'margin-right', 'method' => 'post', 'files' => true]) !!}

{{ trans('beers.edit.menu.brewery_information') }}

@include('flash::message') @if ($errors->any())
{{ trans('beers.edit.errors') }}
@endif {{ Form::hidden('isNewBrewery', 0, ['id' => 'is-new-brewery']) }} {{ Form::hidden('isEditBrewery', $brewery ? 1 : 0, ['id' => 'is-edit-brewery']) }} {{ Form::hidden('id', $brewery->id, ['id' => 'id']) }}
{{ trans('breweries.general_information') }}
{{ Form::label('name', trans('breweries.name'), ['class' => 'control-label']) }} {{ Form::text('name', null, ['class' => 'form-control']) }} @if ($errors->has('name')) {{ $errors->first('name') }} @endif
{{ Form::label('address', trans('breweries.address'), ['class' => 'control-label']) }} {{ Form::text('address', null, ['class' => 'form-control']) }} {{-- Fill adress data based on geometry object from Google Place Autocomplete --}} {{ Form::hidden('latitude', null, ['id' => 'latitude']) }} {{ Form::hidden('longitude', null, ['id' => 'longitude']) }} {{-- Fill adress data based on address_components object from Google Place Autocomplete --}} {{ Form::hidden('street', null, ['id' => 'route']) }} {{ Form::hidden('street_number', null, ['id' => 'street_number']) }} {{ Form::hidden('postal_code', null, ['id' => 'postal_code']) }} {{ Form::hidden('locality', null, ['id' => 'locality']) }} {{ Form::hidden('region', null, ['id' => 'administrative_area_level_1']) }} {{ Form::hidden('country', null, ['id' => 'country']) }} @if ($errors->has('address')) {{ $errors->first('address') }} @endif
@if(Auth::user()->hasRole(['admin', 'admin_vox']))
{{ Form::label('email', trans('breweries.email'), ['class' => 'control-label']) }} {{ Form::text('email', null, ['class' => 'form-control']) }} @if ($errors->has('email')) {{ $errors->first('email') }} @endif
{{ Form::label('facebook_address', trans('breweries.facebook_address'), ['class' => 'control-label']) }} {{ Form::text('facebook_address', null, ['class' => 'form-control']) }} @if ($errors->has('facebook_address')) {{ $errors->first('facebook_address') }} @endif
{{ Form::label('transparency', trans('breweries.tasting_visit_organization'), ['class' => 'control-label']) }}
{!! Form::radio('tasting_visit_organization', 1, ($errors->has('tasting_visit_organization') ? null : (Session::get('brewery.tasting_visit_organization') === true)), ['id' => 'tasting_visit_organization']) !!} {!! Form::label('tasting_visit_organization', 'yes') !!}
{!! Form::radio('tasting_visit_organization', 0, ($errors->has('tasting_visit_organization') ? null : (Session::get('brewery.tasting_visit_organization') === false)), ['id' => 'tasting_visit_organization_1']) !!} {!! Form::label('tasting_visit_organization_1', 'no') !!}
@if ($errors->has('tasting_visit_organization')) {{ $errors->first('tasting_visit_organization') }} @endif
{{ Form::label('phone', trans('breweries.phone'), ['class' => 'control-label']) }} {{ Form::text('phone', null, ['class' => 'form-control']) }} @if ($errors->has('phone')) {{ $errors->first('phone') }} @endif
@endif
{{ Form::label('avatar', trans('breweries.avatar'), ['class' => 'control-label']) }} {{ Form::file('avatar', ['class'=>'form-control'] ) }} @if ($errors->has('avatar')) {{ $errors->first('avatar') }} @endif
{{ Form::label('avatar', trans('breweries.current_avatar'), ['class' => 'control-label']) }}
{{ Form::label('video', trans('breweries.video'), ['class' => 'control-label']) }} {{ Form::file('video', ['class'=>'form-control','accept' => 'video/*'] ) }} @if ($errors->has('video')) {{ $errors->first('video') }} @endif
@if($brewery->video)
{{ Form::label('video', trans('breweries.current_video'), ['class' => 'control-label']) }}
@endif
@if(Auth::user()->hasRole(['admin', 'admin_vox']))
{{ trans('breweries.schedule') }}
{{ Form::label('schedule', trans('breweries.schedule'), ['class' => 'control-label']) }} {{ Form::textarea('schedule', null, ['class' => 'form-control']) }} @if ($errors->has('schedule')) {{ $errors->first('schedule') }} @endif
{{ trans('breweries.creation_date') }}
{{ Form::label('creation_date', trans('breweries.creation_date'), ['class' => 'control-label']) }} {{ Form::text('creation_date', $brewery && $brewery->creation_date ? $brewery->creation_date->format('d/m/Y') : null, ['class' => 'form-control']) }} @if ($errors->has('creation_date')) {{ $errors->first('creation_date') }} @endif
{{ Form::label('history', trans('breweries.history'), ['class' => 'control-label']) }} {{ Form::textarea('history', null, ['class' => 'form-control']) }} @if ($errors->has('history')) {{ $errors->first('history') }} @endif
{{ trans('breweries.ambient_gallery') }}
{{ Form::label('ambientImages', trans('breweries.ambient_gallery_image'), ['class' => 'control-label']) }} {{ Form::file('ambientImages[]', ['multiple' => 'multiple', 'class'=>'form-control'] ) }} @if ($errors->has('ambientImages')) {{ $errors->first('ambientImages') }} @endif
@if(!$brewery->ambientImages->isEmpty())
    @foreach($brewery->ambientImages as $ambientImage)
  • @endforeach
@else {{ trans('breweries.no_ambient_images') }} @endif
@endif
{{ Form::submit(trans('common.update'), ['class' => 'btn btn-success']) }}
{{ Form::close() }}
@endsection @section('bottom_js') @parent @endsection