<?php
/**
 * Single view job meta box.
 *
 * Hooked into single_job_listing_start priority 20
 *
 * This template can be overridden by copying it to yourtheme/job_manager/content-single-job_listing-meta.php.
 *
 * @see         https://wpjobmanager.com/document/template-overrides/
 * @author      Automattic
 * @package     wp-job-manager
 * @category    Template
 * @since       1.14.0
 * @version     1.28.0
 */

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

global $post; ?>

<div class="ui very padded raised segment">
	<h2 class="ui header"><?php esc_html_e('Job Summary', 'campoal') ?></h2>
	<div class="ui section divider"></div>
	<?php do_action( 'single_job_listing_meta_before' ); ?>
	
	<div class="ui very relaxed large list">
		<?php do_action( 'single_job_listing_meta_start' ); ?>

		<div class="item">
			<i class="money bill alternate icon"></i>
			<div class="middle aligned content">
				<div class="header"><?php esc_html_e('Salary', 'campoal') ?></div>
				<?php conikal_display_job_salary_data(); ?>
			</div>
		</div>

		<div class="item">
			<i class="briefcase icon"></i>
			<div class="content">
				<div class="header"><?php esc_html_e('Type', 'campoal') ?></div>
				<?php if ( get_option( 'job_manager_enable_types' ) ) { ?>
					<?php $types = wpjm_get_the_job_types(); ?>
					<?php if ( ! empty( $types ) ) : foreach ( $types as $type ) : ?>

						<?php echo esc_html( $type->name ); ?>

					<?php endforeach; endif; ?>
				<?php } ?>
			</div>
		</div>

		<div class="item">
			<i class="marker icon"></i>
			<div class="content">
				<div class="header"><?php esc_html_e('Location', 'campoal') ?></div>
				<?php the_job_location(); ?>
			</div>
		</div>

		<?php if (!empty(conikal_display_job_category_data(true))) : ?>
		<div class="item">
			<i class="folder icon"></i>
			<div class="content">
				<div class="header">
					<?php esc_html_e('Category', 'campoal') ?>
				</div>
				<?php conikal_display_job_category_data(); ?>
			</div>
		</div>
		<?php endif; ?>


		<?php if ( is_position_filled() ) : ?>
			<div class="item">
				<i class="info circle icon"></i>
				<div class="content position-filled">
					<div class="header"><?php esc_html_e('Position status', 'campoal') ?></div>
					<?php _e( 'This position has been filled', 'campoal' ); ?>
				</div>
			</div>
		<?php elseif ( ! candidates_can_apply() && 'preview' !== $post->post_status ) : ?>
			<div class="item">
				<i class="info circle icon"></i>
				<div class="content ">
					<div class="header"><?php esc_html_e('Position status', 'campoal') ?></div>
					<?php _e( 'Applications have closed', 'campoal' ); ?>
				</div>
			</div>
		<?php endif; ?>

		<?php do_action( 'single_job_listing_meta_end' ); ?>
	</div>

	<?php do_action( 'single_job_listing_meta_after' ); ?>
</div>
