|
@@ -1,6 +1,5 @@
|
1
|
1
|
from django.conf import settings
|
2
|
2
|
|
3
|
|
-# TODO: PRIO: BugFix if subpages filter is used without parameters
|
4
|
3
|
# TODO: PRIO: Add wildcards for subpages filter
|
5
|
4
|
# TODO: Add whoosh and search
|
6
|
5
|
|
|
@@ -105,10 +104,13 @@ class creol_page(object):
|
105
|
104
|
depth = 9999
|
106
|
105
|
#
|
107
|
106
|
rv = ""
|
108
|
|
- pathlist = fstools.dirlist(settings.PAGES_ROOT, rekursive=False)
|
109
|
|
- pathlist.sort()
|
110
|
|
- for path in pathlist:
|
111
|
|
- contentname = self.__folder_content_filter__(os.path.basename(path))
|
|
107
|
+ # create a rel_path list
|
|
108
|
+ pathlist = [self.__folder_content_filter__(os.path.basename(path)) for path in fstools.dirlist(settings.PAGES_ROOT, rekursive=False)]
|
|
109
|
+ # sort basename
|
|
110
|
+ pathlist.sort(key=os.path.basename)
|
|
111
|
+
|
|
112
|
+ last_char = None
|
|
113
|
+ for contentname in pathlist:
|
112
|
114
|
#
|
113
|
115
|
if (contentname.startswith(self._rel_path) or allpages) and contentname != self._rel_path:
|
114
|
116
|
if allpages:
|
|
@@ -116,7 +118,12 @@ class creol_page(object):
|
116
|
118
|
else:
|
117
|
119
|
name = contentname[len(self._rel_path)+1:]
|
118
|
120
|
if name.count('/') < depth and name.startswith(startname):
|
|
121
|
+ if last_char != os.path.basename(name)[0].upper():
|
|
122
|
+ last_char = os.path.basename(name)[0].upper()
|
|
123
|
+ if last_char is not None:
|
|
124
|
+ rv += "</ul>\n"
|
|
125
|
+ rv += f'<h3>{last_char}</h3>\n<ul>\n'
|
119
|
126
|
rv += f' <li><a href="{url_page(self._request, contentname)}">{name}</a></li>\n'
|
120
|
127
|
if len(rv) > 0:
|
121
|
|
- rv = "<ul>\n" + rv + "</ul>\n"
|
|
128
|
+ rv += "</ul>\n"
|
122
|
129
|
return rv
|