%PDF- %PDF-
Direktori : /var/www/html/conference/storage/framework/views/ |
Current File : /var/www/html/conference/storage/framework/views/07ec19c0cbcf5c6722840bdaee6c83d13909751d.php |
<?php $__env->startSection('content'); ?> <div class="container"> <div class="row"> <div class="col-md-12"> <form class="<?php echo e($errors->count() > 0 ? 'was-validated' : ''); ?>" method="POST" autocomplete="off" enctype="multipart/form-data" <?php if($article->id): ?> action="<?php echo e(route('admin.articles.update', ['article' => $article->id])); ?>" <?php else: ?> action="<?php echo e(route('admin.articles.store')); ?>" <?php endif; ?> novalidate> <?php echo e(csrf_field()); ?> <div class="form-group row"> <div class="col-md-12"> <h2>Article</h2> </div> </div> <div class="form-group row"> <div class="col-md-12"> <label class="form-control-label" for="title">Title</label> <input id="title" type="text" class="form-control" name="title" placeholder="Title" required value="<?php echo e($article->title); ?>" autofocus> <?php if($errors->has('title')): ?> <div class="invalid-feedback"> <strong><?php echo e($errors->first('title')); ?></strong> </div> <?php endif; ?> </div> </div> <div class="form-group row"> <div class="col-md-12"> <label class="form-control-label" for="description">Description</label> <textarea name="description" id="description" rows="10" placeholder="Description" class="form-control" required><?php echo e($article->description); ?></textarea> <?php if($errors->has('description')): ?> <div class="invalid-feedback"> <strong><?php echo e($errors->first('description')); ?></strong> </div> <?php endif; ?> </div> </div> <div class="form-group row"> <div class="col-md-12"> <label class="form-control-label" for="session">Session</label> <input id="session" type="number" class="form-control" name="session" placeholder="Session" required value="<?php echo e($article->session); ?>" min="1" max="9"> <?php if($errors->has('session')): ?> <div class="invalid-feedback"> <strong><?php echo e($errors->first('session')); ?></strong> </div> <?php endif; ?> </div> </div> <div class="form-group row"> <div class="col-md-12"> <label class="form-control-label" for="authors">Authors</label> <input type="text" class="form-control" id="authors" name="authors" data-source="<?php echo e($article->authors); ?>" placeholder="Author" data-is-new="<?php echo e(($article->id)); ?>" data-role="tagsinput"> </div> </div> <div class="form-group row"> <div class="col-md-12"> <label class="form-control-label" for="keywords">Keywords</label> <input type="text" class="form-control" id="keywords" name="keywords" data-source="<?php echo e($article->keyWords); ?>" placeholder="Keyword" data-is-new="<?php echo e(($article->id)); ?>" data-role="tagsinput"> </div> </div> <div class="form-group row"> <div class="col-md-12"> <label class="form-control-label" for="category">Category</label> <select class="form-control" id="category" name="category" required> <option value="">Category</option> <?php $__currentLoopData = $categories; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $category): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?> <option value="<?php echo e($category['slug']); ?>" <?php echo e($category['slug'] == $article->category ? 'selected' : ''); ?>> <?php echo e($category['description']); ?> </option> <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?> </select> <?php if($errors->has('category')): ?> <div class="invalid-feedback"> <strong><?php echo e($errors->first('category')); ?></strong> </div> <?php endif; ?> </div> </div> <?php if(!$article->id): ?> <div class="form-group row"> <div class="col-md-12"> <input class="form-control" type="file" name="pdf_file" id="pdf_file" accept="application/pdf" required> <?php if($errors->has('pdf_file')): ?> <div class="invalid-feedback"> <strong><?php echo e($errors->first('pdf_file')); ?></strong> </div> <?php endif; ?> </div> </div> <?php endif; ?> <div class="form-group row"> <div class="col-md-8 col-md-offset-3"> <button type="submit" class="btn btn-primary"> Save </button> </div> </div> </form> </div> </div> </div> <?php $__env->stopSection(); ?> <?php $__env->startSection('script'); ?> <script src="<?php echo e(asset('js/libs/tagsinput.js')); ?>"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/typeahead.js/0.11.1/typeahead.bundle.min.js"></script> <script> var element = $('#authors'); var articleId = element.attr('data-is-new'); var isNew = !articleId; var dataSource = JSON.parse(element.attr('data-source')); var skills = new Bloodhound({ datumTokenizer: Bloodhound.tokenizers.obj.whitespace('id'), queryTokenizer: Bloodhound.tokenizers.whitespace, remote: { url: '/api/authors?term=%QUERY%', wildcard: '%QUERY%' } }); skills.initialize(); element.tagsinput({ itemValue: 'id', itemText: 'fullname', maxChars: 30, trimValue: true, allowDuplicates: false, freeInput: false, focusClass: 'form-control', tagClass: function (item) { if (item.display) return 'badge badge-' + item.display; else return 'badge badge-primary'; }, onTagExists: function (item, $tag) { $tag.hide().fadeIn(); }, typeaheadjs: [ { hint: false, highlight: true }, { name: 'authors', itemValue: 'id', displayKey: 'fullname', source: skills.ttAdapter(), templates: { empty: [ '<ul class="list-group"><li class="list-group-item">Nothing found.</li></ul>' ], header: [ '<ul class="list-group">' ], suggestion: function (data) { return '<li class="list-group-item">' + data.fullname + '</li>' } } }] }); dataSource.forEach(function (value) { element.tagsinput('add', value) }); element.on('beforeItemAdd', function (event, item) { if (!isNew) { $.ajax({ type: 'GET', url: '/api/articles/' + articleId + '/attachAuthor/' + event.item.id, dataType: 'json', success: function () { toastr.success('Author successfully associated'); }, error: function () { //TODO: remove author from input toastr.error('Unexpected error occurred during author association'); } }); } }); element.on('beforeItemRemove', function (event) { if (!isNew) { $.ajax({ type: 'GET', url: '/api/articles/' + articleId + '/detachAuthor/' + event.item.id, dataType: 'json', success: function () { toastr.success('Author successfully disassociated'); }, error: function () { //TODO: add again author on input toastr.error('Unexpected error occurred during author disassociation'); } }); } }); </script> <script> var element = $('#keywords'); var articleId = element.attr('data-is-new'); var isNew = !articleId; var dataSource = JSON.parse(element.attr('data-source')); var skills = new Bloodhound({ datumTokenizer: Bloodhound.tokenizers.obj.whitespace('id'), queryTokenizer: Bloodhound.tokenizers.whitespace, remote: { url: '/api/keywords?term=%QUERY%', wildcard: '%QUERY%' } }); skills.initialize(); element.tagsinput({ itemValue: 'tag', itemText: 'tag', maxChars: 30, trimValue: true, allowDuplicates: false, freeInput: true, focusClass: 'form-control', tagClass: function (item) { if (item.display) return 'badge badge-' + item.display; else return 'badge badge-primary'; }, onTagExists: function (item, $tag) { $tag.hide().fadeIn(); }, typeaheadjs: [ { hint: false, highlight: true }, { name: 'keywords', itemValue: 'tag', displayKey: 'tag', source: skills.ttAdapter(), templates: { header: [ '<ul class="list-group">' ], suggestion: function (data) { return '<li class="list-group-item">' + data.tag + '</li>' } } }] }); dataSource.forEach(function (value) { element.tagsinput('add', value) }); element.on('beforeItemAdd', function (event) { if (typeof event.item === 'string') { event.cancel = true; element.tagsinput('add', {tag: event.item}) } else if (!isNew) { $.ajax({ type: 'GET', url: '/api/articles/' + articleId + '/attachKeyword/' + event.item.tag, dataType: 'json', error: function () { //TODO: remove author from input toastr.error('Unexpected error occurred during author association'); } }); } }); element.on('beforeItemRemove', function (event) { if (!isNew) { $.ajax({ type: 'GET', url: '/api/articles/' + articleId + '/detachKeyword/' + event.item.id, dataType: 'json', error: function () { //TODO: add again author on input toastr.error('Unexpected error occurred during author disassociation'); } }); } }); </script> <?php $__env->stopSection(); ?> <?php echo $__env->make('layouts.app', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>