decor-6-site/site/templates/print.php
2026-04-07 18:09:15 +02:00

142 lines
5.2 KiB
PHP

<?php snippet('head') ?>
<?php $sizes = "(min-width: 1200px) 25vw,
(min-width: 900px) 33vw,
(min-width: 600px) 50vw,
100vw";
?>
<header id="interface-header" w3-include-html="assets/pagedjs/interface.html"></header>
<div id="render-book"></div>
<template id="book-content">
<section class="cover">
<h1><?= $site->title()->html()?></h1>
</section>
<div class="blank-page"></div>
<section class="toc">
<h2>Sommaire =></h2>
<article id="table-of-contents"></article>
</section>
<?php foreach($site->index()->filterBy('intendedTemplate', 'chapitre')->listed() as $chapitre):?>
<!-- Interpage chapitre -->
<?php if($cover = $chapitre->cover()->toFile()):?>
<div class="interpage full-bleed-image">
<figure>
<img src="<?= $cover->url() ?>" alt="">
</figure>
</div>
<?php endif;?>
<section class="chapter <?= $chapitre->typeof()->esc()?>" data-chapter="<?= $chapitre->typeof()->esc()?>" id="<?= $chapitre->uid()?>">
<!-- titre courant -->
<span class="nav-decor">D6cor</span>
<span class="nav-author"><?= $chapitre->author()->html()->smartypants() ?></span>
<span class="nav-title"><?= $chapitre->title()->html()->smartypants() ?></span>
<!-- Entrées des chapitres -->
<div class="chapter-header">
<?php
$type = $chapitre->typeof()->value();
switch ($type) {
case 'entretien':
$symbol = '@';
$before = '@/////////';
$after = '/////////@';
$separator = '@///////////////////////////@';
break;
case 'portfolio':
$symbol = '+';
$before = '+/////////';
$after = '/////////+';
$separator = '+///////////////////////////+';
break;
default:
$symbol = '*';
$before = '*//////////';
$after = '//////////*';
$separator = '*///////////////////////////*';
break;
}
?>
<div class="hgroup">
<div class="type-container">
<div class="before"><?= $before ?></div>
<div class="type"><?= $chapitre->typeof()->html() ?></div>
<div class="after"><?= $after ?></div>
</div>
<div class="type-separator"><?= $separator ?></div>
<h2><span><?= $chapitre->title()->html()->smartypants() ?></span></h2>
<div class="title-between">/ / </div>
<p class="author"><span><?= $chapitre->author()->html()->smartypants() ?></span></p>
<div class="title-after">/ / / / / / </div>
</div>
</div>
<div class="chapter-content">
<?php foreach ($chapitre->text()->toBlocks() as $block): ?>
<div id="<?= $block->id() ?>" class="block block-type-<?= $block->type() ?>">
<?= $block ?>
</div>
<?php endforeach ?>
<!-- Pour les portfolios -->
<?php if($chapitre->portfolio()->isNotEmpty()):?>
<?php
$portfolio = $chapitre->portfolio()->toStructure();
$counter = 0;
?>
<?php foreach($portfolio as $portfolioEl): ?>
<?php $counter ++?>
<?php if($spread = $portfolioEl->spread()->toFile()):?>
<div class="spread">
<div class="spread-inner">
<figure class="spread__left">
<div class="spread-content">
<img src="<?= $spread->url() ?>">
</div>
</figure>
<?php if($portfolioEl->position() == "topleft" || $portfolioEl->position() == "bottomleft"):?>
<?php if($image = $portfolioEl->imageontop()->toFile()):?>
<div class="image__top <?= $portfolioEl->position()?>" style="width: <?= $portfolioEl->largeur() ?>cm">
<img src="<?= $image->url() ?>">
</div>
<?php endif;?>
<?php endif;?>
<!-- <div class="pagebreak"></div> -->
<figure class="spread__right">
<div class="spread-content">
<img src="<?= $spread->url() ?>">
</div>
</figure>
<?php if($portfolioEl->position() == "topright" || $portfolioEl->position() == "bottomright" || $portfolioEl->position() == "center"):?>
<?php if($image = $portfolioEl->imageontop()->toFile()):?>
<div class="image__top <?= $portfolioEl->position()?>" style="width: <?= $portfolioEl->largeur() ?>cm">
<img src="<?= $image->url() ?>">
</div>
<?php endif;?>
<?php endif;?>
</div>
</div>
<div class="pagebreak"></div>
<?php endif;?>
<?php endforeach ?>
<?php endif;?>
</div>
</section>
<?php endforeach;?>
</template>
<?php snippet('footer');?>