X-Git-Url: http://git.onelab.eu/?p=myslice.git;a=blobdiff_plain;f=myslice%2Fviewutils.py;h=b9309e1b123fddd2d44b1935690eab719b841171;hp=c6067f2809fc34c981d3e1690ebe55cb8c98a50b;hb=c33d0dd5fbfbd8e16c7d971100a851469d313eff;hpb=f1df689da513b1523ce89f0ba32728592999c1f2 diff --git a/myslice/viewutils.py b/myslice/viewutils.py index c6067f28..b9309e1b 100644 --- a/myslice/viewutils.py +++ b/myslice/viewutils.py @@ -1,13 +1,14 @@ # a set of utilities to help make the global layout consistent across views -from copy import deepcopy - +# this standard_topmenu_items = [ # { 'label':'Tab', 'href': '/tab/'}, # { 'label':'Scroll', 'href': '/scroll/'}, # { 'label':'One Plugin', 'href': '/plugin/'}, - { 'label':'Dashboard', 'href': '/portal/dashboard/'}, - { 'label':'Slice', 'href': '/slice/'}, +# Thierry : using this goes to some test slice that not every one is in +# besides, the topmenu needs to be shrunk down horizontally +# otherwise the topmenu takes more vertical space than avail. and the layout is broken +# { 'label':'Slice', 'href': '/slice/'}, #{'label':'My Account', 'href': '/portal/account/'} ] @@ -16,15 +17,18 @@ standard_topmenu_items = [ def topmenu_items (current,request=None): has_user=request.user.is_authenticated() + result=[] if has_user: - result=deepcopy(standard_topmenu_items) - result.append({'label':'My Account', 'href': '/portal/account/'}) + result.append({'label':'Platforms', 'href': '/portal/platforms/'}) + result.append({ 'label':'Dashboard', 'href': '/portal/dashboard/'}) + # This should probably go in dashboard at some point result.append({ 'label':'Request a slice', 'href': '/portal/slice_request/'}) + result.append({'label':'My Account', 'href': '/portal/account/'}) else: - result = [] result.append({'label':'Home', 'href': '/login'}) - result.append({ 'label':'Register', 'href': '/portal/user/register/'}) - result.append({'label':'Platforms', 'href': '/portal/platforms/'}) + # looks like this is accessible to non-logged users + result.append({'label':'Platforms', 'href': '/portal/platforms/'}) + result.append({ 'label':'Register', 'href': '/portal/register/'}) result.append({'label':'Contact Support', 'href': '/portal/contact/'}) for d in result: #if d['label'].lower()find(current)>=0: d['is_active']=True