<?php
/**
 * ------------------------------------------------------------------------
 * ja_justitia_tpl
 * ------------------------------------------------------------------------
 * Copyright (C) 2004-2021 J.O.O.M Solutions Co., Ltd. All Rights Reserved.
 * @license - Copyrighted Commercial Software
 * Author: J.O.O.M Solutions Co., Ltd
 * Websites:  http://www.joomlart.com -  http://www.joomlancers.com
 * This file may not be redistributed in whole or significant part.
 * ------------------------------------------------------------------------
*/

defined('_JEXEC') or die;
use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Language\Text;
?>
<ul class="latestnews list-item <?php echo $params->get('moduleclass_sfx',''); ?>">
<?php foreach ($list as $item) :  ?>
	<li class="item clearfix" >
		<div class="item-media">
			<?php if(json_decode($item->images)->image_intro) :?>
				<img src="<?php echo json_decode($item->images)->image_intro; ?>" alt="<?php echo $item->title; ?>" />
			<?php endif ;?>
		</div>
		
		<div class="item-body">
			<h6 class="item-title"><a href="<?php echo $item->link; ?>" itemprop="url"><span itemprop="name"><?php echo $item->title; ?></span></a></h6>
			<div class="item-meta">
				
				<?php 
				$author =  '<span class="name">' . $item->author . '</span>';

				if (!empty($displayData['item']->contact_link ) && $displayData['params']->get('link_author') == true) : ?>
					<div class="author"><?php echo Text::sprintf('TPL_CONTENT_WRITTEN_BY', HTMLHelper::_('link', $displayData['item']->contact_link, $author, array('itemprop' => 'url'))); ?></div>
				<?php else : ?>
					<div class="author"><?php echo Text::sprintf('TPL_CONTENT_WRITTEN_BY', $author); ?></div>
				<?php endif; ?>

				<div class="item-date"><span><?php echo Text::sprintf('TPL_CONTENT_PUBLISHED_DATE_ON', HTMLHelper::_('date', $item->displayDate, Text::_('TPL_DATE_FORMAT_LC1'))); ?></span></div>
			</div>
		</div>
		
	</li>
<?php endforeach; ?>
</ul>
