diff --git a/assets/js/theme/design-system/modal.js b/assets/js/theme/design-system/modal.js new file mode 100644 index 0000000000000000000000000000000000000000..b20356291000fb070a6cd0245540ea3fba97f284 --- /dev/null +++ b/assets/js/theme/design-system/modal.js @@ -0,0 +1,64 @@ + +const CLASSES = { + modalOpened: 'has-modal-opened' +}; + +class Modal { + constructor(button) { + this.button = button; + this.id = this.button.getAttribute('data-open-modal'); + this.element = document.getElementById(this.id); + this.closeButtons = this.element.querySelectorAll('.close'); + + if (!this.element) { + return; + } + + this.state = { + isOpened: false + }; + + this.listen(); + } + + listen() { + this.button.addEventListener('click', () => { + this.toggle(true); + }); + + this.closeButtons.forEach(button => { + button.addEventListener('click', () => { + this.toggle(false); + }); + }); + + window.addEventListener('keydown', (event) => { + if (event.keyCode === 27 || event.key === 'Escape') { + this.toggle(false); + } + }); + + window.addEventListener('click', (event) => { + if (event.target === this.element) { + this.toggle(false); + } + }); + } + + toggle(open = !this.state.isOpened) { + this.state.isOpened = open; + const classAction = this.state.isOpened ? 'add' : 'remove'; + + this.element.setAttribute('aria-hidden', !this.state.isOpened); + document.documentElement.classList[classAction](CLASSES.modalOpened); + } + +} + +// Selectors +(function () { + const modalButtons = document.querySelectorAll("[data-open-modal]"); + modalButtons.forEach(button => { + new Modal(button); + }) +})(); diff --git a/assets/js/theme/index.js b/assets/js/theme/index.js index 62430e9c229b78713f6d5b71c9e71cff9e5e7588..3f053d2eb9b8a226fc13943ffcf3cbb6cf0d5dbc 100644 --- a/assets/js/theme/index.js +++ b/assets/js/theme/index.js @@ -1,6 +1,7 @@ import './body.js'; import './design-system/dropdowns'; import './design-system/mainMenu'; +import './design-system/modal'; import './design-system/toc'; import './blocks/keyFigures'; import './blocks/timeline'; diff --git a/assets/sass/_theme/_configuration.sass b/assets/sass/_theme/_configuration.sass index ca6c35be04c66404edee08d98c1f23127ee435da..b94b3c288593e81971eee821ca6fe63327c0e41c 100644 --- a/assets/sass/_theme/_configuration.sass +++ b/assets/sass/_theme/_configuration.sass @@ -151,6 +151,7 @@ $zindex-header: 52 !default $zindex-body-overlay: 51 !default $zindex-toc: 60 !default $zindex-toc-cta: 49 !default +$zindex-modal: 72 !default $zindex-aside: 48 !default $zindex-footer: 50 !default diff --git a/assets/sass/_theme/design-system/button.sass b/assets/sass/_theme/design-system/button.sass new file mode 100644 index 0000000000000000000000000000000000000000..60adbd146ac638d4dc53465255c6a469611d198c --- /dev/null +++ b/assets/sass/_theme/design-system/button.sass @@ -0,0 +1,30 @@ +.squared-button + @include meta + @include button-reset + align-items: center + cursor: pointer + display: flex + padding: 0 + @include media-breakpoint-up(desktop) + width: col(2,1) + &:first-child + margin-bottom: $spacing0 + &::before + background-color: white + border: 1px solid $color-border + margin-right: $spacing0 + padding: half($spacing0) + transition: background 0.3s ease, border 0.3s ease + @include media-breakpoint-up(desktop) + margin-right: $spacing1 + &:hover + text-decoration: none + &::before + background-color: $color-text + border-color: transparent + color: $color-background + text-decoration: none +button.squared-button + @include icon-block(eye, before) +a.squared-button + @include icon-block(download, before) \ No newline at end of file diff --git a/assets/sass/_theme/design-system/header.sass b/assets/sass/_theme/design-system/header.sass index 06af0f8a78e85baa49b973882c21f156063da7d9..7b19cb5323c6b63701c1e9e600cc35e6a53c4438 100644 --- a/assets/sass/_theme/design-system/header.sass +++ b/assets/sass/_theme/design-system/header.sass @@ -62,6 +62,7 @@ body z-index: $zindex-body-overlay html.has-menu-opened &, + html.has-modal-opened & html.has-offcanvas-opened & overflow: hidden height: 100% @@ -74,6 +75,9 @@ body &::after background-color: $toc-overlay-color z-index: $zindex-header + 1 + html.has-modal-opened & + &::after + z-index: $zindex-modal - 1 html.is-animating:not(.has-menu-opened) & &::after display: block diff --git a/assets/sass/_theme/design-system/layout.sass b/assets/sass/_theme/design-system/layout.sass index e51b956ba9cdcb3d66c05af199682344a069c4b2..c836ae9f8fbc0e1173769fde3ab95d234648b6f2 100644 --- a/assets/sass/_theme/design-system/layout.sass +++ b/assets/sass/_theme/design-system/layout.sass @@ -96,3 +96,35 @@ details &:hover summary::after transform: translateY(-5px) +.modal + align-items: center + display: flex + justify-content: center + height: 100vh + left: 0 + overflow: hidden + position: fixed + top: 0 + width: 100% + margin: 0 + z-index: $zindex-modal + &[aria-hidden="true"] + display: none + .modal-content + position: relative + background-color: $color-background-alt + padding: $spacing2 + width: auto + max-height: 100vh + overflow-y: auto + @include media-breakpoint-up(desktop) + padding: $spacing3 + width: col(8) + .modal-header + margin-bottom: $spacing0 + button + @include button-reset + @include icon-block(close, before) + position: absolute + right: 0 + top: 0 \ No newline at end of file diff --git a/assets/sass/_theme/hugo-osuny.sass b/assets/sass/_theme/hugo-osuny.sass index 6ca12414382461f5b1ce7dd1f0c471663126935a..6d508a41e030b7eed0932e7f8fc628dc3cca5a42 100644 --- a/assets/sass/_theme/hugo-osuny.sass +++ b/assets/sass/_theme/hugo-osuny.sass @@ -18,6 +18,7 @@ @import "design-system/layout" @import "design-system/a11y" @import "design-system/breadcrumb" +@import "design-system/button" @import "design-system/contacts" @import "design-system/footer" @import "design-system/form" @@ -64,6 +65,7 @@ @import "sections/persons" @import "sections/posts" @import "sections/programs" +@import "sections/publications" @import "sections/researchers" @import "sections/sitemap" @import "sections/teachers" diff --git a/assets/sass/_theme/sections/papers.sass b/assets/sass/_theme/sections/papers.sass index a9437b6fb2ebdcaa9fb9d36ff1791560d1a59562..63356e582943740e738bf17455932a0b29497517 100644 --- a/assets/sass/_theme/sections/papers.sass +++ b/assets/sass/_theme/sections/papers.sass @@ -1,6 +1,92 @@ .paper - @include article + a + text-decoration-color: transparent + transition: color 0.3s ease + > div + &:first-of-type + grid-column: 1 / 7 + &.paper-actions + grid-column: 8 / 12 + align-items: start + display: flex + @include media-breakpoint-down(desktop) + flex-wrap: wrap + justify-content: space-between + margin-top: $spacing1 + h3 + a:hover + color: $color-accent + .paper-volume + @include meta + text-transform: lowercase + a + @include link($color-text) + text-transform: none + span + text-transform: uppercase .papers - @include grid(2, md) - @include grid(3, lg) + @include list-reset + margin-block-start: half($spacing3) + li + + li + margin-top: $spacing2 + @include media-breakpoint-up(desktop) + margin-top: $spacing3 + article + @include media-breakpoint-up(desktop) + @include grid + + article + margin-top: $spacing2 + @include media-breakpoint-up(desktop) + margin-top: $spacing3 + + +.papers__page + .document-content + .container + @include media-breakpoint-up(desktop) + @include grid + .content + @include media-breakpoint-up(desktop) + grid-column: 1 / 9 + section + section + margin-top: $spacing2 + @include media-breakpoint-up(desktop) + margin-top: $spacing4 + .squared-button + margin-bottom: 0 + margin-top: $spacing2 + width: auto + .paper-body + h2 + margin-bottom: $spacing2 + .paper-authors + h2 + @include h3 + .authors + @include grid(2, desktop) + article + margin-top: $spacing2 + .name + a + @include h4 + @include stretched-link(before) + text-decoration: none + .document-nav + @include media-breakpoint-up(desktop) + grid-column: 9 / 12 + order: 2 + dl + margin: 0 + dt + @include meta + margin-bottom: $spacing0 + &:not(:first-of-type) + margin-top: $spacing2 + dd:first-of-type + a + display: flex + flex-direction: column + span + order: 3 diff --git a/assets/sass/_theme/sections/persons.sass b/assets/sass/_theme/sections/persons.sass index 5dd3d523f64d62a0f117a05e6134994439bc250f..2553546c8aa292139787f4369abff2446df8da02 100644 --- a/assets/sass/_theme/sections/persons.sass +++ b/assets/sass/_theme/sections/persons.sass @@ -1,4 +1,16 @@ .persons__page + h2 + @include h5 + a + @include icon(arrow-right, after, true) + display: inline-flex + margin-left: half($spacing0) + transition: transform .3s ease + &:hover::after + transform: translateX($spacing0) + // TODO : voir comment gérer les marges comme pour les blocs (pb footer) + section + padding-bottom: $grid-gutter ol.programs li justify-content: flex-start diff --git a/assets/sass/_theme/sections/publications.sass b/assets/sass/_theme/sections/publications.sass new file mode 100644 index 0000000000000000000000000000000000000000..261a15e88a290add33fe64e10dc674699b992c62 --- /dev/null +++ b/assets/sass/_theme/sections/publications.sass @@ -0,0 +1,46 @@ + +// STYLE PUBLICATIONS + +// .persons__page, +// .researchers__term +// .paper +// border-bottom: 1px solid $color-border +// padding: $spacing0 0 +// h2 +// a +// @include stretched-link(before) +// &:hover +// h2 a, +// &::after +// color: $color-accent + +// .persons__page +// .papers +// h2 +// @include inherit-text +// a +// @include stretched-link(before) +// display: flex +// @include media-breakpoint-up(desktop) +// @include icon(arrow-right, after) +// transition: color 0.3s ease +// &::after +// margin-left: auto +// p +// @include small + +// .researchers__term +// .papers +// @include grid(2, desktop) +// @include media-breakpoint-up(desktop) +// grid-row-gap: 0 +// .paper +// @include media-breakpoint-up(desktop) +// @include icon(arrow-right, after) +// bottom: 0 +// position: absolute +// right: 0 +// transition: color 0.3s ease +// p +// @include meta + \ No newline at end of file diff --git a/assets/sass/_theme/sections/volumes.sass b/assets/sass/_theme/sections/volumes.sass index 5e04f349ff1e9f9e18cebab313cc916e4c1adc2f..51681cc556447ece6149b80f56b0dca6b0da2e4b 100644 --- a/assets/sass/_theme/sections/volumes.sass +++ b/assets/sass/_theme/sections/volumes.sass @@ -1,6 +1,60 @@ .volume @include article + .suptitle + @include meta .volumes @include grid(2, md) @include grid(3, lg) + +.volumes__taxonomy + .volume + .media + img + aspect-ratio: 1 / 1.2 +.volumes__term + .document-content + .container + @include media-breakpoint-up(desktop) + @include grid + .content + @include media-breakpoint-up(desktop) + grid-column: 1 / 8 + > div + margin-bottom: $spacing1 + @include media-breakpoint-up(desktop) + margin-bottom: $spacing4 + .document-aside + @include media-breakpoint-up(desktop) + grid-column: 9 / 12 + order: 2 + dl + margin: 0 + dt + @include meta + &:not(:first-of-type) + margin-top: $spacing2 + .paper + display: block + @include media-breakpoint-down(desktop) + > div:first-of-type + .paper-volume + display: inline-flex + margin-left: $spacing0 + @include media-breakpoint-up(desktop) + > div:first-of-type + display: flex + flex-wrap: wrap + justify-content: space-between + h3 + flex: 1 + > span + order: 3 + width: 100% + .paper-volume + padding-left: $spacing1 + .paper-actions + gap: $grid-gutter + margin-top: $spacing1 + a, button + width: unset \ No newline at end of file diff --git a/i18n/fr.yml b/i18n/fr.yml index 4be8ecee642e58b9dc7156183c24aa3e385dc462..1a8dce2a542b1a318413023d78dcd197ef351b2a 100644 --- a/i18n/fr.yml +++ b/i18n/fr.yml @@ -148,10 +148,11 @@ pages: informations: Informations posts: Actualités persons: - posts: Actualités publiées + posts: Actualités publiées récemment programs: Enseignements papers: Papiers publications: Publications + papers: Papiers publiés récemment posts: author: Auteur·rice categories: Catégories @@ -211,7 +212,7 @@ volumes: plural_name: Papiers singular_name: Papier authors: Auteurs - full_text: Texte intégrale + full_text: Texte intégral issn: ISSN keywords: Mots-clés nature: Nature diff --git a/layouts/papers/list.html b/layouts/papers/list.html index b1e67d0cf9fe8b39f0421f6cf1cb170ebfcb7bdd..7337cbee8f8a6cb43a5260a514ff1ab84c22c02b 100644 --- a/layouts/papers/list.html +++ b/layouts/papers/list.html @@ -8,7 +8,13 @@ ) -}} <div class="document-content"> <div class="container"> - {{ partial "papers/papers.html" . }} + <ul class="papers"> + {{ range .Paginator.Pages }} + <li> + {{ partial "papers/paper.html" (dict "paper" . ) }} + </li> + {{ end }} + </ul> {{ partial "commons/pagination.html" . }} </div> diff --git a/layouts/papers/single.html b/layouts/papers/single.html index 5654229356e61356a1a8e9873ef572828ef2f2ab..0157d4c05e7e332532479a3d3ad8979137367f75 100644 --- a/layouts/papers/single.html +++ b/layouts/papers/single.html @@ -10,14 +10,16 @@ <meta itemprop="name" content="{{ partial "PrepareHTML" .Title }}"> <div class="container"> + + {{ partial "papers/document-nav.html" . }} + <div class="content"> - <div> - {{ partial "papers/abstract.html" . }} - {{ partial "papers/authors.html" . }} - {{ partial "papers/body.html" . }} - {{ partial "papers/references.html" . }} - </div> + {{ partial "papers/abstract.html" . }} + {{ partial "papers/authors.html" . }} + {{ partial "papers/body.html" . }} + {{ partial "papers/references.html" . }} </div> + </div> </div> diff --git a/layouts/partials/papers/abstract.html b/layouts/partials/papers/abstract.html index 2a7bfced0e92f0666f2a0f846ae03cb43854b852..324242e7f087ca41559b33c77153e51aaa43d345 100644 --- a/layouts/partials/papers/abstract.html +++ b/layouts/partials/papers/abstract.html @@ -1,3 +1,9 @@ <section> <p itemprop="abstract">{{ partial "PrepareHTML" .Params.Abstract }}</p> + <div role="group"> + {{ partial "papers/actions.html" (dict + "paper" . + "only_file" true + ) }} + </div> </section> diff --git a/layouts/partials/papers/actions.html b/layouts/partials/papers/actions.html new file mode 100644 index 0000000000000000000000000000000000000000..2a2f7ed9e72583e0cc069a478a9c8cce8f63761d --- /dev/null +++ b/layouts/partials/papers/actions.html @@ -0,0 +1,38 @@ +{{ $only_file := .only_file | default false }} +{{ with .paper }} + {{ $modalId := printf "modal-%s" .Slug }} + <div class="paper-actions" role="group"> + {{ if not $only_file }} + {{- if .Params.abstract -}} + <button class="squared-button" type="button" data-open-modal="{{ $modalId }}">{{ i18n "volumes.abstract" }}</button> + {{ partial "papers/modal.html" + (dict + "modalId" $modalId + "title" .Title + "abstract" .Params.abstract + ) }} + {{- end -}} + {{- end -}} + {{- if .Params.pdf -}} + {{- $file := partial "GetMedia" .Params.pdf -}} + {{- $size := partial "GetHumanSize" $file.size -}} + {{- $extension := partial "GetExtensionFile" $file.name -}} + {{- $extension_with_size := (printf "%.2f %s - %s" $size.weight $size.unit $extension) -}} + {{- $title_with_size := printf "%s (%s)" $file.name $extension_with_size -}} + {{- $url := $file.url -}} + {{- if site.Params.keycdn -}} + {{- $url = $file.direct_url -}} + {{- end -}} + {{ if $file }} + <figure> + <a href="{{ $url }}" download="{{ partial "PrepareHTML" $file.name }}" target="_blank" title="{{ i18n "commons.link.blank_aria" (dict "Title" $title_with_size) }}" class="squared-button"> + <figcaption> + <abbr title="{{ i18n (printf "commons.extensions.%s" $extension) }}">{{ $extension }}</abbr> + - {{ $size.weight }} <abbr title="{{ $size.full_unit }}">{{ $size.unit }}</abbr> + </figcaption> + </a> + </figure> + {{ end }} + {{- end -}} + </div> +{{ end }} \ No newline at end of file diff --git a/layouts/partials/papers/authors.html b/layouts/partials/papers/authors.html index 24ec0266a1a0d1da11a624adad740d539c05e669..95763e57e20f3ccd5159d67f914d3012661dc0b6 100644 --- a/layouts/partials/papers/authors.html +++ b/layouts/partials/papers/authors.html @@ -1,5 +1,5 @@ {{ if .Params.Researchers }} - <section> + <section class="paper-authors"> <h2>{{ i18n "volumes.authors" }}</h2> <div class="authors"> {{ range .Params.Researchers }} diff --git a/layouts/partials/papers/body.html b/layouts/partials/papers/body.html index 1663424b298643f879c84b32f954fb9d370ae2b9..b1147c6d7dcb70ffef098e60647af97e14c5e16b 100644 --- a/layouts/partials/papers/body.html +++ b/layouts/partials/papers/body.html @@ -1,5 +1,5 @@ {{ if (partial "GetTextFromHTML" .Content) }} - <section id="full-text"> + <section id="full-text" class="paper-body"> <h2>{{ i18n "volumes.full_text" }}</h2> <div class="articleBody"> {{ partial "PrepareHTML" .Content }} diff --git a/layouts/partials/papers/document-nav.html b/layouts/partials/papers/document-nav.html index e4339574a00e0b907bce82f950f2182cd7e2028a..22055dc8d2aa295ec7adc9e1d6e4100ce09c1c1f 100644 --- a/layouts/partials/papers/document-nav.html +++ b/layouts/partials/papers/document-nav.html @@ -1,14 +1,28 @@ <aside class="document-nav"> - <div role="group"> - {{ if isset .Params "pdf" }} - {{- $pdf := partial "GetMedia" .Params.pdf -}} - <a href="{{ $pdf.url }}" download>{{ i18n "commons.download.pdf" }}</a><br> - {{ end }} - {{ if .Content }} - <a href="#full-text" class="btn-eye">{{ i18n "commons.read_online" }}</a> - {{ end }} - </div> <dl> + {{ range .GetTerms "volumes" }} + <dt>{{ i18n "volumes.singular_name" }}</dt> + <dd itemprop="isPartOf" itemscope itemtype="https://schema.org/PublicationVolume"> + <a href="{{ .Permalink }}" itemprop="url"> + <span itemprop="name">{{ .Title }}</span> + <div class="media"> + {{- if .Params.image -}} + {{- partial "commons/image.html" + (dict + "image" .Params.image + "alt" .Title + "mobile" "327x388" + "tablet" "208x247" + "desktop" "408x485" + ) -}} + {{- else if site.Params.default_image.url -}} + {{- partial "commons/image-default.html" (dict "class" "img-fluid") -}} + {{- end -}} + </div> + </a> + </dd> + {{ end }} + {{ if isset .Params "type" }} <dt>{{ i18n "volumes.nature" }}</dt> <dd>{{ partial "PrepareHTML" .Params.Type }}</dd> @@ -26,15 +40,6 @@ <dd itemprop="inLanguage" content="{{ .Params.Lang_iso }}">{{ .Params.Lang }}</dd> {{ end }} - {{ range .GetTerms "volumes" }} - <dt>{{ i18n "volumes.singular_name" }}</dt> - <dd itemprop="isPartOf" itemscope itemtype="https://schema.org/PublicationVolume"> - <a href="{{ .Permalink }}" itemprop="url"> - <span itemprop="name">{{ .Title }}</span> - </a> - </dd> - {{ end }} - {{ if .Date }} <dt>{{ i18n "commons.date" }}</dt> <dd> diff --git a/layouts/partials/papers/modal.html b/layouts/partials/papers/modal.html new file mode 100644 index 0000000000000000000000000000000000000000..fcd07d34f6fb79e6742ee1182cb0cec690ed1ffa --- /dev/null +++ b/layouts/partials/papers/modal.html @@ -0,0 +1,13 @@ +<div class="modal paper-modal" id="{{ .modalId }}" tabindex="-1" aria-labelledby="{{ .modalId }}Label" aria-hidden="true" aria-modal="true"> + <div class="modal-content"> + <div class="modal-header"> + <h3 class="modal-title" id="{{ .modalId }}Label">{{ .title }}</h3> + <button class="close" type="button" aria-label="{{ i18n "commons.close" }}"></button> + </div> + <div class="modal-body"> + <div itemprop="abstract"> + {{ partial "PrepareHTML" .abstract }} + </div> + </div> + </div> +</div> diff --git a/layouts/partials/papers/paper.html b/layouts/partials/papers/paper.html index dcf7ecb4f392128893c889a1333408ab288b95ac..3019c669e8247d3b94a01f271889622500b598f5 100644 --- a/layouts/partials/papers/paper.html +++ b/layouts/partials/papers/paper.html @@ -1,11 +1,31 @@ -<article class="paper"> - <p class="title"> - <a href="{{ .Permalink }}">{{ partial "PrepareHTML" .Title }}</a> - </p> - {{ range .Params.Volumes }} - {{ $volume := site.GetPage (printf "/volumes%s" .) }} - {{ if $volume }} - <p>{{ i18n "commons.in" }} “<a href="{{ $volume.Permalink }}">{{ $volume.Title }}</a>â€</p> - {{ end }} - {{ end }} -</article> +{{ $inside_volume := .inside_volume | default false }} +{{ $modalId := print "modalID_" .index }} + +{{ with .paper }} + <article class="paper" itemscope itemtype="https://schema.org/ScholarlyArticle" {{- if $inside_volume }} itemProp="hasPart" {{- end -}}> + <div> + <h3> + <a href="{{ .Permalink }}" itemprop="url"> + <span itemprop="name">{{ partial "PrepareHTML" .Title }}</span> + </a> + </h3> + {{- range $index, $authors := .Params.Researchers -}} + {{- $author := site.GetPage (printf "/persons/%s" .) -}} + {{- if ne $index 0 -}},{{ end }} + <span itemprop="author" itemscope itemtype="https://schema.org/Person"><a href="{{ $author.Permalink }}" itemprop="url"><span itemprop="name">{{ trim $author.Title "\n" }}</span></a></span> + {{- end -}} + <p class="paper-volume"> + <span>Article</span> + {{ if not $inside_volume }} + {{ range .Params.Volumes }} + {{ $volume := site.GetPage (printf "/volumes/%s" .) }} + {{ if $volume }} + {{ i18n "commons.in" }} “<a href="{{ $volume.Permalink }}">{{ $volume.Title }}</a>†+ {{ end }} + {{ end }} + {{ end }} + </p> + </div> + {{ partial "papers/actions.html" (dict "paper" . ) }} + </article> +{{ end }} \ No newline at end of file diff --git a/layouts/partials/papers/papers.html b/layouts/partials/papers/papers.html deleted file mode 100644 index 11cce3f4097fac96c6f46bf0ea286e20d26224b3..0000000000000000000000000000000000000000 --- a/layouts/partials/papers/papers.html +++ /dev/null @@ -1,7 +0,0 @@ -<div class="papers"> - {{ range .Paginator.Pages }} - <div> - {{ partial "papers/paper.html" . }} - </div> - {{ end }} -</div> diff --git a/layouts/partials/persons/papers.html b/layouts/partials/persons/papers.html index b0c2a7d3ebaa3e36f0cbab3ac95c9bd6ced9f037..a0c9bac3de6145f2bf359fa4537d1ad5f03767bd 100644 --- a/layouts/partials/persons/papers.html +++ b/layouts/partials/persons/papers.html @@ -4,11 +4,11 @@ <h2>{{ i18n "persons.papers" }}</h2> <a href="{{ $researchers.Permalink }}" class="link">{{ i18n "persons.papers" }}</a> </div> - <div class="papers"> + <ul class="papers"> {{ range first 3 .papers }} - <div> - {{ partial "papers/paper.html" . }} - </div> + <li> + {{ partial "papers/paper.html" (dict "paper" . ) }} + </li> {{ end }} - </div> + </ul> </section> diff --git a/layouts/partials/volumes/description.html b/layouts/partials/volumes/description.html index 3ad551415d56619bab3596c892f4519cc86adbc0..d245c15e17155b0ef6c892bf28cd6fd58a54191f 100644 --- a/layouts/partials/volumes/description.html +++ b/layouts/partials/volumes/description.html @@ -1,7 +1,5 @@ -<div> {{- if (partial "GetTextFromHTML" .Content) -}} <div itemprop="description"> {{ partial "PrepareHTML" .Content }} </div> - {{- end -}} -</div> + {{- end -}} \ No newline at end of file diff --git a/layouts/partials/volumes/modal.html b/layouts/partials/volumes/modal.html deleted file mode 100644 index bb111f75e5e9b2e0f7330b342508876619221588..0000000000000000000000000000000000000000 --- a/layouts/partials/volumes/modal.html +++ /dev/null @@ -1,15 +0,0 @@ -<div class="modal fade" id="{{ .modalId }}" tabindex="-1" aria-labelledby="{{ .modalId }}Label" aria-hidden="true"> - <div class="modal-dialog modal-lg modal-dialog-centered modal-dialog-scrollable"> - <div class="modal-content"> - <div class="modal-header"> - <h5 class="modal-title" id="{{ .modalId }}Label">{{ .title }}</h5> - <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="{{ i18n "commons.close" }}"></button> - </div> - <div class="modal-body"> - <div itemprop="abstract"> - {{ .abstract }} - </div> - </div> - </div> - </div> -</div> diff --git a/layouts/partials/volumes/papers.html b/layouts/partials/volumes/papers.html new file mode 100644 index 0000000000000000000000000000000000000000..62a6897bef7018570a2f36aa149a8ab6e937dc17 --- /dev/null +++ b/layouts/partials/volumes/papers.html @@ -0,0 +1,16 @@ +<section> + <div class="top"> + <h2>{{ i18n "volumes.table_contents" }}</h2> + </div> + <ul class="papers"> + {{ range $index, $element := .Paginator.Pages }} + <li> + {{ partial "papers/paper.html" (dict + "paper" . + "inside_volume" true + "index" $index + ) }} + </li> + {{ end }} + </ul> +</section> diff --git a/layouts/partials/volumes/table-contents.html b/layouts/partials/volumes/table-contents.html deleted file mode 100644 index 268c8a9b6afe8f196ee91b117e56ed9ff47d0e11..0000000000000000000000000000000000000000 --- a/layouts/partials/volumes/table-contents.html +++ /dev/null @@ -1,46 +0,0 @@ -{{ if .Pages }} -<div> - <h2>{{ i18n "volumes.table_contents" }}</h2> - <ol class="volume-table"> - {{ range $index, $articles := .Pages }} - {{ $modalId := print "modalID_" $index }} - <li itemprop="hasPart" itemscope itemtype="https://schema.org/ScholarlyArticle"> - <div> - <span itemprop="articleSection">{{ i18n "volumes.article.singular_name" }}</span> - </div> - <div> - <h3> - <a href="{{ .Permalink }}" itemprop="url"> - <span itemprop="name">{{ partial "PrepareHTML" .Title }}</span> - </a> - </h3> - <p> - {{- range $index, $authors := .Params.Researchers -}} - {{- $author := site.GetPage (printf "/persons/%s" .) -}} - {{- if ne $index 0 -}},{{ end }} - <span itemprop="author" itemscope itemtype="https://schema.org/Person"><a href="{{ $author.Permalink }}" itemprop="url"><span itemprop="name">{{ trim $author.Title "\n" }}</span></a></span> - {{- end -}} - </p> - <div role="group"> - <a href="{{ .Permalink }}" itemprop="url">{{ i18n "commons.read" }}</a> - <button type="button" data-bs-toggle="modal" data-bs-target="#{{ $modalId }}">{{ i18n "volumes.abstract" }}</button> - {{ if .Params.pdf }} - {{- $pdf := partial "GetMedia" .Params.pdf -}} - {{- $pdf_size := partial "GetHumanSize" $pdf.size -}} - <a href="{{ $pdf.url }}" download> - {{- i18n "commons.pdf_with_size" (dict "Size" $pdf_size) }} - </a> - {{ end }} - </div> - {{ partial "volumes/modal.html" - (dict - "modalId" $modalId - "title" .Title - "abstract" .Params.abstract - ) }} - </div> - </li> - {{ end }} - </ol> -</div> -{{ end }} diff --git a/layouts/partials/volumes/volume.html b/layouts/partials/volumes/volume.html index 09fc5ab2605b899b1e1740affcca93017e9c33d9..cdb899dd2515464f71a177c420bff335ab9345c2 100644 --- a/layouts/partials/volumes/volume.html +++ b/layouts/partials/volumes/volume.html @@ -1,7 +1,7 @@ <article class="volume"> <hgroup> <p class="suptitle">{{ i18n "volumes.volume_number" (dict "Number" .Params.Number) }}</p> - <h1><a href="{{ .Permalink }}" title="{{ i18n "commons.more_aria" (dict "Title" .Title) }}">{{ partial "PrepareHTML" .Title }}</a></h1> + <h2><a href="{{ .Permalink }}" title="{{ i18n "commons.more_aria" (dict "Title" .Title) }}">{{ partial "PrepareHTML" .Title }}</a></h2> </hgroup> <div class="media"> {{- if .Params.image -}} diff --git a/layouts/researchers/term.html b/layouts/researchers/term.html index cff40c27b912857af449d7d60d9cd9a8a4213f4d..2ad94562d93378396872348260e33c03ae6ebb7a 100644 --- a/layouts/researchers/term.html +++ b/layouts/researchers/term.html @@ -5,7 +5,13 @@ "context" . ) -}} <div class="document-content container"> - {{ partial "papers/papers.html" . }} + <ul class="papers"> + {{ range .Paginator.Pages }} + <li> + {{ partial "papers/paper.html" (dict "paper" . ) }} + </li> + {{ end }} + </ul> {{ partial "commons/pagination.html" . }} </div> {{ end }} diff --git a/layouts/volumes/term.html b/layouts/volumes/term.html index 6f456eb0c4793a88310bc5a5a7fc0b9ac01904f4..72b588c74583c9983ed28d272ba5a1c7da75d442 100644 --- a/layouts/volumes/term.html +++ b/layouts/volumes/term.html @@ -12,11 +12,17 @@ {{- end -}} <div class="container"> + + {{ partial "volumes/document-aside.html" . }} + <div class="content"> {{ partial "volumes/description.html" . }} - {{ partial "volumes/document-aside.html" . }} - {{ partial "volumes/table-contents.html" . }} + {{ partial "volumes/papers.html" . }} </div> + </div> + + {{ partial "blocks/list.html" . }} + </div> {{ end }}