Skip to content

Commit

Permalink
Support formatted text in publication title & reduce use of getCurren…
Browse files Browse the repository at this point in the history
…tPublication
  • Loading branch information
Vitaliy-1 committed Feb 28, 2023
1 parent 654f4e1 commit 74094c7
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 8 deletions.
6 changes: 6 additions & 0 deletions resources/less/components/article.less
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,12 @@
font-weight: 400;
}

.article__subtitle {
display: block;
font-size: smaller;
margin-top: 0.25em;
}

.article__img {
margin: 0 0 2.5vh 0;
min-width: 100%;
Expand Down
4 changes: 4 additions & 0 deletions resources/less/components/metadata.less
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,7 @@
text-decoration: none;
}
}

.subtitle {
margin-top: 0;
}
8 changes: 7 additions & 1 deletion templates/frontend/objects/article_details.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,15 @@

{* Article title *}
<h1 class="main__title">
{$publication->getLocalizedFullTitle()|escape}
{$publication->getLocalizedTitle(null, 'html')|strip_unsafe_html}
</h1>

{if $publication->getLocalizedData('subtitle')}
<h2 class="subtitle">
{$publication->getLocalizedSubTitle(null, 'html')|strip_unsafe_html}
</h2>
{/if}

{* DOI *}
{foreach from=$pubIdPlugins item=pubIdPlugin}
{if $pubIdPlugin->getPubIdType() != 'doi'}
Expand Down
15 changes: 10 additions & 5 deletions templates/frontend/objects/article_summary.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -16,20 +16,25 @@
* @uses $primaryGenreIds array List of file genre ids for primary file types
*}
{assign var=articlePath value=$article->getBestArticleId()}
{assign var="publication" value=$article->getCurrentPublication()}

{if (!$section.hideAuthor && $article->getHideAuthor() == $smarty.const.AUTHOR_TOC_DEFAULT) || $article->getHideAuthor() == $smarty.const.AUTHOR_TOC_SHOW}
{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}

<article class="row article">
<div class="col-sm-{if $requestedPage == "catalog"}12{else}8{/if}">
<h4 class="article__title">
<a {if $journal}href="{url journal=$journal->getPath() page="article" op="view" path=$articlePath}"{else}href="{url page="article" op="view" path=$articlePath}"{/if}>
{$article->getLocalizedFullTitle()|escape}
{$publication->getLocalizedTitle(null, 'html')|strip_unsafe_html}
{assign var=localizedSubtitle value=$publication->getLocalizedSubtitle(null, 'html')|strip_unsafe_html}
{if $localizedSubtitle}
<span class="article__subtitle">{$localizedSubtitle}</span>
{/if}
</a>
</h4>
{if $showAuthor}
<p class="metadata">{$article->getCurrentPublication()->getAuthorString($authorUserGroups)|escape}</p>
<p class="metadata">{$publication->getAuthorString($authorUserGroups)|escape}</p>
{/if}
{call_hook name="Templates::Issue::Issue::Article"}
</div>
Expand All @@ -43,10 +48,10 @@
{/if}
{/if}
{assign var="hasArticleAccess" value=$hasAccess}
{if $currentContext->getSetting('publishingMode') == $smarty.const.PUBLISHING_MODE_OPEN || $article->getCurrentPublication()->getData('accessStatus') == $smarty.const.ARTICLE_ACCESS_OPEN}
{if $currentContext->getSetting('publishingMode') == \APP\journal\Journal::PUBLISHING_MODE_OPEN || $publication->getData('accessStatus') == \APP\submission\Submission::ARTICLE_ACCESS_OPEN}
{assign var="hasArticleAccess" value=1}
{/if}
{include file="frontend/objects/galley_link.tpl" parent=$article hasAccess=$hasArticleAccess purchaseFee=$currentJournal->getSetting('purchaseArticleFee') purchaseCurrency=$currentJournal->getSetting('currency')}
{include file="frontend/objects/galley_link.tpl" parent=$article publication=$publication hasAccess=$hasArticleAccess purchaseFee=$currentJournal->getSetting('purchaseArticleFee') purchaseCurrency=$currentJournal->getSetting('currency')}
{/foreach}
{/if}
</div>
Expand Down
3 changes: 1 addition & 2 deletions templates/frontend/objects/galley_link.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
{else}
{assign var="page" value="article"}
{assign var="parentId" value=$parent->getBestArticleId()}
{if $publication && $publication->getId() !== $parent->getCurrentPublication()->getId()}
{if $publication && $publication->getId() !== $parent->getData('currentPublicationId')}
{assign var="path" value=$parentId|to_array:"version":$publication->getId():$galley->getBestGalleyId()}
{else}
{assign var="path" value=$parentId|to_array:$galley->getBestGalleyId()}
Expand All @@ -56,7 +56,6 @@
{/if}
{/if}

{* Don't be frightened. This is just a link *}
<a class="{if $isSupplementary}btn btn-secondary galley_supplementary{else}btn btn-secondary{/if} {$type|escape}{if $restricted} restricted{/if}"
href="{url page=$page op="view" path=$path}">

Expand Down

0 comments on commit 74094c7

Please sign in to comment.