<?php
/**
 * Calendar view event listing block.
 *
 * @package EventimUSEventListings
 */

defined( 'ABSPATH' ) || exit;
?>
<div class="dashboard-module calendar-module">
	<div class="module-header">
		<h1><?php esc_html_e( 'Calendar', 'eventim-us-event-listings' ); ?></h1>
		<h4><?php esc_html_e( 'Display a formatted calendar with your event data.', 'eventim-us-event-listings' ); ?></h4>
	</div>
	<div class="module-content">
		<div class="settings-form">
			<div class="form-row shortcode-row">
				<div class="form-label">
					<label><?php esc_html_e( 'Shortcode', '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="[seecalendarview]">
						<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 week-starts-row">
				<div class="form-label">
					<label><?php esc_html_e( 'Week starts on', 'eventim-us-event-listings' ); ?></label>
				</div>
				<div class="form-input">
					<select name="evusel_settings[shortcodes][calendar_view][first_day_of_week]" style="width: 100%; box-sizing: border-box;">
						<option value="s" <?php echo $evuselConfig->get( 'shortcodes.calendar_view.first_day_of_week' ) === 's' ? 'selected' : ''; ?>>
							<?php esc_html_e( 'Sunday', 'eventim-us-event-listings' ); ?>
						</option>
						<option value="m" <?php echo $evuselConfig->get( 'shortcodes.calendar_view.first_day_of_week' ) === 'm' ? 'selected' : ''; ?>>
							<?php esc_html_e( 'Monday', 'eventim-us-event-listings' ); ?>
						</option>
					</select>
				</div>
			</div>

			<div class="form-row number-months-row">
				<div class="form-label">
					<label><?php esc_html_e( 'Number of months to display', 'eventim-us-event-listings' ); ?></label>
				</div>
				<div class="form-input">
					<select name="evusel_settings[shortcodes][calendar_view][number_of_months]" style="width: 100%; box-sizing: border-box;">
						<?php for ( $evusel_i = 1; $evusel_i <= 12; $evusel_i++ ) : ?>
							<option value="<?php echo esc_attr( $evusel_i ); ?>" <?php echo $evuselConfig->get( 'shortcodes.calendar_view.number_of_months' ) == $evusel_i ? 'selected' : ''; ?>>
								<?php echo esc_html( $evusel_i ); ?>
							</option>
						<?php endfor; ?>
					</select>
				</div>
			</div>

			<div class="form-row toggle-row">
				<div class="form-label">
					<label><?php esc_html_e( 'Show months with no events', 'eventim-us-event-listings' ); ?></label>
				</div>
				<div class="form-input">
					<label class="switch">
						<input type="checkbox" 
							name="evusel_settings[shortcodes][calendar_view][show_empty_months]"
							<?php echo $evuselConfig->get( 'shortcodes.calendar_view.show_empty_months' ) === 'on' ? 'checked' : ''; ?>>
						<span class="slider round"></span>
					</label>
				</div>
			</div>

			<div class="form-row toggle-row">
				<div class="form-label">
					<label><?php esc_html_e( 'Hide repeated image on same day events', 'eventim-us-event-listings' ); ?></label>
				</div>
				<div class="form-input">
					<label class="switch">
						<input type="checkbox" 
							name="evusel_settings[shortcodes][calendar_view][hide_repeating_images]"
							<?php echo $evuselConfig->get( 'shortcodes.calendar_view.hide_repeating_images' ) === 'on' ? 'checked' : ''; ?>>
						<span class="slider round"></span>
					</label>
				</div>
			</div>

			<div class="form-row toggle-row">
				<div class="form-label">
					<label><?php esc_html_e( 'List venue name', 'eventim-us-event-listings' ); ?></label>
				</div>
				<div class="form-input">
					<label class="switch">
						<input type="checkbox" 
							name="evusel_settings[shortcodes][calendar_view][show_venue_name]"
							<?php echo $evuselConfig->get( 'shortcodes.calendar_view.show_venue_name' ) === 'on' ? 'checked' : ''; ?>>
						<span class="slider round"></span>
					</label>
				</div>
			</div>
		</div>
	</div>
</div>