<?php $__env->startSection('content'); ?>
	<h2 class="main-title"><?php echo(__('Distributors', THEMOSIS_TEXTDOMAIN)); ?></h2>

	<?php if($query->post_count): ?>
		<?php echo $__env->make('_partials.map', ['query' => $query], array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>

		<div class="address-container bg-bordered bg-bordered-top">
			<span class="title"><?php echo(__('Russia', THEMOSIS_TEXTDOMAIN)); ?></span>
			<div>
				<?php $themosisQuery = (is_array(($query))) ? new WP_Query(($query)) : ($query); if($themosisQuery->have_posts()){ while($themosisQuery->have_posts()){ $themosisQuery->the_post(); ?>
					<?php $distributor = new DistributorEntity(get_post()); ?>

					<?php if(($country = $distributor->getCountry()) && $country->slug === 'russia'): ?>
						<?php echo $__env->make('distributors._partials.item', ['distributor' => $distributor], array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>
					<?php endif; ?>
				<?php }} wp_reset_postdata(); ?>
			</div>
		</div>

		<div class="address-container">
			<span class="title"><?php echo(__('Other countries', THEMOSIS_TEXTDOMAIN)); ?></span>
			<div>
				<?php $themosisQuery = (is_array(($query))) ? new WP_Query(($query)) : ($query); if($themosisQuery->have_posts()){ while($themosisQuery->have_posts()){ $themosisQuery->the_post(); ?>
					<?php $distributor = new DistributorEntity(get_post()) ?>

					<?php if(($country = $distributor->getCountry()) && $country->slug !== 'russia' && $country->count >= 1 ): ?>
						<?php echo $__env->make('distributors._partials.item', ['distributor' => $distributor], array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>
					<?php endif; ?>
				<?php }} wp_reset_postdata(); ?>
			</div>
		</div>
	<?php endif; ?>
<?php $__env->stopSection(); ?>
<?php echo $__env->make('layouts.2cols', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>