1{if !isset($actions) or $actions eq "y"}
2	{if $prefs.art_home_title ne ''}
3		{title help="Articles" admpage="articles"}
4			{if $prefs.art_home_title eq 'topic' and !empty($topic)}
5				{tr}{$topic|escape}{/tr}
6			{elseif $prefs.art_home_title eq 'type' and !empty($type)}
7				{tr}{$type|escape}{/tr}
8			{else}{tr}Articles{/tr}{/if}
9		{/title}
10	{/if}
11	{if $headerLinks eq "y"}
12		<div class="t_navbar mb-4">
13			{if $tiki_p_edit_article eq 'y' or $tiki_p_admin eq 'y' or $tiki_p_admin_cms eq 'y'}
14				{button href="tiki-edit_article.php" _type="link" class="btn btn-link" _icon_name="create" _text="{tr}New Article{/tr}"}
15			{/if}
16			{if $prefs.feature_submissions == 'y' && $tiki_p_edit_submission == "y" && $tiki_p_edit_article neq 'y' && $tiki_p_admin neq 'y' && $tiki_p_admin_cms neq 'y'}
17				{button href="tiki-edit_submission.php" _type="link" class="btn btn-link" _icon_name="create" _text="{tr}New Submission{/tr}"}
18			{/if}
19			{if $tiki_p_read_article eq 'y' or $tiki_p_articles_read_heading eq 'y' or $tiki_p_admin eq 'y' or $tiki_p_admin_cms eq 'y'}
20				{button href="tiki-list_articles.php" _type="link" class="btn btn-link" _icon_name="list" _text="{tr}List Articles{/tr}"}
21			{/if}
22
23			{if $prefs.feature_submissions == 'y' && ($tiki_p_approve_submission == "y"
24			|| $tiki_p_remove_submission == "y" || $tiki_p_edit_submission == "y")}
25				{button href="tiki-list_submissions.php" _type="link" class="btn btn-link" _icon_name="view" _text="{tr}View Submissions{/tr}"}
26			{/if}
27			<div class="btn-group float-right">
28				{if ! $js}<ul class="cssmenu_horiz"><li>{/if}
29				<a class="btn btn-link" data-toggle="dropdown" data-hover="dropdown" href="#">
30					{icon name='menu-extra'}
31				</a>
32				<div class="dropdown-menu dropdown-menu-right">
33					<h6 class="dropdown-header">
34						{tr}Monitoring{/tr}
35					</h6>
36					<div class="dropdown-divider"></div>
37					{if $user_watching_articles eq 'n'}
38						{self_link watch_event='article_*' watch_object='*' watch_action='add' _icon_name='watch' _class='dropdown-item' _text="{tr}Monitor articles{/tr}"}
39						{/self_link}
40					{else}
41						{self_link watch_event='article_*' watch_object='*' watch_action='remove' _icon_name='stop-watching' _class='dropdown-item' _text="{tr}Stop monitoring articles{/tr}"}
42						{/self_link}
43					{/if}
44					{if $prefs.feature_group_watches eq 'y' and $tiki_p_admin_users eq 'y'}
45						<a class="dropdown-item" href="tiki-object_watches.php?watch_event=article_*&amp;objectId=*">
46							{icon name='watch-group'} {tr}Group monitor{/tr}
47						</a>
48					{/if}
49				</div>
50				{if ! $js}</li></ul>{/if}
51			</div>
52		</div>
53	{/if}
54{/if}
55
56{section name=ix loop=$listpages}
57	{capture name=href}{strip}
58		{if empty($urlparam)}
59			{if $useLinktoURL eq 'n' or empty($listpages[ix].linkto)}
60				{$listpages[ix].articleId|sefurl:article}
61			{else}
62				{$listpages[ix].linkto}
63			{/if}
64		{else}
65			{$listpages[ix].articleId|sefurl:article:with_next}{$urlparam}
66		{/if}
67	{/strip}{/capture}
68	{if $listpages[ix].disp_article eq 'y'}
69		{if $prefs.feature_freetags eq 'y' and $tiki_p_view_freetags eq 'y' and $listpages[ix].freetags.data|@count >0}
70			<div class="freetaglist">
71				{foreach from=$listpages[ix].freetags.data item=taginfo}
72					{capture name=tagurl}
73						{if (strstr($taginfo.tag, ' '))}"{$taginfo.tag}"{else}{$taginfo.tag}{/if}
74					{/capture}
75					<a class="freetag" href="tiki-browse_freetags.php?tag={$smarty.capture.tagurl|escape:'url'}">
76						{$taginfo.tag}
77					</a>
78				{/foreach}
79			</div>
80		{/if}
81		<article class="clearfix article {if !empty($container_class)} {$container_class}{/if} article{$smarty.section.ix.index} mt-1 mb-5">
82			{if ($listpages[ix].show_avatar eq 'y')}
83				<div class="avatar float-left mr-3">
84					{$listpages[ix].author|avatarize}
85				</div>
86			{/if}
87			{if $listpages[ix].show_topline eq 'y' and $listpages[ix].topline}
88				<div class="articletopline">
89					{$listpages[ix].topline|escape}
90				</div>
91			{/if}
92
93			<header class="articletitle mt-0 mx-0 mb-1">
94				<h2>
95					{object_link type=article id=$listpages[ix].articleId url=$smarty.capture.href title=$listpages[ix].title}
96				</h2>
97				{if $listpages[ix].show_subtitle eq 'y' and $listpages[ix].subtitle}<div class="articlesubtitle">{$listpages[ix].subtitle|escape}</div>{/if}
98				{if ($listpages[ix].show_author eq 'y')
99					or ($listpages[ix].show_pubdate eq 'y')
100					or ($listpages[ix].show_expdate eq 'y')
101					or ($listpages[ix].show_reads eq 'y')
102				}
103					<span class="titleb">
104						{if $listpages[ix].show_author eq 'y'}
105							{if $listpages[ix].authorName}
106								<span class="author">
107									{tr}Author:{/tr} {$listpages[ix].authorName|escape}
108								</span>
109							{else}
110								<span class="author">
111									{tr}Author:{/tr} {$listpages[ix].author|username}
112								</span>
113							{/if}
114							{if $listpages[ix].show_pubdate eq 'y' or $listpages[ix].show_expdate eq 'y' or $listpages[ix].show_reads eq 'y'}
115								-
116							{/if}
117						{/if}
118						{if $listpages[ix].show_pubdate eq 'y'}
119							<span class="pubdate">
120								{tr}Published{/tr} {$listpages[ix].publishDate|tiki_short_datetime}
121							</span>
122							{if $listpages[ix].show_expdate eq 'y' or $listpages[ix].show_reads eq 'y'}
123								-
124							{/if}
125						{/if}
126						{if $listpages[ix].show_expdate eq 'y'}
127							<span class="expdate">
128								{tr}Expires{/tr} {$listpages[ix].expireDate|tiki_short_datetime}
129							</span>
130							{if $listpages[ix].show_reads eq 'y'}
131								-
132							{/if}
133						{/if}
134						{if $listpages[ix].show_reads eq 'y'}
135							<span class="reads">
136								({$listpages[ix].nbreads} {tr}Reads{/tr})
137							</span>
138						{/if}
139						{if $listpages[ix].comment_can_rate_article eq 'y' && $prefs.article_user_rating eq 'y'
140							&& ($listpages[ix].perms.tiki_p_ratings_view_results eq 'y' or $tiki_p_admin eq 'y')}
141							- <span class="ratingResultAvg">
142								{tr}Users rating: {/tr}
143							</span>{rating_result_avg id=$listpages[ix].articleId type=article}
144						{/if}
145					</span><br>
146				{/if}
147				{if $author ne $user and $listpages[ix].comment_can_rate_article eq 'y' and empty({$listpages[ix].body})
148					and !isset($preview) and $prefs.article_user_rating eq 'y' and ($listpages[ix].perms.tiki_p_rate_article eq 'y'
149					or $listpages[ix].perms.tiki_p_admin_cms eq 'y')}
150					<div class="articleheading">
151						<form method="post" action="">
152							{rating type=article id=$listpages[ix].articleId}
153						</form>
154					</div>
155				{/if}
156				{if $listpages[ix].comment_can_rate_article eq 'y' && $prefs.article_user_rating eq 'y'
157					&& ($listpages[ix].perms.tiki_p_ratings_view_results eq 'y' or $tiki_p_admin eq 'y')}
158					<div class="articleheading">
159						{rating_result id=$listpages[ix].articleId type=article}
160					</div>
161				{/if}
162			</header>
163
164			{if $listpages[ix].use_ratings eq 'y'}
165				<div class="articleheading">
166					{tr}Rating:{/tr}
167					{repeat count=$listpages[ix].rating}
168						{icon name='star'}
169					{/repeat}
170					{if $listpages[ix].rating > $listpages[ix].entrating}
171						{icon name='star-half'}
172					{/if}
173					({$listpages[ix].rating}/10)
174				</div>
175			{/if}
176
177			<div class="articleheading media">
178				<div {if $listpages[ix].isfloat eq 'n'}class="media-left"{/if}>
179					{if $listpages[ix].show_image eq 'y'}
180						{if $listpages[ix].useImage eq 'y'}
181							{if $listpages[ix].hasImage eq 'y'}
182								<a
183									href="{$smarty.capture.href}" {if $listpages[ix].isfloat eq 'y'} style="margin-right:20px; float:left;"{/if}
184									title="{if $listpages[ix].show_image_caption and $listpages[ix].image_caption}{$listpages[ix].image_caption|escape}{elseif $listpages[ix].topicName}{tr}{$listpages[ix].topicName}{/tr}{else}{tr}Read More{/tr}{/if}">
185									{$style=''}
186									<img class="img-thumbnail media-object article-image custom-image"
187										alt="{if $listpages[ix].show_image_caption and $listpages[ix].image_caption}{$listpages[ix].image_caption|escape}{elseif $listpages[ix].topicName}{tr}{$listpages[ix].topicName}{/tr}{/if}"
188										{strip}src="article_image.php?image_type=article&amp;id={$listpages[ix].articleId}
189										{if $listpages[ix].list_image_x > 0 and ($largefirstimage neq 'y' or not $smarty.section.ix.first)}
190											&amp;width={$listpages[ix].list_image_x}
191										{elseif $listpages[ix].image_x > 0}
192											&amp;width={$listpages[ix].image_x}
193										{/if}
194										&amp;cache=y"
195										{if $listpages[ix].list_image_y > 0 and ($largefirstimage neq 'y' or not $smarty.section.ix.first)}
196											{$style=$style|cat:"max-height:"|cat:$listpages[ix].list_image_y|cat:"px;"}
197										{elseif $listpages[ix].image_y > 0}
198											{$style=$style|cat:"max-height:"|cat:$listpages[ix].image_y|cat:"px;"}
199										{/if}
200										style="{$style}"
201									>{/strip}
202								</a>
203							{else}
204								{* Intentionally left blank to allow user add an image from somewhere else through the img tag and no other extra image *}
205							{/if}
206						{else}
207							{if isset($topics[$listpages[ix].topicId].image_size) and $topics[$listpages[ix].topicId].image_size > 0}
208								<a href="{$smarty.capture.href}" class="thumbnail"{if $listpages[ix].isfloat eq 'y'} style="margin-right:20px; float:left;"{/if}
209										title="{if $listpages[ix].show_image_caption and $listpages[ix].image_caption}{$listpages[ix].image_caption|escape}{else}{tr}{$listpages[ix].topicName}{/tr}{/if}">
210									<img class="media-object img-thumbnail article-image topic-image"
211											alt="{if $listpages[ix].show_image_caption and $listpages[ix].image_caption}{$listpages[ix].image_caption|escape}{else}{tr}{$listpages[ix].topicName}{/tr}{/if}"
212											src="article_image.php?image_type=topic&amp;id={$listpages[ix].topicId}">
213								</a>
214							{/if}
215						{/if}
216					{/if}
217				</div>
218				<div class="articleheadingtext{if $listpages[ix].isfloat eq 'n'} media-body{/if}">{$listpages[ix].parsed_heading}</div>
219			</div>
220					{if isset($fullbody) and $fullbody eq "y"}
221			<div class="articlebody py-3">{$listpages[ix].parsed_body}</div>
222					{/if}
223
224			<div class="articletrailer clearfix">
225				{if ($listpages[ix].size > 0) or (($prefs.feature_article_comments eq 'y') and ($listpages[ix].perms.tiki_p_read_comments eq 'y'))}
226				<ul class="list-inline float-left">
227					{if ($listpages[ix].perms.tiki_p_read_article eq 'y' and $listpages[ix].heading_only ne 'y' and (!isset($fullbody) or $fullbody ne "y"))}
228						{if ($listpages[ix].size > 0 and !empty($listpages[ix].body))}
229
230							<li class="list-inline-item status"> {* named to be similar to for<um/blog item *}
231								<a href="{$smarty.capture.href}" class="more">{icon name="book-reader"} {tr}Read More{/tr}</a>
232							</li>
233							{if ($listpages[ix].show_size eq 'y')}
234								<li class="list-inline-item">
235									({$listpages[ix].size} {tr}bytes{/tr})
236								</li>
237							{/if}
238						{/if}
239					{/if}
240					{if ($prefs.feature_article_comments eq 'y') and ($listpages[ix].perms.tiki_p_read_comments eq 'y') and ($listpages[ix].allow_comments eq 'y')}
241						<li class="list-inline-item">
242							<a href="{$listpages[ix].articleId|sefurl:article:with_next}{if $prefs.feature_sefurl neq 'y'}&amp;{/if}show_comzone=y{if !empty($urlparam)}&amp;{$urlparam}{/if}#comments"{if $listpages[ix].comments_cant > 0} class="mark"{/if}>
243								{if $listpages[ix].comments_cant == 0 and $listpages[ix].perms.tiki_p_post_comments == 'y'}
244									{if !isset($actions) or $actions eq "y"}
245										{icon name="comment"} {tr}Add Comment{/tr}
246									{/if}
247								{elseif $listpages[ix].perms.tiki_p_read_comments eq 'y'}
248									{if $listpages[ix].comments_cant == 1}
249                                        {icon name="comment"} {tr}1 comment{/tr}
250									{else}
251                                        {icon name="comments"} {$listpages[ix].comments_cant}&nbsp;{tr}comments{/tr}
252									{/if}
253								{/if}
254							</a>
255						</li>
256					{/if}
257					</ul>
258				{/if}
259				{if !isset($actions) or $actions eq "y"}
260					<div class="btn-group actions float-right dropup">
261						{if $prefs.feature_multilingual eq 'y' and $listpages[ix].perms.tiki_p_edit_article eq 'y'}
262							{include file='translated-lang.tpl' object_type='article' trads=$listpages[ix].translations articleId=$listpages[ix].articleId}
263						{/if}
264						<div class="btn-group">
265							<a class="btn btn-info btn-sm dropdown-toggle" data-toggle="dropdown" data-hover="dropdown" href="#">
266								{icon name="wrench"}
267							</a>
268							<div class="dropdown-menu dropdown-menu-right">
269								<h6 class="dropdown-header">
270									{tr _0="{$listpages[ix].title}"}Actions for %0{/tr}
271								</h6>
272								<div class="dropdown-divider"></div>
273								{if $listpages[ix].perms.tiki_p_edit_article eq 'y' or (!empty($user) and $listpages[ix].author eq $user
274								and $listpages[ix].creator_edit eq 'y')}
275									<a class="dropdown-item" href="tiki-edit_article.php?articleId={$listpages[ix].articleId}">
276										{icon name='edit'} {tr}Edit{/tr}
277									</a>
278								{/if}
279								{if $prefs.feature_cms_print eq 'y'}
280									<a class="dropdown-item" href="tiki-print_article.php?articleId={$listpages[ix].articleId}">
281										{icon name='print'} {tr}Print{/tr}
282									</a>
283								{/if}
284								{if $listpages[ix].perms.tiki_p_remove_article eq 'y'}
285									<a class="dropdown-item" href="tiki-list_articles.php?remove={$listpages[ix].articleId}">
286										{icon name='remove'} {tr}Remove{/tr}
287									</a>
288								{/if}
289							</div>
290						</div>
291					</div>
292				{/if}
293			</div>
294
295		</article>
296	{/if}
297{sectionelse}
298	{if $quiet ne 'y'}
299		{remarksbox type=info title="{tr}No articles yet.{/tr}" close="n"}
300		{/remarksbox}
301	{/if}
302{/section}
303
304{if !isset($actions) or $actions eq "y"}
305	{if $tiki_p_edit_article eq 'y' or $tiki_p_admin eq 'y' or $tiki_p_admin_cms eq 'y'}
306		<br/><a href="tiki-edit_article.php{if (isset($topicId) && !empty($topicId)) or (isset($type) && !empty($type))}?{/if}{if isset($topicId) && !empty($topicId) and is_numeric($topicId)}topicId={$topicId|escape}{/if}{if isset($type) && !empty($type)}&type={$type|escape}{/if}" class="alert-link">
307			{icon name="create"} {tr}New article{/tr}
308		</a>
309	{/if}
310	{if $prefs.feature_submissions == 'y' && $tiki_p_edit_submission == "y" && $tiki_p_edit_article neq 'y' && $tiki_p_admin neq 'y' && $tiki_p_admin_cms neq 'y'}
311		<br/><a href="tiki-edit_submission.php{if (isset($topicId) && !empty($topicId)) or (isset($type) && !empty($type))}?{/if}{if isset($topicId) && !empty($topicId) and is_numeric($topicId)}topicId={$topicId|escape}{/if}{if isset($type) && !empty($type)}&type={$type|escape}{/if}" class="alert-link">
312			{icon name="create"} {tr}New Submission{/tr}
313		</a>
314	{/if}
315{/if}
316
317{if !empty($listpages) && (!isset($usePagination) or $usePagination ne 'n')}
318	{pagination_links cant=$cant step=$maxArticles offset=$offset}{if isset($urlnext)}{$urlnext}{/if}{/pagination_links}
319{/if}
320