<?php
/**
 * Template for displaying course content within the loop.
 *
 * This template can be overridden by copying it to yourtheme/learnpress/content-single-course.php
 *
 * @author  ThimPress
 * @package LearnPress/Templates
 * @version 3.0.0
 */

/**
 * Prevent loading this file directly
 */
defined( 'ABSPATH' ) || exit();

if ( post_password_required() ) {
	echo get_the_password_form();

	return;
}

/**
 * @deprecated
 */
do_action( 'learn_press_before_main_content' );
do_action( 'learn_press_before_single_course' );
do_action( 'learn_press_before_single_course_summary' );

$edumodo_lp_course_login_popup   = edumodo_get_theme_mod('edumodo_single_lp_course_login_popup', 'on');
$edumodo_lp_course_category = edumodo_get_theme_mod('edumodo_single_lp_course_category', 'on');
$edumodo_lp_course_related_course = edumodo_get_theme_mod('edumodo_single_lp_course_related_course', 'on');

?>

<div class="lpcourse-course-wapper-2">

		<div class="lpcourse-top-2">

			<div class="<?php if ( has_post_thumbnail() ) : echo "col-md-6";  endif;  ?> less-padding-two">
				<?php 
					if ( has_post_thumbnail() ) { ?>
				<div class="course-thumbnail"> 
					<?php the_post_thumbnail(); ?>
				</div>
				<?php } ?>
			</div>

			<div class="<?php if ( has_post_thumbnail() ) : echo "col-md-6"; else : echo "col-md-12"; endif;  ?>">
				<div class="course-info">
					<?php the_title( '<h1 class="entry-title" itemprop="name">', '</h1>' ); ?>
					<?php if('on' == $edumodo_lp_course_category) : ?>
						<div class="course-meta">
							<i class="fa fa-folder-open" aria-hidden="true"></i><?php learn_press_course_categories(); ?>
						</div>
					<?php endif; ?>
					<div class="single-excerpt">
						<?php echo get_the_excerpt(); ?>
					</div>

					<div class="lpcourse-top-button">
						<div class="single-price">
							<?php learn_press_courses_loop_item_price(); ?>
						</div>
				<?php if ( ! is_user_logged_in() && 'on' == $edumodo_lp_course_login_popup ): ?>
					<div class="edumodo-popup-login-register">
					  <a id="modal_trigger" href="#modal">
					  	<?php learn_press_course_buttons(); ?>
					  </a>

					  <div id="modal" class="lp-popupContainer" style="display:none;">
					    <header class="lp-popupHeader">
					      <span class="header_title"><?php _e( 'Login', 'edumodo' ); ?></span>
					      <span class="modal_close"><i class="glyph-icon flaticon-remove-symbol"></i></i></span>
					    </header>

					    <section class="edumodo-lp-popupBody">
					    	<!-- Social Login widget-->
							<div class="social_login_widget">
								<?php if ( is_active_sidebar( 'lp-login-register' ) ) : ?>    
								     <?php dynamic_sidebar( 'lp-login-register' ); ?>
								<?php endif; ?>
							</div>
					      <!-- Username & Password Login form -->
					      	<?php if (function_exists('learn_press_profile_login_form')) { ?>
					      <div class="lp_user_login">
					    	<?php learn_press_profile_login_form(); ?>
					          <?php _e( 'Not a member yet?', 'edumodo' ); ?> <a class="lp-register-link" href="#" id="register_form"><?php _e( 'Register now', 'edumodo' ); ?></a>
					      </div>
							<?php } ?>
					      <!-- Register Form -->
					    <?php if (function_exists('learn_press_profile_register_form')) { ?>
					      <div class="user_register">
					    	<?php learn_press_profile_register_form(); ?>
					    	  <div class="lp_action_btns">
						            <div class="one_half"><a href="#" class=" back_btn"><i class="fa fa-angle-double-left"></i> <?php _e( 'Back', 'edumodo' ); ?></a>
						            </div>
					            <div>
					      </div>
					  		<?php } ?>
					    </section>
					  </div>
					</div>	
				<?php else : ?>	
					<?php learn_press_course_buttons(); ?>
				<?php endif; ?>
					</div>
				</div> 
			</div>
			
		</div>

		<div class="lpcourse-main-2">
			<div class="col-md-8"> 
				<?php
				/**
				 * @since 3.0.0
				 */
				//do_action( 'learn-press/before-main-content' );

				do_action( 'learn-press/before-single-course' );

				?>
				<div id="learn-press-course" class="course-summary">
					<?php
					/**
					 * @since 3.0.0
					 *
					 * @see learn_press_single_course_summary()
					 */
					do_action( 'learn-press/single-course-summary' );
					?>
				</div>

				<?php
					/**
					 * @since 3.0.0
					 */
					//do_action( 'learn-press/after-main-content' );

					//do_action( 'learn-press/after-single-course' ); 
				?>

			</div>
			<div class="col-md-4"> 
				<?php edumodo_course_info(); ?>
				<?php if ('on' == $edumodo_lp_course_related_course): ?>			
					<?php edumodo_related_courses(); ?>
				<?php endif; ?>

			</div>
		</div>
</div>


<?php
/**
 * @deprecated
 */
do_action( 'learn_press_after_single_course_summary' );
do_action( 'learn_press_after_single_course' );
do_action( 'learn_press_after_main_content' );