From 5dc37676e9d4f6fdd4bca1d7017b7860da5e3cbf Mon Sep 17 00:00:00 2001 From: Ren <18050944+renintw@users.noreply.github.com> Date: Thu, 4 Jul 2024 06:36:17 +0800 Subject: [PATCH] Update lesson list (#2582) * Update progress bar color * Update the position of "All my courses" * Update the position of the progress bar and its label * Update progress bar label color * Update progress bar height * Update course outline module header style * do not display lesson title * Update status color * Update the course completed checking function * render in progress status by half-filled-circle * Update the styles of the lesson without a module * Add locked icon * fix sign in button style * Add border-radius * Move js files into src. * add comments * fix unstarted course icon border thickness * update styles - reduce space between lessons - give unstarted course a thicker border * Update the color of the progress bar on My Courses * Use icons from wordpress library. * update comments and remove the use of sensei icon * Fix linting errors * fix preview button style * change to use @wordpress/element * make code more concise * Fix logged out not displaying icon error * fix styles of moduled lesson items * update style value --- .../themes/pub/wporg-learn-2024/functions.php | 1 + .../themes/pub/wporg-learn-2024/package.json | 4 +- .../patterns/page-my-courses-content.php | 2 +- .../patterns/sidebar-meta-info.php | 12 ++- .../src/course-outline/block.json | 3 + .../src/course-outline/index.js | 28 ++++++ .../src/course-outline/index.php | 69 +++++++++++++ .../wporg-learn-2024/src/style/_sensei.scss | 97 +++++++++++++++++++ .../wporg-learn-2024/src/style/_sidebar.scss | 11 +-- .../themes/pub/wporg-learn-2024/theme.json | 1 + yarn.lock | 81 ++++++++++++++++ 11 files changed, 292 insertions(+), 17 deletions(-) create mode 100644 wp-content/themes/pub/wporg-learn-2024/src/course-outline/block.json create mode 100644 wp-content/themes/pub/wporg-learn-2024/src/course-outline/index.js create mode 100644 wp-content/themes/pub/wporg-learn-2024/src/course-outline/index.php diff --git a/wp-content/themes/pub/wporg-learn-2024/functions.php b/wp-content/themes/pub/wporg-learn-2024/functions.php index 1d025bd7e..f5c3c1f3a 100644 --- a/wp-content/themes/pub/wporg-learn-2024/functions.php +++ b/wp-content/themes/pub/wporg-learn-2024/functions.php @@ -6,6 +6,7 @@ // Block files require_once __DIR__ . '/src/course-grid/index.php'; +require_once __DIR__ . '/src/course-outline/index.php'; require_once __DIR__ . '/src/learning-pathway-cards/index.php'; require_once __DIR__ . '/src/learning-pathway-header/index.php'; require_once __DIR__ . '/src/lesson-grid/index.php'; diff --git a/wp-content/themes/pub/wporg-learn-2024/package.json b/wp-content/themes/pub/wporg-learn-2024/package.json index e15a5c9bd..edc6065d1 100644 --- a/wp-content/themes/pub/wporg-learn-2024/package.json +++ b/wp-content/themes/pub/wporg-learn-2024/package.json @@ -7,7 +7,9 @@ "private": true, "devDependencies": { "@wordpress/scripts": "27.2.0", - "rtlcss-webpack-plugin": "4.0.7" + "rtlcss-webpack-plugin": "4.0.7", + "@wordpress/icons": "^10.2.0", + "react-dom": "^18.3.1" }, "eslintConfig": { "extends": "../../../../.eslintrc.js" diff --git a/wp-content/themes/pub/wporg-learn-2024/patterns/page-my-courses-content.php b/wp-content/themes/pub/wporg-learn-2024/patterns/page-my-courses-content.php index ffe258336..9570fc5d9 100644 --- a/wp-content/themes/pub/wporg-learn-2024/patterns/page-my-courses-content.php +++ b/wp-content/themes/pub/wporg-learn-2024/patterns/page-my-courses-content.php @@ -46,7 +46,7 @@ - +
diff --git a/wp-content/themes/pub/wporg-learn-2024/patterns/sidebar-meta-info.php b/wp-content/themes/pub/wporg-learn-2024/patterns/sidebar-meta-info.php index 02a76f7f0..b75692afe 100644 --- a/wp-content/themes/pub/wporg-learn-2024/patterns/sidebar-meta-info.php +++ b/wp-content/themes/pub/wporg-learn-2024/patterns/sidebar-meta-info.php @@ -5,16 +5,20 @@ * Inserter: no */ - use function WPOrg_Learn\Sensei\{get_my_courses_page_url} +use function WPOrg_Learn\Sensei\{get_my_courses_page_url}; + +$completed_course = Sensei_Utils::user_completed_course( get_the_ID() ); ?>