{% extends 'wizard/slides/common/base.twig' %}

{% block slide_body %}
	{{ icwp_macros.slideTitle( 'Exclude Certain Files From Scan' ) }}
	<p class="font-italic">(Skip to the next step to run the scan immediately.)</p>
	<p>There are often different types of files on a website that are legitimate but
	   not part of the WordPress Core.</p>
	<p>Since Shield can't automatically know about all the files on your hosting, we give you the ability
	   to add your own list of files to exclude from the scanner.</p>
	<p>In the box below, add each file name you want to ignore. If you
	don't know what to put in here just now, skip to the next step to run the scanner.</p>
	<p>Note: You can come back here and add files if the scanner picks up something
	that you want to ignore.</p>

	<form class="form-horizontal icwp-wizard-form">

		<div class="row">
			<label class="col-4 col-form-label" for="_exclusions">Excluded Files List</label>
			<div class="col-8">
				<textarea class="form-control" name="exclusions" rows="{{ data.files.count + 2 }}"
						  placeholder="{{ data.files.list }}" id="_exclusions">{{ data.files.list }}</textarea>
			</div>
		</div>
		<div class="row">
			<div class="col-11">
				Take a <strong>new line</strong> for each file name.
				<br />Note: You may also use regular expressions.
				<br />Regular expressions must <strong>start and end</strong> with a "hash" character
				i.e. <code>#</code>
				<br />You must escape special characters.
				<br />An example: <code>#\.log#</code>
				<br />This will match the following files:
				<code>test.log</code>, <code>text.log.txt</code>, <code>.log.ini</code>
			</div>
		</div>

		{{ icwp_macros.formInput_Hidden( 'wizard-step', 'exclusions' ) }}
		{{ icwp_macros.formInput_Submit( 'Update File Exclusions' ) }}
	</form>

	<script type="text/javascript">
		jQuery( document ).on( 'icwpWizardFormSubmit', function ( event, oResponse ) {
			if ( oResponse.success ) {
				var $oForm = jQuery( event.target );
				jQuery( 'button[type=submit]', $oForm ).prop( 'disabled', false );
			}
		} );
	</script>
{% endblock %}