From 99b235dcbb78576ce8c9386d58244f15f526a803 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yaroslav=20de=20la=20Pe=C3=B1a=20Smirnov?= Date: Mon, 23 Jul 2018 00:07:18 +0300 Subject: Fix previews for translations, fix chosing languages on translations --- setup.py | 2 +- weblog/views.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/setup.py b/setup.py index 115a37e..56ff784 100755 --- a/setup.py +++ b/setup.py @@ -10,7 +10,7 @@ os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir))) setup( name='w3blog', - version='0.4.1', + version='0.4-testing.16', packages=find_packages(), include_package_data=True, license='BSD License', diff --git a/weblog/views.py b/weblog/views.py index fe050a4..cd5f6e8 100755 --- a/weblog/views.py +++ b/weblog/views.py @@ -135,7 +135,7 @@ def Index(request, **kwargs): if len(post_trans.preview_text) > 5: post['preview_text'] = post_trans.preview_text else: - post['preview_text'] = post_trans.content.split('\n', 1)[0]+'

' + post['preview_text'] = post_trans.content.split('

', 1)[0]+'

' else: post['title'] = post_raw.title post['content'] = post_raw.content @@ -255,7 +255,7 @@ def PostView(request, category_slug, post_slug, language=None): post_languages.append(post_translation.language[:2].lower()) if language and language == post_translation.language[0:2]: context_dict['post_translation'] = post_translation - elif current_language[0:2] == post_translation.language[0:2]: + elif current_language[0:2] == post_translation.language[0:2] and not language: context_dict['post_translation'] = post_translation for lang in settings.LANGUAGES: if lang[0][:2] == orig_lang.lower(): -- cgit v1.2.3