diff --git a/common/djangoapps/third_party_auth/migrations/0012_auto_20231118_2333.py b/common/djangoapps/third_party_auth/migrations/0012_auto_20231118_2333.py new file mode 100644 index 000000000000..6a17b65c6996 --- /dev/null +++ b/common/djangoapps/third_party_auth/migrations/0012_auto_20231118_2333.py @@ -0,0 +1,35 @@ +# Generated by Django 3.2.20 on 2023-11-18 23:33 + +from django.db import migrations, models +import django.db.models.deletion + + +class Migration(migrations.Migration): + + dependencies = [ + ('sites', '0002_alter_domain_unique'), + ('third_party_auth', '0011_applemigrationuseridinfo'), + ] + + operations = [ + migrations.AlterField( + model_name='ltiproviderconfig', + name='site', + field=models.ForeignKey(default=2, help_text='The Site that this provider configuration belongs to.', on_delete=django.db.models.deletion.CASCADE, related_name='ltiproviderconfigs', to='sites.site'), + ), + migrations.AlterField( + model_name='oauth2providerconfig', + name='site', + field=models.ForeignKey(default=2, help_text='The Site that this provider configuration belongs to.', on_delete=django.db.models.deletion.CASCADE, related_name='oauth2providerconfigs', to='sites.site'), + ), + migrations.AlterField( + model_name='samlconfiguration', + name='site', + field=models.ForeignKey(default=2, help_text='The Site that this SAML configuration belongs to.', on_delete=django.db.models.deletion.CASCADE, related_name='samlconfigurations', to='sites.site'), + ), + migrations.AlterField( + model_name='samlproviderconfig', + name='site', + field=models.ForeignKey(default=2, help_text='The Site that this provider configuration belongs to.', on_delete=django.db.models.deletion.CASCADE, related_name='samlproviderconfigs', to='sites.site'), + ), + ] diff --git a/lms/djangoapps/courseware/views/views.py b/lms/djangoapps/courseware/views/views.py index 79d2976d2c97..3ada020aea28 100644 --- a/lms/djangoapps/courseware/views/views.py +++ b/lms/djangoapps/courseware/views/views.py @@ -276,14 +276,13 @@ def courses(request): """ courses_list = [] course_discovery_meanings = getattr(settings, 'COURSE_DISCOVERY_MEANINGS', {}) - if not settings.FEATURES.get('ENABLE_COURSE_DISCOVERY'): - courses_list = get_courses(request.user) + courses_list = get_courses(request.user) - if configuration_helpers.get_value("ENABLE_COURSE_SORTING_BY_START_DATE", - settings.FEATURES["ENABLE_COURSE_SORTING_BY_START_DATE"]): - courses_list = sort_by_start_date(courses_list) - else: - courses_list = sort_by_announcement(courses_list) + if configuration_helpers.get_value("ENABLE_COURSE_SORTING_BY_START_DATE", + settings.FEATURES["ENABLE_COURSE_SORTING_BY_START_DATE"]): + courses_list = sort_by_start_date(courses_list) + else: + courses_list = sort_by_announcement(courses_list) # Add marketable programs to the context. programs_list = get_programs_with_type(request.site, include_hidden=False) diff --git a/lms/envs/devstack.py b/lms/envs/devstack.py index c2454ee71fc2..71420977cda1 100644 --- a/lms/envs/devstack.py +++ b/lms/envs/devstack.py @@ -198,12 +198,17 @@ def should_show_debug_toolbar(request): # lint-amnesty, pylint: disable=missing 'language': LANGUAGE_MAP, } -FEATURES['ENABLE_COURSE_DISCOVERY'] = False +FEATURES['ENABLE_COURSE_DISCOVERY'] = True # Setting for overriding default filtering facets for Course discovery # COURSE_DISCOVERY_FILTERS = ["org", "language", "modes"] FEATURES['COURSES_ARE_BROWSEABLE'] = True HOMEPAGE_COURSE_MAX = 9 +FEATURES['ENABLE_FILTER'] = False +# Toggle for the "filter" feature of the search bar +FEATURES['ENABLE_SORTBY'] = False +# Toggle for the "sort by" feature of the search bar + # Software secure fake page feature flag FEATURES['ENABLE_SOFTWARE_SECURE_FAKE'] = True diff --git a/lms/static/images/filter_icon.png b/lms/static/images/filter_icon.png new file mode 100644 index 000000000000..c67379346c00 Binary files /dev/null and b/lms/static/images/filter_icon.png differ diff --git a/lms/static/images/magnifier.png b/lms/static/images/magnifier.png new file mode 100644 index 000000000000..b94d6dac45c7 Binary files /dev/null and b/lms/static/images/magnifier.png differ diff --git a/lms/static/js/discovery/discovery_factory.js b/lms/static/js/discovery/discovery_factory.js index 662db9c8e1b9..754ec8d582b6 100644 --- a/lms/static/js/discovery/discovery_factory.js +++ b/lms/static/js/discovery/discovery_factory.js @@ -55,7 +55,7 @@ dispatcher.listenTo(search, 'search', function(query, total) { if (total > 0) { - form.showFoundMessage(total); + form.showFoundMessage(total, query); if (query) { filters.add( {type: 'search_query', query: query, name: quote(query)}, diff --git a/lms/static/js/discovery/views/search_form.js b/lms/static/js/discovery/views/search_form.js index e242904b49fd..69890c1404a6 100644 --- a/lms/static/js/discovery/views/search_form.js +++ b/lms/static/js/discovery/views/search_form.js @@ -18,6 +18,8 @@ submitForm: function(event) { event.preventDefault(); + var query = this.$searchField.val(); + $('#search-query-display').text('Search Query: ' + query); this.doSearch(); }, @@ -42,6 +44,7 @@ this.$loadingIndicator.addClass('hidden'); }, + showFoundMessage: function(count) { var msg = ngettext( 'Viewing %s course', diff --git a/lms/templates/courseware/courses.html b/lms/templates/courseware/courses.html index db303073676d..da2bcec68179 100644 --- a/lms/templates/courseware/courses.html +++ b/lms/templates/courseware/courses.html @@ -7,6 +7,8 @@ <%inherit file="../main.html" /> <% course_discovery_enabled = settings.FEATURES.get('ENABLE_COURSE_DISCOVERY') + filter_enabled = settings.FEATURES.get('ENABLE_FILTER') + sortby_enabled = settings.FEATURES.get('ENABLE_SORTBY') %> <%namespace name='static' file='../static_content.html'/> @@ -31,32 +33,281 @@ <%block name="pagetitle">${_("Courses")} + +
% if course_discovery_enabled: +
+ % endif -
+ + + + + + + +
    %for course in courses:
  • @@ -75,6 +326,42 @@

    ${_('Refine Your Search')}

    % endif + + +