

<?php $__env->startSection('title'); ?>
    <?php echo e(isset($page_article) ? ucfirst($page_article) : __('backend.add-articles')); ?>

<?php $__env->stopSection(); ?>

<?php $__env->startSection('content'); ?>

  <div class="container-fluid">
    		<div class="row">
  		<div class="col-xs-12">
				<section id="message-banner" class="panel panel-primary">
				<header class="panel-heading">
						<h2>
							<?php echo e(isset($page_article) ? ucfirst(__('backend.add').' '.$page_article) : __('backend.add-articles')); ?>

						</h2>
					</header>
				<div class="panel-body">
          <form action="<?php echo e(isset($route) ? $route : route('articles.store')); ?>" method="POST" enctype="multipart/form-data" class="form-horizontal image-form" name="form_blog_create">
            <input type="hidden" name="image">

            <?php echo e(csrf_field()); ?>

            <?php echo e(isset($method) ? $method : method_field('POST')); ?>


            <div class="row">
              <div class="col-xs-12">
                <?php echo $__env->make('backend.errors', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>
              </div>
            </div>

            
            <div class="" style="width: 800px; margin: 0 auto 20px auto;">
              <div class="image-cropper" data-height="287.5" data-width="800" data-exportZoom="2" data-src="<?php echo e(isset($article) ? asset($storage_url.'img/article/'.$article->banner) : ''); ?>">
                <div class="cropit-preview">
                  <div class="caption">
                    <p><?php echo app('translator')->getFromJson('backend.minimum-resolution'); ?> 1600x575 px</p>
                  </div>
                </div>

                <div class="controls-wrapper">
                  <div class="rotation-btns">
                    <a class="rotate-ccw-btn"><i class="fa fa-undo"></i></a>
                    <a class="rotate-cw-btn"><i class="fa fa-repeat"></i></a>
                  </div>
                  <div class="slider-wrapper">
                    <i class="fa fa-picture-o" aria-hidden="true"></i>
                    <input type="range" class="cropit-image-zoom-input">
                    <i class="fa fa-picture-o fa-2x" aria-hidden="true"></i>
                  </div>
                </div>

                <label for="cropit-image-input" class="btn btn-primary btn-outlined"><?php echo app('translator')->getFromJson('backend.upload'); ?></label>
                <input type="file" class="cropit-image-input" style="display:none"/>

                <button title="<?php echo app('translator')->getFromJson('backend.search-on-pixabay'); ?>" type="button" class="btn btn-primary btn-outlined js-pixabay-trigger"><?php echo app('translator')->getFromJson('backend.search-on-pixabay'); ?></button>

              </div>
            </div>
            

            
            <ul class="tag-it m-t-20">
              <?php if(isset($article)): ?>
                <?php $__currentLoopData = $article->tags; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $tag): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                  <li value="<?php echo e($tag->id); ?>"><?php echo e($tag->name); ?></li>
                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
              <?php else: ?>
                <?php $__currentLoopData = explode(',',old('tags')); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $tag): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                  <li value=""><?php echo e($tag); ?></li>
                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
              <?php endif; ?>
            </ul>
            


            
            <ul class="nav nav-tabs m-t-20">
              <?php $__currentLoopData = config('translatable.locales'); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $lang => $language): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                <li class="<?php if($loop->first): ?> active <?php endif; ?>">
                  <a href="#<?php echo e($lang); ?>" data-toggle="tab"><?php echo e($language); ?></a>
                </li>
              <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
            </ul>
            

            
            <section class="tab-content">

              <?php $__currentLoopData = config('translatable.locales'); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $lang => $language): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>

              <div class="tab-pane <?php if($loop->first): ?> active <?php endif; ?>" id="<?php echo e($lang); ?>">
              <br>

                <div class="row">

                  
                  <div class="form-group">
                    <label for="title" class="col-lg-2 col-md-2 control-label"><?php echo app('translator')->getFromJson('backend.title'); ?></label>
                    <div class="col-lg-8 col-md-8 col-xs-12 no-gutter">
                      <input type="text" class="form-control" name="title[<?php echo e($lang); ?>]"
                        placeholder="<?php echo app('translator')->getFromJson('backend.title'); ?>" value="<?php echo e(isset($article) && $article->hasTranslation($lang) ? $article->translate($lang)->title : old('title.'.$lang)); ?>">
                    </div>
                  </div>
                  

                  <div class="form-group">
                    <label for="alt" class="col-lg-2 col-md-2 control-label"><?php echo app('translator')->getFromJson('backend.seo'); ?></label>
                    <div class="col-lg-8 col-md-8 col-xs-12 no-gutter">
                      <input type="text" class="form-control" name="alt[<?php echo e($lang); ?>]"
                        placeholder="<?php echo app('translator')->getFromJson('backend.seo'); ?>" value="<?php echo e(isset($article) && $article->hasTranslation($lang) ? $article->translate($lang)->alt : old('alt.'.$lang)); ?>">
                    </div>
                  </div>


                  <div class="form-group">
                    <label for="title" class="col-lg-2 col-md-2 control-label"><?php echo app('translator')->getFromJson('backend.content'); ?></label>
                    <div class="col-lg-8 col-md-8 col-xs-12 no-gutter">
                      <textarea name="content[<?php echo e($lang); ?>]" row="10"><?php echo e(isset($article) && $article->hasTranslation($lang) ? $article->translate($lang)->content : old('content.'.$lang)); ?></textarea>
                    </div>
                  </div>

                </div>


              </div>

              <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>

            </section>
            

            <div class="form-group">
              <div class="col-md-12">
                <button type="submit" class="btn btn-primary btn-sm btn-image-submit"><?php echo app('translator')->getFromJson('backend.save'); ?></button>
                <a href="<?php echo URL::previous(); ?>" class="btn btn-default btn-sm"><?php echo app('translator')->getFromJson('backend.back'); ?></a>
              </div>
            </div>

          </form>
        </div>
				</section>

			</div>
		</div>

	</div>
<?php $__env->stopSection(); ?>

<?php $__env->startSection('script'); ?>
	<script>
		$(document).ready(function() {
			$('textarea').height('500px')
			var avTags = $.get(route('api-tags'));
			avTags.done(function(data) {
			  $(".tag-it").tagit({
			    availableTags: data,
			    fieldName: "tags",
			    singleField: true,
			    placeholderText: "Tags",
			  })
			})
		})
	</script>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('layouts.masterBackend', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>