From 3de6e7789b28a900199e56d8d948bff434a98184 Mon Sep 17 00:00:00 2001 From: Simon Chen Date: Tue, 19 Dec 2017 11:16:07 -0500 Subject: [PATCH] Programmatically indicate nested discussions in filter This is an a11y fix on the discussion topic display on the left. We are going to write out all the parent catagories for each topic EDUCATOR-1549 --- .../discussion/_filter_dropdown.html | 44 ++++++++++++------- 1 file changed, 27 insertions(+), 17 deletions(-) diff --git a/lms/templates/discussion/_filter_dropdown.html b/lms/templates/discussion/_filter_dropdown.html index aec3d1842d..f80d569433 100644 --- a/lms/templates/discussion/_filter_dropdown.html +++ b/lms/templates/discussion/_filter_dropdown.html @@ -5,37 +5,47 @@ from lms.djangoapps.django_comment_client.constants import TYPE_ENTRY from openedx.core.djangolib.markup import HTML %> -<%def name="render_dropdown(map)"> +<%def name="render_dropdown(map, topic_list)"> % for child, c_type in map["children"]: % if child in map["entries"] and c_type == TYPE_ENTRY: - ${HTML(render_entry(map["entries"], child))} + ${HTML(render_entry(map["entries"], child, topic_list))} %else: - ${HTML(render_category(map["subcategories"], child))} + ${HTML(render_category(map["subcategories"], child, topic_list))} %endif %endfor -<%def name="render_entry(entries, entry)"> +<%def name="render_entry(entries, entry, topic_list)">
  • - % if entry: - ${entry} - %endif + %if entry: + + %if topic_list: + + ${', '.join(topic_list)}, + + %endif + ${entry} + + %endif
  • -<%def name="render_category(categories, category)"> +<%def name="render_category(categories, category, topic_list)">