@if( $contract['generated'] || $contract['title'] == 'free_body' )
{{ __('contract.vote.freeword.description') }}
@else
{{ __('contract.vote.description') }}
@endif
@foreach ($contract['questionGroups'] as $group)
{{ $group['label'] }}
@foreach ( $group['questions'] as $question )
@php $voteKey = false; @endphp
@if( $question['renderType'] == 'input' )
{!! $form->index( 'edit', $question, 'd-block' ) !!}
@php $voteShow = false; @endphp
@else
{!! $form->index( 'summary', $question ) !!}
@foreach ( $group['vote'] as $key => $vote )
@if ( isset($vote['userId']) && $vote['userId'] == $user['id'] )
@php $voteKey = $key; @endphp
@endif
@endforeach
@php $voteKey = 0; @endphp
@php $voteShow = true; @endphp
@endif
@endforeach
@if( $loop->index == 0 )
@if( $group['vote'][0]['data'] == 'accepted' )
@if( $group['vote'][0]['data'] == 'accepted' ) {{-- @if($question['renderType'] == 'input') --}}
@else
{!! $form->vote( $group['vote'][0]['data'], $voteShow, $voteKey, $loop->iteration ) !!}
{!! $form->voteCancel() !!}
@endif
@else
{!! $form->vote( $group['vote'][0]['data'], $voteShow, $voteKey, $loop->iteration ) !!}
{!! $form->voteCancel() !!}
@endif
@endif
@if ( $loop->index != 0 )
@if( $contract[ 'status' ] == 'review' )
{!! $form->vote( $group['vote'][0]['data'], $voteShow, $voteKey, $loop->iteration ) !!}
{!! $form->voteCancel() !!}
@else
{!! $form->voteStatus( $group['vote'][0]['data'] ) !!}
@endif
@endif
@endforeach