Merge branch '6.0'
[GitHub/WoltLab/WCF.git] / com.woltlab.wcf / templates / articleListItems.tpl
... / ...
CommitLineData
1{if !$disableAds|isset}{assign var='disableAds' value=false}{/if}
2
3<div class="contentItemList">
4 {foreach from=$objects item='article' name='articles'}
5 {if $article->getArticleContent()}
6 <article class="contentItem contentItemMultiColumn">
7 <div class="contentItemLink">
8 <div class="contentItemImage contentItemImageLarge">
9 <img
10 class="contentItemImageElement"
11 src="{if $article->getTeaserImage()}{$article->getTeaserImage()->getThumbnailLink('medium')}{else}{$__wcf->getStyleHandler()->getStyle()->getCoverPhotoURL()}{/if}"
12 height="{if $article->getTeaserImage()}{@$article->getTeaserImage()->getThumbnailHeight('medium')}{else}{@$__wcf->getStyleHandler()->getStyle()->getCoverPhotoHeight()}{/if}"
13 width="{if $article->getTeaserImage()}{@$article->getTeaserImage()->getThumbnailWidth('medium')}{else}{@$__wcf->getStyleHandler()->getStyle()->getCoverPhotoWidth()}{/if}"
14 loading="lazy"
15 alt="">
16
17 {hascontent}
18 <div class="contentItemBadges">
19 {content}
20 {if $article->isDeleted}<span class="badge label red contentItemBadge contentItemBadgeIsDeleted">{lang}wcf.message.status.deleted{/lang}</span>{/if}
21 {if !$article->isPublished()}<span class="badge label green contentItemBadge contentItemBadgeIsDisabled">{lang}wcf.message.status.disabled{/lang}</span>{/if}
22 {if $article->isNew()}<span class="badge label contentItemBadge contentItemBadgeNew">{lang}wcf.message.new{/lang}</span>{/if}
23
24 {event name='contentItemBadges'}
25 {/content}
26 </div>
27 {/hascontent}
28 </div>
29
30 <div class="contentItemContent">
31 {if $article->hasLabels()}
32 <div class="contentItemLabels">
33 {foreach from=$article->getLabels() item=label}
34 {@$label->render('contentItemLabel')}
35 {/foreach}
36 </div>
37 {/if}
38
39 <h2 class="contentItemTitle"><a href="{$article->getLink()}" class="contentItemTitleLink">{$article->getTitle()}</a></h2>
40
41 <div class="contentItemDescription">
42 {@$article->getFormattedTeaser()}
43 </div>
44 </div>
45 </div>
46
47 <div class="contentItemMeta">
48 <span class="contentItemMetaImage">
49 {@$article->getUserProfile()->getAvatar()->getImageTag(32)}
50 </span>
51
52 <div class="contentItemMetaContent">
53 <div class="contentItemMetaAuthor">
54 {@$article->getUserProfile()->getFormattedUsername()}
55 </div>
56 <div class="contentItemMetaTime">
57 {@$article->time|time}
58 </div>
59 </div>
60
61 <div class="contentItemMetaIcons">
62 {if MODULE_LIKE && $__wcf->getSession()->getPermission('user.like.canViewLike') && $article->cumulativeLikes}
63 <div class="contentItemMetaIcon">
64 {include file='shared_topReaction' cachedReactions=$article->cachedReactions render='short'}
65 </div>
66 {/if}
67 {if $article->getDiscussionProvider()->getDiscussionCountPhrase()}{* empty phrase indicates that comments are disabled *}
68 <div class="contentItemMetaIcon">
69 {icon name='comments'}
70 <span aria-label="{$article->getDiscussionProvider()->getDiscussionCountPhrase()}">
71 {$article->getDiscussionProvider()->getDiscussionCount()}
72 </span>
73 </div>
74 {/if}
75
76 {event name='contentItemMetaIcons'}
77 </div>
78 </div>
79 </article>
80 {/if}
81
82 {if MODULE_WCF_AD && !$disableAds}
83 {if $tpl[foreach][articles][iteration] === 1}
84 {hascontent}
85 <div class="contentItem contentItemAd">
86 {content}{@$__wcf->getAdHandler()->getAds('com.woltlab.wcf.article.after1stArticle')}{/content}
87 </div>
88 {/hascontent}
89 {else}
90 {if $tpl[foreach][articles][iteration] % 2 === 0}
91 {hascontent}
92 <div class="contentItem contentItemAd">
93 {content}{@$__wcf->getAdHandler()->getAds('com.woltlab.wcf.article.afterEvery2ndArticle')}{/content}
94 </div>
95 {/hascontent}
96 {/if}
97
98 {if $tpl[foreach][articles][iteration] % 3 === 0}
99 {hascontent}
100 <div class="contentItem contentItemAd">
101 {content}{@$__wcf->getAdHandler()->getAds('com.woltlab.wcf.article.afterEvery3rdArticle')}{/content}
102 </div>
103 {/hascontent}
104 {/if}
105
106 {if $tpl[foreach][articles][iteration] % 5 === 0}
107 {hascontent}
108 <div class="contentItem contentItemAd">
109 {content}{@$__wcf->getAdHandler()->getAds('com.woltlab.wcf.article.afterEvery5thArticle')}{/content}
110 </div>
111 {/hascontent}
112
113 {if $tpl[foreach][articles][iteration] % 10 === 0}
114 {hascontent}
115 <div class="contentItem contentItemAd">
116 {content}{@$__wcf->getAdHandler()->getAds('com.woltlab.wcf.article.afterEvery10thArticle')}{/content}
117 </div>
118 {/hascontent}
119 {/if}
120 {/if}
121 {/if}
122 {/if}
123 {/foreach}
124</div>