Skip to content

Commit

Permalink
update announcement template functions
Browse files Browse the repository at this point in the history
  • Loading branch information
kaitlinnewson committed Jan 3, 2025
1 parent 382f24b commit 4d79bc5
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 24 deletions.
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>
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
16 changes: 8 additions & 8 deletions templates/frontend/pages/indexJournal.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -60,14 +60,14 @@
{break}
{/if}
<article class="carousel-item{if $announcement@first} active{/if}">
<h3 class="announcement__title_boxed">{$announcement->getLocalizedTitle()|escape}</h3>
<p class="metadata">{$announcement->getDatePosted()|date_format:$dateFormatLong}</p>
<p>{$announcement->getLocalizedDescriptionShort()|strip_unsafe_html}</p>
<p>
{capture assign="announcementPageUrl"}{url router=$smarty.const.ROUTE_PAGE page="announcement" op="view" path=$announcement->getId()}{/capture}
<a href="{$announcementPageUrl}" class="btn btn-secondary">{translate key="common.more"}</a>
</p>
</article>
<h3 class="announcement__title_boxed">{$announcement->getLocalizedData('title')|escape}</h3>
<p class="metadata">{$announcement->datePosted|date_format:$dateFormatLong}</p>
<p>{$announcement->getLocalizedData('descriptionShort')|strip_unsafe_html}</p>
<p>
{capture assign="announcementPageUrl"}{url router=$smarty.const.ROUTE_PAGE page="announcement" op="view" path=$announcement->id}{/capture}
<a href="{$announcementPageUrl}" class="btn btn-secondary">{translate key="common.more"}</a>
</p>
</article>
{/foreach}
</div>
{if $numAnnouncementsHomepage > 1 && $announcements|@count > 1}
Expand Down

0 comments on commit 4d79bc5

Please sign in to comment.