Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

3.5.0 compatibility #107

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion PragmaThemePlugin.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ public function addSiteWideData($hookname, $args) {
$orcidImageUrl = $this->getPluginPath() . '/templates/images/orcid.png';

if ($request->getContext()) {
$templateMgr->assign('pragmaHomepageImage', $journal->getLocalizedSetting('homepageImage'));
$templateMgr->assign('pragmaHomepageImage', $journal->getLocalizedData('homepageImage'));
}

$templateMgr->assign(array(
Expand Down
5 changes: 4 additions & 1 deletion resources/less/import.less
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
*
*/

// styleshets
// stylesheets
@import "fonts";
@import "variables";
@import "general";
Expand All @@ -31,3 +31,6 @@
@import "components/modal";
@import "components/recent-issues";
@import "components/catalog-category";

@import "pages/orcid";
@import "pages/masthead";
34 changes: 34 additions & 0 deletions resources/less/pages/masthead.less
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
/*
* @file less/pages/masthead.less
*
* Copyright (c) 2025 Simon Fraser University
* Copyright (c) 2025 John Willinsky
* Distributed under the GNU GPL v3. For full terms see the file docs/COPYING.
*
* @brief Styles applying to the masthead and editorial history page
* @link templates/frontend/pages/editorialMasthead.tpl
* @link templates/frontend/pages/editorialHistory.tpl
*/

.page_masthead {
.user_listing {
list-style-type: none;
padding: 2em 0;

li {
margin-bottom: 35px;
}

li > span {
display: block;
}

.name {
font-weight: bold;
}

.orcid_icon {
margin-left: 5px;
}
}
}
17 changes: 17 additions & 0 deletions resources/less/pages/orcid.less
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/**
* @file less/pages/orcid.less
*
* Copyright (c) 2025 Simon Fraser University
* Copyright (c) 2025 John Willinsky
* Distributed under the GNU GPL v2. For full terms see the file docs/COPYING.
*
* @brief Stylesheet for ORCID pages (orcidAbout.tpl, orcidVerify.tpl) and buttons
*
*/

.orcid_icon {
display: inline-block;
margin-right: 5px;
width: 24px;
height: 24px;
}
12 changes: 6 additions & 6 deletions templates/frontend/components/registrationFormContexts.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,11 @@
</legend>
<div class="form-check">
{foreach from=$readerUserGroups[$contextId] item=userGroup}
{if $userGroup->getPermitSelfRegistration()}
{assign var="userGroupId" value=$userGroup->getId()}
{if $userGroup->permitSelfRegistration}
{assign var="userGroupId" value=$userGroup->id}
<input type="checkbox" class="form-check-input" id="readerGroup[{$userGroupId}]" name="readerGroup[{$userGroupId}]"{if in_array($userGroupId, $userGroupIds)} checked="checked"{/if}>
<label for="readerGroup[{$userGroupId}]" class="form-check-label">
{$userGroup->getLocalizedName()}
{$userGroup->getLocalizedData('name')|escape}
</label>
{if in_array($userGroupId, $userGroupIds)}
{assign var=isSelected value=true}
Expand All @@ -57,11 +57,11 @@
</div>
<div class="form-check">
{foreach from=$reviewerUserGroups[$contextId] item=userGroup}
{if $userGroup->getPermitSelfRegistration()}
{assign var="userGroupId" value=$userGroup->getId()}
{if $userGroup->permitSelfRegistration}
{assign var="userGroupId" value=$userGroup->id}
<input type="checkbox" class="form-check-input" id="reviewerGroup[{$userGroupId}]" name="reviewerGroup[{$userGroupId}]"{if in_array($userGroupId, $userGroupIds)} checked="checked"{/if}>
<label for="reviewerGroup[{$userGroupId}]" class="form-check-label">
{$userGroup->getLocalizedName()}
{$userGroup->getLocalizedData('name')|escape}
</label>
{if in_array($userGroupId, $userGroupIds)}
{assign var=isSelected value=true}
Expand Down
16 changes: 8 additions & 8 deletions templates/frontend/objects/announcement_summary.tpl
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{**
* templates/frontend/objects/announcement_summary.tpl
*
* Copyright (c) 2014-2020 Simon Fraser University
* Copyright (c) 2003-2020 John Willinsky
* Copyright (c) 2014-2025 Simon Fraser University
* Copyright (c) 2003-2025 John Willinsky
* Distributed under the GNU GPL v2. For full terms see the file docs/COPYING.
*
* @brief Display a summary view of an announcement
Expand All @@ -15,21 +15,21 @@
{/if}

<{$heading}>
<a href="{url router=$smarty.const.ROUTE_PAGE page="announcement" op="view" path=$announcement->getId()}">
{$announcement->getLocalizedTitle()|escape}
<a href="{url router=$smarty.const.ROUTE_PAGE page="announcement" op="view" path=$announcement->id}">
{$announcement->getLocalizedData('title')|escape}
</a>
</{$heading}>
<div class="announcement__date">
{$announcement->getDatePosted()|date_format:$dateFormatShort}
{$announcement->datePosted|date_format:$dateFormatShort}
</div>
<div class="announcement__desc">
{$announcement->getLocalizedDescriptionShort()|strip_unsafe_html}
{$announcement->getLocalizedData('descriptionShort')|strip_unsafe_html}
</div>
<a href="{url router=$smarty.const.ROUTE_PAGE page="announcement" op="view" path=$announcement->getId()}" class="btn btn-secondary">
<a href="{url router=$smarty.const.ROUTE_PAGE page="announcement" op="view" path=$announcement->id}" class="btn btn-secondary">
<span aria-hidden="true" role="presentation">
{translate key="common.readMore"}
</span>
<span class="visually-hidden">
{translate key="common.readMoreWithTitle" title=$announcement->getLocalizedTitle()|escape}
{translate key="common.readMoreWithTitle" title=$announcement->getLocalizedData('title')|escape}
</span>
</a>
24 changes: 13 additions & 11 deletions templates/frontend/objects/article_details.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* Templates::Article::Main
* Templates::Article::Details
*
* @uses $article Article This article
* @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
Expand Down Expand Up @@ -129,14 +129,16 @@
{strip}
<li>
{$authorString->getFullName()|escape}
{if $authorString->getOrcid()}
<a href="{$authorString->getOrcid()|escape}">
{if $orcidIcon}
{$orcidIcon}
{else}
<img src="{$baseUrl}/{$orcidImageUrl}">
{/if}
</a>
{if $authorString->getData('orcid')}
{if $author->getData('orcidAccessToken')}
<a href="{$authorString->getData('orcid')|escape}">
{if $orcidIcon}
{$orcidIcon}
{else}
<img src="{$baseUrl}/{$orcidImageUrl}">
{/if}
</a>
{/if}
{/if}
</li>
{/strip}{if !$smarty.foreach.authors.last}, {/if}
Expand All @@ -152,7 +154,7 @@
{else}
{translate key="user.affiliation"}
{/if}
</button>
</button>
</p>
<div class="collapse metadata" id="authorAffiliations">
{foreach from=$authors item=author}
Expand All @@ -163,7 +165,7 @@
<a class="article__rorImage" href="{$author->getData('rorId')|escape}">{$rorIdIcon}</a>
{/if}
<br><br>
</div>
</div>
{/foreach}
</div>
{/if}
Expand Down
9 changes: 5 additions & 4 deletions templates/frontend/objects/article_summary.tpl
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{**
* templates/frontend/objects/article_summary.tpl
*
* Copyright (c) 2014-2020 Simon Fraser University
* Copyright (c) 2003-2020 John Willinsky
* Copyright (c) 2014-2025 Simon Fraser University
* Copyright (c) 2003-2025 John Willinsky
* Distributed under the GNU GPL v2. For full terms see the file docs/COPYING.
*
* @brief View of an Article summary which is shown within a list of articles.
Expand All @@ -15,9 +15,10 @@
* @uses $hideGalleys bool Hide the article galleys for this article?
* @uses $primaryGenreIds array List of file genre ids for primary file types
*}
{assign var=articlePath value=$article->getBestArticleId()}
{assign var="publication" value=$article->getCurrentPublication()}

{assign var=articlePath value=$publication->getData('urlPath')|default:$article->getId()}

{if (!$section.hideAuthor && $publication->getData('hideAuthor') == \APP\submission\Submission::AUTHOR_TOC_DEFAULT) || $publication->getData('hideAuthor') == \APP\submission\Submission::AUTHOR_TOC_SHOW}
{assign var="showAuthor" value=true}
{/if}
Expand All @@ -39,7 +40,7 @@
{foreach from=$article->getGalleys() item=galley}
{if $primaryGenreIds}
{assign var="file" value=$galley->getFile()}
{if !$galley->getRemoteUrl() && !($file && in_array($file->getGenreId(), $primaryGenreIds))}
{if !$galley->getData('urlRemote') && !($file && in_array($file->getGenreId(), $primaryGenreIds))}
{continue}
{/if}
{/if}
Expand Down
13 changes: 9 additions & 4 deletions templates/frontend/objects/galley_link.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,16 @@
{assign var="path" value=$parentId|to_array:$galley->getBestGalleyId()}
{else}
{assign var="page" value="article"}
{assign var="parentId" value=$parent->getBestArticleId()}
{if $publication && $publication->getId() !== $parent->getData('currentPublicationId')}
{assign var="path" value=$parentId|to_array:"version":$publication->getId():$galley->getBestGalleyId()}
{if $publication}
{if $publication->getId() !== $parent->getData('currentPublicationId')}
{* Get a versioned link if we have an older publication *}
{assign var="path" value=$parent->getBestId()|to_array:"version":$publication->getId():$galley->getBestGalleyId()}
{else}
{assign var="parentId" value=$publication->getData('urlPath')|default:$article->getId()}
{assign var="path" value=$parentId|to_array:$galley->getBestGalleyId()}
{/if}
{else}
{assign var="path" value=$parentId|to_array:$galley->getBestGalleyId()}
{assign var="path" value=$parent->getBestId()|to_array:$galley->getBestGalleyId()}
{/if}
{/if}

Expand Down
4 changes: 2 additions & 2 deletions templates/frontend/pages/about.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@
{include file="frontend/components/editLink.tpl" page="management" op="settings" path="context" anchor="masthead" sectionTitleKey="about.aboutContext"}
</header>
<div>
{$currentContext->getLocalizedSetting('description')}
{$currentContext->getLocalizedData('description')}
<hr>
{$currentContext->getLocalizedSetting('about')}
{$currentContext->getLocalizedData('about')}
</div>
</div>
</div>
Expand Down
16 changes: 8 additions & 8 deletions templates/frontend/pages/announcement.tpl
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
{**
* templates/frontend/pages/announcements.tpl
*
* Copyright (c) 2014-2020 Simon Fraser University
* Copyright (c) 2003-2020 John Willinsky
* Copyright (c) 2014-2025 Simon Fraser University
* Copyright (c) 2003-2025 John Willinsky
* Distributed under the GNU GPL v2. For full terms see the file docs/COPYING.
*
* @brief Display the page which represents a single announcement
*
* @uses $announcement Announcement The announcement to display
*}
{include file="frontend/components/header.tpl" pageTitleTranslated=$announcement->getLocalizedTitle()|escape}
{include file="frontend/components/header.tpl" pageTitleTranslated=$announcement->getLocalizedData('title')|escape}

<main class="container main__content" id="main">
<div class="row">
Expand All @@ -19,17 +19,17 @@
<header class="main__header">
<p class="metadata">{translate key="announcement.announcements"}</p>
<h1 class="main__title">
<span>{$announcement->getLocalizedTitle()|escape}</span>
<span>{$announcement->getLocalizedData('title')|escape}</span>
</h1>
</header>
<p>
{$announcement->getDatePosted()|date_format:$dateFormatShort}
{$announcement->datePosted|date_format:$dateFormatShort}
</p>
<div>
{if $announcement->getLocalizedDescription()}
{$announcement->getLocalizedDescription()|strip_unsafe_html}
{if $announcement->getLocalizedData('description')}
{$announcement->getLocalizedData('description')|strip_unsafe_html}
{else}
{$announcement->getLocalizedDescriptionShort()|strip_unsafe_html}
{$announcement->getLocalizedData('descriptionShort')|strip_unsafe_html}
{/if}
</div>
</article>
Expand Down
4 changes: 2 additions & 2 deletions templates/frontend/pages/article.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
*
* @brief Display the page to view an article with all of it's details.
*
* @uses $article Article This article
* @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
Expand All @@ -17,7 +17,7 @@
* @uses $primaryGalleys array List of article galleys that are not supplementary or dependent
* @uses $supplementaryGalleys array List of article galleys that are supplementary
*}
{include file="frontend/components/header.tpl" pageTitleTranslated=$article->getLocalizedTitle()|escape}
{include file="frontend/components/header.tpl" pageTitleTranslated=$article->getLocalizedData('title')|escape}

<main class="container main__content" id="main">
<div class="row">
Expand Down
62 changes: 62 additions & 0 deletions templates/frontend/pages/editorialHistory.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
{**
* templates/frontend/pages/editorialHistory.tpl
*
* Copyright (c) 2025 Simon Fraser University
* Copyright (c) 2025 John Willinsky
* Distributed under the GNU GPL v3. For full terms see the file docs/COPYING.
*
* @brief Display context's editorial history page.
*
*}
{include file="frontend/components/header.tpl" pageTitle="common.editorialHistory"}

<main class="container main__content page_masthead" id="main">
<div class="row">
<div class="offset-md-1 col-md-10 offset-lg-2 col-lg-8">
<header class="main__header">
<h1 class="main__title">
<span>{translate key="common.editorialHistory.page"}</span>
</h1>
</header>

<p>{translate key="common.editorialHistory.page.description"}</p>
{foreach from=$mastheadRoles item="mastheadRole"}
{if array_key_exists($mastheadRole->id, $mastheadUsers)}
<h2>{$mastheadRole->getLocalizedData('name')|escape}</h2>
<ul class="user_listing" role="list">
{foreach from=$mastheadUsers[$mastheadRole->id] item="mastheadUser"}
<li>
{strip}
<span class="date_start">
{foreach name="services" from=$mastheadUser['services'] item="service"}
{translate key="common.fromUntil" from=$service['dateStart'] until=$service['dateEnd']}
{if !$smarty.foreach.services.last}{translate key="common.commaListSeparator"}{/if}
{/foreach}
</span>
<span class="name">
{$mastheadUser['user']->getFullName()|escape}
{if $mastheadUser['user']->getData('orcid') && $mastheadUser['user']->getData('orcidAccessToken')}
<span class="orcid">
<a href="{$mastheadUser['user']->getData('orcid')|escape}" target="_blank" aria-label="{translate key="common.editorialHistory.page.orcidLink" name=$mastheadUser['user']->getFullName()|escape}">
{$orcidIcon}
</a>
</span>
{/if}
</span>
{if !empty($mastheadUser['user']->getLocalizedData('affiliation'))}
<span class="affiliation">{$mastheadUser['user']->getLocalizedData('affiliation')|escape}</span>
{/if}
{/strip}
</li>
{/foreach}
</ul>
{/if}
{/foreach}

{include file="frontend/components/editLink.tpl" page="management" op="settings" path="context" anchor="masthead" sectionTitleKey="common.editorialHistory"}
{$currentContext->getLocalizedData('editorialHistory')}
</div>
</div>
</main>

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