aboutsummaryrefslogtreecommitdiff
path: root/weblog
diff options
context:
space:
mode:
authorYaroslav de la Peña Smirnov <contact@yaroslavps.com>2018-07-23 00:07:18 +0300
committerYaroslav de la Peña Smirnov <contact@yaroslavps.com>2018-07-23 00:07:18 +0300
commit99b235dcbb78576ce8c9386d58244f15f526a803 (patch)
tree20d93f50f560ddd5dcb0df5023f0d7e40e0615aa /weblog
parenta417f8706a82e5c3fed665c79362df2b66679a19 (diff)
downloadw3blog-99b235dcbb78576ce8c9386d58244f15f526a803.tar.gz
w3blog-99b235dcbb78576ce8c9386d58244f15f526a803.zip
Fix previews for translations, fix chosing languages on translations
Diffstat (limited to 'weblog')
-rwxr-xr-xweblog/views.py4
1 files changed, 2 insertions, 2 deletions
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]+'</p>'
+ post['preview_text'] = post_trans.content.split('</p>', 1)[0]+'</p>'
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():