<?php
    $bodyClass = 'article-detail';
    $layout_path = 'frontend.layouts.content-sidebar';
    if($item->layout_type == 'blocks') {
        $bodyClass .= ' article-detail--blocks';
        $layout_path = 'frontend.layouts.main';

        if($item->header_overlap) {
            $bodyClass .= ' header-over';
        }
    }
?>



<?php if($item->layout_type == 'blocks'): ?>

    <?php $__env->startSection('content'); ?>
        <div class="article-detail__content">
            <?php echo $__env->make('frontend.templates.components.blocks_section', ['blocks' => $item->blocks], \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
        </div>
    <?php $__env->stopSection(); ?>

<?php else: ?>

    <?php $__env->startSection('content-toolbar'); ?>
        <?php if(!$item->document->isEmpty() && $type != 'publication'): ?>
            <a
                target="_blank"
                class="download-btn download-btn--simple"
                href="<?php echo e(url('/uploads/media/' . $item->document->first()->filename)); ?>"
            ></a>
        <?php endif; ?>
        <?php if(!empty($item->pardot_url)): ?>
            <a
                href="#"
                class="download-btn download-btn--simple"
                data-download_id="<?php echo e($item->id); ?>"
                data-download="<?php echo e(base64_encode(json_encode(["title" => $item->title, "url" => $item->pardot_url ]))); ?>"
                data-controller="components/form-modal"
                data-popupid="download-modal"
            >
            </a>
        <?php endif; ?>
        <?php echo $__env->make('frontend.templates.components.share_buttons', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
    <?php $__env->stopSection(); ?>

    <?php $__env->startSection('content-top'); ?>
        <div class="article-detail__header">
            <h1><?php echo co2_subscript(e($item->title)); ?></h1>

            <div class="article-detail__header-info">
                <div class="article-detail__info">
                    <span class="article-detail__date">
                        <?php if($type == 'event'): ?>
                            <?php echo e(event_date($item->date, $item->end_date)); ?>

                        <?php else: ?>
                            <?php echo e(format_date($item->date, true)); ?>

                        <?php endif; ?>
                    </span>
                    <?php if(!empty($item->author)): ?>
                        <span class="article-detail__name"><?php echo app('translator')->get('frontend.by'); ?> <?php echo e($item->author); ?></span>
                    <?php endif; ?>
                    <?php if(!empty($item->location)): ?>
                        <span class="article-detail__name"><?php echo e($item->location); ?></span>
                    <?php endif; ?>
                    <?php if(!empty($item->type)): ?>
                        <span><?php echo app('translator')->get('frontend.article_type_' . $item->type); ?></span>
                    <?php endif; ?>
                    <?php if($type == 'event'): ?>
                        <span><?php echo e($eventsDetail->undertitle); ?></span>
                    <?php endif; ?>
                </div>
            </div>
        </div>
    <?php $__env->stopSection(); ?>
    <?php $__env->startSection('content-left'); ?>
        <?php if($item->media): ?>
            <div class="article-detail__image">
                <?php echo getMediaImg($item->media, '800w', htmlspecialchars($item->title)); ?>

            </div>
        <?php endif; ?>
        <div class="rich-content">
            <?php echo $item->content ? $item->content : $item->summary; ?>

        </div>
        <?php if($type == 'event' && $item->pardotForm): ?>
            <a
                href="#"
                class="pardot-form-open events-content-button std-button blue-button"
                data-fields="<?php echo e(base64_encode(json_encode($pardotData))); ?>"
                data-formid="<?php echo e($item->pardotForm->id); ?>"
                data-formurl="<?php echo e($item->pardotForm->form_url); ?>"
                data-controller="components/form-modal"
                data-popupid="pardot-modal"
            >
                <?php echo e(!empty($item->pardot_button_label) ? $item->pardot_button_label : 'Register'); ?>

            </a>
        <?php endif; ?>
        <?php if($type == 'publication' && !empty($item->pardot_url)): ?>
            <a
                href="#"
                class="pardot-form-open events-content-button std-button blue-button"
                data-download_id="<?php echo e($item->id); ?>"
                data-download="<?php echo e(base64_encode(json_encode(["title" => $item->title, "url" => $item->pardot_url ]))); ?>"
                data-controller="components/form-modal"
                data-popupid="download-modal"
            >
                Download Now
            </a>
        <?php endif; ?>
        <?php if(!empty($item->cta)): ?>
            <?php echo generateLink($eventsDetail->cta, 'std-button blue-button events-content-button'); ?>

        <?php endif; ?>
        <br>
        <?php if(!empty($backUrl)): ?>
            <a
                href="#"
                class="article-detail__return-to-list"
                data-action="go-back"
            ><?php echo app('translator')->get('frontend.return_to_list'); ?></a>
        <?php endif; ?>
    <?php $__env->stopSection(); ?>
<?php endif; ?>

<?php echo $__env->make($layout_path, [
    'body_class' => $bodyClass
], \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /var/www/html-staging/resources/views/frontend/templates/components/article_detail.blade.php ENDPATH**/ ?>