X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=myslice%2Fviewutils.py;h=29ee071a99a3acbaf9e0193de67faa687ff2d035;hb=64be7f204b6f00244951821884a37fb74b3bbe36;hp=030e0d9d1b57ee90b876457b72565810eea08a97;hpb=b5c3c3e05dd4c775fef822eecb997b35081d5a0a;p=unfold.git diff --git a/myslice/viewutils.py b/myslice/viewutils.py index 030e0d9d..29ee071a 100644 --- a/myslice/viewutils.py +++ b/myslice/viewutils.py @@ -2,11 +2,13 @@ from copy import deepcopy -standard_topmenu_items = [ { 'label':'Plugin', 'href': '/plugin/'}, - { 'label':'Slice', 'href': '/slice/'}, - { 'label':'Scroll', 'href': '/scroll/'}, - { 'label':'Tab', 'href': '/tab/'}, - ] +standard_topmenu_items = [ + { 'label':'Tab', 'href': '/tab/'}, + { 'label':'Scroll', 'href': '/scroll/'}, + { 'label':'Plugin', 'href': '/plugin/'}, + { 'label':'Dashboard', 'href': '/dashboard/'}, + { 'label':'Slice', 'href': '/slice/'}, + ] #login_out_items = { False: { 'label':'Login', 'href':'/login/'}, # True: { 'label':'Logout', 'href':'/logout/'}} @@ -14,7 +16,7 @@ standard_topmenu_items = [ { 'label':'Plugin', 'href': '/plugin/'}, def topmenu_items (current,request=None): result=deepcopy(standard_topmenu_items) for d in result: - if d['label'].lower().find(current)>=0: d['active']=True + if d['label'].lower().find(current)>=0: d['is_active']=True if not request: return result has_user=request.user.is_authenticated() # result.append (login_out_items [ has_user] ) @@ -23,7 +25,7 @@ def topmenu_items (current,request=None): def the_user (request): "This code below is broken" if not request.user.is_authenticated (): - print 'void' +# print 'void user!' return '' else: return request.user.email @@ -57,6 +59,8 @@ hard_wired_list.append("just like a standard plugin can be set as visible or not hard_wired_list.append("") hard_wired_list.append("OTOH and IMHO, there should be two separate and explicit subclasses of SimpleList for slices or testbeds") -quickfilter_criterias = [{'key': 'Slice', 'values': ['slice1','slice2']}, \ - {'key': 'Type', 'values': ['type1','type2']}, \ - {'key': 'Network', 'values': ['net1','net2']}] +quickfilter_criterias = [ + {'key': 'Slice', 'values': ['slice1','slice2']}, + {'key': 'Type', 'values': ['type1','type2']}, + {'key': 'Network', 'values': ['net1','net2']}, + ]