diff --git a/lms/djangoapps/course_home_api/dates/v1/serializers.py b/lms/djangoapps/course_home_api/dates/v1/serializers.py index c40feb888d5a07515a2363b0793262e5c3c1386b..fd3c40e0cf463501bc934f2d839daf57895b90c1 100644 --- a/lms/djangoapps/course_home_api/dates/v1/serializers.py +++ b/lms/djangoapps/course_home_api/dates/v1/serializers.py @@ -43,5 +43,6 @@ class DatesTabSerializer(DatesBannerSerializerMixin, serializers.Serializer): Serializer for the Dates Tab """ course_date_blocks = DateSummarySerializer(many=True) + has_ended = serializers.BooleanField() learner_is_full_access = serializers.BooleanField() user_timezone = serializers.CharField() diff --git a/lms/djangoapps/course_home_api/dates/v1/views.py b/lms/djangoapps/course_home_api/dates/v1/views.py index b9cf8cd08010eede537f624796604019bdbfff19..17264901229732f3c49ab5faeb84c1754aa58c2f 100644 --- a/lms/djangoapps/course_home_api/dates/v1/views.py +++ b/lms/djangoapps/course_home_api/dates/v1/views.py @@ -48,11 +48,14 @@ class DatesTabView(RetrieveAPIView): link: (str) An absolute link to content related to the date event (ex. verified link or link to assignment) title: (str) The title of the date event - missed_deadlines: (bool) Indicates whether the user missed any graded content deadlines - missed_gated_content: (bool) Indicates whether the user missed gated content + dates_banner_info: (obj) + content_type_gating_enabled: (bool) Whether content type gating is enabled for this enrollment. + missed_deadlines: (bool) Indicates whether the user missed any graded content deadlines + missed_gated_content: (bool) Indicates whether the user missed gated content + verified_upgrade_link: (str) The link for upgrading to the Verified track in a course + has_ended: (bool) Indicates whether course has ended learner_is_full_access: (bool) Indicates if the user is verified in the course user_timezone: (str) The user's preferred timezone - verified_upgrade_link: (str) The link for upgrading to the Verified track in a course **Returns** diff --git a/lms/djangoapps/course_home_api/outline/v1/serializers.py b/lms/djangoapps/course_home_api/outline/v1/serializers.py index 87442babdcbfd35b8a1e6c7cabac7869f918fe92..01c3e03e6b31cbc87ede3a7286ca84d2a78a6327 100644 --- a/lms/djangoapps/course_home_api/outline/v1/serializers.py +++ b/lms/djangoapps/course_home_api/outline/v1/serializers.py @@ -6,6 +6,7 @@ from django.utils.translation import ngettext from rest_framework import serializers from lms.djangoapps.course_home_api.dates.v1.serializers import DateSummarySerializer +from lms.djangoapps.course_home_api.mixins import DatesBannerSerializerMixin class CourseBlockSerializer(serializers.Serializer): @@ -104,7 +105,7 @@ class ResumeCourseSerializer(serializers.Serializer): url = serializers.URLField() -class OutlineTabSerializer(serializers.Serializer): +class OutlineTabSerializer(DatesBannerSerializerMixin, serializers.Serializer): """ Serializer for the Outline Tab """ @@ -115,6 +116,7 @@ class OutlineTabSerializer(serializers.Serializer): dates_widget = DatesWidgetSerializer() enroll_alert = EnrollAlertSerializer() handouts_html = serializers.CharField() + has_ended = serializers.BooleanField() offer_html = serializers.CharField() resume_course = ResumeCourseSerializer() welcome_message_html = serializers.CharField() diff --git a/lms/djangoapps/course_home_api/outline/v1/views.py b/lms/djangoapps/course_home_api/outline/v1/views.py index 2e8d8e219a7221898b17106134592fdedc6eb88a..344cd73b9e0d9de102196680bda1e27b9dbd70db 100644 --- a/lms/djangoapps/course_home_api/outline/v1/views.py +++ b/lms/djangoapps/course_home_api/outline/v1/views.py @@ -91,6 +91,11 @@ class OutlineTabView(RetrieveAPIView): analytics_id: (str) The unique id given to the tool. title: (str) The display title of the tool. url: (str) The link to access the tool. + dates_banner_info: (obj) + content_type_gating_enabled: (bool) Whether content type gating is enabled for this enrollment. + missed_deadlines: (bool) Whether the user has missed any graded content deadlines for the given course. + missed_gated_content: (bool) Whether the user has missed any gated content for the given course. + verified_upgrade_link: (str) The URL to ecommerce IDA for purchasing the verified upgrade. dates_widget: course_date_blocks: List of serialized Course Dates objects. Each serialization has the following fields: complete: (bool) Meant to only be used by assignments. Indicates completeness for an @@ -108,6 +113,7 @@ class OutlineTabView(RetrieveAPIView): can_enroll: (bool) Whether the user can enroll in the given course extra_text: (str) handouts_html: (str) Raw HTML for the handouts section of the course info + has_ended: (bool) Indicates whether course has ended resume_course: has_visited_course: (bool) Whether the user has ever visited the course url: (str) The display name of the course block to resume @@ -249,6 +255,7 @@ class OutlineTabView(RetrieveAPIView): 'dates_widget': dates_widget, 'enroll_alert': enroll_alert, 'handouts_html': handouts_html or None, + 'has_ended': course.has_ended(), 'offer_html': offer_html or None, 'resume_course': resume_course, 'welcome_message_html': welcome_message_html or None,