Support for more content elements
[GitHub/WoltLab/WCF.git] / com.woltlab.wcf / templates / articleListItems.tpl
CommitLineData
b9e122ff 1<div class="contentItemList">
a5a4f02d 2 {foreach from=$objects item='article'}
b9e122ff
AE
3 <article class="contentItem">
4 <a href="{$article->getLink()}" class="contentItemLink">
8b2e8e5d 5 <div class="contentItemImage" style="background-image: url({if $article->getImage()}{$article->getImage()->getThumbnailLink('medium')}{else}{$__wcf->getStyleHandler()->getStyle()->getCoverPhotoURL()}{/if})">
b9e122ff
AE
6 {hascontent}
7 <div class="contentItemBadges">
8 {content}
9 {if $article->isDeleted}<span class="badge label red contentItemBadge contentItemBadgeIsDeleted">{lang}wcf.message.status.deleted{/lang}</span>{/if}
10 {if ARTICLE_ENABLE_VISIT_TRACKING && $article->isNew()}<span class="badge label contentItemBadge contentItemBadgeNew">{lang}wcf.message.new{/lang}</span>{/if}
ebd7b480
AE
11
12 {event name='contentItemBadges'}
b9e122ff 13 {/content}
a5a4f02d 14 </div>
b9e122ff
AE
15 {/hascontent}
16 </div>
17
18 <div class="contentItemContent">
19 {if $article->hasLabels()}
20 <div class="contentItemLabels">
21 {foreach from=$article->getLabels() item=label}
22 <span class="label badge contentItemLabel{if $label->getClassNames()} {$label->getClassNames()}{/if}">{lang}{$label->label}{/lang}</span>
23 {/foreach}
a5a4f02d 24 </div>
b9e122ff
AE
25 {/if}
26
27 <h2 class="contentItemTitle">{$article->getTitle()}</h2>
28
29 <div class="contentItemDescription">
30 {@$article->getFormattedTeaser()}
31 </div>
32 </div>
33 </a>
34
35 <div class="contentItemMeta">
36 <a href="{$article->getUserProfile()->getLink()}" class="contentItemMetaImage" aria-hidden="true" tabindex="-1">
37 {@$article->getUserProfile()->getAvatar()->getImageTag(32)}
38 </a>
39
40 <div class="contentItemMetaContent">
41 <div class="contentItemMetaAuthor">
42 {if $article->userID}
ebd7b480 43 <a href="{$article->getUserProfile()->getLink()}" class="userLink" data-user-id="{@$article->userID}">{$article->getUserProfile()->username}</a>
b9e122ff
AE
44 {else}
45 {$article->username}
46 {/if}
a5a4f02d 47 </div>
b9e122ff
AE
48 <div class="contentItemMetaTime">
49 {@$article->time|time}
0c968ac8 50 </div>
b9e122ff 51 </div>
b20c6ed6 52
b9e122ff
AE
53 <div class="contentItemMetaIcons">
54 {if MODULE_LIKE && $__wcf->getSession()->getPermission('user.like.canViewLike') && ($article->likes || $article->dislikes || $article->neutralReactions)}
55 <div class="contentItemMetaIcon reputationCounter {if $article->cumulativeLikes > 0}positive{elseif $article->cumulativeLikes < 0}negative{else}neutral{/if}">
56 <span aria-label="{lang cumulativeLikes=$article->cumulativeLikes}wcf.like.reputation.label{/lang}">
57 {if $article->cumulativeLikes > 0}+{elseif $article->cumulativeLikes == 0}±{/if}{#$article->cumulativeLikes}
58 </span>
59 </div>
60 {/if}
61 <div class="contentItemMetaIcon">
62 <span class="icon icon16 fa-comments"></span>
63 <span aria-label="{$article->getDiscussionProvider()->getDiscussionCountPhrase()}">
64 {$article->getDiscussionProvider()->getDiscussionCount()}
65 </span>
66 </div>
67 </div>
68 </div>
69 </article>
a5a4f02d 70 {/foreach}
b9e122ff 71</div>