avoid unicode error if keyword starts with special characters.

In addition show only starting characters appearing in word list
in headline.
This commit is contained in:
Helmut Merz 2018-02-19 14:30:53 +01:00
parent e35fafad81
commit d282e3c93a
2 changed files with 12 additions and 3 deletions

View file

@ -415,7 +415,8 @@ class ConceptView(BaseView):
children = getChildren
def childrenAlphaGroups(self, predicates=None):
result = Jeep()
#result = Jeep()
result = {}
rels = self.getChildren(predicates=predicates or [self.defaultPredicate],
topLevelOnly=False, sort=False)
rels = sorted(rels, key=lambda r: r.title.lower())

View file

@ -4,7 +4,7 @@
tal:define="data item/childrenAlphaGroups">
<metal:title use-macro="item/conceptMacros/concepttitle" />
<div><a name="top">&nbsp;</a></div>
<div>
<div tal:condition="nothing">
<span tal:repeat="letter python: [chr(c) for c in range(ord('A'), ord('Z')+1)]"
class="navlink">
<a href="#"
@ -13,8 +13,16 @@
tal:content="letter">A</a>
</span>
</div>
<div>
<span tal:repeat="letter python:data.keys()"
class="navlink">
<a href="#"
tal:attributes="href string:${view/requestUrl/-1}#$letter"
tal:content="letter">A</a>
</span>
</div>
<div>&nbsp;</div>
<div tal:repeat="letter data/keys">
<div tal:repeat="letter python:data.keys()">
<div class="subtitle"><a name="A" href="#top"
tal:attributes="name letter;
href string:${view/requestUrl/-1}#top"