Removed 'change password' link next to the current user's name and added a few view to handle the current user's password, details and editing

This commit is contained in:
Roberto Rosario
2011-06-16 15:14:05 -04:00
parent e6fad805c7
commit af59b3a7cd
5 changed files with 81 additions and 4 deletions

View File

@@ -1,6 +1,19 @@
import tempfile
from django.utils.translation import ugettext_lazy as _
from common.conf import settings as common_settings
from navigation.api import register_links
TEMPORARY_DIRECTORY = common_settings.TEMPORARY_DIRECTORY \
if common_settings.TEMPORARY_DIRECTORY else tempfile.mkdtemp()
def has_usable_password(context):
return context['request'].user.has_usable_password
password_change_view = {'text': _(u'change password'), 'view': 'password_change_view', 'famfam': 'computer_key', 'condition': has_usable_password}
current_user_details = {'text': _(u'user details'), 'view': 'current_user_details', 'famfam': 'vcard'}
current_user_edit = {'text': _(u'edit details'), 'view': 'current_user_edit', 'famfam': 'vcard_edit'}
register_links(['current_user_details', 'current_user_edit', 'password_change_view'], [current_user_details, current_user_edit, password_change_view], menu_name='secondary_menu')