<?php
	$customHelp = null;
if ( ! $this->yarpp->diagnostic_custom_templates() ) {
	$customHelp = __( 'This option is disabled because no YARPP templates were found in your active theme folder.', 'yet-another-related-posts-plugin' );
}
if ( $this->offer_copy_templates() ) {
	$customHelp .=
	' ' . __( 'Would you like to copy some sample templates bundled with YARPP into your active theme folder?', 'yet-another-related-posts-plugin' ) .
	'<br /><br /><input type="button" class="button button-small yarpp_copy_templates_button" value="' . esc_attr( __( 'Copy Templates', 'yet-another-related-posts-plugin' ) ) . '"/><span class="spinner"></span>';
}
?>

<div class="yarpp_form_row <?php echo $class; ?>"><?php _e( 'Theme:', 'yet-another-related-posts-plugin' ); ?></div>
<div class="yarpp_form_row yarpp_form_template_buttons <?php echo $class; ?>">
	<div data-value="builtin" class="yarpp_template_button <?php echo $builtIn; ?>">
		<div class="image"></div>
		<div class="label"><?php _e( 'List', 'yet-another-related-posts-plugin' ); ?></div>
	</div>

	<div
		data-value="thumbnails"
		class="yarpp_template_button <?php echo $thumbnails; ?> <?php echo $diagPostThumbs; ?>"
		<?php if ( ! $this->yarpp->diagnostic_post_thumbnails() ) : ?>
		data-help="<?php echo esc_attr( __( 'This option is disabled because your theme does not support post thumbnails.', 'yet-another-related-posts-plugin' ) ); ?>"
		<?php endif ?>
	>
		<div class="image"></div>
		<div class="label"><?php _e( 'Thumbnails', 'yet-another-related-posts-plugin' ); ?></div>
	</div>

	<div
		data-value="custom"
		class="yarpp_template_button <?php echo $custom; ?> <?php echo $diagCustTemplt; ?>"
		<?php if ( $customHelp ) : ?>
		data-help="<?php echo esc_attr( $customHelp ); ?>"
		<?php endif ?>
	>
		<div class="image"></div>
		<div class="label"><?php _e( 'Custom', 'yet-another-related-posts-plugin' ); ?></div>
	</div>

	<input
		type="hidden"
		name="<?php echo $pre; ?>use_template"
		id="yarpp-<?php echo $pre; ?>use_template"
		class="use_template" value="<?php echo $choice; ?>"
	/>

</div>
