comment-card.php
5 days ago
comment-form.php
5 days ago
comment-list.php
5 days ago
comment-replies.php
5 days ago
comments.php
5 days ago
content.php
5 days ago
exercise-files.php
5 days ago
footer.php
5 days ago
nav-item.php
5 days ago
overview.php
5 days ago
exercise-files.php
52 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Lesson exercise files |
| 4 | * |
| 5 | * @package Tutor\Templates |
| 6 | * @subpackage LearningArea |
| 7 | * @author Themeum <support@themeum.com> |
| 8 | * @link https://themeum.com |
| 9 | * @since 4.0.0 |
| 10 | */ |
| 11 | |
| 12 | defined( 'ABSPATH' ) || exit; |
| 13 | |
| 14 | use TUTOR\Icon; |
| 15 | use Tutor\Components\SvgIcon; |
| 16 | global $tutor_current_content_id; |
| 17 | |
| 18 | $attachments = tutor_utils()->get_attachments( $tutor_current_content_id ); |
| 19 | $open_mode_view = 'view' === apply_filters( 'tutor_pro_attachment_open_mode', null ); |
| 20 | |
| 21 | ?> |
| 22 | |
| 23 | <div x-show="activeTab === 'exercise_files'" x-cloak class="tutor-tab-panel" role="tabpanel"> |
| 24 | <div class="tutor-lesson-exercise-files tutor-p-6"> |
| 25 | <h5 class="tutor-h5 tutor-mb-4"><?php esc_html_e( 'Exercise Files', 'tutor' ); ?></h5> |
| 26 | <div class="tutor-grid tutor-grid-cols-2 tutor-sm-grid-cols-1 tutor-gap-5"> |
| 27 | <?php foreach ( $attachments as $attachment ) : ?> |
| 28 | <div class="tutor-rounded-md tutor-flex tutor-flex-col tutor-gap-2"> |
| 29 | <div class="tutor-card tutor-attachment-card"> |
| 30 | <div class="tutor-attachment-card-icon" aria-hidden="true"> |
| 31 | <?php SvgIcon::make()->name( Icon::RESOURCES )->render(); ?> |
| 32 | </div> |
| 33 | <div class="tutor-attachment-card-body"> |
| 34 | <div class="tutor-attachment-card-title"> |
| 35 | <?php echo esc_html( sprintf( '%s (%s)', $attachment->title, $attachment->ext ) ); ?> |
| 36 | </div> |
| 37 | <span class="tutor-attachment-card-meta"> |
| 38 | <?php echo esc_html( $attachment->size ); ?> |
| 39 | </span> |
| 40 | </div> |
| 41 | <div class="tutor-attachment-card-actions"> |
| 42 | <a href="<?php echo esc_url( $attachment->url ); ?>" class="tutor-btn tutor-btn-ghost tutor-btn-x-small tutor-btn-icon" rel="noopener" <?php echo esc_attr( $open_mode_view ? 'target="_blank"' : 'download' ); ?>> |
| 43 | <?php SvgIcon::make()->name( $open_mode_view ? Icon::LINK_EXTERNAL : Icon::DOWNLOAD_2 )->size( 20 )->render(); ?> |
| 44 | </a> |
| 45 | </div> |
| 46 | </div> |
| 47 | </div> |
| 48 | <?php endforeach; ?> |
| 49 | </div> |
| 50 | </div> |
| 51 | </div> |
| 52 |