<?php
$lfld= isset($entry->id) ? $entry->id : '';
$uniquid = time().$lfld;
?>
<div class="entry" data-type="quizquestion" data-co="<?php echo e($uniquid); ?>" <?php if(isset($entry->id)): ?> data-entry-id="<?php echo e($entry->id); ?>" <?php endif; ?>>
    <?php echo $__env->make('_forms.__entryactions', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>
    <h3><i class="fa fa-question-circle"></i> <?php echo e(trans('buzzyquiz.question')); ?></h3>
    <div class="inpunting  ordering">
        <button class="order-number button button-gray show">1</button>
        <?php echo Form::text(null, isset($entry->title) ? $entry->title : null ?: null, ['data-type' => 'title', 'class' => 'cd-input ', 'placeholder' => trans('buzzyquiz.entry_question')]); ?>

    </div>
    <div class="inpunting mediaupload" <?php if(isset($entry->image)): ?> style="display: none;" <?php endif; ?>>
        <div class="item-media-placeholder" style="padding-top: 70px;padding-bottom: 70px">
            <i class="fa fa-picture-o  fa-2x"></i><br>
            <small class="text-muted"><?php echo e(trans('addpost.entry_addimage')); ?></small>
            <form action="">
            <input type="file" accept="image/*" class="uploadaimage" data-target="entry">
            </form>
            <div style="font-size:12px;color:#ccc"> <?php echo e(trans('updates.or')); ?> </div>
            <div class="image-upload-actions">
                <a class="button button-white getimageurl" data-action="add" data-target="entry"><?php echo e(trans('updates.getfromurl')); ?> <i class="fa fa-download"></i></a>
            </div>
        </div>
    </div>
    <?php echo Form::hidden(null, isset($entry->image) ? makepreview($entry->image, null, 'entries') : null, ['data-type' => 'image', 'class' => 'cd-input-image ']); ?>

    <div class="inpunting imagearea <?php if(empty($entry->image)): ?> hide <?php endif; ?>">
        <div class="imagearea_img">
        <?php if(isset($entry->image)): ?> <img src="<?php echo e(makepreview($entry->image, null, 'entries')); ?>"> <?php endif; ?>
        </div>
        <div class="thumbactions">
            <a class="button button-red deleteimage" data-action="remove" data-target="image"><i class="fa fa-trash"></i></a>  <a class="button button-white makepreview"><i class="fa fa-image"></i>&nbsp;<?php echo e(trans('addpost.makepreview')); ?></a>
        </div>
    </div>
    <div class="moredetail text">

        <div class="detailhide" style="display:none">

                <div class="inpunting">
                    <?php echo Form::text(null, isset($entry->source) ? $entry->source : null, ['data-type' => 'source', 'class' => 'cd-input ', 'placeholder' => trans('addpost.entry_source')]); ?>

                </div>
               <div class="inpunting">
               <?php echo Form::textarea(null, isset($entry->body) ? $entry->body : null, ['data-type' => 'body', 'class' => 'message','id' => 'edit', 'placeholder' => trans('addpost.entry_body')]); ?>

                </div>
        </div>
        <a href="javascript:;"  style="float:right" class="trigger"><span class="down"><?php echo e(trans('addpost.mored')); ?> <i class="fa fa-angle-down"></i></span><span class="up"><?php echo e(trans('addpost.lessd')); ?>  <i class="fa fa-angle-up"></i></span></a>
    </div>
    <div class="moredetail questionmore">

        <div class="answertypeselection">
            <a class="button <?php if(isset($entry->video)): ?> <?php echo e($entry->video=='1' ?  'button-orange' : 'button-white'); ?> <?php else: ?> button-orange <?php endif; ?> clickanswertype" data-style="thdefault" data-query="1" <?php if(isset($entry->video)): ?> <?php echo e($entry->video=='1' ? 'data-curtype=on' : ''); ?><?php else: ?> data-curtype="on" <?php endif; ?>><i class="fa fa-th"></i></a>
            <a class="button <?php if(isset($entry->video)): ?> <?php echo e($entry->video=='2' ?  'button-orange' : 'button-white'); ?> <?php else: ?> button-white <?php endif; ?> clickanswertype" data-style="thlarge" data-query="2" <?php if(isset($entry->video)): ?> <?php echo e($entry->video=='2' ? 'data-curtype=on' : ''); ?> <?php endif; ?>><i class="fa fa-th-large"></i></a>
            <a class="button <?php if(isset($entry->video)): ?> <?php echo e($entry->video=='3' ?  'button-orange' : 'button-white'); ?> <?php else: ?> button-white <?php endif; ?> clickanswertype" data-style="thlist" data-query="3" <?php if(isset($entry->video)): ?> <?php echo e($entry->video=='3' ? 'data-curtype=on' : ''); ?> <?php endif; ?>><i class="fa fa-th-list "></i></a>
        </div>
        <div class="clearfix"></div>
        <form action="<?php echo e($uniquid); ?>" onsubmit="return false">
        <div id="answer<?php echo e($uniquid); ?>" class="answers <?php if(isset($entry->video)): ?> <?php if($entry->video == '1'): ?>thdefault <?php else: ?> <?php echo e($entry->video == "2" ?  'thlarge' : 'thlist'); ?><?php endif; ?> <?php endif; ?>"  style="border-radius:0;border:0;padding:0;margin:0;margin-left:-15px;background: transparent;">
            <?php if(empty($entry->video)): ?>

                <?php echo $__env->make('_forms._buzzyquiz.__addanswerform', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>

                <?php echo $__env->make('_forms._buzzyquiz.__addanswerform', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>

                <?php echo $__env->make('_forms._buzzyquiz.__addanswerform', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>

                <?php else: ?>

                <?php foreach($post->entry()->where('type', 'answer')->where('source', $entry->id)->orderBy('order')->get() as $keya => $answers): ?>

                    <?php echo $__env->make('_forms._buzzyquiz.__addanswerform', ['answer' =>  $answers], array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>


                <?php endforeach; ?>

            <?php endif; ?>


        </div>
        </form>
        <div class="clearfix"></div>
        <a class="button button-white button-full submit-button postable answerbutton" data-method="Get" data-target="answer<?php echo e($uniquid); ?>" data-puttype="append" data-type="answerform" href="<?php echo e(action('FormController@addnewform')); ?>?addnew=answer<?php echo e(Request::query('qtype')=='trivia' ? '&qtype=trivia' : ''); ?>"><i class="fa fa-plus-circle"></i><?php echo e(trans('addpost.add', ['type' => trans('buzzyquiz.answer')])); ?></a>
    </div>
</div>
