Compare commits

..

No commits in common. "d4b7a3f3fb2bb4c203b59e69256b6aae614050ab" and "8f9e75126eb45049b4075a99b6037bcf35816ef5" have entirely different histories.

12 changed files with 23 additions and 71 deletions

View file

@ -9,10 +9,10 @@
color: #000;
}
.k-panel[data-template="year"] .k-section-name-texts .k-list-items .k-item:first-child {
.k-panel[data-template="year"] .k-list-items .k-item:first-child {
margin-bottom: 2rem;
}
.k-panel[data-template="year"] .k-section-name-texts .k-list-items::before {
.k-panel[data-template="year"] .k-list-items::before {
content: "Texte princeps";
display: block;
padding: 0.5rem;

View file

@ -15,7 +15,7 @@ tabs:
type: pages
template: year
sortBy: title desc
- width: 1/2
- width: 1/1
sections:
allTextsSection:
label: Tous les textes

View file

@ -24,14 +24,6 @@ tabs:
templates:
- linear
- grid
linkedTextsSection:
type: fields
fields:
linkedTexts:
label: Textes liés
type: pages
query : site.find('textes').grandChildren.not(page.children)
help: textes enregistrés à une autre année à inclure aussi dans celle-ci.
- width: 2/3
fields:
edito:

View file

@ -1,8 +0,0 @@
<?php
class YearPage extends Page{
public function allTexts(){
$texts = $this->children()->listed();
$linked = $this->linkedTexts()->toPages();
return $texts->merge($linked);
}
}

View file

@ -1,15 +1,15 @@
<?php
Kirby::plugin('sylvainjule/code-editor', [
'options' => array(
'options' => [
'language' => 'css',
'size' => 'small',
'lineNumbers' => true,
'size' => 'small',
'lineNumbers' => true,
'tabSize' => 4,
'insertSpaces' => true,
'ignoreTabKey' => false,
),
'fields' => array(
],
'fields' => [
'code-editor' => require_once __DIR__ . '/lib/fields/code-editor.php',
),
],
]);

View file

@ -1,17 +1,5 @@
<?php
function allYears ($article) {
$years = new Pages([$article->parent()]);
foreach (site()->find('textes')->children() as $year) {
if ($year->linkedTexts()->toPages()->has($article)) {
$years = $years->add($year);
}
}
return $years;
}
function setTitleFontSizeClass($title, $level = 'h1')
{
$length = strlen($title);

View file

@ -29,12 +29,9 @@
<span class="light">publié le </span><?php echo $article->published()->toDate('d/m/Y') ?><br>
<span class="light">dans</span>
<?php foreach(allYears($article) as $year):?>
<a href="<?= $year->url() ?>"><?= $year->title()?></a>/
<?php endforeach ?>
<a
<span class="light">dans</span> <a
href="<?= $article->parent()->url() ?>"><?= $article->parent()->title() ?></a>
/ <a
href="/categories/<?= Str::slug($article->category()) ?>"><?= $article->category() ?></a>
</p>
</div>

View file

@ -18,8 +18,7 @@
class="see-more toggle-btn toggle-btn--left" @click="edito = !edito">Lire</button>
<?php endif ?>
<ul class="panel-item-content__texts texts">
<?php $articles = method_exists($section, 'allTexts') ? $section->allTexts() : $section->children(); ?>
<?php foreach($articles as $article): ?>
<?php foreach($section->children() as $article): ?>
<?php
$author = $article->author()->toPage() == null ? 'inconnu' : $article->author()->toPage()->title();
?>
@ -49,11 +48,9 @@
<span class="light">publié le </span><?php echo $article->published()->toDate('d/m/Y') ?><br>
<span class="light">dans</span>
<?php foreach(allYears($article) as $year): ?>
<a href="<?= $year->url() ?>"><?= $year->title() ?></a> /
<?php endforeach ?>
<a
<span class="light">dans</span> <a
href="<?= $article->parent()->url() ?>"><?= $article->parent()->title() ?></a>
/ <a
href="/categories/<?= Str::slug($article->category()) ?>"><?= $article->category() ?></a>
</p>
</div>

View file

@ -9,11 +9,7 @@
<span class="light">par</span>
<a class="author" href="/auteurs/<?= Str::slug($article->author()->toPage()->title()) ?>"><?= $article->author()->toPage()->title() ?></a><br>
<span class="light">publié le </span><?= $article->published()->toDate('d/m/Y') ?><br>
<span class="light">dans</span>
<?php foreach(allYears($article) as $year): ?>
<a href="<?= $year->url() ?>"><?= $year->title() ?></a> /
<?php endforeach ?>
<a href="/categories/<?= $article->category() ?>"><?= $article->category() ?></a>
<span class="light">dans</span> <a href="<?= $article->parent()->url() ?>"><?= $article->parent()->title() ?></a> / <a href="/categories/<?= $article->category() ?>"><?= $article->category() ?></a>
</p>
</div>
</li>

View file

@ -23,11 +23,7 @@
<div class="text__infos">
<p>
<span class="light">publié le </span><?= $article->published()->toDate('d/m/Y') ?><br>
<span class="light">dans</span>
<?php foreach(allYears($article) as $year): ?>
<a href="<?= $year->url() ?>"><?= $year->title() ?></a> /
<?php endforeach ?>
<a href="/categories/<?= $article->category() ?>"><?= $article->category() ?></a>
<span class="light">dans</span> <a href="<?= $article->parent()->url() ?>"><?= $article->parent()->title() ?></a> / <a href="/categories/<?= $article->category() ?>"><?= $article->category() ?></a>
</p>
</div>
</li>

View file

@ -27,11 +27,9 @@
href="/auteurs/<?= Str::slug($article->author()->toPage()->title()) ?>"><?= $article->author()->toPage()->title() ?></a><br>
<span class="light">publié le
</span><?= $article->published()->toDate('d/m/Y') ?><br>
<span class="light">dans</span>
<?php foreach(allYears($article) as $year): ?>
<a href="<?= $year->url() ?>"><?= $year->title() ?></a> /
<?php endforeach ?>
<a
<span class="light">dans</span> <a
href="<?= $article->parent()->url() ?>"><?= $article->parent()->title() ?></a>
/ <a
href="/categories/<?= $article->category() ?>"><?= $article->category() ?></a>
</p>
</div>

View file

@ -28,7 +28,7 @@
>Lire</button>
<?php endif ?>
<ul class="texts">
<?php foreach($page->allTexts() as $article): ?>
<?php foreach($page->children() as $article): ?>
<li
class="text"
>
@ -40,11 +40,7 @@
<span class="light">par</span>
<a class="author" href="/auteurs/<?= Str::slug($article->author()->toPage()->title()) ?>"><?= $article->author()->toPage()->title() ?></a><br>
<span class="light">publié le </span><?= $article->published()->toDate('d/m/Y') ?><br>
<span class="light">dans</span>
<?php foreach(allYears($article) as $year):?>
<a href="<?= $year->url() ?>"><?= $year->title() ?></a> /
<?php endforeach ?>
<a href="/categories/<?= $article->category() ?>"><?= $article->category() ?></a>
<span class="light">dans</span> <a href="<?= $article->parent()->url() ?>"><?= $article->parent()->title() ?></a> / <a href="/categories/<?= $article->category() ?>"><?= $article->category() ?></a>
</p>
</div>
</li>