From f3c17470515a946e839e9cacfa70d69da283f074 Mon Sep 17 00:00:00 2001 From: Calen Pennington Date: Wed, 27 May 2020 11:19:12 -0400 Subject: [PATCH] Check for the mobile app specifically in the dates banner conditionals --- lms/djangoapps/courseware/views/views.py | 2 ++ lms/templates/dates_banner.html | 6 +++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/lms/djangoapps/courseware/views/views.py b/lms/djangoapps/courseware/views/views.py index 31c14a67cf..7b0a9f9e47 100644 --- a/lms/djangoapps/courseware/views/views.py +++ b/lms/djangoapps/courseware/views/views.py @@ -107,6 +107,7 @@ from openedx.core.djangoapps.site_configuration import helpers as configuration_ from openedx.core.djangoapps.util.user_messages import PageLevelMessages from openedx.core.djangoapps.zendesk_proxy.utils import create_zendesk_ticket from openedx.core.djangolib.markup import HTML, Text +from openedx.core.lib.mobile_utils import is_request_from_mobile_app from openedx.features.course_duration_limits.access import generate_course_expired_fragment from openedx.features.course_experience import ( COURSE_ENABLE_UNENROLLED_ACCESS_FLAG, @@ -1681,6 +1682,7 @@ def render_xblock(request, usage_key_string, check_if_enrolled=True): 'on_courseware_page': True, 'verified_upgrade_link': verified_upgrade_deadline_link(request.user, course=course), 'is_learning_mfe': request.META.get('HTTP_REFERER', '').startswith(settings.LEARNING_MICROFRONTEND_URL), + 'is_mobile_app': is_request_from_mobile_app(request), } return render_to_response('courseware/courseware-chromeless.html', context) diff --git a/lms/templates/dates_banner.html b/lms/templates/dates_banner.html index f26e7c2451..04bfb811b4 100644 --- a/lms/templates/dates_banner.html +++ b/lms/templates/dates_banner.html @@ -24,12 +24,12 @@ on_course_outline_page_as_audit = on_course_outline_page and enrollment_mode == on_course_outline_page_as_verified = on_course_outline_page and enrollment_mode == CourseMode.VERIFIED on_courseware_page_as_audit = on_courseware_page and enrollment_mode == CourseMode.AUDIT on_courseware_page_as_verified = on_courseware_page and enrollment_mode == CourseMode.VERIFIED -additional_styling_class = 'on-mobile' if web_app_course_url else 'has-button' +additional_styling_class = 'on-mobile' if is_mobile_app else 'has-button' %> % if (missed_deadlines and (on_dates_tab_as_verified or on_courseware_page_as_audit or on_courseware_page_as_verified)) or (on_dates_tab_as_audit and has_locked_assignments) or on_course_outline_page_as_audit or on_course_outline_page_as_verified:
- % if web_app_course_url: + % if is_mobile_app: % if enrollment_mode == CourseMode.VERIFIED: ${_('It looks like you missed some important deadlines based on our suggested schedule. ')} ${_('To keep yourself on track, you can update this schedule and shift the past due assignments into the future by visiting ')} @@ -61,7 +61,7 @@ additional_styling_class = 'on-mobile' if web_app_course_url else 'has-button' % endif % endif
- % if not web_app_course_url: + % if not is_mobile_app:
% if on_course_outline_page_as_verified or (missed_deadlines and (on_dates_tab_as_verified or on_courseware_page_as_verified)):