Skip to content

Commit

Permalink
Update issue_toc.tpl and article_summary.tpl
Browse files Browse the repository at this point in the history
  • Loading branch information
madi-nuralin committed Sep 10, 2021
1 parent fdb8859 commit 0202c33
Show file tree
Hide file tree
Showing 2 changed files with 98 additions and 1 deletion.
97 changes: 97 additions & 0 deletions templates/frontend/objects/article_summary.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
{**
* templates/frontend/objects/article_summary.tpl
*
* Copyright (c) 2021 Madi Nuralin
* Distributed under the GNU GPL v3. For full terms see the file docs/COPYING.
*
* @brief View of an Article summary which is shown within a list of articles.
*
* @uses $article Article The article
* @uses $hasAccess bool Can this user access galleys for this context? The
* context may be an issue or an article
* @uses $showDatePublished bool Show the date this article was published?
* @uses $hideGalleys bool Hide the article galleys for this article?
* @uses $primaryGenreIds array List of file genre ids for primary file types
* @uses $heading string HTML heading element, default: h2
*}
{assign var=articlePath value=$article->getBestId()}
{if !$heading}
{assign var="heading" value="h2"}
{/if}

{if (!$section.hideAuthor && $article->getHideAuthor() == $smarty.const.AUTHOR_TOC_DEFAULT) || $article->getHideAuthor() == $smarty.const.AUTHOR_TOC_SHOW}
{assign var="showAuthor" value=true}
{/if}

{assign var=publication value=$article->getCurrentPublication()}
<div class="obj_article_summary">
{if $publication->getLocalizedData('coverImage')}
<div class="cover d-flex justify-content-center">
<a {if $journal}href="{url journal=$journal->getPath() page="article" op="view" path=$articlePath}"{else}href="{url page="article" op="view" path=$articlePath}"{/if} class="file">
{assign var="coverImage" value=$article->getCurrentPublication()->getLocalizedData('coverImage')}
<img
class="img-fluid"
src="{$article->getCurrentPublication()->getLocalizedCoverImageUrl($article->getData('contextId'))|escape}"
alt="{$coverImage.altText|escape|default:''}"
>
</a>
</div>
{/if}

<{$heading} class="title text-center text-md-start">
<a id="article-{$article->getId()}" {if $journal}href="{url journal=$journal->getPath() page="article" op="view" path=$articlePath}"{else}href="{url page="article" op="view" path=$articlePath}"{/if}>
{$article->getLocalizedTitle()|strip_unsafe_html}
{if $article->getLocalizedSubtitle()}
<span class="subtitle">
{$article->getLocalizedSubtitle()|escape}
</span>
{/if}
</a>
</{$heading}>

{if $showAuthor || $article->getPages() || ($article->getDatePublished() && $showDatePublished)}
<div class="meta text-center text-md-start">
{if $showAuthor}
<div class="authors">
{$article->getAuthorString()|escape}
</div>
{/if}

{* Page numbers for this article *}
{if $article->getPages()}
<div class="pages">
{$article->getPages()|escape}
</div>
{/if}

{if $showDatePublished && $article->getDatePublished()}
<div class="published">
{$article->getDatePublished()|date_format:$dateFormatShort}
</div>
{/if}

</div>
{/if}

{if !$hideGalleys}
<ul class="galleys_links list-unstyled d-flex flex-wrap justify-content-md-start justify-content-center">
{foreach from=$article->getGalleys() item=galley}
{if $primaryGenreIds}
{assign var="file" value=$galley->getFile()}
{if !$galley->getRemoteUrl() && !($file && in_array($file->getGenreId(), $primaryGenreIds))}
{continue}
{/if}
{/if}
<li class="me-1 mb-1">
{assign var="hasArticleAccess" value=$hasAccess}
{if $currentContext->getSetting('publishingMode') == $smarty.const.PUBLISHING_MODE_OPEN || $publication->getData('accessStatus') == $smarty.const.ARTICLE_ACCESS_OPEN}
{assign var="hasArticleAccess" value=1}
{/if}
{include file="frontend/objects/galley_link.tpl" parent=$article labelledBy="article-{$article->getId()}" hasAccess=$hasArticleAccess purchaseFee=$currentJournal->getData('purchaseArticleFee') purchaseCurrency=$currentJournal->getData('currency')}
</li>
{/foreach}
</ul>
{/if}

{call_hook name="Templates::Issue::Issue::Article"}
</div>
2 changes: 1 addition & 1 deletion templates/frontend/objects/issue_toc.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@
{if $section.articles}
{if $section.title}
<h2 class="accordion-header" id="accordion-header-{$sectionCounter}">
<button class="accordion-button collapsed px-0" type="button" data-mdb-toggle="collapse" data-mdb-target="#accordion-collapse-{$sectionCounter}" aria-expanded="false" aria-controls="accordion-collapse-{$sectionCounter}">
<button class="accordion-button collapsed px-0 text-md-start text-center" type="button" data-mdb-toggle="collapse" data-mdb-target="#accordion-collapse-{$sectionCounter}" aria-expanded="false" aria-controls="accordion-collapse-{$sectionCounter}">
{$section.title|escape}
</button>
</h2>
Expand Down

0 comments on commit 0202c33

Please sign in to comment.