<?php

/**
 * @package     Joomla.Site
 * @subpackage  mod_articles_news
 *
 * @copyright   (C) 2010 Open Source Matters, Inc. <https://www.joomla.org>
 * @license     GNU General Public License version 2 or later; see LICENSE.txt
 */

defined('_JEXEC') or die;

use Joomla\CMS\Layout\LayoutHelper;

$additionalFields = array();
foreach($item->jcfields as $field) {
	$additionalFields[$field->name] = $field->value;
}
?>
<a class="portfolio-link" href="<?php echo $item->link; ?>">
	<figure class="portfolio-image">
		<?php echo LayoutHelper::render(
			'joomla.html.image',
			[
				'src' => $item->imageSrc,
				'alt' => $item->imageAlt,
			]
		); ?>
	</figure>
	<div class="item-portfolio-box">
		<div class="item-header">
			<?php echo $item->title; ?>
		</div>
		<div class="field-items field-portfolio">
			<? if (isset($additionalFields['lokatsiya']) and !empty($additionalFields['lokatsiya'])) :?>
				<div class="field-icon lokatsiya"><?php echo $additionalFields['lokatsiya']; ?></div>
			<?php endif;?>
			<? if (isset($additionalFields['material']) and !empty($additionalFields['material'])) :?>
				<div class="field-icon material"><span>Пленка:</span> <?php echo $additionalFields['material']; ?></div>
			<?php endif;?>
			<? if (isset($additionalFields['ploshchad']) and !empty($additionalFields['ploshchad'])) :?>
				<div class="field-icon ploshchad"><span>Площадь:</span> <?php echo $additionalFields['ploshchad']; ?>м<sup>2</sup></div>
			<?php endif;?>
			<? if (isset($additionalFields['srok']) and !empty($additionalFields['srok'])) :?>
				<div class="field-icon srok"><span>Срок:</span> <?php echo $additionalFields['srok']; ?></div>
			<?php endif;?>
		</div>
	</div>
</a>