|
@@ -33,71 +33,73 @@ def menubar(bar, request):
|
33
|
33
|
|
34
|
34
|
def actionbar(bar, request):
|
35
|
35
|
bar.append_entry(*login_entry_parameters(request, left=True))
|
36
|
|
- bar.append_entry(*recover_entry_parameters(request, left=True))
|
37
|
|
- if parameter.get(parameter.USERS_SELF_REGISTRATION):
|
|
36
|
+ if parameter.get(parameter.USERS_PASSWORD_RECOVERY) or request.user.is_superuser:
|
|
37
|
+ bar.append_entry(*recover_entry_parameters(request, left=True))
|
|
38
|
+ if parameter.get(parameter.USERS_SELF_REGISTRATION) or request.user.is_superuser:
|
38
|
39
|
bar.append_entry(*register_entry_parameters(request, left=True))
|
39
|
40
|
|
40
|
41
|
|
41
|
42
|
def login_entry_parameters(request, left=False):
|
42
|
43
|
return (
|
43
|
|
- LOGIN_ENTRY_UID, # uid
|
44
|
|
- _('Login'), # name
|
45
|
|
- color_icon_url(request, 'login.png'), # icon
|
46
|
|
- url_login(request), # url
|
47
|
|
- left, # left
|
48
|
|
- request.path == url_login(request, True) # active
|
|
44
|
+ LOGIN_ENTRY_UID, # uid
|
|
45
|
+ _('Login'), # name
|
|
46
|
+ color_icon_url(request, 'login.png'), # icon
|
|
47
|
+ url_login(request), # url
|
|
48
|
+ left, # left
|
|
49
|
+ request.path == url_login(request, True) # active
|
49
|
50
|
)
|
50
|
51
|
|
51
|
52
|
|
52
|
53
|
def recover_entry_parameters(request, left=False):
|
53
|
54
|
return (
|
54
|
|
- RECOVER_ENTRY_UID, # uid
|
55
|
|
- _('Recover'), # name
|
56
|
|
- color_icon_url(request, 'recover.png'), # icon
|
57
|
|
- url_recover(request), # url
|
58
|
|
- left, # left
|
59
|
|
- request.path == url_recover(request, True) # active
|
|
55
|
+ RECOVER_ENTRY_UID, # uid
|
|
56
|
+ _('Recover'), # name
|
|
57
|
+ color_icon_url(request, 'recover.png'), # icon
|
|
58
|
+ url_recover(request), # url
|
|
59
|
+ left, # left
|
|
60
|
+ request.path == url_recover(request, True) # active
|
60
|
61
|
)
|
61
|
62
|
|
|
63
|
+
|
62
|
64
|
def register_entry_parameters(request, left=False):
|
63
|
65
|
return (
|
64
|
|
- REGISTER_ENTRY_UID, # uid
|
65
|
|
- _('Register'), # name
|
66
|
|
- color_icon_url(request, 'register.png'), # icon
|
67
|
|
- url_register(request), # url
|
68
|
|
- left, # left
|
69
|
|
- request.path == url_register(request, True) # active
|
|
66
|
+ REGISTER_ENTRY_UID, # uid
|
|
67
|
+ _('Register'), # name
|
|
68
|
+ color_icon_url(request, 'register.png'), # icon
|
|
69
|
+ url_register(request), # url
|
|
70
|
+ left, # left
|
|
71
|
+ request.path == url_register(request, True) # active
|
70
|
72
|
)
|
71
|
73
|
|
72
|
74
|
|
73
|
75
|
def logout_entry_parameters(request):
|
74
|
76
|
return (
|
75
|
|
- LOGOUT_ENTRY_UID, # uid
|
76
|
|
- _('Logout'), # name
|
77
|
|
- color_icon_url(request, 'logout.png'), # icon
|
78
|
|
- url_logout(request), # url
|
79
|
|
- False, # left
|
80
|
|
- False, # active
|
|
77
|
+ LOGOUT_ENTRY_UID, # uid
|
|
78
|
+ _('Logout'), # name
|
|
79
|
+ color_icon_url(request, 'logout.png'), # icon
|
|
80
|
+ url_logout(request), # url
|
|
81
|
+ False, # left
|
|
82
|
+ False, # active
|
81
|
83
|
)
|
82
|
84
|
|
83
|
85
|
|
84
|
86
|
def admin_entry_parameters(request):
|
85
|
87
|
return (
|
86
|
|
- ADMIN_ENTRY_UID, # uid
|
87
|
|
- _('Administration'), # name
|
88
|
|
- color_icon_url(request, 'admin.png'), # icon
|
89
|
|
- reverse('admin:index'), # url
|
90
|
|
- False, # left
|
91
|
|
- False # active
|
|
88
|
+ ADMIN_ENTRY_UID, # uid
|
|
89
|
+ _('Administration'), # name
|
|
90
|
+ color_icon_url(request, 'admin.png'), # icon
|
|
91
|
+ reverse('admin:index'), # url
|
|
92
|
+ False, # left
|
|
93
|
+ False # active
|
92
|
94
|
)
|
93
|
95
|
|
94
|
96
|
|
95
|
97
|
def profile_entry_parameters(request):
|
96
|
98
|
return (
|
97
|
|
- PROFILE_ENTRY_UID, # uid
|
98
|
|
- request.user.username, # name
|
99
|
|
- color_icon_url(request, 'user.png'), # icon
|
100
|
|
- url_profile(request), # url
|
101
|
|
- False, # left
|
102
|
|
- request.path == url_profile(request, True) # active
|
|
99
|
+ PROFILE_ENTRY_UID, # uid
|
|
100
|
+ request.user.username, # name
|
|
101
|
+ color_icon_url(request, 'user.png'), # icon
|
|
102
|
+ url_profile(request), # url
|
|
103
|
+ False, # left
|
|
104
|
+ request.path == url_profile(request, True) # active
|
103
|
105
|
)
|