Skip to content

Commit

Permalink
pkp/pkp-lib#4870 Adapt for versioning and publications
Browse files Browse the repository at this point in the history
  • Loading branch information
NateWr committed Feb 18, 2020
1 parent 99b1972 commit 6527922
Show file tree
Hide file tree
Showing 9 changed files with 38 additions and 20 deletions.
2 changes: 1 addition & 1 deletion HealthSciencesThemePlugin.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ public function getDescription() {
*/
public function loadTemplateData($hookName, $args) {
$templateMgr = $args[0];
$request = Application::getRequest();
$request = Application::get()->getRequest();
$context = $request->getContext();

if (!defined('SESSION_DISABLE_INIT')) {
Expand Down
10 changes: 5 additions & 5 deletions templates/frontend/objects/article_details.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -362,18 +362,18 @@
{/if}

{* References *}
{if $parsedCitations->getCount() || $article->getCitations()}
{if $parsedCitations || $publication->getData('citationsRaw')}
<div class="article-details-block article-details-references">
<h2 class="article-details-heading">
{translate key="submission.citations"}
</h2>
<div class="article-details-references-value">
{if $parsedCitations->getCount()}
{iterate from=parsedCitations item=parsedCitation}
{if $parsedCitations}
{foreach from=$parsedCitations item=parsedCitation}
<p>{$parsedCitation->getCitationWithLinks()|strip_unsafe_html}</p>
{/iterate}
{/foreach}
{elseif $article->getCitations()}
{$article->getCitations()|nl2br}
{$publication->getData('citationsRaw')|nl2br}
{/if}
</div>
</div>
Expand Down
4 changes: 2 additions & 2 deletions templates/frontend/objects/article_summary.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* @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=articlePath value=$article->getBestId()}

{if (!$section.hideAuthor && $article->getHideAuthor() == $smarty.const.AUTHOR_TOC_DEFAULT) || $article->getHideAuthor() == $smarty.const.AUTHOR_TOC_SHOW}
{assign var="showAuthor" value=true}
Expand Down Expand Up @@ -87,7 +87,7 @@
{/if}
{/if}
{assign var="hasArticleAccess" value=$hasAccess}
{if ($article->getAccessStatus() == $smarty.const.ARTICLE_ACCESS_OPEN)}
{if $currentContext->getSetting('publishingMode') == $smarty.const.PUBLISHING_MODE_OPEN || $article->getCurrentPublication()->getData('accessStatus') == $smarty.const.ARTICLE_ACCESS_OPEN}
{assign var="hasArticleAccess" value=1}
{/if}
{include file="frontend/objects/galley_link.tpl" parent=$article hasAccess=$hasArticleAccess}
Expand Down
2 changes: 1 addition & 1 deletion templates/frontend/objects/galley_link.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
{assign var="parentId" value=$parent->getBestIssueId()}
{else}
{assign var="page" value="article"}
{assign var="parentId" value=$parent->getBestArticleId()}
{assign var="parentId" value=$parent->getBestId()}
{/if}

{* Get user access flag *}
Expand Down
2 changes: 1 addition & 1 deletion templates/frontend/pages/issueInterstitial.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
{assign var="parentId" value=$parent->getBestIssueId()}
{url op="view" path=$parentId}
{else}
{assign var="parentId" value=$parent->getBestArticleId()}
{assign var="parentId" value=$parent->getBestId()}
{url page="article" op="view" path=$parentId}
{/if}
{/capture}
Expand Down
2 changes: 1 addition & 1 deletion templates/frontend/pages/search.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
{* Results pagination *}
{else}
{iterate from=results item=result}
{include file="frontend/objects/article_summary.tpl" article=$result.publishedArticle journal=$result.journal showDatePublished=true hideGalleys=true}
{include file="frontend/objects/article_summary.tpl" article=$result.publishedSubmission journal=$result.journal showDatePublished=true hideGalleys=true}
{/iterate}
<div class="pagination">
{page_info iterator=$results}
Expand Down
6 changes: 3 additions & 3 deletions templates/frontend/pages/searchAuthorDetails.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,12 @@
<span>{$section->getLocalizedTitle()|escape}</span>
</div>
<div class="author-details-block author-details-article">
<a href="{url journal=$journal->getPath() page="article" op="view" path=$article->getBestArticleId()}">{$article->getLocalizedTitle()|strip_unsafe_html}</a>
<a href="{url journal=$journal->getPath() page="article" op="view" path=$article->getBestId()}">{$article->getLocalizedTitle()|strip_unsafe_html}</a>
</div>
{if (!$issueUnavailable || $article->getAccessStatus() == $smarty.const.ARTICLE_ACCESS_OPEN)}
{if (!$issueUnavailable || $publication->getData('accessStatus') == $smarty.const.ARTICLE_ACCESS_OPEN}}
<div class="author-details-block author-details-galleys">
{foreach from=$article->getGalleys() item=galley name=galleyList}
<a href="{url journal=$journal->getPath() page="article" op="view" path=$article->getBestArticleId()|to_array:$galley->getBestGalleyId()}"
<a href="{url journal=$journal->getPath() page="article" op="view" path=$article->getBestId()|to_array:$galley->getBestGalleyId()}"
class="btn btn-primary">{$galley->getGalleyLabel()|escape}</a>
{/foreach}
</div>
Expand Down
18 changes: 13 additions & 5 deletions templates/plugins/generic/htmlArticleGalley/templates/display.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,27 @@
{* Header wrapper *}
<header class="header_view">

<a href="{url page="article" op="view" path=$article->getBestArticleId()}" class="return">
<a href="{url page="article" op="view" path=$article->getBestId()}" class="return">
<span class="pkp_screen_reader">
{translate key="article.return"}
</span>
</a>

<a href="{url page="article" op="view" path=$article->getBestArticleId()}" class="title">
{$article->getLocalizedTitle()|escape}
{if !$isLatestPublication}
<div class="title" role="alert">
{translate key="submission.outdatedVersion"
datePublished=$galleyPublication->getData('datePublished')|date_format:$dateFormatLong
urlRecentVersion=$parentUrl
}
</div>
{else}
<a href="{url page="article" op="view" path=$article->getBestId()}" class="title">
{$galleyPublication->getLocalizedTitle()|escape}
</a>
{/if}
</header>

<div id="htmlContainer" class="galley_view" style="overflow:visible;-webkit-overflow-scrolling:touch">
<iframe id="htmlGalleyFrame" name="htmlFrame" src="{url page="article" op="download" path=$article->getBestArticleId()|to_array:$galley->getBestGalleyId() inline=true}" allowfullscreen webkitallowfullscreen></iframe>
<iframe id="htmlGalleyFrame" name="htmlFrame" src="{url page="article" op="download" path=$article->getBestId()|to_array:$galley->getBestGalleyId() inline=true}" allowfullscreen webkitallowfullscreen></iframe>
</div>
{call_hook name="Templates::Common::Footer::PageFooter"}
</body>
Expand Down
12 changes: 11 additions & 1 deletion templates/plugins/generic/pdfJsViewer/templates/display.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,19 @@
{translate key="article.return"}
{/if}
</span>
{$title}
{if $isLatestPublication}
{$title|escape}
{/if}
</a>
</div>
{if !$isLatestPublication}
<div class="alert alert-primary" role="alert">
{translate key="submission.outdatedVersion"
datePublished=$galleyPublication->getData('datePublished')|date_format:$dateFormatLong
urlRecentVersion=$parentUrl
}
</div>
{/if}
<div class="pdf-download-button">
<a href="{$pdfUrl}" class="btn" download>
<span class="label">
Expand Down

0 comments on commit 6527922

Please sign in to comment.