From a1f3a72532fc7d1cc13bc6283e26a4da66d0b465 Mon Sep 17 00:00:00 2001 From: Evgeny Fadeev Date: Thu, 29 Dec 2011 02:26:39 -0300 Subject: made askbot work better when hosted under "subdirectory", still need to fix uploaded avatar --- askbot/conf/skin_general_settings.py | 2 +- askbot/setup_templates/settings.py | 2 +- askbot/setup_templates/settings.py.mustache | 2 +- askbot/skins/default/templates/main_page/javascript.html | 6 +++--- askbot/skins/default/templates/meta/bottom_scripts.html | 4 ++-- askbot/tests/badge_tests.py | 3 ++- askbot/tests/skin_tests.py | 9 +++++---- askbot/views/writers.py | 2 +- 8 files changed, 16 insertions(+), 14 deletions(-) diff --git a/askbot/conf/skin_general_settings.py b/askbot/conf/skin_general_settings.py index 1bdb5887..387ac1f6 100644 --- a/askbot/conf/skin_general_settings.py +++ b/askbot/conf/skin_general_settings.py @@ -26,7 +26,7 @@ settings.register( 'then submit this whole form.' ), upload_directory = django_settings.ASKBOT_FILE_UPLOAD_DIR, - upload_url = '/' + django_settings.ASKBOT_UPLOADED_FILES_URL, + upload_url = django_settings.ASKBOT_URL + '/' + django_settings.ASKBOT_UPLOADED_FILES_URL, default = '/images/logo.gif', url_resolver = skin_utils.get_media_url ) diff --git a/askbot/setup_templates/settings.py b/askbot/setup_templates/settings.py index 9e847eba..c3f5533a 100644 --- a/askbot/setup_templates/settings.py +++ b/askbot/setup_templates/settings.py @@ -209,7 +209,7 @@ LOGIN_URL = '/%s%s%s' % (ASKBOT_URL,_('account/'),_('signin/')) LOGIN_REDIRECT_URL = ASKBOT_URL #adjust if needed #note - it is important that upload dir url is NOT translated!!! #also, this url must not have the leading slash -ASKBOT_UPLOADED_FILES_URL = '%s%s' % (ASKBOT_URL, 'upfiles/') +ASKBOT_UPLOADED_FILES_URL = 'upfiles/' ALLOW_UNICODE_SLUGS = False ASKBOT_USE_STACKEXCHANGE_URLS = False #mimic url scheme of stackexchange diff --git a/askbot/setup_templates/settings.py.mustache b/askbot/setup_templates/settings.py.mustache index 79b98814..2d114fe6 100644 --- a/askbot/setup_templates/settings.py.mustache +++ b/askbot/setup_templates/settings.py.mustache @@ -208,7 +208,7 @@ LOGIN_URL = '/%s%s%s' % (ASKBOT_URL,_('account/'),_('signin/')) LOGIN_REDIRECT_URL = ASKBOT_URL #adjust, if needed #note - it is important that upload dir url is NOT translated!!! #also, this url must not have the leading slash -ASKBOT_UPLOADED_FILES_URL = '%s%s' % (ASKBOT_URL, 'upfiles/') +ASKBOT_UPLOADED_FILES_URL = 'upfiles/' ALLOW_UNICODE_SLUGS = False ASKBOT_USE_STACKEXCHANGE_URLS = False #mimic url scheme of stackexchange diff --git a/askbot/skins/default/templates/main_page/javascript.html b/askbot/skins/default/templates/main_page/javascript.html index e35113dd..619574d9 100644 --- a/askbot/skins/default/templates/main_page/javascript.html +++ b/askbot/skins/default/templates/main_page/javascript.html @@ -29,9 +29,9 @@ } } - askbot['urls']['mark_interesting_tag'] = scriptUrl + '{% url mark_interesting_tag %}'; - askbot['urls']['mark_ignored_tag'] = scriptUrl + '{% url mark_ignored_tag %}'; - askbot['urls']['unmark_tag'] = scriptUrl + '{% url unmark_tag %}'; + askbot['urls']['mark_interesting_tag'] = '{% url mark_interesting_tag %}'; + askbot['urls']['mark_ignored_tag'] = '{% url mark_ignored_tag %}'; + askbot['urls']['unmark_tag'] = '{% url unmark_tag %}'; askbot['urls']['set_tag_filter_strategy'] = '{% url "set_tag_filter_strategy" %}'; askbot['urls']['questions'] = '{% url "questions" %}'; {% if settings.ASKBOT_TRANSLATE_URL %} diff --git a/askbot/skins/default/templates/meta/bottom_scripts.html b/askbot/skins/default/templates/meta/bottom_scripts.html index 0df25e7c..ad7bffa1 100644 --- a/askbot/skins/default/templates/meta/bottom_scripts.html +++ b/askbot/skins/default/templates/meta/bottom_scripts.html @@ -25,8 +25,8 @@ askbot['urls']['mark_read_message'] = '{% url "read_message" %}'; askbot['urls']['get_tags_by_wildcard'] = '{% url "get_tags_by_wildcard" %}'; askbot['urls']['get_tag_list'] = '{% url "get_tag_list" %}'; - askbot['urls']['follow_user'] = scriptUrl + 'followit/follow/user/{{'{{'}}userId{{'}}'}}/'; - askbot['urls']['unfollow_user'] = scriptUrl + 'followit/unfollow/user/{{'{{'}}userId{{'}}'}}/'; + askbot['urls']['follow_user'] = '/followit/follow/user/{{'{{'}}userId{{'}}'}}/'; + askbot['urls']['unfollow_user'] = '/followit/unfollow/user/{{'{{'}}userId{{'}}'}}/'; askbot['urls']['user_signin'] = '{{ settings.LOGIN_URL }}';