Skip to content

Commit

Permalink
updated settings template and startup procedures to make tinymce work
Browse files Browse the repository at this point in the history
  • Loading branch information
fitoria committed Feb 14, 2013
1 parent 967bff7 commit 028b94f
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 14 deletions.
5 changes: 3 additions & 2 deletions askbot/setup_templates/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -244,11 +244,11 @@
#http://django-haystack.readthedocs.org/en/v1.2.7/settings.html
HAYSTACK_SEARCH_ENGINE = 'simple'

TINYMCE_COMPRESSOR = True
TINYMCE_COMPRESSOR = False
TINYMCE_SPELLCHECKER = False
TINYMCE_JS_ROOT = os.path.join(STATIC_ROOT, 'default/media/js/tinymce/')

TINYMCE_URL = STATIC_URL + 'default/media/js/tinymce/'
TINYMCE_JS_URL = STATIC_URL + 'default/media/js/tinymce/tiny_mce.js'
TINYMCE_DEFAULT_CONFIG = {
'plugins': 'askbot_imageuploader,askbot_attachment',
'convert_urls': False,
Expand All @@ -268,6 +268,7 @@
'theme_advanced_resizing': True,
'theme_advanced_resize_horizontal': False,
'theme_advanced_statusbar_location': 'bottom',
'width': '730',
'height': '250'
}

Expand Down
6 changes: 3 additions & 3 deletions askbot/setup_templates/settings.py.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -250,10 +250,10 @@ HAYSTACK_SITECONF = 'askbot.search.haystack'
#http://django-haystack.readthedocs.org/en/v1.2.7/settings.html
HAYSTACK_SEARCH_ENGINE = 'simple'

TINYMCE_COMPRESSOR = True
TINYMCE_COMPRESSOR = False
TINYMCE_SPELLCHECKER = False
TINYMCE_JS_ROOT = os.path.join(STATIC_ROOT, 'default/media/js/tinymce/')
TINYMCE_URL = STATIC_URL + 'default/media/js/tinymce/'
TINYMCE_JS_URL = STATIC_URL + 'default/media/js/tinymce/tiny_mce.js'
TINYMCE_DEFAULT_CONFIG = {
'plugins': 'askbot_imageuploader,askbot_attachment',
'convert_urls': False,
Expand All @@ -274,7 +274,7 @@ TINYMCE_DEFAULT_CONFIG = {
'theme_advanced_resizing': True,
'theme_advanced_resize_horizontal': False,
'theme_advanced_statusbar_location': 'bottom',
'width': '723',
'width': '730',
'height': '250'
}

Expand Down
2 changes: 1 addition & 1 deletion askbot/setup_templates/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
(r'^tinymce/', include('tinymce.urls')),
(r'^robots.txt$', include('robots.urls')),
url( # TODO: replace with django.conf.urls.static ?
r'^%s(?P<path>.*)$' % settings.MEDIA_URL[1:],
r'^%s(?P<path>.*)$' % settings.MEDIA_URL[1:],
'django.views.static.serve',
{'document_root': settings.MEDIA_ROOT.replace('\\','/')},
),
Expand Down
16 changes: 8 additions & 8 deletions askbot/startup_procedures.py
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ def test_template_loader():
errors.append(
'"%s" must be the first element of TEMPLATE_LOADERS' % current_loader
)

print_errors(errors)

def test_celery():
Expand Down Expand Up @@ -609,7 +609,7 @@ def test_tinymce():
required_attrs = (
'TINYMCE_COMPRESSOR',
'TINYMCE_JS_ROOT',
'TINYMCE_URL',
'TINYMCE_JS_URL',
'TINYMCE_DEFAULT_CONFIG'
)

Expand Down Expand Up @@ -665,11 +665,11 @@ def test_tinymce():
errors.append(error_tpl % relative_js_path)

#check url setting
url = getattr(django_settings, 'TINYMCE_URL', '')
expected_url = django_settings.STATIC_URL + relative_js_path
url = getattr(django_settings, 'TINYMCE_JS_URL', '')
expected_url = django_settings.STATIC_URL + relative_js_path + 'tiny_mce.js'
old_expected_url = django_settings.STATIC_URL + old_relative_js_path
if urls_equal(url, expected_url) is False:
error_tpl = "add line: TINYMCE_URL = STATIC_URL + '%s'"
error_tpl = "add line: TINYMCE_JS_URL = STATIC_URL + '%s'"
if urls_equal(url, old_expected_url):
error_tpl += '\nNote: we have moved files from "common" into "default"'
errors.append(error_tpl % relative_js_path)
Expand Down Expand Up @@ -721,7 +721,7 @@ def test_template_context_processors():
required_processors.append(new_auth_processor)
if old_auth_processor in django_settings.TEMPLATE_CONTEXT_PROCESSORS:
invalid_processors.append(old_auth_processor)

missing_processors = list()
for processor in required_processors:
if processor not in django_settings.TEMPLATE_CONTEXT_PROCESSORS:
Expand Down Expand Up @@ -790,7 +790,7 @@ def test_group_messaging():
errors.append(
"make setting 'GROUP_MESSAGING to be exactly:\n" + settings_sample
)

url_params = settings.get('BASE_URL_PARAMS', None)
else:
errors.append('add this to your settings.py:\n' + settings_sample)
Expand Down Expand Up @@ -819,7 +819,7 @@ def test_multilingual():
errors.append('ASKBOT_MULTILINGUAL=True works only with django >= 1.4')

if is_multilang:
middleware = 'django.middleware.locale.LocaleMiddleware'
middleware = 'django.middleware.locale.LocaleMiddleware'
if middleware not in django_settings.MIDDLEWARE_CLASSES:
errors.append(
"add 'django.middleware.locale.LocaleMiddleware' to your MIDDLEWARE_CLASSES "
Expand Down

0 comments on commit 028b94f

Please sign in to comment.