<?php
/**
 * The template to display Admin notices
 *
 * @package TOURIMO
 * @since TOURIMO 1.0.64
 */

$tourimo_skins_url  = get_admin_url( null, 'admin.php?page=trx_addons_theme_panel#trx_addons_theme_panel_section_skins' );
$tourimo_skins_args = get_query_var( 'tourimo_skins_notice_args' );

?>
<div class="tourimo_admin_notice tourimo_skins_notice update-nag">
	<?php
	// Theme image
	$tourimo_theme_img = tourimo_get_file_url( 'screenshot.jpg' );
	if ( '' != $tourimo_theme_img ) {
		?>
		<div class="tourimo_notice_image"><img src="<?php echo esc_url( $tourimo_theme_img ); ?>" alt="<?php esc_attr_e( 'Theme screenshot', 'tourimo' ); ?>"></div>
		<?php
	}

	// Title
	?>
	<h3 class="tourimo_notice_title">
		<?php esc_html_e( 'New skins available', 'tourimo' ); ?>
	</h3>
	<?php

	// Description
	$tourimo_total      = $tourimo_skins_args['update'];	// Store value to the separate variable to avoid warnings from ThemeCheck plugin!
	$tourimo_skins_msg  = $tourimo_total > 0
							// Translators: Add new skins number
							? '<strong>' . sprintf( _n( '%d new version', '%d new versions', $tourimo_total, 'tourimo' ), $tourimo_total ) . '</strong>'
							: '';
	$tourimo_total      = $tourimo_skins_args['free'];
	$tourimo_skins_msg .= $tourimo_total > 0
							? ( ! empty( $tourimo_skins_msg ) ? ' ' . esc_html__( 'and', 'tourimo' ) . ' ' : '' )
								// Translators: Add new skins number
								. '<strong>' . sprintf( _n( '%d free skin', '%d free skins', $tourimo_total, 'tourimo' ), $tourimo_total ) . '</strong>'
							: '';
	$tourimo_total      = $tourimo_skins_args['pay'];
	$tourimo_skins_msg .= $tourimo_skins_args['pay'] > 0
							? ( ! empty( $tourimo_skins_msg ) ? ' ' . esc_html__( 'and', 'tourimo' ) . ' ' : '' )
								// Translators: Add new skins number
								. '<strong>' . sprintf( _n( '%d paid skin', '%d paid skins', $tourimo_total, 'tourimo' ), $tourimo_total ) . '</strong>'
							: '';
	?>
	<div class="tourimo_notice_text">
		<p>
			<?php
			// Translators: Add new skins info
			echo wp_kses_data( sprintf( __( "We are pleased to announce that %s are available for your theme", 'tourimo' ), $tourimo_skins_msg ) );
			?>
		</p>
	</div>
	<?php

	// Buttons
	?>
	<div class="tourimo_notice_buttons">
		<?php
		// Link to the theme dashboard page
		?>
		<a href="<?php echo esc_url( $tourimo_skins_url ); ?>" class="button button-primary"><i class="dashicons dashicons-update"></i> 
			<?php
			// Translators: Add theme name
			esc_html_e( 'Go to Skins manager', 'tourimo' );
			?>
		</a>
		<?php
		// Dismiss
		?>
		<a href="#" data-notice="skins" class="tourimo_hide_notice"><i class="dashicons dashicons-dismiss"></i> <span class="tourimo_hide_notice_text"><?php esc_html_e( 'Dismiss', 'tourimo' ); ?></span></a>
	</div>
</div>
