summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEvgeny Fadeev <evgeny.fadeev@gmail.com>2011-12-29 02:26:39 -0300
committerEvgeny Fadeev <evgeny.fadeev@gmail.com>2011-12-29 02:26:39 -0300
commita1f3a72532fc7d1cc13bc6283e26a4da66d0b465 (patch)
tree0b1fad2a44e666db7f49923f343c68ff47809fba
parenta4eab2f673b65ca4359aef6976b96a7481fa871f (diff)
downloadaskbot-a1f3a72532fc7d1cc13bc6283e26a4da66d0b465.tar.gz
askbot-a1f3a72532fc7d1cc13bc6283e26a4da66d0b465.tar.bz2
askbot-a1f3a72532fc7d1cc13bc6283e26a4da66d0b465.zip
made askbot work better when hosted under "subdirectory", still need to fix uploaded avatar
-rw-r--r--askbot/conf/skin_general_settings.py2
-rw-r--r--askbot/setup_templates/settings.py2
-rw-r--r--askbot/setup_templates/settings.py.mustache2
-rw-r--r--askbot/skins/default/templates/main_page/javascript.html6
-rw-r--r--askbot/skins/default/templates/meta/bottom_scripts.html4
-rw-r--r--askbot/tests/badge_tests.py3
-rw-r--r--askbot/tests/skin_tests.py9
-rw-r--r--askbot/views/writers.py2
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 }}';
</script>
<script
diff --git a/askbot/tests/badge_tests.py b/askbot/tests/badge_tests.py
index fdb9d626..c4a47fc5 100644
--- a/askbot/tests/badge_tests.py
+++ b/askbot/tests/badge_tests.py
@@ -1,4 +1,5 @@
import datetime
+from django.conf import settings as django_settings
from django.test.client import Client
from askbot.tests.utils import AskbotTestCase
from askbot.conf import settings
@@ -499,6 +500,6 @@ class BadgeTests(AskbotTestCase):
self.u1.save()
self.assert_have_badge('enthusiast', self.u1, 0)
self.client.login(method = 'force', user_id = self.u1.id)
- self.client.get('/')
+ self.client.get('/' + django_settings.ASKBOT_URL)
self.assert_have_badge('enthusiast', self.u1, 1)
diff --git a/askbot/tests/skin_tests.py b/askbot/tests/skin_tests.py
index 660daa4e..f8e940ee 100644
--- a/askbot/tests/skin_tests.py
+++ b/askbot/tests/skin_tests.py
@@ -66,9 +66,10 @@ class SkinTests(TestCase):
askbot_settings.update('SITE_LOGO_URL', new_logo)
logo_url = askbot_settings.SITE_LOGO_URL
self.assertTrue(
- logo_url.startswith(
- '/' + django_settings.ASKBOT_UPLOADED_FILES_URL
- )
- )
+ logo_url.startswith(
+ django_settings.ASKBOT_URL + \
+ '/' + django_settings.ASKBOT_UPLOADED_FILES_URL
+ )
+ )
response = self.client.get(logo_url)
self.assertTrue(response.status_code == 200)
diff --git a/askbot/views/writers.py b/askbot/views/writers.py
index c1bbc9be..f8da2181 100644
--- a/askbot/views/writers.py
+++ b/askbot/views/writers.py
@@ -616,8 +616,8 @@ def post_comments(request):#generic ajax handler to load comments to an object
else:
raise Http404
-@decorators.ajax_only
@csrf.csrf_exempt
+@decorators.ajax_only
@decorators.check_spam('comment')
def edit_comment(request):
if request.user.is_authenticated():