diff options
author | Hrishi <hrishi@Hrishi-Mobile-Workstation.(none)> | 2011-09-20 00:54:19 +0530 |
---|---|---|
committer | Hrishi <hrishi@Hrishi-Mobile-Workstation.(none)> | 2011-09-20 00:54:19 +0530 |
commit | 94641e2915f2d0b765119c4b142dbdd603358fc6 (patch) | |
tree | 4147dfe693a8954168b825ce76e317306eefbb3d | |
parent | 094b354a0725c0d75c1565541e5fed50f9950ed8 (diff) | |
download | askbot-94641e2915f2d0b765119c4b142dbdd603358fc6.tar.gz askbot-94641e2915f2d0b765119c4b142dbdd603358fc6.tar.bz2 askbot-94641e2915f2d0b765119c4b142dbdd603358fc6.zip |
made the welcome message for anonymous users editable via admin settings
-rw-r--r-- | askbot/conf/site_settings.py | 17 | ||||
-rw-r--r-- | askbot/const/message_keys.py | 16 | ||||
-rw-r--r-- | askbot/locale/en/LC_MESSAGES/django.po | 8 | ||||
-rw-r--r-- | askbot/middleware/anon_user.py | 3 |
4 files changed, 20 insertions, 24 deletions
diff --git a/askbot/conf/site_settings.py b/askbot/conf/site_settings.py index 376c65c0..603ae6b9 100644 --- a/askbot/conf/site_settings.py +++ b/askbot/conf/site_settings.py @@ -74,19 +74,16 @@ settings.register( settings.register( livesettings.StringValue( QA_SITE_SETTINGS, - 'GREETING_URL', - default='/' + _('faq/'),#cannot reverse url here, must be absolute also - hidden=True, + 'GREETING_FOR_ANONYMOUS_USER', + default='First time here? Check out the FAQ!', + hidden=False, description=_( - 'Link shown in the greeting message ' + 'Text shown in the greeting message ' 'shown to the anonymous user' ), - help_text=_('If you change this url from the default - ' - 'then you will also probably want to adjust translation of ' - 'the following string: ') + '"' - + escape(const.GREETING_FOR_ANONYMOUS_USER + '"' - ' You can find this string in your locale django.po file' - ) + help_text=_( + 'Use HTML to format the message ' + ) ) ) diff --git a/askbot/const/message_keys.py b/askbot/const/message_keys.py index f7115009..5ba77248 100644 --- a/askbot/const/message_keys.py +++ b/askbot/const/message_keys.py @@ -9,14 +9,14 @@ _ = lambda v:v #NOTE: all strings must be explicitly put into this dictionary, #because you don't want to import _ from here with import * -__all__ = ['GREETING_FOR_ANONYMOUS_USER', ] - -#this variable is shown in settings, because -#the url within is configurable, the default is reverse('faq') -#if user changes url they will have to be able to fix the -#message translation too -GREETING_FOR_ANONYMOUS_USER = \ - _('First time here? Check out the <a href="%s">FAQ</a>!') +__all__ = [] + + + + + + + #messages loaded in the templates via direct _ calls _('most relevant questions') diff --git a/askbot/locale/en/LC_MESSAGES/django.po b/askbot/locale/en/LC_MESSAGES/django.po index a1548a93..4d6cd0ba 100644 --- a/askbot/locale/en/LC_MESSAGES/django.po +++ b/askbot/locale/en/LC_MESSAGES/django.po @@ -1600,10 +1600,10 @@ msgstr "" msgid "bronze" msgstr "" -#: const/message_keys.py:19 -#, python-format -msgid "First time here? Check out the <a href=\"%s\">FAQ</a>!" -msgstr "" + + + + #: const/message_keys.py:22 skins/default/templates/main_page/tab_bar.html:27 msgid "most relevant questions" diff --git a/askbot/middleware/anon_user.py b/askbot/middleware/anon_user.py index 06e9dfd0..fe1ddf14 100644 --- a/askbot/middleware/anon_user.py +++ b/askbot/middleware/anon_user.py @@ -31,6 +31,5 @@ class ConnectToSessionMessagesMiddleware(object): #also set the first greeting one time per session only if 'greeting_set' not in request.session: request.session['greeting_set'] = True - msg = _(const.GREETING_FOR_ANONYMOUS_USER) \ - % askbot_settings.GREETING_URL + msg = _(askbot_settings.GREETING_FOR_ANONYMOUS_USER) request.user.message_set.create(message=msg) |