{% extends "1-col-sidebar.html.twig" %}
{% block column %}
{% if site_code == constant("App\\Entity\\Content::SITE_RCS") %}
{% include "includes/curtain-ads/rlw.html.twig" %}
{% endif %}
{% if content is defined %}
{% if content.getShowTitle() %}
<div class="row">
<h1>{{ content.getTitle() | raw }}</h1>
{% include "includes/ebooks-sort-select.html.twig" %}
</div>
{% endif %}
{% if content.getFeaturedImageTag() %}
{{ content.getFeaturedImageTag("display-block","")|raw }}
{% endif %}
{% if content.getContentFull() is not empty %}
{{ content.getContentFull() | wordpress | raw }}
{% endif %}
{% endif %}
<style>
h1 {
display: inline-block
}
.row {
display: flex;
flex-direction: row;
/*justify-content: space-between;*/
}
.column {
justify-content: center;
display: flex;
flex-direction: column;
}
.book {
height: 288px;
margin: auto;
box-shadow: 5px 4px 6px 2px #0000006e;
position: relative;
transition: 0.2s ease-in-out;
width: 223px;
overflow: hidden;
}
.book:hover {
box-shadow: 0 12px 15px -2px #0000006e;
padding: 0;
transform: scale(1.05);
}
.book:hover > .title {
bottom: 15px;
}
.title {
/*position: absolute;*/
bottom: -6px;
left: 0;
width: 100%;
text-align: center;
font-weight: bolder;
transition: 0.2s ease-in-out;
padding: 0 10px;
}
.book-container {
margin-top: 20px;
margin-bottom: 14px;
}
.cover-art {
max-height: 288px;
margin: auto;
display: block;
}
</style>
{% if customers is defined %}
<div class="row">
{% for customer in customers %}
<a class="col-lg-4 col-md-6 " href="/ebooks-by/{{customer.getDirectoryContent().getSlug()}}">
<div class="book-container">
<div class="book">
{{random(customer.getLatestContent(19, 0)).getMedia().getImageTag('cover-art')|raw}}
</div>
</div>
<div class="title">{{customer}}</div>
</a>
{% endfor %}
</div>
{% elseif categories is defined %}
<div class="row">
{% for category in categories %}
<a class="col-lg-4 col-md-6 " href="/category/ebooks/{{category.getSlug()}}">
<div class="book-container">
<div class="book">
{# Business & Industry #}
{% if category.getMedia() %}
<img src="{{category.getMedia().getURL()}}" class="cover-art" loading="lazy">
{% elseif category.getId() == 1309 and site_code == constant("App\\Entity\\Content::SITE_RCS") %}
<img src="https://www.rooferscoffeeshop.com/uploads/media/2023/07/ebook-business-industry.png" class="cover-art" loading="lazy">
{% elseif category.getId() == 1309 and site_code == constant("App\\Entity\\Content::SITE_CCS") %}
<img src="https://www.rooferscoffeeshop.com/uploads/media/2023/07/ccs-ebook-business-industry.png" class="cover-art" loading="lazy">
{# Catalogs #}
{% elseif category.getId() == 1313 and site_code == constant("App\\Entity\\Content::SITE_RCS") %}
<img src="https://www.rooferscoffeeshop.com/uploads/media/2023/07/ebook-catalogs.png" class="cover-art" loading="lazy">
{% elseif category.getId() == 1313 and site_code == constant("App\\Entity\\Content::SITE_CCS") %}
<img src="https://www.rooferscoffeeshop.com/uploads/media/2023/07/ccs-ebook-catalogs.png" class="cover-art" loading="lazy">
{# Design #}
{% elseif category.getId() == 1312 and site_code == constant("App\\Entity\\Content::SITE_RCS") %}
<img src="https://www.rooferscoffeeshop.com/uploads/media/2023/07/ebook-design.png" class="cover-art" loading="lazy">
{% elseif category.getId() == 1312 and site_code == constant("App\\Entity\\Content::SITE_CCS") %}
<img src="https://www.rooferscoffeeshop.com/uploads/media/2023/07/ccs-ebook-design.png" class="cover-art" loading="lazy">
{# Homeowner #}
{% elseif category.getId() == 1369 and site_code == constant("App\\Entity\\Content::SITE_CCS") %}
<img src="https://www.rooferscoffeeshop.com/uploads/media/2023/07/ccs-ebook-homeowner.png" class="cover-art" loading="lazy">
{# Materials & Install #}
{% elseif category.getId() == 1310 and site_code == constant("App\\Entity\\Content::SITE_RCS") %}
<img src="https://www.rooferscoffeeshop.com/uploads/media/2023/07/ebook-materials-install.png" class="cover-art" loading="lazy">
{% elseif category.getId() == 1310 and site_code == constant("App\\Entity\\Content::SITE_CCS") %}
<img src="https://www.rooferscoffeeshop.com/uploads/media/2023/07/ccs-ebook-materials-install.png" class="cover-art" loading="lazy">
{# Tech & Software #}
{% elseif category.getId() == 1311 and site_code == constant("App\\Entity\\Content::SITE_RCS") %}
<img src="https://www.rooferscoffeeshop.com/uploads/media/2023/07/ebook-tech-software.png" class="cover-art" loading="lazy">
{% elseif category.getId() == 1311 and site_code == constant("App\\Entity\\Content::SITE_CCS") %}
<img src="https://www.rooferscoffeeshop.com/uploads/media/2023/07/ccs-ebook-tech-software.png" class="cover-art" loading="lazy">
{% else %}
{{(category.getPinnedEbook(site_code)).getMedia().getImageTag('cover-art')|raw}}
{% endif %}
</div>
</div>
<div class="title">{{category}}</div>
</a>
{% endfor %}
</div>
{% else %}
<div class="row">
{% for eBook in eBooks %}
<a class="col-lg-4 col-md-6 " href="/ebooks/{{eBook.getSlug()}}">
<div class="book-container">
<div class="book">
{{eBook.getMedia().getImageTag('cover-art')|raw}}
</div>
</div>
<div class="title">{{eBook.getTitle()}}</div>
</a>
{% endfor %}
</div>
{% endif %}
{% endblock %}