diff --git a/lms/static/sass/features/_course-outline.scss b/lms/static/sass/features/_course-outline.scss index 7ea0b7e791..6e9a98a57d 100644 --- a/lms/static/sass/features/_course-outline.scss +++ b/lms/static/sass/features/_course-outline.scss @@ -35,21 +35,32 @@ list-style-type: none; a.outline-item { - display: block; + display: flex; + justify-content: space-between; padding: ($baseline / 2); &:hover { background-color: palette(primary, x-back); - text-decoration: none; + } + + .subsection-text { + .details { + font-size: $body-font-size; + color: $lms-gray; + font-style: italic; + } + } + + .subsection-actions { + .resume-right { + position: relative; + top: calc(50% - (#{$baseline} / 2)); + } } } &.current { border: 1px solid $lms-active-color; - - .resume-right { - @include float(right); - } } } } diff --git a/openedx/features/course_experience/templates/course_experience/course-outline-fragment.html b/openedx/features/course_experience/templates/course_experience/course-outline-fragment.html index 3d5f66295b..7c92a47101 100644 --- a/openedx/features/course_experience/templates/course_experience/course-outline-fragment.html +++ b/openedx/features/course_experience/templates/course_experience/course-outline-fragment.html @@ -27,7 +27,6 @@ from django.utils.translation import ugettext as _
    % for subsection in section.get('children') or []: - ${ subsection.get('special_exam', '') }
  1. - ${ subsection['display_name'] } - ${ _("This is your last visited course section.") } - % if subsection['current']: - - ${ _("Resume Course") } - - - % endif +
    + ## Subsection title + ${ subsection['display_name'] } + +
    + ## There are behavior differences between rendering of subsections which have + ## special_exam/timed examinations and those that do not. + ## + ## Proctoring exposes a exam status message field as well as a status icon + <% + if subsection.get('due') is None: + data_string = subsection['format'] + else: + if 'special_exam' in subsection: + data_string = _('due {date}') + else: + data_string = _("{subsection_format} due {{date}}").format(subsection_format=subsection['format']) + %> + % if subsection['format'] or due_date or 'special_exam' in subsection: + + % if 'special_exam' in subsection: + ## Display the proctored exam status icon and status message + + + ${subsection['special_exam'].get('short_description', '')} + + + ## completed proctored exam statuses should not show the due date + ## since the exam has already been submitted by the user + % if not subsection['special_exam'].get('in_completed_state', False): + + % endif + % else: + ## non-proctored section, we just show the exam format and the due date + ## this is the standard case in edx-platform + + + % if 'graded' in subsection and subsection['graded']: + + ${_("This content is graded")} + % endif + % endif + + % endif +
    +
    +
    + ## Resume button (if last visited section) + % if subsection['current']: + ${ _("This is your last visited course section.") } + + ${ _("Resume Course") } + + + %endif +
  2. % endfor diff --git a/openedx/features/course_experience/views/course_outline.py b/openedx/features/course_experience/views/course_outline.py index 8724a0f173..26e35936bb 100644 --- a/openedx/features/course_experience/views/course_outline.py +++ b/openedx/features/course_experience/views/course_outline.py @@ -29,6 +29,13 @@ class CourseOutlineFragmentView(EdxFragmentView): for i in range(len(children)): child_id = block['children'][i] child_detail = self.populate_children(all_blocks[child_id], all_blocks, course_position) + + # Fake data; remove + child_detail = dict(child_detail, **{ + "format": "", + "due": "" + }) + block['children'][i] = child_detail block['children'][i]['current'] = course_position == child_detail['block_id']