Commit c60eff46 authored by Charles Bourdot's avatar Charles Bourdot
Browse files

Meilleure cohabitation templates PKP/Plugin (cf. souci galleys, souci head)

parent 1822330f
Loading
Loading
Loading
Loading
+6 −4
Changes for templates/HTMLGalleyView.tpl: 6 added lines, 4 removed lines.
Original line number Diff line number Diff line
@@ -4,21 +4,23 @@
        <meta charset="{$defaultCharset|escape}">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <title>
            {$currentContext->getLocalizedName()}
            {$currentContext->getLocalizedName()|escape}
        </title>

        {if $cssSideViewUrl}
            <link rel="stylesheet" href="{$cssSideViewUrl}" />
            <link rel="stylesheet" href="{$cssSideViewUrl|escape}" />
        {else}
            <link rel="stylesheet" type="text/css" href="{$assetsPath}styles/xml_2_html.css">
        {/if}

        <script>
            let lang = "{$currentLocale}"
            let lang = "{$currentLocale|escape:"javascript"}";
        </script>
        <script src="{$assetsPath}javascript/xml_2_html.js"></script>
        <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/styles/github-dark.min.css">
        <script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/highlight.min.js"></script>
        <script>hljs.highlightAll();</script>
    	<script id="MathJax-script" src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"></script>
        {$dcMetas}
    </head>
    <body>
    {if $breadcrumbOp == 'catalog'}
+63 −26
Changes for templates/LandingPage.tpl: 63 added lines, 26 removed lines.
Original line number Diff line number Diff line
{**
* templates/frontend/pages/article.tpl
 * plugins/generic/xml2html/templates/LandingPage.tpl
 *
* Copyright (c) 2014-2021 Simon Fraser University
* Copyright (c) 2003-2021 John Willinsky
* Distributed under the GNU GPL v3. For full terms see the file docs/COPYING.
 * Article landing page with the full text rendered from the XML zip galley.
 * Adapted from templates/frontend/pages/article.tpl.
 *
* @brief Display the page to view an article with all of it's details.
*
* @uses $article Submission This article
* @uses $publication Publication The publication being displayed
* @uses $firstPublication Publication The first published version of this article
* @uses $currentPublication Publication The most recently published version of this article
* @uses $issue Issue The issue this article is assigned to
* @uses $section Section The journal section this article is assigned to
* @uses $journal Journal The journal currently being viewed.
* @uses $primaryGalleys array List of article galleys that are not supplementary or dependent
* @uses $supplementaryGalleys array List of article galleys that are supplementary
 * @uses $metadataSource string 'tei' to replace OJS metadata by the source's, keeping the galley links
 * @uses $text string HTML rendering of the galley
 * @uses $assetsPath string URL of the plugin's resources directory
 * @uses $cssLandingPageUrl string|null URL of the journal's custom CSS
 *
 * @hook Templates::Article::Footer::PageFooter []
 *}

{include file="frontend/components/headerHead.tpl" pageTitleTranslated=$article->getCurrentPublication()->getLocalizedFullTitle(null, 'html')|strip_unsafe_html} 
<!DOCTYPE html>
<html lang="{$currentLocale|replace:"_":"-"}" xml:lang="{$currentLocale|replace:"_":"-"}">
<head>
	<meta charset="{$defaultCharset|escape}">
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	<title>
		{$publication->getLocalizedFullTitle(null, 'html')|strip_tags}
		{if $currentContext}| {$currentContext->getLocalizedName()|escape}{/if}
	</title>
	{load_header context="frontend"}
	<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/styles/github-dark.min.css">
	{if $loadThemeStyles}
		{load_stylesheet context="frontend"}
	{/if}
	{if $cssLandingPageUrl}
		<link rel="stylesheet" href="{$cssLandingPageUrl|escape}" />
	{else}
		<link rel="stylesheet" type="text/css" href="{$assetsPath}styles/landingpage.css">
	{/if}
</head>
<body class="pkp_page_{$requestedPage|escape|default:"index"} pkp_op_{$requestedOp|escape|default:"index"}" dir="{$currentLocaleLangDir|escape|default:"ltr"}">


<!-- <header class="pkp_structure_head" id="headerNavigationContainer" role="banner">
<header class="pkp_structure_head" id="headerNavigationContainer" role="banner">
			<div class="pkp_head_wrapper">

				<div class="pkp_site_name_wrapper">
@@ -54,7 +67,7 @@
				</div>

			</div>
		</header> -->
		</header>

    {if $section}
    {include file="frontend/components/breadcrumbs_article.tpl" currentTitle=$section->getLocalizedTitle()}
@@ -63,25 +76,49 @@
    {/if}

<div class="page page_article">
    {if $metadataSource == 'pkp'}
    {if $metadataSource != 'tei'}
        {include file="frontend/objects/article_details.tpl"}
    {/if}
    <script>
        let lang = "{$currentLocale}"
        let lang = "{$currentLocale|escape:"javascript"}";
        let statsApiUrl = "{$statsApiUrl|escape:"javascript"}";
    </script>
    <script src="{$assetsPath}javascript/xml_2_html.js">
    </script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/highlight.min.js"></script>
    <script>hljs.highlightAll();</script>
    <script id="MathJax-script" src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js">
    </script>
    
    
    
    {if $cssLandingPageUrl}
    <link rel="stylesheet" href="{$cssLandingPageUrl}" />
    {else}
    <link rel="stylesheet" type="text/css" href="{$assetsPath}styles/landingpage.css">
    {/if}
    <div class="landingPage {if $metadataSource == 'tei'}metadata_tei{else}metadata_pkp{/if}">
        {if $metadataSource == 'tei'}
            {if $primaryGalleys}
                <div class="item galleys">
                    <h2 class="pkp_screen_reader">{translate key="submission.downloads"}</h2>
                    <ul class="value galleys_links">
                        {foreach from=$primaryGalleys item=galley}
                            <li>
                                {include file="frontend/objects/galley_link.tpl" parent=$article publication=$publication galley=$galley purchaseFee=$currentJournal->getData('purchaseArticleFee') purchaseCurrency=$currentJournal->getData('currency')}
                            </li>
                        {/foreach}
                    </ul>
                </div>
            {/if}
            {if $supplementaryGalleys}
                <div class="item galleys">
                    <h2 class="pkp_screen_reader">{translate key="submission.additionalFiles"}</h2>
                    <ul class="value supplementary_galleys_links">
                        {foreach from=$supplementaryGalleys item=galley}
                            <li>
                                {include file="frontend/objects/galley_link.tpl" parent=$article publication=$publication galley=$galley isSupplementary="1"}
                            </li>
                        {/foreach}
                    </ul>
                </div>
            {/if}
        {/if}
        {$text}
    </div>
        {call_hook name="Templates::Article::Footer::PageFooter"}
@@ -90,4 +127,4 @@
    <!-- .page -->

    
    {include file="frontend/components/footer.tpl"}
 No newline at end of file
    {include file=$footerTemplate}
 No newline at end of file
+58 −8
Changes for templates/LandingPageBook.tpl: 58 added lines, 8 removed lines.
Original line number Diff line number Diff line
@@ -4,10 +4,52 @@
    {assign var=pageTitle value=$publishedSubmission->getCurrentPublication()->getLocalizedFullTitle()}
{/if}

{include file="frontend/components/header.tpl" pageTitleTranslated=$pageTitle}
<!DOCTYPE html>
<html lang="{$currentLocale|replace:"_":"-"}" xml:lang="{$currentLocale|replace:"_":"-"}">
<head>
	<meta charset="{$defaultCharset|escape}">
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	<title>
		{$pageTitle|strip_tags}
		{if $currentContext}| {$currentContext->getLocalizedName()|escape}{/if}
	</title>
	{load_header context="frontend"}
	{if $loadThemeStyles}
		{load_stylesheet context="frontend"}
	{/if}
	{if $cssLandingPageUrl}
		<link rel="stylesheet" href="{$cssLandingPageUrl|escape}" />
	{else}
		<link rel="stylesheet" type="text/css" href="{$assetsPath}styles/landingpage.css">
	{/if}
</head>
<body class="pkp_page_{$requestedPage|escape|default:"index"} pkp_op_{$requestedOp|escape|default:"index"}" dir="{$currentLocaleLangDir|escape|default:"ltr"}">

<header class="pkp_structure_head" id="headerNavigationContainer" role="banner">
	<div class="pkp_head_wrapper">
		<div class="pkp_site_name_wrapper">
			<div class="pkp_site_name">
				{capture assign="homeUrl"}
					{url page="index" router=$smarty.const.ROUTE_PAGE}
				{/capture}
				{if $displayPageHeaderLogo}
					<a href="{$homeUrl}" class="is_img">
						<img src="{$publicFilesDir}/{$displayPageHeaderLogo.uploadName|escape:"url"}" width="{$displayPageHeaderLogo.width|escape}" height="{$displayPageHeaderLogo.height|escape}" {if $displayPageHeaderLogo.altText != ''}alt="{$displayPageHeaderLogo.altText|escape}"{/if} />
					</a>
				{elseif $displayPageHeaderTitle}
					<a href="{$homeUrl}" class="is_text">{$displayPageHeaderTitle|escape}</a>
				{else}
					<a href="{$homeUrl}" class="is_img">
						<img src="{$baseUrl}/templates/images/structure/logo.png" alt="{$applicationName|escape}" title="{$applicationName|escape}" width="180" height="90" />
					</a>
				{/if}
			</div>
		</div>
	</div>
</header>

<div class="page page_book">
    {if $metadataSource == 'pkp'}
    {if $metadataSource != 'tei'}
        {if $isChapterRequest}
            {include file="frontend/objects/chapter.tpl" monograph=$publishedSubmission}
        {else}
@@ -15,22 +57,30 @@
        {/if}
    {/if}
    <script>
        let lang = "{$currentLocale}"
        let lang = "{$currentLocale|escape:"javascript"}";
    </script>
    <script src="{$assetsPath}javascript/xml_2_html.js">
    </script>
    <script id="MathJax-script" src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js">
    </script>

    {if $cssLandingPageUrl}
    <link rel="stylesheet" href="{$cssLandingPageUrl}" />
    <div class="landingPage {if $metadataSource == 'tei'}metadata_tei{else}metadata_pkp{/if}">
        {if $metadataSource == 'tei'}
            {if $isChapterRequest}
                {pluck_files assign=publicationFiles files=$availableFiles by="chapter" value=$chapter->getId()}
            {else}
    <link rel="stylesheet" type="text/css" href="{$assetsPath}styles/landingpage.css">
                {pluck_files assign=publicationFiles files=$availableFiles by="chapter" value=0}
            {/if}
            {if $publicationFiles|@count || (!$isChapterRequest && $remotePublicationFormats|@count)}
                <div class="item files">
                    <h2 class="pkp_screen_reader">{translate key="submission.downloads"}</h2>
                    {include file="frontend/components/publicationFormats.tpl" monograph=$publishedSubmission publicationFiles=$publicationFiles}
                </div>
            {/if}
        {/if}
    <div class="landingPage {if $metadataSource == 'tei'}metadata_tei{else}metadata_pkp{/if}">
        {$text}
    </div>
    {call_hook name="Templates::Catalog::Book::Footer::PageFooter"}
</div>

{include file="frontend/components/footer.tpl"}
{include file=$footerTemplate}

templates/footer.tpl

0 → 100644
+32 −0
Changes for templates/footer.tpl: 32 added lines, 0 removed lines.
Original line number Diff line number Diff line
{**
 * plugins/generic/xml2html/templates/footer.tpl
 *
 * Footer of the landing pages. Unlike frontend/components/footer.tpl, it does not
 * close the theme's structure divs, which the landing pages do not open.
 *
 * @hook Templates::Common::Footer::PageFooter []
 *}
<div class="pkp_structure_footer_wrapper" role="contentinfo">
	<a id="pkp_content_footer"></a>

	<div class="pkp_structure_footer">

		{if $pageFooter}
			<div class="pkp_footer_content">
				{$pageFooter}
			</div>
		{/if}

		<div class="pkp_brand_footer">
			<a href="{url page="about" op="aboutThisPublishingSystem"}">
				<img alt="{translate key="about.aboutThisPublishingSystem"}" src="{$baseUrl}/{$brandImage}">
			</a>
		</div>
	</div>
</div><!-- pkp_structure_footer_wrapper -->

{load_script context="frontend"}

{call_hook name="Templates::Common::Footer::PageFooter"}
</body>
</html>
+34 −15
Changes for templates/settingsForm.tpl: 34 added lines, 15 removed lines.
Original line number Diff line number Diff line
{**
 * plugins/generic/xml2html/templates/settingsForm.tpl
 *
 * Settings of the XML2HTML plugin. Submitted with FormData because
 * PKP's AjaxFormHandler does not send file inputs.
 *}
{capture assign="saveError"}{translate key="plugins.generic.xml2html.settings.saveError"}{/capture}
<script>
    $(function() {ldelim}
        $('#xml2htmlSettingsForm').on('submit', function(e) {ldelim}
            e.preventDefault();

            var formData = new FormData(this);
            var $form = $(this);

            $.ajax({ldelim}
                url: $(this).attr('action'),
                url: $form.attr('action'),
                type: 'POST',
                data: formData,
                data: new FormData(this),
                processData: false,
                contentType: false,
                dataType: 'json',
                success: function(response) {ldelim}
                    if (response.status) {ldelim}
                        location.reload();
                    {rdelim} else {ldelim}
                        // Form re-rendered with its validation errors
                        $form.replaceWith(response.content);
                    {rdelim}
                {rdelim},
                error: function() {ldelim}
                    alert('Error saving settings.');
                    alert('{$saveError|escape:"javascript"}');
                {rdelim}
            {rdelim});
        {rdelim});
@@ -25,8 +37,9 @@
<form class="pkp_form" id="xml2htmlSettingsForm" method="post" enctype="multipart/form-data"
      action="{url router=$smarty.const.ROUTE_COMPONENT op="manage" category="generic" plugin=$pluginName verb="settings" save=true}">
    <div id="xml2htmlSettings">
    <h2>{translate key="plugins.generic.xml2html.settingsFor"} {$currentContext->getLocalizedName()}</h2>
        <h2>{translate key="plugins.generic.xml2html.settingsFor"} {$currentContext->getLocalizedName()|escape}</h2>
        {csrf}
        {include file="common/formErrors.tpl"}

        {fbvFormSection label="plugins.generic.xml2html.format"}
            <select name="format">
@@ -42,16 +55,23 @@
            </label>
        {/fbvFormSection}

        {fbvFormSection}
            <label>
                {translate key="plugins.generic.xml2html.loadThemeStyles"}
                <input type="checkbox" name="loadThemeStyles" value="1" {if $loadThemeStyles}checked="checked"{/if} />
            </label>
        {/fbvFormSection}

        {fbvFormSection label="plugins.generic.xml2html.cssLandingPage"}
            <input type="file" name="cssLandingPageFile" accept=".css" />
            {if $cssLandingPageUrl}
                <p>
                    {translate key="plugins.generic.xml2html.customCss.current"}
                    <a href="{$cssLandingPageUrl}" target="_blank">{translate key="plugins.generic.xml2html.customCss.view"}</a> | 
                    <span>
                    <a href="{$cssLandingPageUrl|escape}" target="_blank" rel="noopener">{translate key="plugins.generic.xml2html.customCss.view"}</a> |
                    <label>
                        {translate key="plugins.generic.xml2html.customCss.delete"}
                        <input type="checkbox" name="deleteCssLandingPage" value="1" />
                    </span>
                    </label>
                </p>
            {/if}
        {/fbvFormSection}
@@ -61,11 +81,11 @@
            {if $cssSideViewUrl}
                <p>
                    {translate key="plugins.generic.xml2html.customCss.current"}
                    <a href="{$cssSideViewUrl}" target="_blank">{translate key="plugins.generic.xml2html.customCss.view"}</a> | 
                    <span>
                    <a href="{$cssSideViewUrl|escape}" target="_blank" rel="noopener">{translate key="plugins.generic.xml2html.customCss.view"}</a> |
                    <label>
                        {translate key="plugins.generic.xml2html.customCss.delete"}
                        <input type="checkbox" name="deleteCssSideView" value="1" />
                    </span>
                    </label>
                </p>
            {/if}
        {/fbvFormSection}
@@ -73,15 +93,14 @@
        {fbvFormSection label="plugins.generic.xml2html.metadata"}
            <select name="metadataSource">
                <option value="pkp" {if $metadataSource=='pkp'}selected{/if}>
                    Métadonnées OJS
                    {translate key="plugins.generic.xml2html.metadata.pkp"}
                </option>
                <option value="tei" {if $metadataSource=='tei'}selected{/if}>
                    Métadonnées source
                    {translate key="plugins.generic.xml2html.metadata.source"}
                </option>
            </select>
        {/fbvFormSection}

        {fbvFormButtons submitText="common.save"}
        
    </div>
</form>