1 # a set of utilities to help make the global layout consistent across views
3 def topmenu_items (current,request=None):
4 has_user=request.user.is_authenticated()
7 result.append({'label':'Platforms', 'href': '/portal/platforms/'})
8 result.append({ 'label':'Dashboard', 'href': '/portal/dashboard/'})
9 # This should probably go in dashboard at some point
10 result.append({ 'label':'Request a slice', 'href': '/portal/slice_request/'})
11 result.append({'label':'My Account', 'href': '/portal/account/'})
13 result.append({'label':'Home', 'href': '/login'})
14 # looks like this is accessible to non-logged users
15 result.append({'label':'Platforms', 'href': '/portal/platforms/'})
16 result.append({ 'label':'Register', 'href': '/portal/register/'})
17 result.append({'label':'Contact Support', 'href': '/portal/contact/'})
19 #if d['label'].lower()find(current)>=0: d['is_active']=True
20 if d['label'] == current: d['is_active']=True
21 if not request: return result
22 # result.append (login_out_items [ has_user] )
25 def the_user (request):
26 "retrieves logged in user's email, or empty string"
27 if not request.user.is_authenticated ():
30 return request.user.email