From e0471007d8f8d6d6bad60ee9aa6e0f492f01b214 Mon Sep 17 00:00:00 2001 From: Giulio Gratta Date: Fri, 16 Aug 2013 17:24:36 -0700 Subject: [PATCH] removed sort in HTML and instead added conditional to use subcategory titles as sort_key --- lms/djangoapps/django_comment_client/utils.py | 2 ++ lms/templates/discussion/_filter_dropdown.html | 1 - 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/lms/djangoapps/django_comment_client/utils.py b/lms/djangoapps/django_comment_client/utils.py index c3e2708f67..ed97c43113 100644 --- a/lms/djangoapps/django_comment_client/utils.py +++ b/lms/djangoapps/django_comment_client/utils.py @@ -129,6 +129,8 @@ def filter_unstarted_categories(category_map): def sort_map_entries(category_map): things = [] for title, entry in category_map["entries"].items(): + if entry["sort_key"] == None: + entry["sort_key"] = title things.append((title, entry)) for title, category in category_map["subcategories"].items(): things.append((title, category)) diff --git a/lms/templates/discussion/_filter_dropdown.html b/lms/templates/discussion/_filter_dropdown.html index a51467eade..c09f295b11 100644 --- a/lms/templates/discussion/_filter_dropdown.html +++ b/lms/templates/discussion/_filter_dropdown.html @@ -2,7 +2,6 @@ <%! import json %> <%def name="render_dropdown(map)"> - ${map["children"].sort()} % for child in map["children"]: % if child in map["entries"]: ${render_entry(map["entries"], child)}