Commit f3f2e0ee authored by Bourdot's avatar Bourdot
Browse files

Landing page : colonne OJS (couverture, galleys, numéro, rubrique) en métadonnées source et OJS

parent e8e6c446
Loading
Loading
Loading
Loading
+14 −0
Changes for resources/javascript/xml_2_html.js: 14 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -298,6 +298,9 @@ window.addEventListener('DOMContentLoaded', (event) => {
    // Appel fonction traitant ensemble notes et figures : 
    bindFootnotesAndImages();

    // Landing page : détails OJS à droite de la page de titre
    placeLandingEntryDetails();

    // Appel fonction pour tableaux déroulants 
    initialiseTableaux();
    
@@ -597,6 +600,17 @@ function bindIndexToggleButtons() {
    });
}

function placeLandingEntryDetails() {
    const details = document.querySelector('.landing_entry_details');
    const titlePage = document.querySelector('.landingPage .title_page');
    if (!details || !titlePage) return;

    const header = document.createElement('div');
    header.className = 'landing_header';
    titlePage.before(header);
    header.append(titlePage, details);
}

function hideHtmlDownloadLinks() {
    document.querySelectorAll('.cmp_download_link, .obj_galley_link, .remote_resource').forEach(function (link) {
        if (link.textContent.trim().toUpperCase().includes('HTML')) {
+184 −0
Changes for resources/styles/landingpage.css: 184 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -2016,3 +2016,187 @@ div[id*="figures"] figure figcaption {
    pointer-events: auto;
}


/* Landing page : colonne de détails OJS (couverture, galleys, numéro…)
   - métadonnées source : .landing_entry_details, placé à droite de la page de titre
   - métadonnées OJS : .entry_details de article_details.tpl */

.landingPage .landing_header {
    display: flex;
    align-items: flex-start;
    gap: 2rem;
    margin-bottom: 2rem;
}

.landingPage .landing_header > .title_page {
    flex: 1 1 auto;
    min-width: 0;
}

:is(.landingPage .landing_entry_details, .obj_article_details .entry_details) {
    flex: 0 0 280px;
    min-width: 0;
    max-width: 280px;
    padding-left: 0;
    border-left: 1px solid #ddd;
    font-family: var(--font-sans, "Noto Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif);
    font-size: 1rem;
    line-height: 1.5;
}

.obj_article_details .entry_details {
    display: block;
    border-left: 1px solid #ddd !important;
}

:is(.landingPage .landing_entry_details, .obj_article_details .entry_details) .item {
    padding: 1.5rem 0 1.5rem 2rem;
}

:is(.landingPage .landing_entry_details, .obj_article_details .entry_details) .item + .item {
    border-top: 1px solid #ddd;
}

:is(.landingPage .landing_entry_details, .obj_article_details .entry_details) .cover_image img {
    display: block;
    width: 100%;
    height: auto;
    margin: 0;
    padding: 0;
    border-radius: 0;
    box-shadow: none;
}

:is(.landingPage .landing_entry_details, .obj_article_details .entry_details) .item.galleys {
    font-size: 1rem;
}

:is(.landingPage .landing_entry_details, .obj_article_details .entry_details) .item.galleys ul {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

:is(.landingPage .landing_entry_details, .obj_article_details .entry_details) .item.galleys li {
    margin: 0;
    padding: 0;
}

:is(.landingPage .landing_entry_details, .obj_article_details .entry_details) .item.galleys a.obj_galley_link {
    display: inline-flex;
    align-items: center;
    gap: 0.4em;
    width: auto;
    padding: 0.3em 0.9em;
    border: 1px solid var(--primary-color, #006798);
    border-radius: 3px;
    background: #fff;
    color: var(--primary-color, #006798);
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 400;
    letter-spacing: normal;
    text-transform: none;
    text-decoration: none;
    line-height: 1.6;
}

:is(.landingPage .landing_entry_details, .obj_article_details .entry_details) .item.galleys a.obj_galley_link::before {
    content: "";
    flex: none;
    width: 1em;
    height: 1em;
    background-color: currentColor;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linejoin='round'%3E%3Cpath d='M6 2.5h8l4.5 4.5v14.5H6z'/%3E%3Cpath d='M14 2.5V7h4.5M9 11h6M9 14h6M9 17h6'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linejoin='round'%3E%3Cpath d='M6 2.5h8l4.5 4.5v14.5H6z'/%3E%3Cpath d='M14 2.5V7h4.5M9 11h6M9 14h6M9 17h6'/%3E%3C/svg%3E") center / contain no-repeat;
}

:is(.landingPage .landing_entry_details, .obj_article_details .entry_details) .item.galleys a.obj_galley_link:hover,
:is(.landingPage .landing_entry_details, .obj_article_details .entry_details) .item.galleys a.obj_galley_link:focus {
    background: var(--primary-color, #006798);
    color: #fff;
}

:is(.landingPage .landing_entry_details, .obj_article_details .entry_details) .sub_item + .sub_item {
    margin-top: 1.5rem;
}

:is(.landingPage .landing_entry_details, .obj_article_details .entry_details) :is(.item, .sub_item) > h2.label {
    margin: 0 0 0.25rem;
    padding: 0;
    border: none;
    background: none;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 400;
    letter-spacing: normal;
    text-transform: none;
    color: #757575;
}

:is(.landingPage .landing_entry_details, .obj_article_details .entry_details) .item .value {
    font-size: 1rem;
    color: var(--text-primary, #1e293b);
}

:is(.landingPage .landing_entry_details, .obj_article_details .entry_details) .item .value a {
    color: var(--primary-color, #006798);
    text-decoration: underline;
}

body.dark :is(.landingPage .landing_entry_details, .obj_article_details .entry_details),
body.dark :is(.landingPage .landing_entry_details, .obj_article_details .entry_details) .item + .item {
    border-color: var(--dark-border, #334155) !important;
}

body.dark :is(.landingPage .landing_entry_details, .obj_article_details .entry_details) .item.galleys a.obj_galley_link {
    border-color: var(--accent-color, #0ea5e9);
    background: transparent;
    color: var(--accent-color, #0ea5e9);
}

body.dark :is(.landingPage .landing_entry_details, .obj_article_details .entry_details) .item.galleys a.obj_galley_link:hover,
body.dark :is(.landingPage .landing_entry_details, .obj_article_details .entry_details) .item.galleys a.obj_galley_link:focus {
    background: var(--accent-color, #0ea5e9);
    color: #fff;
}

body.dark :is(.landingPage .landing_entry_details, .obj_article_details .entry_details) :is(.item, .sub_item) > h2.label {
    color: var(--dark-text-secondary, #cbd5e1);
}

body.dark :is(.landingPage .landing_entry_details, .obj_article_details .entry_details) .item .value {
    color: var(--dark-text-primary, #e2e8f0);
}

body.dark :is(.landingPage .landing_entry_details, .obj_article_details .entry_details) .item .value a {
    color: var(--accent-color, #0ea5e9);
}

@media (max-width: 768px) {
    .landingPage .landing_header {
        flex-direction: column;
        align-items: stretch;
        gap: 0;
    }

    :is(.landingPage .landing_entry_details, .obj_article_details .entry_details) {
        flex: none;
        width: 100%;
        max-width: none;
        border-left: none !important;
        border-top: 1px solid #ddd;
    }

    :is(.landingPage .landing_entry_details, .obj_article_details .entry_details) .item {
        padding-left: 0;
    }

    :is(.landingPage .landing_entry_details, .obj_article_details .entry_details) .cover_image img {
        width: 160px;
    }
}
+37 −0
Changes for templates/LandingPage.tpl: 37 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -94,6 +94,22 @@
    
    <div class="landingPage {if $metadataSource == 'tei'}metadata_tei{else}metadata_pkp{/if}">
        {if $metadataSource == 'tei'}
            <div class="landing_entry_details">
                {if $publication->getLocalizedData('coverImage') || ($issue && $issue->getLocalizedCoverImage())}
                    <div class="item cover_image">
                        {if $publication->getLocalizedData('coverImage')}
                            {assign var="coverImage" value=$publication->getLocalizedData('coverImage')}
                            <img
                                src="{$publication->getLocalizedCoverImageUrl($article->getData('contextId'))|escape}"
                                alt="{$coverImage.altText|escape|default:''}"
                            >
                        {else}
                            <a href="{url page="issue" op="view" path=$issue->getBestIssueId()}">
                                <img src="{$issue->getLocalizedCoverImageUrl()|escape}" alt="{$issue->getLocalizedCoverImageAltText()|escape|default:''}">
                            </a>
                        {/if}
                    </div>
                {/if}
                {if $primaryGalleys}
                    <div class="item galleys">
                        <h2 class="pkp_screen_reader">{translate key="submission.downloads"}</h2>
@@ -118,6 +134,27 @@
                        </ul>
                    </div>
                {/if}
                {if $issue || $section}
                    <div class="item issue">
                        {if $issue}
                            <section class="sub_item">
                                <h2 class="label">{translate key="issue.issue"}</h2>
                                <div class="value">
                                    <a class="title" href="{url page="issue" op="view" path=$issue->getBestIssueId()}">
                                        {$issue->getIssueIdentification()|escape}
                                    </a>
                                </div>
                            </section>
                        {/if}
                        {if $section}
                            <section class="sub_item">
                                <h2 class="label">{translate key="section.section"}</h2>
                                <div class="value">{$section->getLocalizedTitle()|escape}</div>
                            </section>
                        {/if}
                    </div>
                {/if}
            </div>
        {/if}
        {$text}
    </div>