<?php $__env->startSection('title', 'Edit Canned response'); ?>
<?php $__env->startSection('content'); ?>
    <div class="row">
        <div class="widget">
            <div class="widget-header"> <i class="icon-edit"></i>
                <h3>Edit User : <?php echo e($ticketemailtemplates->title); ?></h3>
            </div>
            <!-- /widget-header -->
            <div class="widget-content">
            <div class="span6">
                <form method="POST" action="<?php echo e(route('ticket-email-templates.update',$ticketemailtemplates->id)); ?>" accept-charset="UTF-8" class="form-horizontal" id="formapp">
                    <?php echo csrf_field(); ?>
                    <?php echo method_field('PUT'); ?>
                    <fieldset>
                        <div class="control-group">
                            <label class="control-label asterisk" for="firstname">Subject:</label>
                            <div class="controls">
                                <input class="span6" name="title" type="text" id="title" value="<?php echo e($ticketemailtemplates->title); ?>" placeholder="Email Subject
"><?php if($errors->has('title')): ?>
                                    <span class="text-danger"><?php echo e($errors->first('title')); ?></span>
                                <?php endif; ?>                            </div> <!-- /controls -->
                        </div> <!-- /control-group -->

                        <div class="control-group">
                             <label class="control-label asterisk" for="firstname">Description:</label>
                            <div class="controls">
                                <textarea class="ckeditor" name="content" cols="30" id="content" placeholder="Describe your Canned response here in details"><?php echo e($ticketemailtemplates->content); ?></textarea>
                                <span class="text-danger contenterror"></span>
                            </div>
                        </div>



                        <div class="form-actions">
                            <input class="btn btn-primary" type="submit" value="Update">
                            <a href="<?php echo e(url('ticket-email-templates')); ?>" class="btn btn-default">Back</a>
                        </div> <!-- /form-actions -->
                    </fieldset>
                </form>
                </div>

                    <div class="span2">&nbsp;</div>
                <div class="span3">
                        <div class="control-group">
                            <div class="controls">
                                <h2>Valid Shortcodes</h2>
                                <p>This is a list shortcodes that have been organized by content areas where they can be used:
</p>  <h3>To :</h3>

<?php echo $ticketemailtemplates->shortcodes; ?>


                            </div>
                        </div>
                </div>    


                <!-- /shortcuts -->
            </div>
            <!-- /widget-content -->
        </div>
        <!-- /widget -->
    </div>

      <script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-multiselect/0.9.13/js/bootstrap-multiselect.js"></script>
  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-multiselect/0.9.13/css/bootstrap-multiselect.css">
      <link rel="stylesheet" type="text/css" href="<?php echo e(asset('css/custom.css')); ?>" >


    <script src="//ajax.microsoft.com/ajax/jquery.validate/1.7/jquery.validate.min.js"></script>
    <script src="//openconcept.ca/sites/all/libraries/ckeditor/ckeditor.js"></script>
    <script>
            $(document).ready(function() {
        $('#multiple-checkboxes').multiselect({
            includeSelectAllOption: true
        });
        $("#formapp").validate({
            rules: {
                content: {
                    required: true,
                    minlength: 10
                },
                title: {
                    required: true
                }
            },
            messages: {
                title:{
                    required: "Email Subject is required"
                },
                content: {
                required: "Enter Describe your content here in details",
                    minlength: "Minimum password length is 10"
                }
            },
            errorPlacement: function(error, element) {
                if (element.attr("id") == "content") {
                    //element.parent('div').prev().append(error[0]);
                    $(".contenterror").append(error[0]);
                }
                else {
                    error.insertAfter(element);
                }
            },
            submitHandler: function(form) {
                form.submit();
            }
        });


        CKEDITOR.on('instanceReady', function () {
        $.each(CKEDITOR.instances, function (instance) {
            CKEDITOR.instances[instance].document.on("keyup", CK_jQ);
            CKEDITOR.instances[instance].document.on("paste", CK_jQ);
            CKEDITOR.instances[instance].document.on("keypress", CK_jQ);
            CKEDITOR.instances[instance].document.on("blur", CK_jQ);
            CKEDITOR.instances[instance].document.on("change", CK_jQ);
        });
        });
        
        function CK_jQ() {
        for (instance in CKEDITOR.instances) {
            CKEDITOR.instances[instance].updateElement();
        }
        }
        
        CKEDITOR.config.toolbar = [
            ['Bold','Italic','Underline','StrikeThrough','-','Undo','Redo','-','Cut','Copy','Paste','Find','Replace','-','Outdent','Indent','-','Print']

        ] ;

    });
    </script>
<?php $__env->stopSection(); ?>
<?php echo $__env->make('layouts.layout', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>