Commit e0471007 by Giulio Gratta

removed sort in HTML and instead added conditional to use subcategory titles as sort_key

parent 8cac4eba
...@@ -129,6 +129,8 @@ def filter_unstarted_categories(category_map): ...@@ -129,6 +129,8 @@ def filter_unstarted_categories(category_map):
def sort_map_entries(category_map): def sort_map_entries(category_map):
things = [] things = []
for title, entry in category_map["entries"].items(): for title, entry in category_map["entries"].items():
if entry["sort_key"] == None:
entry["sort_key"] = title
things.append((title, entry)) things.append((title, entry))
for title, category in category_map["subcategories"].items(): for title, category in category_map["subcategories"].items():
things.append((title, category)) things.append((title, category))
......
...@@ -2,7 +2,6 @@ ...@@ -2,7 +2,6 @@
<%! import json %> <%! import json %>
<%def name="render_dropdown(map)"> <%def name="render_dropdown(map)">
${map["children"].sort()}
% for child in map["children"]: % for child in map["children"]:
% if child in map["entries"]: % if child in map["entries"]:
${render_entry(map["entries"], child)} ${render_entry(map["entries"], child)}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment