Add Journals support
Enable the journal app in LMS. Add support to display Journals on index and courseware pages and dashboard.
This commit is contained in:
@@ -42,6 +42,7 @@ from openedx.core.djangoapps.util.maintenance_banner import add_maintenance_bann
|
||||
from openedx.core.djangoapps.waffle_utils import WaffleFlag, WaffleFlagNamespace
|
||||
from openedx.core.djangolib.markup import HTML, Text
|
||||
from openedx.features.enterprise_support.api import get_dashboard_consent_notification
|
||||
from openedx.features.journals.api import journals_enabled
|
||||
from shoppingcart.api import order_history
|
||||
from shoppingcart.models import CourseRegistrationCode, DonationConfiguration
|
||||
from student.cookies import set_user_info_cookie
|
||||
@@ -821,6 +822,7 @@ def student_dashboard(request):
|
||||
'nav_hidden': True,
|
||||
'inverted_programs': inverted_programs,
|
||||
'show_program_listing': ProgramsApiConfig.is_enabled(),
|
||||
'show_journal_listing': journals_enabled(), # TODO: Dashboard Plugin required
|
||||
'show_dashboard_tabs': True,
|
||||
'disable_courseware_js': True,
|
||||
'display_course_modes_on_dashboard': enable_verified_certificates and display_course_modes_on_dashboard,
|
||||
|
||||
@@ -70,6 +70,7 @@ from openedx.core.djangoapps.user_api.models import UserRetirementRequest
|
||||
from openedx.core.djangoapps.user_api.preferences import api as preferences_api
|
||||
from openedx.core.djangoapps.user_api.config.waffle import PREVENT_AUTH_USER_WRITES, SYSTEM_MAINTENANCE_MSG, waffle
|
||||
from openedx.core.djangolib.markup import HTML, Text
|
||||
from openedx.features.journals.api import get_journals_context
|
||||
from student.cookies import set_logged_in_cookies
|
||||
from student.forms import AccountCreationForm, PasswordResetFormNoActive, get_registration_extension_form
|
||||
from student.helpers import (
|
||||
@@ -195,6 +196,9 @@ def index(request, extra_context=None, user=AnonymousUser()):
|
||||
# Add marketable programs to the context.
|
||||
context['programs_list'] = get_programs_with_type(request.site, include_hidden=False)
|
||||
|
||||
# TODO: Course Listing Plugin required
|
||||
context['journal_info'] = get_journals_context(request)
|
||||
|
||||
return render_to_response('index.html', context)
|
||||
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@ class CourseDiscoveryPage(PageObject):
|
||||
"""
|
||||
Return search result items.
|
||||
"""
|
||||
return self.q(css=".courses-listing-item")
|
||||
return self.q(css=".courses-list .courses-listing-item")
|
||||
|
||||
@property
|
||||
def clear_button(self):
|
||||
|
||||
Reference in New Issue
Block a user