diff --git a/assets/css/panel.css b/assets/css/panel.css index 3b53cbb..e5eb4a7 100644 --- a/assets/css/panel.css +++ b/assets/css/panel.css @@ -9,10 +9,10 @@ color: #000; } -.k-panel[data-template="year"] .k-list-items .k-item:first-child { +.k-panel[data-template="year"] .k-section-name-texts .k-list-items .k-item:first-child { margin-bottom: 2rem; } -.k-panel[data-template="year"] .k-list-items::before { +.k-panel[data-template="year"] .k-section-name-texts .k-list-items::before { content: "Texte princeps"; display: block; padding: 0.5rem; diff --git a/site/blueprints/pages/texts.yml b/site/blueprints/pages/texts.yml index 8a3347b..247d9b3 100644 --- a/site/blueprints/pages/texts.yml +++ b/site/blueprints/pages/texts.yml @@ -15,7 +15,7 @@ tabs: type: pages template: year sortBy: title desc - - width: 1/1 + - width: 1/2 sections: allTextsSection: label: Tous les textes diff --git a/site/blueprints/pages/year.yml b/site/blueprints/pages/year.yml index d0ad42e..451d1c6 100644 --- a/site/blueprints/pages/year.yml +++ b/site/blueprints/pages/year.yml @@ -24,6 +24,14 @@ 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: diff --git a/site/models/year.php b/site/models/year.php new file mode 100644 index 0000000..e9eb907 --- /dev/null +++ b/site/models/year.php @@ -0,0 +1,8 @@ +children()->listed(); + $linked = $this->linkedTexts()->toPages(); + return $texts->merge($linked); + } +} \ No newline at end of file diff --git a/site/plugins/code-editor/index.php b/site/plugins/code-editor/index.php index ba1302a..f4a3250 100644 --- a/site/plugins/code-editor/index.php +++ b/site/plugins/code-editor/index.php @@ -1,15 +1,15 @@ [ + 'options' => array( 'language' => 'css', - 'size' => 'small', - 'lineNumbers' => true, + 'size' => 'small', + 'lineNumbers' => true, 'tabSize' => 4, 'insertSpaces' => true, 'ignoreTabKey' => false, - ], - 'fields' => [ + ), + 'fields' => array( 'code-editor' => require_once __DIR__ . '/lib/fields/code-editor.php', - ], + ), ]); diff --git a/site/plugins/helpers/index.php b/site/plugins/helpers/index.php index 69357d7..3a4d755 100644 --- a/site/plugins/helpers/index.php +++ b/site/plugins/helpers/index.php @@ -1,5 +1,17 @@ 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); diff --git a/site/snippets/nav__texts--all.php b/site/snippets/nav__texts--all.php index 8ee0245..083c522 100644 --- a/site/snippets/nav__texts--all.php +++ b/site/snippets/nav__texts--all.php @@ -29,9 +29,12 @@ publié le published()->toDate('d/m/Y') ?>
- dans parent()->title() ?> - / dans + + title()?>/ + + + category() ?>

diff --git a/site/snippets/nav__texts--collection.php b/site/snippets/nav__texts--collection.php index cf29a0e..c3a3b3c 100644 --- a/site/snippets/nav__texts--collection.php +++ b/site/snippets/nav__texts--collection.php @@ -18,7 +18,8 @@ class="see-more toggle-btn toggle-btn--left" @click="edito = !edito">Lire