@if (isset($post->gallery)) @endif @if (isset($post)) @else @endif @if (isset($custom_fields)) @else @endif @if (isset($custom_fields_data)) @else @endif

@if($type == 'create') {{Lang::get('post.labels.new_category_post')}} @else {{Lang::get('post.labels.edit_category_post')}} @endif


{{ Form::open(array('route' => 'postNewCategoryPost', 'role' => 'form', 'class' => 'form-horizontal', 'autocomplete' => 'off', 'files' => true, 'id' => 'postform')) }} {{Form::hidden('city_id', $city->id)}} {{Form::hidden('category_id', $category_id)}} {{Form::hidden('template_id', $template_id)}} {{Form::hidden('avatar_status', isset($post->image) ? 1 : 0 )}} {{Form::hidden('catImage', null, array('id' => 'catImage'))}} {{Form::hidden('catImageType', null, array('id' => 'catImageType'))}} {{Form::hidden('catImageThumb', null, array('id' => 'catImageThumb'))}} {{Form::hidden('catImageTypeThumb', null, array('id' => 'catImageTypeThumb'))}} @if(isset($post)) {{Form::hidden('post_id', $post->id)}} @endif @foreach($fields as $key => $field) @if ($field != 'gallery' && $field != 'garbage' && $field != 'days' && $field != 'date') {{Form::hidden('fields_to_validate[]', $field)}} @endif @if($field == 'title')
{{ Form::text($field, isset($post->$field) ? $post->$field : null, ['class' => 'form-control', 'id' => 'title']) }} {{ $errors->first($field) }}
@elseif($field == 'email' || $field == 'phone' || $field == 'website' || $field == 'address' || $field == 'excerpt')
{{ Form::text($field, isset($post->$field) ? $post->$field : null, ['class' => 'form-control', 'id' => $field]) }} {{ $errors->first($field) }}
@elseif($field == 'location')
{{ Form::hidden($field, isset($post->$field) ? $post->$field : null) }} {{ $errors->first($field) }}
@elseif($field == 'text')
{{ Form::textarea($field, isset($post->$field) ? $post->$field : null, ['class' => 'form-control', 'id' => 'content']) }} {{ $errors->first($field) }}
@elseif($field == 'garbage')
@if(!isset($post)) @if(!Session::has('zona') && !((Session::has('days') || Session::has('dates'))))
{{Lang::get('template.labels.daysSelect')}}
{{Lang::get('template.labels.dateSelect')}}