<?php
/**
 * This file belongs to the YIT Plugin Framework.
 *
 * This source file is subject to the GNU GENERAL PUBLIC LICENSE (GPL 3.0)
 * that is bundled with this package in the file LICENSE.txt.
 * It is also available through the world-wide-web at this URL:
 * http://www.gnu.org/licenses/gpl-3.0.txt
 *
 * @package YITH WooCommerce Request A Quote Premium
 * @var WP_List_Table $table
 * @var bool          $is_blank
 */

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


?>
<div class="ywdpd-admin-wrap-content">


	<?php
	/**
	 * This file belongs to the YIT Plugin Framework.
	 *
	 * This source file is subject to the GNU GENERAL PUBLIC LICENSE (GPL 3.0)
	 * that is bundled with this package in the file LICENSE.txt.
	 * It is also available through the world-wide-web at this URL:
	 * http://www.gnu.org/licenses/gpl-3.0.txt
	 *
	 * @package YITH WooCommerce Request A Quote Premium
	 */

	/**
	 * Admin View: Exclusions List Table
	 */

	if ( ! defined( 'ABSPATH' ) ) {
		exit; // Exit if accessed directly.
	}
	?>
	<div class="wrap ywdpd-exclusion-list-tab">
		<?php
		if ( $is_blank ) :

			$submessage = sprintf( '<p><small>%s</small></p>', __( 'Click on the "Add exclusion" button to exclude a product, a category or a tag!', 'ywdpd' ) );
			$component  = array(
				'type'     => 'list-table-blank-state',
				'icon_url' => YITH_YWDPD_URL . '/assets/icons/exclusion-list.svg',
				'message'  => __( 'Your exclusion list is empty...', 'ywdpd' ) . $submessage,
				'cta'      => array(
					'title' => __( 'Add exclusion', 'ywdpd' ),
					'class' => 'ywdpd-add-exclusion yith-plugin-fw__button--add',
				),
			);
			yith_plugin_fw_get_component( $component );
			?>
		<?php else : ?>
			<div class="yith-plugin-ui--boxed-wp-list-style">
				<form method="get">
					<input type="hidden" name="page" value="<?php echo esc_attr( $get['page'] ); ?>">
					<input type="hidden" name="tab" value="exclusions">
					<?php $table->display(); ?>
				</form>
			</div>
			<div>
				<button type="button"
				        class="ywdpd-add-exclusion yith-plugin-fw__button--add yith-plugin-fw__button--xxl"><?php esc_html_e( 'Add exclusion', 'ywdpd' ); ?></button>
			</div>
		<?php endif; ?>

	</div>
</div>
<script type="text/template" id="tmpl-ywdpd-exclusion-popup">
	<?php
	require YITH_YWDPD_VIEW_PATH . '/panel/custom-tabs/ywdpd-exclusions-popup.php';
	?>
</script>

