
<?php $__env->startSection('head_title', trans('addpost.create', ['type' => ucfirst($category->posturl_slug) ]).' | '.getenvcong('sitename')); ?>
<?php $__env->startSection('modedefault', 'mode-add'); ?>
<?php $__env->startSection("header"); ?>
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css">

    <link rel="stylesheet" href="/assets/plugins/editor/simditor.css">
    <link rel="stylesheet" href="/assets/plugins/selectize.css" data-theme="default">
    <link rel="stylesheet" href="/assets/plugins/selectize.default.css" data-theme="default">
<?php $__env->stopSection(); ?>
<?php $__env->startSection("content"); ?>

    <div class="buzz-container">

        <?php echo Form::open(array('action' => 'PostsController@CreateNewPost', 'method' => 'POST', 'onsubmit' => 'return false', 'enctype' => 'multipart/form-data')); ?>

        <div class="global-container container add-container" style="background: #fcfcfc;">

            <div class="content"  style="background: #fff;">
                <section class="form  layout" style="background: #f9f9f9;padding:0!important">
                    <div class="layout-items">
                        <?php foreach(\App\Categories::where("main", '1')->where("disabled", '0')->orwhere("main", '2')->where("disabled", '0')->orderBy('order')->limit(6)->get() as $ko => $categorys): ?>
                            <a class="<?php echo e($typene==$categorys->type ? 'selected' : ''); ?>" href="<?php echo e(action('PostsController@CreateNew', ['new'=>$categorys->posturl_slug])); ?>">
                                <?php echo $categorys->icon; ?><strong><?php echo e(trans('index.'.$categorys->posturl_slug) == 'index.'.$categorys->posturl_slug ? ucfirst($categorys->posturl_slug) :  trans('index.'.$categorys->posturl_slug)); ?></strong>
                            </a>
                        <?php endforeach; ?>
                    </div>
                </section>


                <div class="question-post-form" data-type="<?php echo e($category->type); ?>">
                    <fieldset>
                        <div class="clear"></div>

                        <section class="form">

                            <legend><?php echo e(trans('addpost.title')); ?> & <?php echo e(trans('addpost.categories')); ?></legend>
                            <div class="cd-form">
                                <?php echo Form::text('headline', null , ['class' => 'cd-input title-input', 'style' => 'margin-bottom:10px', 'placeholder' => trans('addpost.titleplace')]); ?>


                                <select id="tagcats" class="demo-default" name="category" multiple placeholder="<?php echo e(trans('addpost.categories')); ?>">
                                    <?php foreach(\App\Categories::where('main', 1)->orwhere('main', 2)->orderBy('order', 'asc')->get() as $ci => $categorys): ?>
                                        <optgroup label="<?php echo e($categorys->name); ?>">
                                            <option value="<?php echo e($categorys->id); ?>,"><?php echo e($categorys->name); ?></option>
                                            <?php foreach(\App\Categories::where('type', $categorys->id)->orderBy('name')->get() as  $i => $cat): ?>
                                                <option value="<?php echo e($categorys->id); ?>,<?php echo e($cat->id); ?>,"><b><?php echo e($categorys->name); ?></b> / <?php echo e($cat->name); ?></option>
                                                <?php foreach(\App\Categories::where('type', $cat->id)->orderBy('name')->get() as  $io => $catq): ?>
                                                    <option value="<?php echo e($categorys->id); ?>,<?php echo e($cat->id); ?>,<?php echo e($catq->id); ?>," ><strong><?php echo e($categorys->name); ?></strong> / <b><?php echo e($cat->name); ?></b> / <?php echo e($catq->name); ?></option>
                                                <?php endforeach; ?>
                                            <?php endforeach; ?>
                                        </optgroup>
                                    <?php endforeach; ?>
                                </select>
                            </div>
                             <legend><?php echo e(trans('addpost.desc')); ?></legend>
                            <div class="cd-form">
                                <?php echo Form::textarea('description', null , ['class' => 'cd-input ','style' => 'height:80px', 'placeholder' => trans('addpost.descplace')]); ?>

                            </div>

                        </section>
                        <?php if($typene=='list'): ?>
                        <section class="form">
                            <legend><?php echo e(trans('addpost.listtype')); ?></legend>
                            <div class="lists-types">
                                <a class="button button-gray selected" data-order="asc">
                                    <i class="fa fa-sort-numeric-asc"></i>
                                    <strong><?php echo e(trans('addpost.listasc')); ?></strong>
                                </a>
                                <a class=" button button-white" data-order="desc">
                                    <i class="fa fa-sort-numeric-desc"></i>
                                    <strong><?php echo e(trans('addpost.listdesc')); ?></strong>
                                </a>
                                <a class=" button button-white last" data-order="none">
                                    <i class="fa fa-list-ul"></i>
                                    <strong><?php echo e(trans('addpost.normallist')); ?></strong>
                                </a>

                            </div>
                        </section>
                        <?php endif; ?>


                        <?php if($typene=='quiz'): ?>
                            <section class="form">
                                <legend><?php echo e(trans('buzzyquiz.quiztype')); ?></legend>
                                <div class="lists-types">
                                    <a href="<?php echo e(action('PostsController@CreateNew', ['new'=> Request::query('new')])); ?>" class="button <?php echo e(Request::query('qtype')=='trivia' ?  'button-white' : 'button-gray selected'); ?>"  style="width:48%" data-order="persinalty">
                                        <i class="fa fa-info-circle"></i>
                                        <strong><?php echo trans('buzzyquiz.persinalty'); ?></strong>
                                    </a>
                                    <a href="<?php echo e(action('PostsController@CreateNew', ['new'=> Request::query('new'), 'qtype'=>'trivia'])); ?>" class=" button <?php echo e(Request::query('qtype')=='trivia' ? 'button-gray selected' : 'button-white'); ?> last" style="width:48%" data-order="trivia">
                                        <i class="fa fa-check-circle"></i>
                                        <strong><?php echo trans('buzzyquiz.trivia'); ?></strong>
                                    </a>

                                </div>
                            </section>

                            <?php if(Request::query('qtype')!=='trivia'): ?>
                            <section class="form last" id="addnew"  style="border-bottom: 1px solid #e3e3e3;">


                                <legend><?php echo e(trans('buzzyquiz.quizresults')); ?></legend><br>

                                <div id="results">

                                    <?php echo $__env->make('_forms._buzzyquiz.__addresultform', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>

                                </div>


                                <a class="submit-button button button-rosy button-big button-full postable" style="width:100%;float:none;padding-left:0;padding-right:0;" data-method="Get" data-target="results" data-puttype="append" data-type="resultform" href="<?php echo e(action('FormController@addnewform')); ?>?addnew=result" ><i class="fa fa-check-circle-o"></i><?php echo e(trans('addpost.add', ['type' => trans('buzzyquiz.result')])); ?></a>
                                <br><br><br><br>
                            </section>
                            <?php endif; ?>
                        <?php endif; ?>

                        <section class="form" >
                            <legend><?php echo e(trans('addpost.entries', ['type' => ucfirst($category->posturl_slug) ])); ?></legend>
                            <div id="entries">
                                <?php if($typene=='video'): ?>

                                    <?php echo $__env->make('_forms.__addvideoform', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>

                                    <?php elseif($typene=='list'): ?>

                                    <?php echo $__env->make('_forms.__addimageform', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>

                                    <?php elseif($typene=='quiz'): ?>

                                    <?php echo $__env->make('_forms._buzzyquiz.__addquestionform', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>

                                    <?php elseif($typene=='poll'): ?>

                                    <?php echo $__env->make('_forms._buzzypoll.__addpollform', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>

                                    <?php else: ?>

                                    <?php echo $__env->make('_forms.__addtextform', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>

                                <?php endif; ?>

                            </div>

                            <?php if($typene=='quiz'): ?>
                                <a class="submit-button button button-blue button-full postable"  style="width:100%;float:none;padding-left:0;padding-right:0;" data-method="Get" data-target="entries" data-puttype="append" data-type="questionform" href="<?php echo e(action('FormController@addnewform')); ?>?addnew=question<?php echo e(Request::query('qtype')=='trivia' ? '&qtype=trivia' : ''); ?>"><i class="fa fa-question-circle"></i><?php echo e(trans('addpost.add', ['type' => trans('buzzyquiz.question')])); ?></a>


                                <div class="clear"></div>
                                <br><br><br>
                            <?php endif; ?>

                        </section>

                        <?php if ( ! ($typene=='quiz')): ?>
                        <section class="form last" id="addnew">
                            <?php echo $__env->make('posts.add-entry', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>
                        </section>
                        <?php endif; ?>
                        <div class="clear"></div>
                    </fieldset>

                </div>

            </div>

            <?php echo $__env->make('posts.create-sidebar', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>

        </div>
        <?php echo Form::close(); ?>

    </div>

<?php $__env->stopSection(); ?>
<?php $__env->startSection("footer"); ?>
    <?php echo $__env->make('posts.create-footerjs', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>
<?php $__env->stopSection(); ?>
<?php echo $__env->make("app", array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>