<?php $__env->startSection('title'); ?>
Galeria
<?php $__env->stopSection(); ?>

<?php $__env->startSection('content-header'); ?>
Galeria 
<small>
   <?php echo $action; ?>

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

<?php $__env->startSection('breadcrumb'); ?>
<li>
    <a href="<?php echo route('admin.galeria.index'); ?>">
        Galeria
    </a>
</li>
<li class="active">
    <?php echo $action; ?>

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

<?php $__env->startSection('styles'); ?>
    <?php echo HTML::style('assets/vendor/dropzone/dist/min/dropzone.min.css'); ?>

    <?php echo HTML::style('assets/vendor/lightGallery/dist/css/lightgallery.min.css'); ?>

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

<?php $__env->startSection('plugins'); ?>
    <?php echo HTML::script('assets/vendor/dropzone/dist/min/dropzone.min.js'); ?>

    <?php echo HTML::script('assets/vendor/lightGallery/dist/js/lightgallery.min.js'); ?>

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

<?php $__env->startSection('content'); ?>
<div class="row">
    <div class="col-xs-12">
        <div class="nav-tabs-custom">
            <ul class="nav nav-tabs pull-right">
                <?php /* TABS */ ?>

                <?php if($album->exists): ?>
                <li role="navigation">
                    <a href="#tab-fotos" data-toggle="tab">Fotografias</a>
                </li>
                <?php endif; ?>
                
                <li class="active" role="navigation">
                    <a href="#tab-info" data-toggle="tab">Detalhes</a>
                </li>
                
                <?php /* TITLE */ ?>
                <li class="pull-left header">
                    <i class="fa fa-picture-o"></i> <?php echo $action; ?> <small class="text-muted"><?php echo $album->titulo; ?></small>
                </li>
            </ul>

            <div class="tab-content">
                
                <?php /* DETALHES DO ALBUM*/ ?>
                <div class="tab-pane active" id="tab-info">
                    <?php echo $__env->make('admin.gallery.partials.info', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>
                </div>

                <?php /* FOTOS DO ALBUM */ ?>
                <?php if($album->exists): ?>
                <div class="tab-pane" id="tab-fotos">
                    <?php echo $__env->make('admin.gallery.partials.fotos', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>
                </div>
                <?php endif; ?>
            </div>
        </div>
    </div>
</div>

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

<?php $__env->startSection('modals'); ?>
    <?php echo $__env->make('admin.gallery.partials.modal_edit', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>
<?php $__env->stopSection(); ?>

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

    $('.ace-thumbnails').lightGallery({
        selector: '.image-item'
    });

    Helper.dropzoneTranslations();

     $('#modal-edit').on('show.bs.modal', function (event) {
        
        var button = $(event.relatedTarget); // Button that triggered the modal
        
        var action = button.data('action');

        var autor = button.data('autor'); // Extract info from data-* attributes
        var legenda = button.data('legenda'); // Extract info from data-* attributes
        var capa = button.data('capa');
        var destaque = button.data('destaque');
        var modal = $(this);

        var status = capa ? 'check' : 'uncheck';
        var disable = capa ? 'disable' : 'enable'
        var destaqueCheck = destaque ? 'check' : 'uncheck';

        modal.find('form').attr('action', action);
        modal.find("input[name='autor']").val(autor);
        modal.find("input[name='legenda']").val(legenda);
        modal.find("input[name='capa']").iCheck(status).iCheck(disable);
        modal.find("input[name='capa']").prop('checked', capa).trigger('change');

        modal.find("input[name='destaque']").iCheck(destaqueCheck);
        modal.find("input[name='destaque']").prop('checked', destaque).trigger('change');

    });

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