diff options
-rw-r--r-- | askbot/setup_templates/tinymce_sample_config.py | 1 | ||||
-rw-r--r-- | askbot/startup_procedures.py | 24 | ||||
-rw-r--r-- | askbot/templates/base.html | 9 | ||||
-rw-r--r-- | askbot/templates/meta/html_head_meta.html | 8 | ||||
-rw-r--r-- | askbot/tests/page_load_tests.py | 12 |
5 files changed, 45 insertions, 9 deletions
diff --git a/askbot/setup_templates/tinymce_sample_config.py b/askbot/setup_templates/tinymce_sample_config.py index ac49da68..11085212 100644 --- a/askbot/setup_templates/tinymce_sample_config.py +++ b/askbot/setup_templates/tinymce_sample_config.py @@ -3,6 +3,7 @@ TINYMCE_SPELLCHECKER = False TINYMCE_JS_ROOT = os.path.join(STATIC_ROOT, 'default/media/js/tinymce/') TINYMCE_URL = STATIC_URL + 'default/media/js/tinymce/' TINYMCE_DEFAULT_CONFIG = { + 'convert_urls': False, 'plugins': 'askbot_imageuploader,askbot_attachment', 'theme': 'advanced', 'content_css': STATIC_URL + 'default/media/style/tinymce/content.css', diff --git a/askbot/startup_procedures.py b/askbot/startup_procedures.py index 091338e5..105500b8 100644 --- a/askbot/startup_procedures.py +++ b/askbot/startup_procedures.py @@ -598,6 +598,30 @@ def test_tinymce(): compressor_on = getattr(django_settings, 'TINYMCE_COMPRESSOR', False) if compressor_on is False: errors.append('add line: TINYMCE_COMPRESSOR = True') + #todo: add pointer to instructions on how to debug tinymce: + #1) add ('tiny_mce', os.path.join(ASKBOT_ROOT, 'media/js/tinymce')), + # to STATIFILES_DIRS + #2) add this to the main urlconf: + # ( + # r'^m/(?P<path>.*)$', + # 'django.views.static.serve', + # {'document_root': static_root} + # ), + #3) disable `compressor_on` check above + #then - tinymce compressing will be disabled and it will + #be possible to debug custom tinymce plugins that are used with askbot + + + config = getattr(django_settings, 'TINYMCE_DEFAULT_CONFIG', None) + if config: + if 'convert_urls' in config: + if config['convert_urls'] is not False: + message = "set 'convert_urls':False in TINYMCE_DEFAULT_CONFIG" + errors.append(message) + else: + message = "add to TINYMCE_DEFAULT_CONFIG\n'convert_urls': False," + errors.append(message) + #check js root setting - before version 0.7.44 we used to have #"common" skin and after we combined it into the default diff --git a/askbot/templates/base.html b/askbot/templates/base.html index eaf2261d..63d7115f 100644 --- a/askbot/templates/base.html +++ b/askbot/templates/base.html @@ -2,7 +2,14 @@ <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>{% block title %}{% endblock %} - {{ settings.APP_TITLE|escape }}</title> - {% include "meta/html_head_meta.html" %} + <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> + {% block meta_description %} + <meta name="description" content="{{settings.APP_DESCRIPTION|escape}}" /> + {% endblock %} + <meta name="keywords" content="{%block keywords%}{%endblock%},{{settings.APP_KEYWORDS|escape}}" /> + {% if settings.GOOGLE_SITEMAP_CODE %} + <meta name="google-site-verification" content="{{settings.GOOGLE_SITEMAP_CODE}}" /> + {% endif %} <link rel="shortcut icon" href="{{ settings.SITE_FAVICON|media }}" /> {% block before_css %}{% endblock %} {% include "meta/html_head_stylesheets.html" %} diff --git a/askbot/templates/meta/html_head_meta.html b/askbot/templates/meta/html_head_meta.html deleted file mode 100644 index 352ffb53..00000000 --- a/askbot/templates/meta/html_head_meta.html +++ /dev/null @@ -1,8 +0,0 @@ -<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> -{% block meta_description %} -<meta name="description" content="{{settings.APP_DESCRIPTION|escape}}" /> -{% endblock %} -<meta name="keywords" content="{%block keywords%}{%endblock%},{{settings.APP_KEYWORDS|escape}}" /> -{% if settings.GOOGLE_SITEMAP_CODE %} -<meta name="google-site-verification" content="{{settings.GOOGLE_SITEMAP_CODE}}" /> -{% endif %} diff --git a/askbot/tests/page_load_tests.py b/askbot/tests/page_load_tests.py index 0f102975..293cb78d 100644 --- a/askbot/tests/page_load_tests.py +++ b/askbot/tests/page_load_tests.py @@ -9,6 +9,7 @@ from django.utils import simplejson import coffin import coffin.template +from bs4 import BeautifulSoup from askbot import models from askbot.utils.slug import slugify @@ -568,6 +569,17 @@ class AvatarTests(AskbotTestCase): ) +class QuestionViewTests(AskbotTestCase): + def test_meta_description_has_question_summary(self): + user = self.create_user('user') + text = 'this is a question' + question = self.post_question(user=user, body_text=text) + response = self.client.get(question.get_absolute_url()) + soup = BeautifulSoup(response.content) + meta_descr = soup.find_all('meta', attrs={'name': 'description'})[0] + self.assertTrue(text in meta_descr.attrs['content']) + + class QuestionPageRedirectTests(AskbotTestCase): def setUp(self): |