<?php
/**
 * Just announced events filter block.
 *
 * @package EventimUSEventListings
 */

defined( 'ABSPATH' ) || exit;
?>
<div class="dashboard-module">
	<div class="module-header">
		<h1><?php esc_html_e( 'Just Announced', 'eventim-us-event-listings' ); ?></h1>
		<h4><?php esc_html_e( 'Display your events based on Publish Date on Eventim US. In the case there is no publish date given, the Just Announced section will default to showing upcoming shows.', 'eventim-us-event-listings' ); ?>
		</h4>
	</div>
	<div class="module-content">
		<div class="settings-form">
			<div class="form-row">
				<div class="form-label">
					<label><?php esc_html_e( 'Shortcode for Grid view', 'eventim-us-event-listings' ); ?></label>
				</div>
				<div class="form-input">
					<div class="input-with-button">
						<input class="shortcode-info-input regular-text" type="text"
							value="[<?php echo esc_attr( $evuselConfig::SHORTCODE_JUST_ANNOUNCED_EVENTS . " tag-parameters='" . implode( ',', $tagParameters ) . "'" ); ?>]">
						<button type="button" class="see-menu-item dispevli-menu-item-active copy-shortcode"
							onclick="copyShortcode(this)">
							<?php esc_html_e( 'Copy', 'eventim-us-event-listings' ); ?>
						</button>
					</div>
				</div>
			</div>

			<div class="form-row">
				<div class="form-label">
					<label><?php esc_html_e( 'Number of events displayed', 'eventim-us-event-listings' ); ?></label>
				</div>
				<div class="form-input">
					<input type="number" name="evusel_settings[shortcodes][just_announced][no_to_display]"
						id="list-view-type"
						value="<?php echo esc_attr( $evuselConfig->get( 'shortcodes.just_announced.no_to_display' ) ); ?>"
						min="1" max="10">
				</div>
			</div>

			<div class="form-row">
				<div class="form-label">
					<label><?php esc_html_e( 'Tag Parameters', 'eventim-us-event-listings' ); ?></label>
				</div>
				<div class="form-input">
					<div class="radio-options connected-radio-options"
						style="max-height: 150px; overflow-y: auto;  border-radius: 2px; width: 100%;">
						
						<?php foreach ( $tags as $evusel_tagItem ) : ?>
							<div class="radio-option">
								<input type="checkbox" id="tag-<?php echo esc_attr( $evusel_tagItem->slug ); ?>"
									name="evusel_settings[shortcodes][just_announced][selected_tags][]"
									value="<?php echo esc_attr( $evusel_tagItem->slug ); ?>" <?php echo in_array( $evusel_tagItem->slug, $tagParameters ) ? 'checked' : ''; ?>>
								<label for="tag-<?php echo esc_attr( $evusel_tagItem->slug ); ?>">
									<?php echo esc_html( $evusel_tagItem->name ); ?>
								</label>
							</div>
						<?php endforeach; ?>
					</div>
				</div>
			</div>
		</div>
	</div>
</div>