| @@ -1,82 +1,88 @@ | ||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * Template for displaying setup form of static pages while setting up LP | |
| 3 | + * Template for displaying system pages while setting up LearnPress. | |
| 4 | 4 | * |
| 5 | 5 | * @author ThimPress |
| 6 | 6 | * @package LearnPress/Admin/Views |
| 7 | - * @version 3.0.1 | |
| 7 | + * @version 4.3.2 | |
| 8 | 8 | */ |
| 9 | 9 | |
| 10 | -defined( 'ABSPATH' ) or exit; | |
| 10 | +defined( 'ABSPATH' ) || exit; | |
| 11 | 11 | |
| 12 | +$system_pages = array( | |
| 13 | + 'courses' => array( | |
| 14 | + 'title' => __( 'All Courses Page', 'learnpress' ), | |
| 15 | + 'description' => __( 'Main directory displaying all available courses for students.', 'learnpress' ), | |
| 16 | + ), | |
| 17 | + 'instructors' => array( | |
| 18 | + 'title' => __( 'All Instructors Page', 'learnpress' ), | |
| 19 | + 'description' => __( 'Grid listing all registered teachers and instructors.', 'learnpress' ), | |
| 20 | + ), | |
| 21 | + 'single_instructor' => array( | |
| 22 | + 'title' => __( 'Single Instructor Page', 'learnpress' ), | |
| 23 | + 'description' => __( 'Public instructor profile and their authored courses.', 'learnpress' ), | |
| 24 | + ), | |
| 25 | + 'profile' => array( | |
| 26 | + 'title' => __( 'Profile Page', 'learnpress' ), | |
| 27 | + 'description' => __( 'Student dashboard for enrolled courses, certificates & progress.', 'learnpress' ), | |
| 28 | + ), | |
| 29 | + 'checkout' => array( | |
| 30 | + 'title' => __( 'Checkout Page', 'learnpress' ), | |
| 31 | + 'description' => __( 'Secure payment checkout and course registration page.', 'learnpress' ), | |
| 32 | + ), | |
| 33 | + 'become_a_teacher' => array( | |
| 34 | + 'title' => __( 'Become an Instructor Page', 'learnpress' ), | |
| 35 | + 'description' => __( 'Registration form for prospective instructors to apply.', 'learnpress' ), | |
| 36 | + ), | |
| 37 | + 'term_conditions' => array( | |
| 38 | + 'title' => __( 'Terms and Conditions Page', 'learnpress' ), | |
| 39 | + 'description' => __( 'Terms of service agreement required prior to course purchase.', 'learnpress' ), | |
| 40 | + ), | |
| 41 | +); | |
| 12 | 42 | ?> |
| 13 | -<h2><?php _e( 'Static Pages', 'learnpress' ); ?></h2> | |
| 43 | +<section class="lp-setup-system-pages"> | |
| 44 | + <header class="lp-setup-section-header"> | |
| 45 | + <h2><?php esc_html_e( 'Step 2: Setup System Pages', 'learnpress' ); ?></h2> | |
| 46 | + <p> | |
| 47 | + <?php esc_html_e( 'When LearnPress is installed, essential system pages are automatically created and assigned out-of-the-box so your online academy is ready to function right away. You can easily re-assign or customize any page below anytime.', 'learnpress' ); ?> | |
| 48 | + </p> | |
| 49 | + </header> | |
| 14 | 50 | |
| 15 | -<p><?php _e( 'The pages will display the content of LP\'s necessary pages, such as Courses, Checkout, and Profile.', 'learnpress' ); ?></p> | |
| 51 | + <div class="lp-setup-system-pages__list"> | |
| 52 | + <?php foreach ( $system_pages as $page_key => $page_data ) { ?> | |
| 53 | + <?php | |
| 54 | + $page_id = learn_press_get_page_id( $page_key ); | |
| 55 | + $is_ready = $page_id && 'publish' === get_post_status( $page_id ); | |
| 56 | + ?> | |
| 57 | + <article class="lp-setup-page-card lp-setup-card"> | |
| 58 | + <div class="lp-setup-page-card__content"> | |
| 59 | + <h3><?php echo esc_html( $page_data['title'] ); ?></h3> | |
| 60 | + <p><?php echo esc_html( $page_data['description'] ); ?></p> | |
| 61 | + </div> | |
| 16 | 62 | |
| 17 | -<table class="form-field"> | |
| 18 | - <tr> | |
| 19 | - <th> | |
| 20 | - <?php _e( 'All courses page', 'learnpress' ); ?> | |
| 21 | - </th> | |
| 22 | - <td> | |
| 23 | - <?php learn_press_pages_dropdown( 'learn_press_courses_page_id', learn_press_get_page_id( 'courses' ) ); ?> | |
| 24 | - </td> | |
| 25 | - </tr> | |
| 26 | - <tr> | |
| 27 | - <th> | |
| 28 | - <?php _e( 'All instructors page', 'learnpress' ); ?> | |
| 29 | - </th> | |
| 30 | - <td> | |
| 31 | - <?php learn_press_pages_dropdown( 'learn_press_instructors_page_id', learn_press_get_page_id( 'instructors' ) ); ?> | |
| 32 | - </td> | |
| 33 | - </tr> | |
| 34 | - <tr> | |
| 35 | - <th> | |
| 36 | - <?php _e( 'Single instructor page', 'learnpress' ); ?> | |
| 37 | - </th> | |
| 38 | - <td> | |
| 39 | - <?php learn_press_pages_dropdown( 'learn_press_single_instructor_page_id', learn_press_get_page_id( 'single_instructor' ) ); ?> | |
| 40 | - </td> | |
| 41 | - </tr> | |
| 42 | - <tr> | |
| 43 | - <th> | |
| 44 | - <?php _e( 'Profile page', 'learnpress' ); ?> | |
| 45 | - </th> | |
| 46 | - <td> | |
| 47 | - <?php learn_press_pages_dropdown( 'learn_press_profile_page_id', learn_press_get_page_id( 'profile' ) ); ?> | |
| 48 | - </td> | |
| 49 | - </tr> | |
| 50 | - <tr> | |
| 51 | - <th> | |
| 52 | - <?php _e( 'Checkout page', 'learnpress' ); ?> | |
| 53 | - </th> | |
| 54 | - <td> | |
| 55 | - <?php learn_press_pages_dropdown( 'learn_press_checkout_page_id', learn_press_get_page_id( 'checkout' ) ); ?> | |
| 56 | - </td> | |
| 57 | - </tr> | |
| 58 | - <tr> | |
| 59 | - <th> | |
| 60 | - <?php _e( 'Become an instructors page', 'learnpress' ); ?> | |
| 61 | - </th> | |
| 62 | - <td> | |
| 63 | - <?php learn_press_pages_dropdown( 'learn_press_become_a_teacher_page_id', learn_press_get_page_id( 'become_a_teacher' ) ); ?> | |
| 64 | - </td> | |
| 65 | - </tr> | |
| 66 | - <tr> | |
| 67 | - <th> | |
| 68 | - <?php _e( 'Terms and conditions page', 'learnpress' ); ?> | |
| 69 | - </th> | |
| 70 | - <td> | |
| 71 | - <?php learn_press_pages_dropdown( 'learn_press_term_conditions_page_id', learn_press_get_page_id( 'term_conditions' ) ); ?> | |
| 72 | - </td> | |
| 73 | - </tr> | |
| 74 | - <tr> | |
| 75 | - <th> | |
| 76 | - <?php _e( 'Logout Redirect', 'learnpress' ); ?> | |
| 77 | - </th> | |
| 78 | - <td> | |
| 79 | - <?php learn_press_pages_dropdown( 'learn_press_logout_redirect_page_id', learn_press_get_page_id( 'logout_redirect' ) ); ?> | |
| 80 | - </td> | |
| 81 | - </tr> | |
| 82 | -</table> | |
| 63 | + <div class="lp-setup-page-card__actions"> | |
| 64 | + <?php if ( $is_ready ) { ?> | |
| 65 | + <span class="lp-setup-page-status lp-setup-page-status--ready"> | |
| 66 | + <span class="lp-icon-check" aria-hidden="true"></span> | |
| 67 | + <?php esc_html_e( 'Created & Ready to use', 'learnpress' ); ?> | |
| 68 | + </span> | |
| 69 | + | |
| 70 | + <a class="lp-setup-page-card__edit" href="<?php echo esc_url( get_edit_post_link( $page_id ) ); ?>" target="_blank" rel="noopener noreferrer"> | |
| 71 | + <span class="lp-icon-edit" aria-hidden="true"></span> | |
| 72 | + <?php esc_html_e( 'Edit', 'learnpress' ); ?> | |
| 73 | + </a> | |
| 74 | + | |
| 75 | + <a class="lp-setup-page-card__view" href="<?php echo esc_url( get_permalink( $page_id ) ); ?>" target="_blank" rel="noopener noreferrer"> | |
| 76 | + <span class="lp-icon-eye" aria-hidden="true"></span> | |
| 77 | + <?php esc_html_e( 'View', 'learnpress' ); ?> | |
| 78 | + </a> | |
| 79 | + <?php } else { ?> | |
| 80 | + <span class="lp-setup-page-status lp-setup-page-status--missing"> | |
| 81 | + <?php esc_html_e( 'Needs setup', 'learnpress' ); ?> | |
| 82 | + </span> | |
| 83 | + <?php } ?> | |
| 84 | + </div> | |
| 85 | + </article> | |
| 86 | + <?php } ?> | |
| 87 | + </div> | |
| 88 | +</section> | |