X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=ui%2Ftopmenu.py;h=1fc3b4b2d03e0ac3ba4f587e7d022515985eabdd;hb=fb214ca95fc3d8fb37a94a3fcbdf5ab60a617049;hp=e6250f0562b261f8b1ebb405880a90ffd2777f34;hpb=83f3bc8abee6f1312ad9a0a24e63871fc1ee8b16;p=myslice.git diff --git a/ui/topmenu.py b/ui/topmenu.py index e6250f05..1fc3b4b2 100644 --- a/ui/topmenu.py +++ b/ui/topmenu.py @@ -17,6 +17,7 @@ def topmenu_items (current,request=None): result.append({'label':'Request a slice', 'href': '/portal/slice_request/'}) result.append({'label':'Validation', 'href': '/portal/validate/'}) dropdown = [] + dropdown.append({'label':'Platforms', 'href': '/portal/platforms/'}) dropdown.append({'label':'My Account', 'href': '/portal/account/'}) dropdown.append({'label':'Contact Support', 'href': '/portal/contact/'}) result.append({'label': 'More', 'href':"#", 'dropdown':True, 'contents':dropdown}) @@ -31,12 +32,14 @@ def topmenu_items (current,request=None): if current is not None: current=current.lower() curlen=len(current) - def mark_active(d): - if d['label'][:curlen].lower() == current: d['is_active']=True + def mark_active(d,up=None): + if d['label'][:curlen].lower() == current: + d['is_active']=True + if up is not None: up['is_active']=True for d in result: mark_active(d) if 'dropdown' in d: - for dd in d['contents']: mark_active(dd) + for dd in d['contents']: mark_active(dd,d) return result def the_user (request):