@extends('master') @section('breadcrumb') @stop @section('content')
@if(kvfj(Auth::user()->permissions, 'polls_edit')) {!! Form::open(['url' => '/poll/'.$poll->id.'/edit']) !!}

Editar encuesta

{!! Form::text('title', $poll->title) !!}
{!! Form::text('content', $poll->desc) !!}
{!! Form::date('date_until', $poll->date_until) !!}
{!! Form::select('status', shop_status(),$poll->status, ['class' => 'form-select']) !!}
{!! Form::close() !!} {!! Form::open(['url' => '/poll/'.$poll->id.'/option/add']) !!}

Crear opción

{!! Form::text('title', null) !!}
{!! Form::select('option_type', poll_options_type(), null, ['class' => 'form-select']) !!}
{!! Form::number('order', 0, ['min' => '0']) !!}
{!! Form::close() !!} @endif
@foreach($poll->getOptions as $option)

{{ $option->title }}

{!! Form::open(['url' => '/poll/'.$poll->id.'/option/'.$option->id.'/edit']) !!}
{!! Form::text('title', $option->title) !!}
{!! Form::number('order', $option->oporder, ['min' => '0']) !!}
{!! Form::number('number_answers', $option->number_answers, ['min' => '0']) !!}
{!! Form::select('is_required', yes_no(), $option->is_required, ['class' => 'form-select']) !!}
{!! Form::close() !!}
@endforeach
@endsection