Merge pull request #28462 from edx/mikix/banner-style

fix: modernize look of in-xblock shift-dates banner
This commit is contained in:
Michael Terry
2021-08-16 09:51:53 -04:00
committed by GitHub
4 changed files with 16 additions and 9 deletions

View File

@@ -19,7 +19,7 @@ class CallToActionService(PluginManager):
See the CallToActionService class constants for a list of recognized categories.
Returns: list of dictionaries, describing the calls to action, with the following keys:
link, link_name, form_values, and description.
link, link_name, form_values, and description (which can include html tags).
If the category is not recognized, an empty list is returned.
An example of a returned list:
@@ -32,7 +32,7 @@ class CallToActionService(PluginManager):
# A long-form description to be associated with the CTA
'description': "If you don't want to do this problem, just skip it!",
# A data set we include if the CTA is being rendered within an iframe. For example,
# we do this in Learning MFE. This dictionary is passed to its's parent container via
# we do this in Learning MFE. This dictionary is passed to its parent container via
# parent.postMessage. Parent containers should use window.onmessage event handler to
# catch this dataset.
'event_data': {

View File

@@ -11,6 +11,7 @@ from django.urls import reverse
from django.utils.translation import ngettext, gettext as _
from xmodule.util.misc import is_xblock_an_assignment
from openedx.core.djangolib.markup import HTML, Text
from openedx.core.lib.mobile_utils import is_request_from_mobile_app
from openedx.features.course_experience.url_helpers import is_request_from_learning_mfe
from openedx.features.course_experience.utils import dates_banner_should_display
@@ -119,9 +120,14 @@ class PersonalizedLearnerScheduleCallToAction:
'form_values': {
'course_id': course_key,
},
'description': _('To participate in this assignment, the suggested schedule for your course needs '
'updating. Dont worry, well shift all the due dates for you and you wont lose '
'any of your progress.'),
'description': Text('{b_open}{header}{b_close} {explanation}').format(
b_open=HTML('<b>'),
b_close=HTML('</b>'),
header=_('It looks like you missed some important deadlines based on our suggested schedule.'),
explanation=_('To keep yourself on track, you can update this schedule and shift the past due '
'assignments into the future. Dont worry—you wont lose any of the progress youve '
'made when you shift your due dates.'),
),
}
has_attempts = hasattr(xblock, 'attempts') and hasattr(xblock, 'max_attempts')