*'; /** * Sample booking page. * * @param string $mode Which halves the block embeds — one of * {@see Booking\BookingPage::MODE_BOTH}, * `MODE_BOOKING` or `MODE_UPCOMING`. The preview shows * the same sections the published page would. */ public static function booking( string $mode = Booking\BookingPage::MODE_BOTH ): string { if ( Booking\BookingPage::MODE_UPCOMING === $mode ) { return sprintf( '
%s
%s
', self::note( __( 'Editor preview — students see their own lessons on the published page.', 'unsupervised-schedular' ) ), self::upcomingLessons() ); } $days = [ [ 'label' => __( 'Monday', 'unsupervised-schedular' ), 'slots' => [ [ '4:00 PM–4:30 PM', 30 ], [ '4:30 PM–5:00 PM', 30 ], ], ], [ 'label' => __( 'Wednesday', 'unsupervised-schedular' ), 'slots' => [ [ '5:00 PM–5:45 PM', 45 ], ], ], ]; $dayHtml = ''; foreach ( $days as $day ) { $slotHtml = ''; foreach ( $day['slots'] as $slot ) { $slotHtml .= sprintf( '
%s (%d min)
', esc_html( $slot[0] ), (int) $slot[1], esc_html__( 'Book', 'unsupervised-schedular' ) ); } $dayHtml .= sprintf( '

%s

%s
', esc_html( $day['label'] ), $slotHtml ); } $lessons = Booking\BookingPage::MODE_BOOKING === $mode ? '' : sprintf( '
%s
', self::upcomingLessons() ); return sprintf( '
%s%s
%s
', self::note( __( 'Editor preview — students see live availability on the published page.', 'unsupervised-schedular' ) ), $lessons, $dayHtml ); } /** * Sample "your upcoming lessons" panel, shared by the booking preview's * full and upcoming-only modes. */ private static function upcomingLessons(): string { return sprintf( '

%s

' . '
' . '%s (30 min)' . '%s
' . '
' . '%s' . '' . '
', esc_html__( 'Your upcoming lessons', 'unsupervised-schedular' ), esc_html__( 'Piano Lesson', 'unsupervised-schedular' ), esc_html__( 'Monday · 4:00 PM–4:30 PM', 'unsupervised-schedular' ), esc_html__( 'Confirmed', 'unsupervised-schedular' ), esc_html__( 'Cancel', 'unsupervised-schedular' ) ); } /** * Sample group-class card. * * @param bool $singleClass Whether the block is pinned to one class, in * which case the live page omits the class * description and the preview does too. */ public static function groupClasses( bool $singleClass = false ): string { $note = $singleClass ? __( 'Editor preview — the published page shows the chosen class with its live schedule and enrolment status.', 'unsupervised-schedular' ) : __( 'Editor preview — students see live group classes on the published page.', 'unsupervised-schedular' ); $description = $singleClass ? '' : '

' . esc_html__( 'A sample class shown so the page can be styled.', 'unsupervised-schedular' ) . '

'; return sprintf( '
%s

%s

%s

%s

%s

%s

', self::note( $note ), esc_html__( 'Beginner Group Class', 'unsupervised-schedular' ), esc_html__( 'Saturdays 10:00 AM–11:00 AM', 'unsupervised-schedular' ), $description, // Prices on the live page always carry their cadence, so the sample does too. esc_html__( '25.00 CAD up front', 'unsupervised-schedular' ), esc_html__( 'Enrol by Sep 6, 2026', 'unsupervised-schedular' ), esc_html__( 'Enrol', 'unsupervised-schedular' ) ); } /** * The live login form renders fine without any request state, so the * preview includes the real template (the editing user is logged in, which * would otherwise short-circuit to an "already logged in" message). */ public static function login(): string { $error = ''; ob_start(); include USC_PLUGIN_DIR . 'templates/frontend/login-page.php'; return self::note( __( 'Editor preview — logged-in visitors are offered a link to the booking page instead.', 'unsupervised-schedular' ) ) . (string) ob_get_clean(); } public static function registration(): string { $fields = sprintf( '

', esc_html__( 'Email', 'unsupervised-schedular' ) ); $fields .= sprintf( '

', esc_html__( 'Your name', 'unsupervised-schedular' ) ); $fields .= sprintf( '

', esc_html__( 'Password', 'unsupervised-schedular' ) ); $fields .= sprintf( '

', esc_attr__( 'Create Account', 'unsupervised-schedular' ) ); return sprintf( '
%s
%s
', self::note( __( 'Editor preview — the live form requires a valid invite link and lists signup policies.', 'unsupervised-schedular' ) ), $fields ); } /** * Sample family page: the account holder's own details, two representative * children and the add form, with the controls inert so the editor preview * cannot post. */ public static function family(): string { $self = sprintf( '

%s

%s grace@example.com

' . '

' . '

' . '

' . '

', esc_html__( 'Your details', 'unsupervised-schedular' ), esc_html__( 'Email', 'unsupervised-schedular' ), esc_html__( 'Your name', 'unsupervised-schedular' ), esc_attr__( 'Grace Hopper', 'unsupervised-schedular' ), esc_html__( 'I take lessons myself', 'unsupervised-schedular' ), esc_html__( 'Your birth year', 'unsupervised-schedular' ), esc_html__( 'Save my details', 'unsupervised-schedular' ) ); $children = ''; foreach ( [ 'Ada Lovelace', 'Alan Turing' ] as $name ) { $children .= sprintf( '
  • %s' . '%s
  • ', esc_html( $name ), esc_html__( 'Edit', 'unsupervised-schedular' ), esc_html__( 'Remove', 'unsupervised-schedular' ) ); } $add = sprintf( '

    %s

    ' . '

    ' . '

    ', esc_html__( 'Add a student', 'unsupervised-schedular' ), esc_html__( 'Name', 'unsupervised-schedular' ), esc_html__( 'Birth year', 'unsupervised-schedular' ), esc_html__( 'Add student', 'unsupervised-schedular' ) ); return sprintf( '
    %s

    %s

    %s
    ' . '

    %s

    %s
    ', self::note( __( 'Editor preview — signed-in visitors see and manage their own details and students here.', 'unsupervised-schedular' ) ), esc_html__( 'Your profile', 'unsupervised-schedular' ), $self, esc_html__( 'Your students', 'unsupervised-schedular' ), $children, $add ); } /** * Sample account panel. Shown populated whatever the editor's own login * state, since on the published page a signed-out visitor may see nothing at * all and an empty box tells the person placing the block nothing. */ public static function account(): string { return sprintf( '
    %s' . '

    ' . '

    ' . '

    ', self::note( __( 'Editor preview — each visitor sees their own account here.', 'unsupervised-schedular' ) ), esc_html__( 'Grace Hopper', 'unsupervised-schedular' ), esc_html__( 'grace@example.com', 'unsupervised-schedular' ), esc_html__( 'Sign out', 'unsupervised-schedular' ) ); } private static function note( string $text ): string { return '

    ' . esc_html( $text ) . '

    '; } }