From d24f45f3ee718bfcb6a69551bf28da0028ec228a Mon Sep 17 00:00:00 2001 From: Feanil Patel Date: Fri, 23 May 2025 16:34:19 -0400 Subject: [PATCH] feat: Drop unused render_accordion function and template. This was referenced by the legacy courseware page so we don't need it anymore. --- lms/djangoapps/courseware/views/index.py | 18 ----- lms/templates/courseware/accordion.html | 94 ------------------------ 2 files changed, 112 deletions(-) delete mode 100644 lms/templates/courseware/accordion.html diff --git a/lms/djangoapps/courseware/views/index.py b/lms/djangoapps/courseware/views/index.py index e36d43b75b..6fa0850632 100644 --- a/lms/djangoapps/courseware/views/index.py +++ b/lms/djangoapps/courseware/views/index.py @@ -115,24 +115,6 @@ class CoursewareIndex(View): raise Redirect(mfe_url) - -def render_accordion(request, course, table_of_contents): - """ - Returns the HTML that renders the navigation for the given course. - Expects the table_of_contents to have data on each chapter and section, - including which ones are active. - """ - context = dict( - [ - ('toc', table_of_contents), - ('course_id', str(course.id)), - ('csrf', csrf(request)['csrf_token']), - ('due_date_display_format', course.due_date_display_format), - ] + list(TEMPLATE_IMPORTS.items()) - ) - return render_to_string('courseware/accordion.html', context) - - def save_child_position(seq_block, child_name): """ child_name: url_name of the child diff --git a/lms/templates/courseware/accordion.html b/lms/templates/courseware/accordion.html deleted file mode 100644 index bfbff20731..0000000000 --- a/lms/templates/courseware/accordion.html +++ /dev/null @@ -1,94 +0,0 @@ -<%page expression_filter="h"/> -<%namespace name='static' file='../static_content.html'/> -<%! - from django.urls import reverse - from django.utils.translation import gettext as _ - from django.conf import settings - from openedx.core.djangolib.markup import HTML, Text -%> - -<%def name="make_chapter(chapter)"> -<% -if chapter.get('active'): - aria_label = _('{chapter} current chapter').format(chapter=chapter['display_name']) - active_class = 'active' -else: - aria_label = chapter['display_name'] - active_class = '' -%> - -
- -
- - -% for chapter in toc: - ${make_chapter(chapter)} -% endfor - - -% if toc: - <%static:require_module_async module_name="js/courseware/accordion_events" class_name="AccordionEvents"> - AccordionEvents(); - - - <%static:require_module_async module_name="js/dateutil_factory" class_name="DateUtilFactory"> - DateUtilFactory.transform(iterationKey=".localized-datetime"); - -% endif