Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .changelogs/3092.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
significance: patch
type: fixed
links:
- "#3058"
attributions:
- "@faisalahammad"
entry: Show "Mark Complete" button when quiz requirements are already met.
7 changes: 7 additions & 0 deletions .changelogs/3093.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
significance: patch
type: fixed
links:
- "#3057"
attributions:
- "@faisalahammad"
entry: Strip formatting when pasting into Course Builder title fields.
5 changes: 5 additions & 0 deletions .changelogs/additional-checks-course-enrollment-cap.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
significance: patch
type: changed
links:
- "#3086"
entry: Add additional check for course capacity on the checkout page.
4 changes: 4 additions & 0 deletions .changelogs/blocks-update-1.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
significance: patch
type: dev
entry: Adding actions for add-ons to insert additional blocks when a post is
migrated to the block editor.
3 changes: 3 additions & 0 deletions .changelogs/blocks-update.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
significance: patch
type: fixed
entry: Avoid "block not found" error in the theme template editor.
3 changes: 3 additions & 0 deletions .changelogs/change_quiz-question-scroll-to-top.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
significance: minor
type: changed
entry: Scroll to the top of the quiz UI area when a quiz question is loaded.
4 changes: 4 additions & 0 deletions .changelogs/course-builder-improvements-1.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
significance: minor
type: added
entry: Lesson content can be edited within the Course Builder for new lessons,
or existing lessons with no existing content.
3 changes: 3 additions & 0 deletions .changelogs/course-builder-improvements-2.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
significance: patch
type: fixed
entry: Close lesson settings panel when lesson has been trashed.
9 changes: 9 additions & 0 deletions .changelogs/course-builder-improvements.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
significance: minor
type: changed
links:
- "#3033"
- "#3056"
- "#3097"
- "#2938"
- "#3030"
entry: Various course builder fixes, with quizzes set to published by default.
5 changes: 5 additions & 0 deletions .changelogs/deprecate-update-class.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
significance: patch
type: deprecated
links:
- "#1981"
entry: Removing unused LLMS_Update class.
3 changes: 3 additions & 0 deletions .changelogs/event-promo.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
significance: patch
type: added
entry: Adding tab for Events.
7 changes: 7 additions & 0 deletions .changelogs/feature_any-engagement-trigger.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
significance: minor
type: added
links:
- "#3109"
entry: Added an explicit 'Any' trigger option for engagements so one engagement
can apply to all matching courses, memberships, lessons, quizzes, sections,
access plans, or tracks.
6 changes: 6 additions & 0 deletions .changelogs/fix_change-loop-columns.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
significance: patch
type: fixed
links:
- "#3101"
entry: Fix lifterlms_loop_columns filter styling to change the number of columns
in a loop (ie. Course Catalog).
3 changes: 3 additions & 0 deletions .changelogs/focus-mode.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
significance: major
type: added
entry: Adding new "focus mode" when viewing lessons and quizzes in a course.
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
significance: patch
type: fixed
links:
- "#2943"
entry: Avoid "Launch Course Builder" showing on orphaned lessons.
3 changes: 3 additions & 0 deletions .changelogs/llms-verify-nonce-removal.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
significance: patch
type: changed
entry: Using standard WP nonce check functions instead of llms_verify_nonce.
4 changes: 4 additions & 0 deletions .changelogs/remove_sql-calc-found-rows.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
significance: major
type: changed
entry: Removing use of SQL_CALC_FOUND_ROWS due to depreciation in MySQL and
observed unreliability of count results.
4 changes: 4 additions & 0 deletions .changelogs/update-helper-and-rest-nonce-change.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
significance: patch
type: changed
entry: Updating helper and rest libraries, which switch to using standard WP
nonce check functions.
1 change: 1 addition & 0 deletions .cursor/BUGBOT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Do not review pull requests authored by dependabot[bot] or any automated dependency update bots.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ assets/css/lifterlms.css
assets/css/lifterlms.min.css
assets/css/llms-admin-addons.css
assets/css/llms-admin-addons-rtl.css
assets/css/llms-focus-mode*

assets/js/llms-builder.js
assets/js/llms-builder.min.js
Expand Down
26 changes: 26 additions & 0 deletions assets/js/builder/Controllers/Sync.js
Original file line number Diff line number Diff line change
Expand Up @@ -430,6 +430,18 @@ define( [], function() {
model.set( 'id', info.id );
delete model._unsavedChanges.id;
}

if ( info.permalink ) {
model.set( 'permalink', info.permalink );
}
if ( info.name ) {
model.set( 'name', info.name );
}

if ( info.content_added_in_builder ) {
model.set( 'content_added_in_builder', info.content_added_in_builder );
}

maybe_restart_tracking( model, info );

// check children
Expand Down Expand Up @@ -460,6 +472,20 @@ define( [], function() {
model.set( 'id', info.id );
delete model._unsavedChanges.id;
}

// Update permalink and name if provided by the server.
if ( info.permalink ) {
model.set( 'permalink', info.permalink );
}
if ( info.name ) {
model.set( 'name', info.name );
}

if ( info.content_added_in_builder ) {
model.set( 'content_added_in_builder', info.content_added_in_builder );
}


maybe_restart_tracking( model, info );

// check children
Expand Down
2 changes: 2 additions & 0 deletions assets/js/builder/Models/Lesson.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,8 @@ define( [ 'Models/Quiz', 'Models/_Relationships', 'Models/_Utilities', 'Schemas/
quiz: {}, // Quiz model/data.
quiz_enabled: 'no',

content_added_in_builder: '',

_forceSync: false,

};
Expand Down
2 changes: 1 addition & 1 deletion assets/js/builder/Models/Quiz.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ define( [
type: 'llms_quiz',
lesson_id: '',

status: 'draft',
status: 'publish',

// editable fields.
content: '',
Expand Down
57 changes: 43 additions & 14 deletions assets/js/builder/Schemas/Lesson.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,34 @@ define( [], function() {
title: LLMS.l10n.translate( 'General Settings' ),
toggleable: true,
fields: [
[
{
attribute: 'permalink',
id: 'permalink',
type: 'permalink',
},
], [
{
attribute: 'video_embed',
[
{
attribute: 'permalink',
id: 'permalink',
type: 'permalink',
},
], [
{
attribute: 'content',
id: 'content',
label: LLMS.l10n.translate( 'Content' ),
type: 'editor',
condition: function() {
return '' === this.get( 'content' ) || 'yes' === this.get( 'content_added_in_builder' );
},
},
], [
{
id: 'content-page-builder-notice',
label: LLMS.l10n.translate( 'Content' ),
type: 'page_builder_notice',
condition: function() {
return '' !== this.get( 'content' ) && 'yes' !== this.get( 'content_added_in_builder' );
},
},
], [
{
attribute: 'video_embed',
id: 'video-embed',
label: LLMS.l10n.translate( 'Video Embed URL' ),
type: 'video_embed',
Expand Down Expand Up @@ -194,12 +213,22 @@ define( [], function() {
date_format: 'h:i A',
id: 'time-available',
label: LLMS.l10n.translate( 'Time' ),
type: 'datepicker',
},
],
],
type: 'datepicker',
},
], [
{
label: LLMS.l10n.translate( 'Associated Event(s)' ),
id: 'llms-events-promo',
type: 'heading',
detail: LLMS.l10n.translate( 'Schedule events for your lessons with the LifterLMS Events add-on.' ) + ' <a href="https://lifterlms.com/product/lifterlms-events/?utm_source=LifterLMS%20Plugin&utm_medium=Lesson%20Builder&utm_campaign=Events%20Addon%20Upsell" target="_blank">' + LLMS.l10n.translate( 'Learn More' ) + '</a>',
condition: function() {
return ! window.llms_builder.events;
},
},
],
],
},

} );
} );

} );
21 changes: 21 additions & 0 deletions assets/js/builder/Views/Assignment.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,8 @@ define( [
*/
this.model.set_parent( this.lesson );

this.listenTo( this.model, 'change:permalink', this.render_settings );

}

this.on( 'model-trashed', this.on_trashed );
Expand Down Expand Up @@ -154,6 +156,23 @@ define( [

},

/**
* Re-render the settings subview when permalink updates after saving.
*
* @since [version]
*
* @return {Void}
*/
render_settings: function() {

var view = this.get_subview( 'settings' );
if ( view && view.instance ) {
view.instance.render();
this.init_selects();
}

},

/**
* Adds a new assignment to a lesson which currently has no assignment associated with it.
*
Expand All @@ -176,6 +195,7 @@ define( [
this.lesson.set( 'assignment_enabled', 'yes' );
this.lesson.set( 'assignment', this.model );

this.listenTo( this.model, 'change:permalink', this.render_settings );
this.render();

} else {
Expand Down Expand Up @@ -221,6 +241,7 @@ define( [
this.lesson.set( 'assignment', assignment );
this.model = assignment;

this.listenTo( this.model, 'change:permalink', this.render_settings );
this.render();

},
Expand Down
9 changes: 7 additions & 2 deletions assets/js/builder/Views/Course.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,12 @@ define( [

Backbone.pubSub.on( 'lesson-selected', this.active_lesson_change, this );

// Select the first section by default on load.
var firstSection = this.model.get( 'sections' ).first();
if ( firstSection ) {
this.sectionListView.setSelectedModel( firstSection );
}

},

/**
Expand Down Expand Up @@ -167,8 +173,7 @@ define( [
*/
on_section_toggle: function( model ) {

var selected = model.get( '_expanded' ) ? [ model ] : [];
this.sectionListView.setSelectedModels( selected );
this.sectionListView.setSelectedModel( model );

},

Expand Down
19 changes: 15 additions & 4 deletions assets/js/builder/Views/Elements.js
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,9 @@ define( [ 'Models/Section', 'Views/Section', 'Models/Lesson', 'Views/Lesson', 'V

event.preventDefault();

var pop = new Popover( {
var pop, onLessonSelect;

pop = new Popover( {
el: '#llms-existing-lesson',
args: {
backdrop: true,
Expand All @@ -144,13 +146,22 @@ define( [ 'Models/Section', 'Views/Section', 'Models/Lesson', 'Views/Lesson', 'V
post_type: 'lesson',
searching_message: LLMS.l10n.translate( 'Search for existing lessons...' ),
} ).render().$el,
onHide: function() {
Backbone.pubSub.off( 'lesson-search-select', onLessonSelect );
},
}
} );

onLessonSelect = function() {
pop.hide();

// Ref #3097 — pop.hide() doesn't always remove the DOM elements.
$( '.webui-popover' ).remove();
$( '.webui-popover-backdrop' ).remove();
};

pop.show();
Backbone.pubSub.on( 'lesson-search-select', function() {
pop.hide()
} );
Backbone.pubSub.once( 'lesson-search-select', onLessonSelect );

},

Expand Down
3 changes: 3 additions & 0 deletions assets/js/builder/Views/LessonEditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,9 @@ define( [
var change_events = window.llms.hooks.applyFilters( 'llms_lesson_rerender_change_events', [
'change:date_available',
'change:drip_method',
'change:permalink',
'change:content_added_in_builder',
'change:name',
'change:time_available',
] );
_.each( change_events, function( event ) {
Expand Down
Loading
Loading