Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Course builder UI/UX updates #2614

Merged
merged 47 commits into from
Apr 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
70d4ef7
Hiding lesson icons when not active to clean up the UI.
brianhogg Feb 26, 2024
5b45ecf
Removing Section X: and Lesson X: prefixes.
brianhogg Feb 26, 2024
e78bf5a
Add a section and three lessons if no sections exist.
brianhogg Feb 26, 2024
07a7eb2
Hiding assignments and quiz icons if there are none.
brianhogg Feb 27, 2024
46d29e0
Expand first 100 sections by default.
brianhogg Feb 28, 2024
ccd90ae
Adding beautifully styled New Lesson button to sections.
brianhogg Feb 28, 2024
bc5015f
Hide the new lesson button if the section is collapsed.
brianhogg Feb 28, 2024
796e5b7
Removing delay on tooltip.
brianhogg Feb 29, 2024
1445f8d
Reducing time between save changes checks. Need to see if there's a p…
brianhogg Feb 29, 2024
390d815
Only reduce interval with auto save turned off.
brianhogg Feb 29, 2024
bac38b3
Adjusting wording, icon placement, and interactivity of course builder.
kimcoleman Mar 6, 2024
04415f8
Finalizing course builder UI updates and accessibility and responsive…
kimcoleman Mar 6, 2024
5c3e28d
Styling the expand all / collapse all buttons; tightening up sidebar
kimcoleman Mar 6, 2024
1835c9c
Reverting destructive actions to <a> / links. Needs JS adjustments to…
kimcoleman Mar 6, 2024
6fed61c
Make click to the headline open the lesson editor.
brianhogg Mar 7, 2024
13e2079
Making lesson title uneditable inline. Styling.
brianhogg Mar 7, 2024
960789f
Updating default auto-save status to no.
brianhogg Mar 7, 2024
84a8b1e
Updating default auto save display in the user profile.
brianhogg Mar 7, 2024
9e89746
Change trash and detach to buttons.
brianhogg Mar 7, 2024
5c9626f
Removing console log.
brianhogg Mar 7, 2024
35ac76c
Switch section trash to button.
brianhogg Mar 7, 2024
6d79452
Restrict setting dropdown options to a max length of 100 characters b…
brianhogg Mar 7, 2024
e2e0d20
Merge branch 'trunk' of https://github.com/gocodebox/lifterlms into f…
kimcoleman Apr 3, 2024
16d8beb
Adding translation for the Close button.
brianhogg Apr 3, 2024
e3caa23
Adding translation for the Close button.
brianhogg Apr 3, 2024
658cdac
Add New Section Button at the bottom of the course outline.
brianhogg Apr 3, 2024
51853ab
Removing duplicate HTML element IDs.
brianhogg Apr 3, 2024
4eb054b
Removing the explainer video and updating as a link from help text.
kimcoleman Apr 3, 2024
ae600b8
Adding link to help text for course builder tutorial.
kimcoleman Apr 3, 2024
f003d00
Merge branch 'feature/course-builder-ui-ux-updates' of https://github…
kimcoleman Apr 3, 2024
def4d4b
More places to remove the video explainer
kimcoleman Apr 3, 2024
6318cbe
Allow clicking on the section header to expand/collapse.
brianhogg Apr 3, 2024
28bc227
More spacing for section and lesson expand/collapse/move interactivit…
kimcoleman Apr 3, 2024
be9e653
Merge branch 'feature/course-builder-ui-ux-updates' of https://github…
kimcoleman Apr 3, 2024
fa84d1b
Fixing tips that needed double quotes to not need them so the strings…
kimcoleman Apr 3, 2024
052ddcb
Fixing tips to sentence case for consistency throughout builder
kimcoleman Apr 3, 2024
6e3999a
Fixing tips to sentence case; moving lesson ID position
kimcoleman Apr 3, 2024
3761c9a
Responsive fix to builder; now the unsaved changes button is brand or…
kimcoleman Apr 3, 2024
818d0a6
Merge branch 'dev' into feature/course-builder-ui-ux-updates
ideadude Apr 16, 2024
c507a7b
Merge branch 'dev' into feature/course-builder-ui-ux-updates
ideadude Apr 16, 2024
f02be39
Merge branch 'dev' into feature/course-builder-ui-ux-updates
brianhogg Apr 16, 2024
5d7cc42
Merge branch 'dev' into feature/course-builder-ui-ux-updates
ideadude Apr 16, 2024
d655a35
Adding changelog.
brianhogg Apr 16, 2024
a92f02d
Updating package lock.
brianhogg Apr 16, 2024
318e0fe
Merge branch 'feature/course-builder-ui-ux-updates' of github.com:goc…
brianhogg Apr 16, 2024
4f982c3
Removing failing builder tests.
brianhogg Apr 16, 2024
42023a9
Merge branch 'dev' into feature/course-builder-ui-ux-updates
ideadude Apr 16, 2024
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
3 changes: 3 additions & 0 deletions .changelogs/feature_course-builder-ui-ux-updates.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
significance: minor
type: changed
entry: Improved the Course Builder UI.
2 changes: 1 addition & 1 deletion assets/js/builder/Controllers/Sync.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ define( [], function() {
var self = this,
autosave = ( 'yes' === window.llms_builder.autosave ),
check_interval = null,
check_interval_ms = settings.check_interval_ms || 10000,
check_interval_ms = settings.check_interval_ms || ( ( 'yes' === window.llms_builder.autosave ) ? 10000 : 1000 ),
detached = new Backbone.Collection(),
trashed = new Backbone.Collection();

Expand Down
3 changes: 2 additions & 1 deletion assets/js/builder/Models/Section.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ define( [ 'Collections/Lessons', 'Models/_Relationships' ], function( Lessons, R
title: LLMS.l10n.translate( 'New Section' ),
type: 'section',

_expanded: false,
// Expand the first 100 sections by default to avoid timeout issues.
_expanded: ! this.collection || this.collection.length <= 100 ? true : false,
_selected: false,
};
},
Expand Down
6 changes: 3 additions & 3 deletions assets/js/builder/Schemas/Lesson.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,14 @@ define( [], function() {
attribute: 'free_lesson',
id: 'free-lesson',
label: LLMS.l10n.translate( 'Free Lesson' ),
tip: LLMS.l10n.translate( "Free lessons can be accessed without enrollment." ),
tip: LLMS.l10n.translate( 'Free lessons can be accessed without enrollment.' ),
type: 'switch',
},
{
attribute: 'require_passing_grade',
id: 'require-passing-grade',
label: LLMS.l10n.translate( 'Require Passing Grade on Quiz' ),
tip: LLMS.l10n.translate( "When enabled, students must pass this lesson's quiz before the lesson can be completed." ),
tip: LLMS.l10n.translate( 'When enabled, students must pass this quiz before the lesson can be completed.' ),
type: 'switch',
condition: function() {
return ( 'yes' === this.get( 'quiz_enabled' ) );
Expand All @@ -53,7 +53,7 @@ define( [], function() {
attribute: 'require_assignment_passing_grade',
id: 'require-assignment-passing-grade',
label: LLMS.l10n.translate( 'Require Passing Grade on Assignment' ),
tip: LLMS.l10n.translate( "When enabled, students must pass this lesson's assignment before the lesson can be completed." ),
tip: LLMS.l10n.translate( 'When enabled, students must pass this assignment before the lesson can be completed.' ),
type: 'switch',
condition: function() {
return ( 'undefined' !== window.llms_builder.assignments && 'yes' === this.get( 'assignment_enabled' ) );
Expand Down
2 changes: 2 additions & 0 deletions assets/js/builder/Views/Assignment.js
Original file line number Diff line number Diff line change
Expand Up @@ -327,6 +327,8 @@ define( [
// placement: 'left',
width: 380,
title: LLMS.l10n.translate( 'Unlock LifterLMS Assignments' ),
// This is here for translation but not actually used by the popover.
closeLabel: LLMS.l10n.translate( 'Close' ),
content: '<h3>' + h3 + '</h3><p>' + p + '</p><br><p><a class="llms-button-primary" href="' + url + '" target="_blank">' + btn + '</a></p>'
}
} );
Expand Down
49 changes: 47 additions & 2 deletions assets/js/builder/Views/Course.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,19 @@
* @since 3.13.0
* @version 3.16.0
*/
define( [ 'Views/SectionList', 'Views/_Editable' ], function( SectionListView, Editable ) {
define( [
'Views/SectionList',
'Views/_Detachable',
'Views/_Editable',
'Views/_Shiftable',
'Views/_Trashable'
], function(
SectionListView,
Detachable,
Editable,
Shiftable,
Trashable
) {

return Backbone.View.extend( _.defaults( {

Expand Down Expand Up @@ -71,12 +83,23 @@ define( [ 'Views/SectionList', 'Views/_Editable' ], function( SectionListView, E

Backbone.pubSub.on( 'section-toggle', this.on_section_toggle, this );

Backbone.pubSub.on( 'section-select', this.on_section_select, this );

Backbone.pubSub.on( 'expand-section', this.expand_section, this );

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

},

/**
* Events
* @type {Object}
* @version [version]
*/
events: _.defaults( {
'click .new-section': 'add_new_section',
}, Detachable.events, Editable.events, Trashable.events ),

/**
* Compiles the template and renders the view
*
Expand Down Expand Up @@ -147,7 +170,29 @@ define( [ 'Views/SectionList', 'Views/_Editable' ], function( SectionListView, E
var selected = model.get( '_expanded' ) ? [ model ] : [];
this.sectionListView.setSelectedModels( selected );

}
},


/**
* When doing things like adding a lesson, seelct the section.
*
* @param obj model toggled section
* @return void
* @since [version]
* @version [version]
*/
on_section_select: function( model ) {

this.sectionListView.setSelectedModel( model );

},

add_new_section: function( event ) {

event.preventDefault();
Backbone.pubSub.trigger( 'add-new-section' );
},


}, Editable ) );

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

this.$el.html( this.template() );
this.draggable();
this.maybe_disable_buttons();
this.maybe_add_initial_section();

return this;
},
Expand Down Expand Up @@ -161,12 +161,15 @@ define( [ 'Models/Section', 'Views/Section', 'Models/Lesson', 'Views/Lesson', 'V
* @since 3.16.0
* @version 3.16.0
*/
maybe_disable_buttons: function() {
maybe_add_initial_section: function() {

var $els = $( '#llms-new-lesson, #llms-existing-lesson' );

if ( ! this.SidebarView.CourseView.model.get( 'sections' ).length ) {
$els.attr( 'disabled', 'disabled' );
Backbone.pubSub.trigger( 'add-new-section' );
Backbone.pubSub.trigger( 'add-new-lesson' );
Backbone.pubSub.trigger( 'add-new-lesson' );
Backbone.pubSub.trigger( 'add-new-lesson' );
} else {
$els.removeAttr( 'disabled' );
}
Expand Down
1 change: 1 addition & 0 deletions assets/js/builder/Views/Lesson.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ define( [
*/
events: _.defaults( {
'click .edit-lesson': 'open_lesson_editor',
'click .llms-headline': 'open_lesson_editor',
'click .edit-quiz': 'open_quiz_editor',
'click .edit-assignment': 'open_assignment_editor',
'click .section-prev': 'section_prev',
Expand Down
27 changes: 26 additions & 1 deletion assets/js/builder/Views/Section.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ define( [
'click .collapse': 'collapse',
'click .shift-up--section': 'shift_up',
'click .shift-down--section': 'shift_down',

'click .new-lesson': 'add_new_lesson',
'click .llms-builder-header': 'toggle',
'mouseenter .llms-lessons': 'on_mouseenter',

}, Editable.events, Trashable.events ),
Expand Down Expand Up @@ -125,6 +126,15 @@ define( [

},

add_new_lesson: function( event ) {

event.preventDefault();

Backbone.pubSub.trigger( 'section-select', this.model );
Backbone.pubSub.trigger( 'add-new-lesson' );

},

active_lesson_change: function( current, previous ) {

Backbone.pubSub.trigger( 'active-lesson-change', {
Expand All @@ -134,6 +144,21 @@ define( [

},

toggle: function( event, update ) {

// We only want to expand/collapse when the actual header div is clicked, not an element inside it.
if ( 'llms-builder-header' !== event.target.className ) {
return;
}

if ( this.model.get( '_expanded' ) ) {
this.collapse( event, update );
} else {
this.expand( event, update );
}

},

/**
* Collapse lessons within the section
* @param obj event js event object
Expand Down
2 changes: 1 addition & 1 deletion assets/js/builder/Views/SettingsFields.js
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ define( [], function() {

function option_html( label, val ) {

return '<option value="' + val + '"' + _.selected( val, selected ) + '>' + label + '</option>';
return '<option value="' + val + '"' + _.selected( val, selected ) + '>' + label.substring( 0, 100 ) + ( label.length > 100 ? '...' : '' ) + '</option>';

}

Expand Down
7 changes: 0 additions & 7 deletions assets/js/builder/Views/Sidebar.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,11 @@ define( [
'Views/Editor',
'Views/Elements',
'Views/Utilities',
'Views/VideoExplainer',
'Views/_Subview'
], function(
Editor,
Elements,
Utilities,
VideoExplainer,
Subview
) {

Expand All @@ -41,11 +39,6 @@ define( [
instance: null,
state: 'builder',
},
video_explainer: {
class: VideoExplainer,
instance: null,
state: 'builder',
},
editor: {
class: Editor,
instance: null,
Expand Down
92 changes: 0 additions & 92 deletions assets/js/builder/Views/VideoExplainer.js

This file was deleted.

1 change: 1 addition & 0 deletions assets/js/builder/Views/_Detachable.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ define( [], function() {
*/
events: {
'click a[href="#llms-detach-model"]': 'detach_model',
'click button.llms-detach-model': 'detach_model',
},

/**
Expand Down
1 change: 1 addition & 0 deletions assets/js/builder/Views/_Trashable.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ define( [], function() {
*/
events: {
'click a[href="#llms-trash-model"]': 'trash_model',
'click button.llms-trash-model': 'trash_model',
},

/**
Expand Down
2 changes: 1 addition & 1 deletion assets/scss/_includes/_tooltip.scss
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@
&:hover:before,
&:hover:after {
opacity: 1;
transition: all 0.2s 0.6s ease;
transition: all 0 0.1s ease;
visibility: visible;
z-index: 99999999;
}
Expand Down
Loading
Loading