You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.
 
 
 

73 lines
2.7 KiB

<?php
/**
* Block Name: Material
*/
$id = 'reuna-material-' . $block['id'];
if (! empty($block['anchor'])) {
$id = $block['anchor'];
}
$align_class = $block['align'] ? 'align' . $block['align'] : '';
?>
<div class="reuna-bloco-material <?php echo $align_class; ?>" id="<?php echo $id; ?>">
<div class="rb-relative rb-pr-3 rb-pt-3 lg:rb-pr-5 lg:rb-pt-5">
<div class="rb-absolute rb-inset-0 rb-pl-3 rb-pb-3 lg:rb-pl-5 lg:rb-pb-5">
<div class="rb-w-full rb-h-full rb-border-orange-600 rb-border" style="border-color: <?php echo get_field('cor') ?> !important"></div>
</div>
<div class="rb-relative rb-flex rb-flex-col rb-space-y-3">
<?php
if (get_field('capa')) {
echo wp_get_attachment_image(get_field('capa'), 'medium_large', false, ['class' => 'rb-w-full rb-h-auto rb-shadow']);
}
?>
<div class="rb-flex rb-flex-col rb-space-y-2">
<?php if (get_field('arquivo-online')): ?>
<a
x-data
class="rb-block rb-text-xs rb-text-white rb-text-center rb-font-bold rb-uppercase rb-no-underline rb-bg-orange-600 rb-px-3 rb-py-3 hover:rb-shadow-lg rb-transition-shadow rb-duration-200 rb-ease-in-out"
style="background-color: <?php echo get_field('cor') ?> !important"
<?php if (is_user_logged_in()): ?>
href="<?php echo get_field('arquivo-online')['url'] ?>"
target="_blank"
<?php if (get_field('tag-mailchimp', $post_id)): ?>
@click="$dispatch('reuna-mailchimp-subscribe', { tags: ['<?php echo get_field('tag-mailchimp', $post_id); ?>'] })"
<?php endif; ?>
<?php else: ?>
href="#"
@click.prevent="$dispatch('modal-open', { modal: 'login' })"
<?php endif; ?>
>
<?php echo __('Baixar para estudar online', 'reuna-blocos'); ?>
</a>
<?php endif; ?>
<?php if (get_field('arquivo-impressao')): ?>
<a
x-data
class="rb-block rb-text-xs rb-text-white rb-text-center rb-font-bold rb-uppercase rb-no-underline rb-bg-orange-600 rb-px-3 rb-py-3 hover:rb-shadow-lg rb-transition-shadow rb-duration-200 rb-ease-in-out"
style="background-color: <?php echo get_field('cor') ?> !important"
<?php if (is_user_logged_in()): ?>
href="<?php echo get_field('arquivo-impressao')['url'] ?>"
target="_blank"
<?php if (get_field('tag-mailchimp', $post_id)): ?>
@click="$dispatch('reuna-mailchimp-subscribe', { tags: ['<?php echo get_field('tag-mailchimp', $post_id); ?>'] })"
<?php endif; ?>
<?php else: ?>
href="#"
@click.prevent="$dispatch('modal-open', { modal: 'login' })"
<?php endif; ?>
>
<?php echo __('Baixar para imprimir', 'reuna-blocos'); ?>
</a>
<?php endif; ?>
</div>
</div>
</div>
</div>