From 0a691f244f58b7818f74eafe844f7b93c4b59150 Mon Sep 17 00:00:00 2001 From: Calen Pennington Date: Thu, 28 May 2020 14:34:53 -0400 Subject: [PATCH] Pull out def for dates-page upgrade-for-graded-content dates-banner --- lms/templates/dates_banner.html | 63 +++++++++++++++------------------ 1 file changed, 29 insertions(+), 34 deletions(-) diff --git a/lms/templates/dates_banner.html b/lms/templates/dates_banner.html index 7acc63ab22..984a82b10c 100644 --- a/lms/templates/dates_banner.html +++ b/lms/templates/dates_banner.html @@ -79,6 +79,31 @@ additional_styling_class = 'on-mobile' if is_mobile_app else 'has-button' % endif +<%def name="upgrade_to_complete_graded_banner()"> +
+
+ % if is_mobile_app: + ${_('You are auditing this course,')} + ${_(' which means that you are unable to participate in graded assignments.')} + ${_(' To complete graded assignments as part of this course and shift the past due assignments into the future, you can upgrade today by visiting ')} + edx.org. + % else: + ${_('You are auditing this course,')} + ${_(' which means that you are unable to participate in graded assignments.')} + ${_(' To complete graded assignments as part of this course, you can upgrade today.')} + % endif +
+ % if not is_mobile_app: + + % endif +
+ % if (missed_deadlines and (on_dates_tab_as_verified or on_courseware_page)): % if is_verified: ${reset_dates_banner()} @@ -86,41 +111,11 @@ additional_styling_class = 'on-mobile' if is_mobile_app else 'has-button' ${upgrade_to_reset_banner()} % endif % elif on_dates_tab_as_audit and has_locked_assignments: -
-
- % if is_mobile_app: - ${_('You are auditing this course,')} - ${_(' which means that you are unable to participate in graded assignments.')} - % if missed_deadlines: - ${_(' It looks like you missed some important deadlines based on our suggested schedule. To complete graded assignments as part of this course and shift the past due assignments into the future, you can upgrade today by visiting ')} - % else: - ${_(' To complete graded assignments as part of this course and shift the past due assignments into the future, you can upgrade today by visiting ')} - % endif - edx.org. - % else: - ${_('You are auditing this course,')} - ${_(' which means that you are unable to participate in graded assignments.')} - % if missed_deadlines: - ${_(' It looks like you missed some important deadlines based on our suggested schedule. To complete graded assignments as part of this course and shift the past due assignments into the future, you can upgrade today.')} - % else: - ${_(' To complete graded assignments as part of this course, you can upgrade today.')} - % endif - % endif -
- % if not is_mobile_app: - + % if missed_deadlines: + ${upgrade_to_reset_banner()} + % else: + ${upgrade_to_complete_graded_banner()} % endif -
% elif on_course_outline_page and (is_audit or is_verified): ## The outline page uses javascript to show the dates banner, so everything below is only displayed when a user has actually missed deadlines % if is_verified: