<?php
/**
 * Provide a admin area view for the plugin
 *
 * This file is used to markup the admin-facing aspects of the plugin.
 * This file should primarily consist of HTML with a little bit of PHP.
 *
 * @link       https://personalizewp.com
 * @since      1.0.0
 *
 * @package    PersonalizeWP
 * @subpackage PersonalizeWP/Admin/Partials
 */

use PersonalizeWP\Admin\PageRules;

defined( 'ABSPATH' ) || exit; // Exit if accessed directly.

?>
<main class="section flow">
	<a class="back" href="<?php echo esc_url( admin_url( PageRules::$index_url ) ); ?>">&larr; <?php esc_html_e( 'Back', 'personalizewp' ); ?></a>
	<h2 class="section-title"><?php esc_html_e( 'Add New Rule', 'personalizewp' ); ?></h2>

	<div class="pwp-panel">
		<div class="section-description">
			<p><?php esc_html_e( 'Create a new rule using the options below. Once the rule has been added, it will become active or inactive, depending on the conditions chosen. All conditions within a single rule are matched using AND logic.', 'personalizewp' ); ?></p>
			<p>
			<?php
			echo wp_kses(
				sprintf(
					/* translators: 1: %s HTML of asterisk indicating required fields */
					__( '%s = required fields', 'personalizewp' ),
					'<span class="required">*</span>'
				),
				array(
					'span' => array(
						'class' => array(),
					),
				)
			);
			?>
		</div>

		<form action="<?php echo esc_url( admin_url( PageRules::$create_url ) ); ?>" method="post" accept-charset="UTF-8" id="pwp-form">
			<?php
				wp_nonce_field( 'rule-create' );
				require_once __DIR__ . '/_form.php';
			?>
		</form>
	</div>
</main>
