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

defined( 'ABSPATH' ) || exit;
?>
<div class="dashboard-module list-view-module">
	<div class="module-header">
		<h1><?php esc_html_e( 'List View', 'eventim-us-event-listings' ); ?></h1>
	</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 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="[seelistview type=grid]">
						<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 shortcode-row">
				<div class="form-label">
					<label><?php esc_html_e( 'Shortcode for List 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="[seelistview type=list]">
						<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 list-input-row">
				<div class="form-label">
					<label><?php esc_html_e( 'Initial events per page', 'eventim-us-event-listings' ); ?></label>
				</div>
				<div class="form-input">
					<input type="number" min="1" name="evusel_settings[shortcodes][list_view][per_page]"
						value="<?php echo esc_attr( $evuselConfig->get( 'shortcodes.list_view.per_page' ) ); ?>"
						style="width: 100%; box-sizing: border-box;">
				</div>
			</div>

			<div class="form-row list-input-row" id="list_column_amount">
				<div class="form-label">
					<label><?php esc_html_e( 'Grid columns', 'eventim-us-event-listings' ); ?></label>
				</div>
				<div class="form-input">
					<div class="radio-options">
						<?php
						$evusel_currentColumns = (int) $evuselConfig->get( 'shortcodes.list_view.column_amount' );
						foreach ( array( 2, 3, 4 ) as $evusel_cols ) :
							?>
							<div class="radio-option">
								<input type="radio" id="radio-list_view-column-<?php echo esc_attr( $evusel_cols ); ?>"
									name="evusel_settings[shortcodes][list_view][column_amount]"
									value="<?php echo esc_attr( $evusel_cols ); ?>"
									<?php echo $evusel_currentColumns === $evusel_cols ? 'checked' : ''; ?>>
								<label for="radio-list_view-column-<?php echo esc_attr( $evusel_cols ); ?>">
									<?php echo esc_html( $evusel_cols ); ?>
								</label>
							</div>
						<?php endforeach; ?>
					</div>
				</div>
			</div>

			<div class="form-row" id="list-navigation-type">
				<div class="form-label">
					<label><?php esc_html_e( 'Display more events', 'eventim-us-event-listings' ); ?></label>
				</div>
				<div class="form-input">
					<div class="radio-options">
						<div class="radio-option">
							<input type="radio" id="radio-list_view-navigation-for-list-pagination"
								name="evusel_settings[shortcodes][list_view][navigation_for_list]" value="pagination"
								<?php echo $evuselConfig->get( 'shortcodes.list_view.navigation_for_list' ) === 'pagination' ? 'checked' : ''; ?>>
							<label for="radio-list_view-navigation-for-list-pagination">
								<?php esc_html_e( 'Pagination', 'eventim-us-event-listings' ); ?>
							</label>
						</div>
						<div class="radio-option">
							<input type="radio" id="radio-list_view-navigation-for-list-loadmore"
								name="evusel_settings[shortcodes][list_view][navigation_for_list]" value="loadmore"
								<?php echo $evuselConfig->get( 'shortcodes.list_view.navigation_for_list' ) === 'loadmore' ? 'checked' : ''; ?>>
							<label for="radio-list_view-navigation-for-list-loadmore">
								<?php esc_html_e( '"Load More" button', 'eventim-us-event-listings' ); ?>
							</label>
						</div>
					</div>
				</div>
			</div>
		</div>
	</div>
</div>