summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEvgeny Fadeev <evgeny.fadeev@gmail.com>2012-08-23 18:06:56 -0400
committerEvgeny Fadeev <evgeny.fadeev@gmail.com>2012-08-25 14:46:36 -0400
commit1c16316b721117bef9387ba181b49557777a5bc9 (patch)
tree31eb7f04bd7b8a7b5e89b52a7d862023c28ee6e9
parenta2d1de600828ca6017b65ce36498e824cadca87f (diff)
downloadaskbot-1c16316b721117bef9387ba181b49557777a5bc9.tar.gz
askbot-1c16316b721117bef9387ba181b49557777a5bc9.tar.bz2
askbot-1c16316b721117bef9387ba181b49557777a5bc9.zip
added js patch for the noscript tag to hide red margin on IE and disabled Lamson on Windows
-rw-r--r--askbot/__init__.py6
-rw-r--r--askbot/doc/source/changelog.rst1
-rw-r--r--askbot/doc/source/optional-modules.rst5
-rw-r--r--askbot/setup_templates/settings.py1
-rw-r--r--askbot/setup_templates/settings.py.mustache1
-rw-r--r--askbot/skins/default/templates/meta/bottom_scripts.html6
-rw-r--r--askbot/skins/default/templates/widgets/user_navigation.html2
-rw-r--r--askbot/startup_procedures.py19
-rw-r--r--askbot/utils/forms.py5
-rw-r--r--askbot_requirements.txt1
10 files changed, 44 insertions, 3 deletions
diff --git a/askbot/__init__.py b/askbot/__init__.py
index 8e4f20ab..51b7c24f 100644
--- a/askbot/__init__.py
+++ b/askbot/__init__.py
@@ -5,6 +5,7 @@ Functions in the askbot module perform various
basic actions on behalf of the forum application
"""
import os
+import platform
VERSION = (0, 7, 43)
@@ -30,10 +31,13 @@ REQUIREMENTS = {
'recaptcha_works': 'django-recaptcha-works',
'openid': 'python-openid',
'pystache': 'pystache==0.3.1',
- 'lamson': 'Lamson',
'pytz': 'pytz',
+ 'longerusername': 'longerusername',
}
+if platform.system() != 'Windows':
+ REQUIREMENTS['lamson'] = 'Lamson'
+
#necessary for interoperability of django and coffin
try:
from askbot import patches
diff --git a/askbot/doc/source/changelog.rst b/askbot/doc/source/changelog.rst
index d88cd734..9d28dd5f 100644
--- a/askbot/doc/source/changelog.rst
+++ b/askbot/doc/source/changelog.rst
@@ -3,6 +3,7 @@ Changes in Askbot
Development version
-------------------
+* Allow user names longer than 30 characters (Evgeny)
* Option to disable feedback form for the anonymos users (Evgeny)
* Optional restriction to have confirmed email address to join forum (Evgeny)
* Optional list of allowed email addresses and email domain name for the new users (Evgeny)
diff --git a/askbot/doc/source/optional-modules.rst b/askbot/doc/source/optional-modules.rst
index 25bb5cc8..3dc2b5ae 100644
--- a/askbot/doc/source/optional-modules.rst
+++ b/askbot/doc/source/optional-modules.rst
@@ -216,6 +216,11 @@ Askbot supports posting replies by email. For this feature to work ``Lamson`` a
pip install django-lamson
+.. note::
+ On Windows installation of the Lamson module may require
+ additional work. Askbot does not support this feature
+ on Windows automatically.
+
The lamson daemon needs a folder to store it's mail queue files and a folder to store log files, create the folders folder named ``run`` and ``logs`` within your project folder by executing the following commands:
mkdir run
diff --git a/askbot/setup_templates/settings.py b/askbot/setup_templates/settings.py
index 632c4e70..3b1f6bf5 100644
--- a/askbot/setup_templates/settings.py
+++ b/askbot/setup_templates/settings.py
@@ -150,6 +150,7 @@ TEMPLATE_CONTEXT_PROCESSORS = (
INSTALLED_APPS = (
+ 'longerusername',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
diff --git a/askbot/setup_templates/settings.py.mustache b/askbot/setup_templates/settings.py.mustache
index 18ac214d..69b030ed 100644
--- a/askbot/setup_templates/settings.py.mustache
+++ b/askbot/setup_templates/settings.py.mustache
@@ -149,6 +149,7 @@ TEMPLATE_CONTEXT_PROCESSORS = (
INSTALLED_APPS = (
+ 'longerusername',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
diff --git a/askbot/skins/default/templates/meta/bottom_scripts.html b/askbot/skins/default/templates/meta/bottom_scripts.html
index 6c132203..1bcdca1f 100644
--- a/askbot/skins/default/templates/meta/bottom_scripts.html
+++ b/askbot/skins/default/templates/meta/bottom_scripts.html
@@ -6,6 +6,12 @@
<noscript class="noscript">
{% trans app_name = settings.APP_SHORT_NAME %}Please note: {{app_name}} requires javascript to work properly, please enable javascript in your browser, <a href="{{noscript_url}}">here is how</a>{% endtrans %}
</noscript>
+ <script type="text/javascript">
+ //IE fix to hide the red margin
+ var noscript = document.getElementsByTagName('noscript')[0];
+ noscript.style.padding = '0px';
+ noscript.style.backgroundColor = 'transparent';
+ </script>
</div>
<script type="text/javascript">
var i18nLang = '{{settings.LANGUAGE_CODE}}';
diff --git a/askbot/skins/default/templates/widgets/user_navigation.html b/askbot/skins/default/templates/widgets/user_navigation.html
index 717cd7ee..227053b0 100644
--- a/askbot/skins/default/templates/widgets/user_navigation.html
+++ b/askbot/skins/default/templates/widgets/user_navigation.html
@@ -17,7 +17,7 @@
<a href="{{ settings.LOGOUT_URL }}?next={{ settings.LOGOUT_REDIRECT_URL }}">{% trans %}sign out{% endtrans %}</a>
{% endif %}
{% elif settings.USE_ASKBOT_LOGIN_SYSTEM %}
- <a href="{{ settings.LOGIN_URL }}?next={{request.path|clean_login_url}}">{% trans %}Hi, there! Please sign in{% endtrans %}</a>
+ <a href="{{ settings.LOGIN_URL }}?next={{request.path|clean_login_url}}">{% trans %}Hi there! Please sign in{% endtrans %}</a>
{% endif %}
{% if request.user.is_authenticated() and request.user.is_administrator() %}
<a href="{% url site_settings %}">{% trans %}settings{% endtrans %}</a>
diff --git a/askbot/startup_procedures.py b/askbot/startup_procedures.py
index 0fec6d5f..4b4575cf 100644
--- a/askbot/startup_procedures.py
+++ b/askbot/startup_procedures.py
@@ -512,6 +512,24 @@ def test_custom_user_profile_tab():
footer = 'Please carefully read about adding a custom user profile tab.'
print_errors(errors, header = header, footer = footer)
+def test_longerusername():
+ """tests proper installation of the "longerusername" app
+ """
+ errors = list()
+ if 'longerusername' not in django_settings.INSTALLED_APPS:
+ errors.append(
+ "add 'longerusername', as the first item in the INSTALLED_APPS"
+ )
+ else:
+ index = django_settings.INSTALLED_APPS.index('longerusername')
+ if index != 0:
+ message = "move 'longerusername', to the beginning of INSTALLED_APPS"
+ raise AskbotConfigError(message)
+
+ if errors:
+ errors.append('run "python manage.py migrate longerusername"')
+ print_errors(errors)
+
def run_startup_tests():
"""function that runs
all startup tests, mainly checking settings config so far
@@ -527,6 +545,7 @@ def run_startup_tests():
test_celery()
#test_csrf_cookie_domain()
test_staticfiles()
+ test_longerusername()
test_avatar()
settings_tester = SettingsTester({
'CACHE_MIDDLEWARE_ANONYMOUS_ONLY': {
diff --git a/askbot/utils/forms.py b/askbot/utils/forms.py
index 319e9b9d..4375ca17 100644
--- a/askbot/utils/forms.py
+++ b/askbot/utils/forms.py
@@ -9,6 +9,7 @@ from askbot.conf import settings as askbot_settings
from askbot.utils.slug import slugify
from askbot.utils.functions import split_list
from askbot import const
+from longerusername import MAX_USERNAME_LENGTH
import logging
import urllib
@@ -78,7 +79,9 @@ class UserNameField(StrippedNonEmptyCharField):
if 'error_messages' in kw:
error_messages.update(kw['error_messages'])
del kw['error_messages']
- super(UserNameField,self).__init__(max_length=30,
+
+ max_length = MAX_USERNAME_LENGTH
+ super(UserNameField,self).__init__(max_length=max_length,
widget=forms.TextInput(attrs=login_form_widget_attrs),
label=label,
error_messages=error_messages,
diff --git a/askbot_requirements.txt b/askbot_requirements.txt
index 7b619c36..885a21e3 100644
--- a/askbot_requirements.txt
+++ b/askbot_requirements.txt
@@ -19,3 +19,4 @@ django-recaptcha-works
python-openid
pystache==0.3.1
pytz
+longerusername