From f797c1e8398958dca45df85fac79f115576ea250 Mon Sep 17 00:00:00 2001 From: Evgeny Fadeev Date: Sat, 7 Jan 2012 10:34:00 -0300 Subject: added option to disable changing email address --- askbot/conf/user_settings.py | 9 +++++++++ askbot/forms.py | 1 - askbot/skins/default/templates/base.html | 5 +++++ .../default/templates/user_profile/user_edit.html | 21 ++++++++++++++------- askbot/skins/default/templates/widgets/header.html | 1 - 5 files changed, 28 insertions(+), 9 deletions(-) diff --git a/askbot/conf/user_settings.py b/askbot/conf/user_settings.py index cec13083..086f7583 100644 --- a/askbot/conf/user_settings.py +++ b/askbot/conf/user_settings.py @@ -24,6 +24,15 @@ settings.register( ) ) +settings.register( + livesettings.BooleanValue( + USER_SETTINGS, + 'EDITABLE_EMAIL', + default = True, + description = _('Allow users change own email addresses') + ) +) + settings.register( livesettings.BooleanValue( USER_SETTINGS, diff --git a/askbot/forms.py b/askbot/forms.py index 00735b72..019e5f83 100644 --- a/askbot/forms.py +++ b/askbot/forms.py @@ -920,7 +920,6 @@ class EditAnswerForm(forms.Form): class EditUserForm(forms.Form): email = forms.EmailField( label=u'Email', - help_text=_('this email will be linked to gravatar'), required=True, max_length=255, widget=forms.TextInput(attrs={'size' : 35}) diff --git a/askbot/skins/default/templates/base.html b/askbot/skins/default/templates/base.html index 1102007b..8287f5ba 100644 --- a/askbot/skins/default/templates/base.html +++ b/askbot/skins/default/templates/base.html @@ -17,6 +17,11 @@ {% include "widgets/system_messages.html" %} {% include "custom_header.html" ignore missing %} + {% if settings.CUSTOM_HEADER|trim != '' %} +
+ {{settings.CUSTOM_HEADER}} +
+ {% endif %} {% include "widgets/header.html" %} {# Logo, user tool navigation and meta navitation #} {% include "widgets/secondary_header.html" %} {# Scope selector, search input and ask button #}
diff --git a/askbot/skins/default/templates/user_profile/user_edit.html b/askbot/skins/default/templates/user_profile/user_edit.html index daaa3663..94a1d58d 100644 --- a/askbot/skins/default/templates/user_profile/user_edit.html +++ b/askbot/skins/default/templates/user_profile/user_edit.html @@ -42,17 +42,24 @@ {{ form.username }} {{ form.username.errors }} {% else %} - {{ request.user.username }} + {{ view_user.username }} {% endif %} - {{ form.email.label_tag() }}: - {{ form.email }} {{ form.email.errors }} - - - - {{ form.email.help_text }} + + {{ form.email.label_tag() }}: + + + {% if settings.EDITABLE_EMAIL %} + {{ form.email }} + + {{ form.email.errors }} + {% else %} + {{ view_user.email }} + {% trans %}(cannot be changed){% endtrans %} + {% endif %} + {{ form.realname.label_tag() }}: diff --git a/askbot/skins/default/templates/widgets/header.html b/askbot/skins/default/templates/widgets/header.html index d4e7d66a..52e528bc 100644 --- a/askbot/skins/default/templates/widgets/header.html +++ b/askbot/skins/default/templates/widgets/header.html @@ -7,7 +7,6 @@
{% include "widgets/user_navigation.html" %} - {{settings.CUSTOM_HEADER}}
{% if settings.SHOW_LOGO %} {% include "widgets/logo.html" %} -- cgit v1.2.3-1-g7c22