diff MoinMoin/apps/frontend/views.py @ 484:19b257c0e102

code to get the subitem index flag has been refactored and moved under items/__init__.py and also unitest is added for the same.
author Akash Sinha <akash2607@gmail.com>
date Sat, 09 Jul 2011 00:11:02 +0530
parents 4307261bac75
children 3a3aea61aa1b
line wrap: on
line diff
--- a/MoinMoin/apps/frontend/views.py	Fri Jul 08 17:15:53 2011 +0530
+++ b/MoinMoin/apps/frontend/views.py	Sat Jul 09 00:11:02 2011 +0530
@@ -478,23 +478,14 @@
         abort(403)
     index = item.flat_index()
 
-    index_more_links = []
-    all_item_index = item.get_index()
-    all_item_text = "\n".join(item_info[1] for item_info in all_item_index)
-    for fullname, relname, contenttype in index:
-        hassubitem = False
-        subitem_name_re = u"%s/" % re.escape(relname)
-        regex = re.compile(subitem_name_re, re.UNICODE)
-        if regex.search(all_item_text):
-            hassubitem = True
-        index_more_links.append((fullname, relname, contenttype, hassubitem))
-    index_more_links.sort()
+    detailed_index = item.get_detailed_index(index)
+    detailed_index.sort()
     split_char = u'/'
     item_names = item_name.split(split_char)
 
     return render_template(item.index_template,
                            item=item, item_name=item_name,
-                           index=index_more_links,
+                           index=detailed_index,
                            item_names=item_names
                           )