<?php
/**
 * Job listing in the loop.
 *
 * This template can be overridden by copying it to yourtheme/job_manager/content-job_listing.php.
 *
 * @see         https://wpjobmanager.com/document/template-overrides/
 * @author      Automattic
 * @package     wp-job-manager
 * @category    Template
 * @since       1.0.0
 * @version     1.34.0
 */

if ( ! defined( 'ABSPATH' ) ) {
	exit; // Exit if accessed directly.
}

global $post;
?>
<div <?php job_listing_class('ui padded segment'); ?> data-longitude="<?php echo esc_attr( $post->geolocation_long ); ?>" data-latitude="<?php echo esc_attr( $post->geolocation_lat ); ?>">
	<div class="ui grid">
		<div class="one wide column">
			<div class="ui big avatar image">
				<?php the_company_logo(); ?>
			</div>
		</div>
		<div class="fifteen wide column position">
			<div class="ui ui grid">
				<div class="twelve wide column">
					<h3 class="ui header">
						<div class="content">
							<a class="ui" href="<?php the_job_permalink(); ?>">
								<?php wpjm_the_job_title(); ?>
							</a>
						</div>
					</h3>

					<div class="ui list">
						<div class="item">
							<i class="building middle aligned icon"></i>
							<div class="content">
								<div class="header">
									<?php the_company_name( '<strong>', '</strong> ' ); ?>
									<?php the_company_tagline( '<span class="tagline text grey">', '</span>' ); ?>
								</div>
							</div>
						</div>
					</div>
				</div>

				<div class="four wide right aligned column">
					<?php do_action( 'job_listing_meta_start' ); ?>
					<?php if ( get_option( 'job_manager_enable_types' ) ) { ?>
						<div class="ui primary labels">
							<?php $types = wpjm_get_the_job_types(); ?>
							<?php if ( ! empty( $types ) ) : foreach ( $types as $type ) : ?>
								<span class="ui label job-type <?php echo esc_attr( sanitize_title( $type->slug ) ); ?>"><?php echo esc_html( $type->name ); ?></span>
							<?php endforeach; endif; ?>
						</div>
					<?php } ?>
					<?php do_action( 'job_listing_meta_end' ); ?>
				</div>
			</div>

			<div class="ui vertical basic segment">
				<span class="text grey"><?php the_excerpt(); ?></span>
			</div>

			<div class="ui relaxed horizontal list">
				<div class="item">
					<div class="ui avatar image"><i class="large map pin icon"></i></div>
					<div class="content">
						<div class="header">
							<?php esc_html_e('Location', 'campoal') ?>
						</div>
						<?php the_job_location( false ); ?>
					</div>
				</div>

				<div class="item">
					<div class="ui avatar image"><i class="large dollar sign icon"></i></div>
					<div class="content">
						<div class="header">
							<?php esc_html_e('Salary', 'campoal') ?>
						</div>
						<?php conikal_display_job_salary_data(); ?>
					</div>
				</div>

				<div class="item">
					<div class="ui avatar image"><i class="large calendar outline icon"></i></div>
					<div class="content">
						<div class="header">
							<?php esc_html_e('Date', 'campoal') ?>
						</div>
						<?php the_job_publish_date(); ?>
					</div>
				</div>
			</div>
		</div>
	</div>
</div>
