Commit 0c0bcb5c authored by Charles Bourdot's avatar Charles Bourdot
Browse files

Ajout bouton retour vue de lecture

parent 9aff7867
Loading
Loading
Loading
Loading
+8 −0
Changes for XML2HTMLPlugin.php: 8 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -171,6 +171,7 @@ class XML2HTMLPlugin extends GenericPlugin
        $templateMgr->assign('text', $html);
        $templateMgr->assign('cssLandingPageUrl', $this->getCssFileUrl($this->getRequest(), 'cssLandingPageFile'));
        $templateMgr->assign('cssSideViewUrl', $this->getCssFileUrl($this->getRequest(), 'cssSideViewFile'));
        $templateMgr->assign('metadataUrl', $this->getMetadataUrl($submissionId, $op));
        $templateMgr->display($this->getTemplateResource('HTMLGalleyView.tpl'));
    }

@@ -217,6 +218,13 @@ class XML2HTMLPlugin extends GenericPlugin

    }

    private function getMetadataUrl(int $submissionId, string $op): string
    {
        $request = $this->getRequest();
        $page = $op === 'catalog' ? 'catalog' : 'article';
        return $request->url(null, $page, 'view', [$submissionId]);
    }

    /**
     * get HTML file path from its zip one
     * exemple : a/b/c/1234.zip -> ojs/files/dir/a/b/c/1234/1234.html
+3 −0
Changes for locale/en/locale.po: 3 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -37,3 +37,6 @@ msgstr "Settings for"

msgid "plugins.generic.xml2html.metadata"
msgstr "Metadata's source"

msgid "plugins.generic.xml2html.backToMetadata"
msgstr "Back to article page"
 No newline at end of file
+3 −0
Changes for locale/fr/locale.po: 3 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -37,3 +37,6 @@ msgstr "Paramétrage de la revue"

msgid "plugins.generic.xml2html.metadata"
msgstr "Source des métadonnées"

msgid "plugins.generic.xml2html.backToMetadata"
msgstr "Retour à la page de l'article"
 No newline at end of file
+39 −0
Changes for resources/styles/xml_2_html.css: 39 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -129,6 +129,45 @@ body.dark #moon:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.sideview-back-btn {
    position: fixed;
    top: 10px;
    right: 50px;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #fff;
    border: 1px solid #ccc;
    color: #333;
    font-size: 1.25rem;
    line-height: 1;
    text-decoration: none;
    cursor: pointer;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

.sideview-back-btn:hover,
.sideview-back-btn:focus {
    background: #f0f0f0;
    color: #000;
}

body.dark .sideview-back-btn {
    background: var(--dark-theme-bg);
    border-color: var(--dark-border);
    color: var(--dark-theme-txt);
}

body.dark .sideview-back-btn:hover,
body.dark .sideview-back-btn:focus {
    background-color: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.wrap {
    padding-top: 42px;
    min-height: 100vh;
+3 −0
Changes for templates/HTMLGalleyView.tpl: 3 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -21,6 +21,9 @@
        {$dcMetas}
    </head>
    <body>
    {if $metadataUrl}
        <a href="{$metadataUrl}" class="sideview-back-btn" title="{translate key="plugins.generic.xml2html.backToMetadata"}" aria-label="{translate key="plugins.generic.xml2html.backToMetadata"}">&#10005;</a>
    {/if}
    <div class="page {if $metadataSource == 'tei'}metadata_tei{else}metadata_pkp{/if}">
        {$text}
    </div>