<?php $__env->startSection('content'); ?>
<div id="window_title" class="page-window active-window">
  <input type="hidden" class="prev_window"/>
  <div class="row">
      <div class="col-lg-12">
          <section class="panel">
            <header class="panel-heading">
              <div class="panel-actions">
                <a href="#" class="panel-action panel-action-toggle" data-panel-toggle></a>
                <a href="#" class="panel-action panel-action-dismiss" data-panel-dismiss></a>
              </div>

              <h2 class="panel-title"><?php echo e(trans('resource.webtitle')); ?></h2>
            </header>
            <div class="panel-body">
              <form action="titlesave" id="title_form" class="form-horizontal form-bordered" enctype="multipart/form-data">

                <input type="hidden" name="id" value="1"/>
                <?php $__currentLoopData = $langs; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $lang): $__env->incrementLoopIndices(); $loop = $__env->getFirstLoop(); ?>
                  <div class="form-group">
                    <label class="col-sm-3 control-label"><?php echo e(trans('resource.webtitle')); ?> <?php echo e($lang->lang_key); ?></label>
                    <div class="col-sm-6">
                      <input type="text" class="form-control" name="title[<?php echo e($lang->lang_key); ?>]" value="<?php echo e(!empty($title) ? $title->whereIn('lang', $lang->lang_key)->first()->title : ''); ?>" />
                    </div>
                  </div>
                  <div class="form-group">
                    <label class="col-sm-3 control-label"><?php echo e(trans('resource.shorter')); ?> <?php echo e($lang->lang_key); ?></label>
                    <div class="col-sm-6">
                      <input type="text" class="form-control" name="body[<?php echo e($lang->lang_key); ?>]" value="<?php echo e(!empty($title) ? $title->whereIn('lang', $lang->lang_key)->first()->body : ''); ?>" />
                    </div>
                  </div>
                <?php endforeach; $__env->popLoop(); $loop = $__env->getFirstLoop(); ?>
                <div class="form-group usticky" style="background: #fff;">
                  <div class="col-md-12">
                    <div style="float: right;">
                      <button type="button" class="btn btn-primary" onclick="saveContentCat();"><?php echo e(trans('resource.buttons.save')); ?></button>
                    </div>
                  </div>
                </div>
              </form>
            </div>
          </section>
      </div>
    </div>
  </div>
  <script type="text/javascript">
  function saveContentCat(){
    $.ajax({
        url: '/admin/titlesave',
        type: "POST",
        dataType: "json",
        data : new FormData($("#title_form")[0]),
        processData: false,  // tell jQuery not to process the data
        contentType: false,  // tell jQuery not to set contentType
        success: function(data){
            if(data.type == 'success'){
              umsg.success(messages.saved);
            }else{
              uvalidate.setErrors(data);
            }
        }
    });
  }

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

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