From 5a7466204b4030873405b1a0fcb8b208762453ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yaroslav=20de=20la=20Pe=C3=B1a=20Smirnov?= Date: Thu, 31 May 2018 15:04:45 +0300 Subject: Ability to pin posts, updated to bootstrap 4, fixes --- weblog/__init__.py | 79 +---------- weblog/admin.py | 0 weblog/apps.py | 4 +- weblog/locale/es/LC_MESSAGES/django.mo | Bin 3062 -> 3534 bytes weblog/locale/es/LC_MESSAGES/django.po | 147 +++++++++++++-------- weblog/locale/ru/LC_MESSAGES/django.mo | Bin 3905 -> 4447 bytes weblog/locale/ru/LC_MESSAGES/django.po | 147 +++++++++++++-------- weblog/migrations/0001_initial.py | 0 weblog/migrations/0002_auto_20180113_1606.py | 0 weblog/migrations/0003_auto_20180119_0156.py | 0 weblog/migrations/0004_auto_20180119_0156.py | 0 weblog/migrations/0005_auto_20180119_0231.py | 0 weblog/migrations/0006_auto_20180121_1002.py | 0 weblog/migrations/0007_auto_20180122_1943.py | 0 weblog/migrations/0008_auto_20180531_0329.py | 25 ++++ weblog/migrations/__init__.py | 0 .../__pycache__/0001_initial.cpython-36.pyc | Bin 0 -> 1804 bytes .../0002_auto_20180113_1606.cpython-36.pyc | Bin 0 -> 1588 bytes .../0003_auto_20180119_0156.cpython-36.pyc | Bin 0 -> 897 bytes .../0004_auto_20180119_0156.cpython-36.pyc | Bin 0 -> 805 bytes .../0005_auto_20180119_0231.cpython-36.pyc | Bin 0 -> 676 bytes .../0006_auto_20180121_1002.cpython-36.pyc | Bin 0 -> 776 bytes .../0007_auto_20180122_1943.cpython-36.pyc | Bin 0 -> 841 bytes .../0008_auto_20180531_0329.cpython-36.pyc | Bin 0 -> 770 bytes .../migrations/__pycache__/__init__.cpython-36.pyc | Bin 0 -> 155 bytes weblog/models.py | 6 +- weblog/static/weblog/css/weblog.css | 0 weblog/static/weblog/js/weblog.js | 0 weblog/templates/weblog/index.html | 30 ++++- weblog/templates/weblog/post.html | 0 weblog/templates/weblog/sidebar_archive.html | 0 weblog/templates/weblog/sidebar_categories.html | 0 weblog/templates/weblog/weblog.html | 14 +- weblog/templates/weblog_base.html | 19 +-- weblog/templates/weblog_base_old.html | 0 weblog/templatetags/__init__.py | 0 .../__pycache__/__init__.cpython-35.pyc | Bin 166 -> 0 bytes .../__pycache__/__init__.cpython-36.pyc | Bin 166 -> 0 bytes .../__pycache__/weblog_extras.cpython-35.pyc | Bin 2682 -> 0 bytes .../__pycache__/weblog_extras.cpython-36.pyc | Bin 1448 -> 0 bytes weblog/templatetags/weblog_extras.py | 7 +- weblog/tests.py | 0 weblog/urls.py | 0 weblog/views.py | 47 +++++-- 44 files changed, 298 insertions(+), 227 deletions(-) mode change 100644 => 100755 weblog/__init__.py mode change 100644 => 100755 weblog/admin.py mode change 100644 => 100755 weblog/apps.py mode change 100644 => 100755 weblog/locale/es/LC_MESSAGES/django.mo mode change 100644 => 100755 weblog/locale/es/LC_MESSAGES/django.po mode change 100644 => 100755 weblog/locale/ru/LC_MESSAGES/django.mo mode change 100644 => 100755 weblog/locale/ru/LC_MESSAGES/django.po mode change 100644 => 100755 weblog/migrations/0001_initial.py mode change 100644 => 100755 weblog/migrations/0002_auto_20180113_1606.py mode change 100644 => 100755 weblog/migrations/0003_auto_20180119_0156.py mode change 100644 => 100755 weblog/migrations/0004_auto_20180119_0156.py mode change 100644 => 100755 weblog/migrations/0005_auto_20180119_0231.py mode change 100644 => 100755 weblog/migrations/0006_auto_20180121_1002.py mode change 100644 => 100755 weblog/migrations/0007_auto_20180122_1943.py create mode 100644 weblog/migrations/0008_auto_20180531_0329.py mode change 100644 => 100755 weblog/migrations/__init__.py create mode 100755 weblog/migrations/__pycache__/0001_initial.cpython-36.pyc create mode 100755 weblog/migrations/__pycache__/0002_auto_20180113_1606.cpython-36.pyc create mode 100755 weblog/migrations/__pycache__/0003_auto_20180119_0156.cpython-36.pyc create mode 100755 weblog/migrations/__pycache__/0004_auto_20180119_0156.cpython-36.pyc create mode 100755 weblog/migrations/__pycache__/0005_auto_20180119_0231.cpython-36.pyc create mode 100755 weblog/migrations/__pycache__/0006_auto_20180121_1002.cpython-36.pyc create mode 100755 weblog/migrations/__pycache__/0007_auto_20180122_1943.cpython-36.pyc create mode 100644 weblog/migrations/__pycache__/0008_auto_20180531_0329.cpython-36.pyc create mode 100755 weblog/migrations/__pycache__/__init__.cpython-36.pyc mode change 100644 => 100755 weblog/models.py mode change 100644 => 100755 weblog/static/weblog/css/weblog.css mode change 100644 => 100755 weblog/static/weblog/js/weblog.js mode change 100644 => 100755 weblog/templates/weblog/index.html mode change 100644 => 100755 weblog/templates/weblog/post.html mode change 100644 => 100755 weblog/templates/weblog/sidebar_archive.html mode change 100644 => 100755 weblog/templates/weblog/sidebar_categories.html mode change 100644 => 100755 weblog/templates/weblog/weblog.html mode change 100644 => 100755 weblog/templates/weblog_base.html mode change 100644 => 100755 weblog/templates/weblog_base_old.html mode change 100644 => 100755 weblog/templatetags/__init__.py delete mode 100644 weblog/templatetags/__pycache__/__init__.cpython-35.pyc delete mode 100644 weblog/templatetags/__pycache__/__init__.cpython-36.pyc delete mode 100644 weblog/templatetags/__pycache__/weblog_extras.cpython-35.pyc delete mode 100644 weblog/templatetags/__pycache__/weblog_extras.cpython-36.pyc mode change 100644 => 100755 weblog/templatetags/weblog_extras.py mode change 100644 => 100755 weblog/tests.py mode change 100644 => 100755 weblog/urls.py mode change 100644 => 100755 weblog/views.py (limited to 'weblog') diff --git a/weblog/__init__.py b/weblog/__init__.py old mode 100644 new mode 100755 index a97f18a..8c180c5 --- a/weblog/__init__.py +++ b/weblog/__init__.py @@ -1,79 +1,6 @@ from . import apps from django.conf import settings -try: - apps.SETTINGS['enable_comments'] = settings.WEBLOG_ENABLE_COMMENTS -except AttributeError: - pass -except NameError: - pass - -try: - apps.SETTINGS['allow_anon_comments'] = settings.WEBLOG_ALLOW_ANON_COMMENTS -except AttributeError: - pass -except NameError: - pass - -try: - apps.SETTINGS['multilingual'] = settings.WEBLOG_MULTILINGUAL -except AttributeError: - pass -except NameError: - pass - -try: - apps.SETTINGS['blog_title'] = settings.WEBLOG_TITLE -except AttributeError: - pass -except NameError: - pass - -try: - apps.SETTINGS['base_template'] = settings.WEBLOG_BASE_TEMPLATE -except AttributeError: - pass -except NameError: - pass - -try: - apps.SETTINGS['show_author'] = settings.WEBLOG_SHOW_AUTHOR -except AttributeError: - pass -except NameError: - pass - -try: - apps.SETTINGS['use_authors_username'] = settings.WEBLOG_USE_AUTHORS_USERNAME -except AttributeError: - pass -except NameError: - pass - -try: - apps.SETTINGS['show_sidebar'] = settings.WEBLOG_SHOW_SIDEBAR -except AttributeError: - pass -except NameError: - pass - -try: - apps.SETTINGS['show_categories'] = settings.WEBLOG_SHOW_CATEGORIES -except AttributeError: - pass -except NameError: - pass - -try: - apps.SETTINGS['show_archive'] = settings.WEBLOG_SHOW_ARCHIVE -except AttributeError: - pass -except NameError: - pass - -try: - apps.SETTINGS['posts_per_page'] = settings.WEBLOG_POSTS_PER_PAGE -except AttributeError: - pass -except NameError: - pass \ No newline at end of file +if settings.WEBLOG_SETTINGS: + for key, value in settings.WEBLOG_SETTINGS.items(): + apps.SETTINGS[key] = value diff --git a/weblog/admin.py b/weblog/admin.py old mode 100644 new mode 100755 diff --git a/weblog/apps.py b/weblog/apps.py old mode 100644 new mode 100755 index 3389f92..6f2db71 --- a/weblog/apps.py +++ b/weblog/apps.py @@ -2,10 +2,10 @@ from django.apps import AppConfig SETTINGS = { 'enable_comments': False, - 'allow_anon_comments': True, + 'allow_anon_comments': False, 'multilingual': True, 'blog_title': 'Django-Weblog', - 'base_template': 'base.html', + 'base_template': 'weblog_base.html', 'show_author': True, 'use_authors_username': True, 'show_sidebar': True, diff --git a/weblog/locale/es/LC_MESSAGES/django.mo b/weblog/locale/es/LC_MESSAGES/django.mo old mode 100644 new mode 100755 index 9558ef1..51b607c Binary files a/weblog/locale/es/LC_MESSAGES/django.mo and b/weblog/locale/es/LC_MESSAGES/django.mo differ diff --git a/weblog/locale/es/LC_MESSAGES/django.po b/weblog/locale/es/LC_MESSAGES/django.po old mode 100644 new mode 100755 index 5afb637..b3b69ff --- a/weblog/locale/es/LC_MESSAGES/django.po +++ b/weblog/locale/es/LC_MESSAGES/django.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2018-01-31 08:00+0300\n" +"POT-Creation-Date: 2018-05-31 14:31+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -18,249 +18,280 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" -#: weblog/models.py:8 weblog/models.py:23 +#: models.py:8 models.py:23 msgctxt "Noun, not personal name" msgid "Name" msgstr "Nombre" -#: weblog/models.py:9 weblog/models.py:45 +#: models.py:9 models.py:45 msgid "Slug (URL)" msgstr "" -#: weblog/models.py:10 +#: models.py:10 msgid "Parent category" msgstr "Categoría raíz" -#: weblog/models.py:19 weblog/models.py:25 +#: models.py:19 models.py:25 msgctxt "Post category" msgid "Category" msgstr "Categoría" -#: weblog/models.py:20 weblog/models.py:46 weblog/templates/weblog/post.html:16 -#: weblog/templates/weblog/sidebar_categories.html:3 +#: models.py:20 models.py:46 templates/weblog/post.html:16 +#: templates/weblog/sidebar_categories.html:3 msgctxt "Post categories" msgid "Categories" msgstr "Categorías" -#: weblog/models.py:24 weblog/models.py:67 +#: models.py:24 models.py:69 msgid "Language (ISO)" msgstr "Idioma (ISO)" -#: weblog/models.py:34 +#: models.py:34 msgid "Category name translation" msgstr "Traducción de la categoría" -#: weblog/models.py:35 +#: models.py:35 msgid "Category name translations" msgstr "Traducciones de categorías" -#: weblog/models.py:39 weblog/models.py:78 +#: models.py:39 models.py:80 msgid "Author" msgstr "Autor" -#: weblog/models.py:40 weblog/models.py:68 +#: models.py:40 models.py:70 msgctxt "As in name" msgid "Title" msgstr "Título" -#: weblog/models.py:41 weblog/models.py:69 weblog/models.py:80 +#: models.py:41 models.py:71 models.py:82 msgctxt "Of post, comment, article, etc." msgid "Content" msgstr "Contenido" -#: weblog/models.py:42 weblog/models.py:70 +#: models.py:42 models.py:72 msgid "Preview image" msgstr "Imágen de vista previa" -#: weblog/models.py:43 weblog/models.py:71 +#: models.py:43 models.py:73 msgid "Preview Text" msgstr "Texto de vista previa" -#: weblog/models.py:44 +#: models.py:44 msgid "Original language (ISO)" msgstr "Idioma original" -#: weblog/models.py:47 +#: models.py:47 +msgid "Pin blog post" +msgstr "Anclar entrada de blog" + +#: models.py:48 +msgid "Pinned post priority (if pinned)" +msgstr "Prioridad (entre entradas ancladas)" + +#: models.py:49 msgctxt "Make post viewable" msgid "Published" msgstr "Publicado" -#: weblog/models.py:48 +#: models.py:50 msgid "Publish date" msgstr "Fecha de publicación" -#: weblog/models.py:62 +#: models.py:64 msgid "Blog Post" msgstr "Entrada de blog" -#: weblog/models.py:63 +#: models.py:65 msgid "Blog Posts" msgstr "Entradas de blog" -#: weblog/models.py:66 weblog/models.py:79 +#: models.py:68 models.py:81 #, fuzzy #| msgid "Blog Post" msgctxt "Noun, as in blog post" msgid "Post" msgstr "Entrada" -#: weblog/models.py:74 +#: models.py:76 msgid "Translation" msgstr "Traducción" -#: weblog/models.py:75 +#: models.py:77 msgid "Translations" msgstr "Traducciones" -#: weblog/models.py:83 +#: models.py:85 msgctxt "Noun" msgid "Comment" msgstr "Comentario" -#: weblog/models.py:84 +#: models.py:86 msgctxt "Noun" msgid "Comments" msgstr "Comentarios" -#: weblog/templates/weblog/index.html:6 weblog/templatetags/weblog_extras.py:43 -#: weblog/views.py:75 weblog/views.py:150 +#: templates/weblog/index.html:6 templatetags/weblog_extras.py:43 views.py:94 +#: views.py:178 msgctxt "Posts without category" msgid "Uncategorized" msgstr "Sin categoría" -#: weblog/templates/weblog/index.html:17 +#: templates/weblog/index.html:11 templates/weblog/index.html:28 +msgctxt "Home page" +msgid "Home" +msgstr "Página principal" + +#: templates/weblog/index.html:17 msgctxt "Uncategorized page title" msgid "Uncategorized posts" msgstr "Entradas sin categoría" -#: weblog/templates/weblog/index.html:19 +#: templates/weblog/index.html:19 #, python-format msgctxt "Posts in category" msgid "Posts in %(category_name)s" msgstr "Entradas en %(category_name)s" -#: weblog/templates/weblog/index.html:28 weblog/templates/weblog/post.html:7 +#: templates/weblog/index.html:23 +#, python-format +msgctxt "Posts from archive (year/month,year)" +msgid "Posts from %(month)s, %(year)s" +msgstr "Entradas de %(month)s, %(year)s" + +#: templates/weblog/index.html:25 +#, python-format +msgctxt "Posts from archive (year/month,year)" +msgid "Posts from %(year)s" +msgstr "Entradas del %(year)s" + +#: templates/weblog/index.html:34 +msgid "Important post" +msgstr "Importante" + +#: templates/weblog/index.html:36 templates/weblog/index.html:51 +#: templates/weblog/post.html:7 #, python-format msgid "Published on %(publish_date)s" msgstr "Publicado el %(publish_date)s" -#: weblog/templates/weblog/index.html:28 weblog/templates/weblog/post.html:7 +#: templates/weblog/index.html:36 templates/weblog/index.html:51 +#: templates/weblog/post.html:7 #, python-format msgctxt "Written by (Author)" msgid ", by %(author)s" msgstr ", por %(author)s" -#: weblog/templates/weblog/index.html:34 +#: templates/weblog/index.html:42 templates/weblog/index.html:57 msgid "Read more..." msgstr "Leer más..." -#: weblog/templates/weblog/index.html:41 +#: templates/weblog/index.html:64 msgctxt "Page" msgid "First" msgstr "Primera" -#: weblog/templates/weblog/index.html:42 +#: templates/weblog/index.html:65 msgctxt "Page" msgid "Previous" msgstr "Anterior" -#: weblog/templates/weblog/index.html:70 +#: templates/weblog/index.html:93 msgctxt "Page" msgid "Next" msgstr "Siguiente" -#: weblog/templates/weblog/index.html:71 +#: templates/weblog/index.html:94 msgctxt "Page" msgid "Last" msgstr "Última" -#: weblog/templates/weblog/index.html:76 +#: templates/weblog/index.html:100 msgid "Nothing has been posted yet." msgstr "No hay ninguna publicación." -#: weblog/templates/weblog/post.html:24 +#: templates/weblog/post.html:24 msgid "Leave a comment" msgstr "Dejar un comentario" -#: weblog/templates/weblog/post.html:31 +#: templates/weblog/post.html:31 msgid "Submit comment" msgstr "Enviar comentario" -#: weblog/templates/weblog/post.html:35 +#: templates/weblog/post.html:35 msgid "To leave a comment you need to sign in" msgstr "Para poder comentar, necesitar iniciar sesión." -#: weblog/templates/weblog/post.html:47 +#: templates/weblog/post.html:47 msgid "Comment submited successfully" msgstr "Comentario enviado exitosamente" -#: weblog/templates/weblog/post.html:54 +#: templates/weblog/post.html:54 msgctxt "Unauthenticated comment poster" msgid "Anonymous" msgstr "Anónimo" -#: weblog/templates/weblog/post.html:62 +#: templates/weblog/post.html:62 msgid "Nobody has left a comment on this post yet" msgstr "No hay ningún comentario relacionado a esta entrada" -#: weblog/templates/weblog/sidebar_archive.html:2 +#: templates/weblog/sidebar_archive.html:2 msgctxt "Blog archive" msgid "Archive" msgstr "Archivo" -#: weblog/templatetags/weblog_extras.py:12 +#: templatetags/weblog_extras.py:12 msgid "January" msgstr "" -#: weblog/templatetags/weblog_extras.py:13 +#: templatetags/weblog_extras.py:13 msgid "February" msgstr "" -#: weblog/templatetags/weblog_extras.py:14 +#: templatetags/weblog_extras.py:14 msgid "March" msgstr "" -#: weblog/templatetags/weblog_extras.py:15 +#: templatetags/weblog_extras.py:15 msgid "April" msgstr "" -#: weblog/templatetags/weblog_extras.py:16 +#: templatetags/weblog_extras.py:16 msgid "May" msgstr "" -#: weblog/templatetags/weblog_extras.py:17 +#: templatetags/weblog_extras.py:17 msgid "June" msgstr "" -#: weblog/templatetags/weblog_extras.py:18 +#: templatetags/weblog_extras.py:18 msgid "July" msgstr "" -#: weblog/templatetags/weblog_extras.py:19 +#: templatetags/weblog_extras.py:19 msgid "August" msgstr "" -#: weblog/templatetags/weblog_extras.py:20 +#: templatetags/weblog_extras.py:20 msgid "September" msgstr "" -#: weblog/templatetags/weblog_extras.py:21 +#: templatetags/weblog_extras.py:21 msgid "October" msgstr "" -#: weblog/templatetags/weblog_extras.py:22 +#: templatetags/weblog_extras.py:22 msgid "November" msgstr "" -#: weblog/templatetags/weblog_extras.py:23 +#: templatetags/weblog_extras.py:23 msgid "December" msgstr "" -#: weblog/views.py:171 +#: views.py:199 msgid "You need to sign in to submit a comment" msgstr "Para poder comentar necesita iniciar sesión" -#: weblog/views.py:173 +#: views.py:201 msgid "Error submitting comment: Invalid data" msgstr "Error al intentar enviar el comentario: Información invalida" diff --git a/weblog/locale/ru/LC_MESSAGES/django.mo b/weblog/locale/ru/LC_MESSAGES/django.mo old mode 100644 new mode 100755 index a419335..723a8e1 Binary files a/weblog/locale/ru/LC_MESSAGES/django.mo and b/weblog/locale/ru/LC_MESSAGES/django.mo differ diff --git a/weblog/locale/ru/LC_MESSAGES/django.po b/weblog/locale/ru/LC_MESSAGES/django.po old mode 100644 new mode 100755 index e586fbd..6af07da --- a/weblog/locale/ru/LC_MESSAGES/django.po +++ b/weblog/locale/ru/LC_MESSAGES/django.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2018-01-31 08:00+0300\n" +"POT-Creation-Date: 2018-05-31 14:31+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -20,247 +20,278 @@ msgstr "" "%10<=4 && (n%100<12 || n%100>14) ? 1 : n%10==0 || (n%10>=5 && n%10<=9) || (n" "%100>=11 && n%100<=14)? 2 : 3);\n" -#: weblog/models.py:8 weblog/models.py:23 +#: models.py:8 models.py:23 msgctxt "Noun, not personal name" msgid "Name" msgstr "Название" -#: weblog/models.py:9 weblog/models.py:45 +#: models.py:9 models.py:45 msgid "Slug (URL)" msgstr "" -#: weblog/models.py:10 +#: models.py:10 msgid "Parent category" msgstr "Корневая категория" -#: weblog/models.py:19 weblog/models.py:25 +#: models.py:19 models.py:25 msgctxt "Post category" msgid "Category" msgstr "Категория" -#: weblog/models.py:20 weblog/models.py:46 weblog/templates/weblog/post.html:16 -#: weblog/templates/weblog/sidebar_categories.html:3 +#: models.py:20 models.py:46 templates/weblog/post.html:16 +#: templates/weblog/sidebar_categories.html:3 msgctxt "Post categories" msgid "Categories" msgstr "Категории" -#: weblog/models.py:24 weblog/models.py:67 +#: models.py:24 models.py:69 msgid "Language (ISO)" msgstr "Язык (В стандарте ISO)" -#: weblog/models.py:34 +#: models.py:34 msgid "Category name translation" msgstr "Перевод названия категории" -#: weblog/models.py:35 +#: models.py:35 msgid "Category name translations" msgstr "Переводы названия категории" -#: weblog/models.py:39 weblog/models.py:78 +#: models.py:39 models.py:80 msgid "Author" msgstr "Автор" -#: weblog/models.py:40 weblog/models.py:68 +#: models.py:40 models.py:70 msgctxt "As in name" msgid "Title" msgstr "Название" -#: weblog/models.py:41 weblog/models.py:69 weblog/models.py:80 +#: models.py:41 models.py:71 models.py:82 msgctxt "Of post, comment, article, etc." msgid "Content" msgstr "Содержание" -#: weblog/models.py:42 weblog/models.py:70 +#: models.py:42 models.py:72 msgid "Preview image" msgstr "Картинка предпросмотра" -#: weblog/models.py:43 weblog/models.py:71 +#: models.py:43 models.py:73 msgid "Preview Text" msgstr "Текст предпросмотра" -#: weblog/models.py:44 +#: models.py:44 msgid "Original language (ISO)" msgstr "Язык оригинала (в стандарте ISO)" -#: weblog/models.py:47 +#: models.py:47 +msgid "Pin blog post" +msgstr "Прикрепить запись блога" + +#: models.py:48 +msgid "Pinned post priority (if pinned)" +msgstr "Приоритет прикрепленной записи" + +#: models.py:49 msgctxt "Make post viewable" msgid "Published" msgstr "Опубликовать" -#: weblog/models.py:48 +#: models.py:50 msgid "Publish date" msgstr "Дата публикации" -#: weblog/models.py:62 +#: models.py:64 msgid "Blog Post" msgstr "Запись блога" -#: weblog/models.py:63 +#: models.py:65 msgid "Blog Posts" msgstr "Записи блога" -#: weblog/models.py:66 weblog/models.py:79 +#: models.py:68 models.py:81 msgctxt "Noun, as in blog post" msgid "Post" msgstr "Запись" -#: weblog/models.py:74 +#: models.py:76 msgid "Translation" msgstr "Перевод" -#: weblog/models.py:75 +#: models.py:77 msgid "Translations" msgstr "Переводы" -#: weblog/models.py:83 +#: models.py:85 msgctxt "Noun" msgid "Comment" msgstr "Комментарий" -#: weblog/models.py:84 +#: models.py:86 msgctxt "Noun" msgid "Comments" msgstr "Комментарии" -#: weblog/templates/weblog/index.html:6 weblog/templatetags/weblog_extras.py:43 -#: weblog/views.py:75 weblog/views.py:150 +#: templates/weblog/index.html:6 templatetags/weblog_extras.py:43 views.py:94 +#: views.py:178 msgctxt "Posts without category" msgid "Uncategorized" msgstr "Без категории" -#: weblog/templates/weblog/index.html:17 +#: templates/weblog/index.html:11 templates/weblog/index.html:28 +msgctxt "Home page" +msgid "Home" +msgstr "Главная" + +#: templates/weblog/index.html:17 msgctxt "Uncategorized page title" msgid "Uncategorized posts" msgstr "Записи без категории" -#: weblog/templates/weblog/index.html:19 +#: templates/weblog/index.html:19 #, python-format msgctxt "Posts in category" msgid "Posts in %(category_name)s" msgstr "Записи в %(category_name)s" -#: weblog/templates/weblog/index.html:28 weblog/templates/weblog/post.html:7 +#: templates/weblog/index.html:23 +#, python-format +msgctxt "Posts from archive (year/month,year)" +msgid "Posts from %(month)s, %(year)s" +msgstr "Архив: %(month)s, %(year)s" + +#: templates/weblog/index.html:25 +#, python-format +msgctxt "Posts from archive (year/month,year)" +msgid "Posts from %(year)s" +msgstr "Архив: %(year)s" + +#: templates/weblog/index.html:34 +msgid "Important post" +msgstr "Прикрепленная запись" + +#: templates/weblog/index.html:36 templates/weblog/index.html:51 +#: templates/weblog/post.html:7 #, python-format msgid "Published on %(publish_date)s" msgstr "Опубликовано %(publish_date)s" -#: weblog/templates/weblog/index.html:28 weblog/templates/weblog/post.html:7 +#: templates/weblog/index.html:36 templates/weblog/index.html:51 +#: templates/weblog/post.html:7 #, python-format msgctxt "Written by (Author)" msgid ", by %(author)s" msgstr ". %(author)s" -#: weblog/templates/weblog/index.html:34 +#: templates/weblog/index.html:42 templates/weblog/index.html:57 msgid "Read more..." msgstr "Читать далее..." -#: weblog/templates/weblog/index.html:41 +#: templates/weblog/index.html:64 msgctxt "Page" msgid "First" msgstr "Первая" -#: weblog/templates/weblog/index.html:42 +#: templates/weblog/index.html:65 msgctxt "Page" msgid "Previous" msgstr "Предыдущая" -#: weblog/templates/weblog/index.html:70 +#: templates/weblog/index.html:93 msgctxt "Page" msgid "Next" msgstr "Следующая" -#: weblog/templates/weblog/index.html:71 +#: templates/weblog/index.html:94 msgctxt "Page" msgid "Last" msgstr "Последняя" -#: weblog/templates/weblog/index.html:76 +#: templates/weblog/index.html:100 msgid "Nothing has been posted yet." msgstr "Нет записи на данный момент." -#: weblog/templates/weblog/post.html:24 +#: templates/weblog/post.html:24 msgid "Leave a comment" msgstr "Оставьте комментарий" -#: weblog/templates/weblog/post.html:31 +#: templates/weblog/post.html:31 msgid "Submit comment" msgstr "Отправить комметарий" -#: weblog/templates/weblog/post.html:35 +#: templates/weblog/post.html:35 msgid "To leave a comment you need to sign in" msgstr "Для того чтобы оставить комментарий, зайдите в свою учетную запись" -#: weblog/templates/weblog/post.html:47 +#: templates/weblog/post.html:47 msgid "Comment submited successfully" msgstr "Ваш комментарий был успешно отправлен" -#: weblog/templates/weblog/post.html:54 +#: templates/weblog/post.html:54 msgctxt "Unauthenticated comment poster" msgid "Anonymous" msgstr "Анонимный" -#: weblog/templates/weblog/post.html:62 +#: templates/weblog/post.html:62 msgid "Nobody has left a comment on this post yet" msgstr "У этой записи нет комментарии." -#: weblog/templates/weblog/sidebar_archive.html:2 +#: templates/weblog/sidebar_archive.html:2 msgctxt "Blog archive" msgid "Archive" msgstr "Архив" -#: weblog/templatetags/weblog_extras.py:12 +#: templatetags/weblog_extras.py:12 msgid "January" msgstr "" -#: weblog/templatetags/weblog_extras.py:13 +#: templatetags/weblog_extras.py:13 msgid "February" msgstr "" -#: weblog/templatetags/weblog_extras.py:14 +#: templatetags/weblog_extras.py:14 msgid "March" msgstr "" -#: weblog/templatetags/weblog_extras.py:15 +#: templatetags/weblog_extras.py:15 msgid "April" msgstr "" -#: weblog/templatetags/weblog_extras.py:16 +#: templatetags/weblog_extras.py:16 msgid "May" msgstr "" -#: weblog/templatetags/weblog_extras.py:17 +#: templatetags/weblog_extras.py:17 msgid "June" msgstr "" -#: weblog/templatetags/weblog_extras.py:18 +#: templatetags/weblog_extras.py:18 msgid "July" msgstr "" -#: weblog/templatetags/weblog_extras.py:19 +#: templatetags/weblog_extras.py:19 msgid "August" msgstr "" -#: weblog/templatetags/weblog_extras.py:20 +#: templatetags/weblog_extras.py:20 msgid "September" msgstr "" -#: weblog/templatetags/weblog_extras.py:21 +#: templatetags/weblog_extras.py:21 msgid "October" msgstr "" -#: weblog/templatetags/weblog_extras.py:22 +#: templatetags/weblog_extras.py:22 msgid "November" msgstr "" -#: weblog/templatetags/weblog_extras.py:23 +#: templatetags/weblog_extras.py:23 msgid "December" msgstr "" -#: weblog/views.py:171 +#: views.py:199 msgid "You need to sign in to submit a comment" msgstr "Для того чтобы оставить комментарий, зайдите в свою учетную запись" -#: weblog/views.py:173 +#: views.py:201 msgid "Error submitting comment: Invalid data" msgstr "Ошибка: неправильный формат данных" diff --git a/weblog/migrations/0001_initial.py b/weblog/migrations/0001_initial.py old mode 100644 new mode 100755 diff --git a/weblog/migrations/0002_auto_20180113_1606.py b/weblog/migrations/0002_auto_20180113_1606.py old mode 100644 new mode 100755 diff --git a/weblog/migrations/0003_auto_20180119_0156.py b/weblog/migrations/0003_auto_20180119_0156.py old mode 100644 new mode 100755 diff --git a/weblog/migrations/0004_auto_20180119_0156.py b/weblog/migrations/0004_auto_20180119_0156.py old mode 100644 new mode 100755 diff --git a/weblog/migrations/0005_auto_20180119_0231.py b/weblog/migrations/0005_auto_20180119_0231.py old mode 100644 new mode 100755 diff --git a/weblog/migrations/0006_auto_20180121_1002.py b/weblog/migrations/0006_auto_20180121_1002.py old mode 100644 new mode 100755 diff --git a/weblog/migrations/0007_auto_20180122_1943.py b/weblog/migrations/0007_auto_20180122_1943.py old mode 100644 new mode 100755 diff --git a/weblog/migrations/0008_auto_20180531_0329.py b/weblog/migrations/0008_auto_20180531_0329.py new file mode 100644 index 0000000..d79446b --- /dev/null +++ b/weblog/migrations/0008_auto_20180531_0329.py @@ -0,0 +1,25 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.11.8 on 2018-05-31 03:29 +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('weblog', '0007_auto_20180122_1943'), + ] + + operations = [ + migrations.AddField( + model_name='blogpost', + name='pin_priority', + field=models.IntegerField(default=0, verbose_name='Pinned post priority (if pinned)'), + ), + migrations.AddField( + model_name='blogpost', + name='pinned', + field=models.BooleanField(default=False, verbose_name='Pin blog post'), + ), + ] diff --git a/weblog/migrations/__init__.py b/weblog/migrations/__init__.py old mode 100644 new mode 100755 diff --git a/weblog/migrations/__pycache__/0001_initial.cpython-36.pyc b/weblog/migrations/__pycache__/0001_initial.cpython-36.pyc new file mode 100755 index 0000000..b917027 Binary files /dev/null and b/weblog/migrations/__pycache__/0001_initial.cpython-36.pyc differ diff --git a/weblog/migrations/__pycache__/0002_auto_20180113_1606.cpython-36.pyc b/weblog/migrations/__pycache__/0002_auto_20180113_1606.cpython-36.pyc new file mode 100755 index 0000000..31d68d5 Binary files /dev/null and b/weblog/migrations/__pycache__/0002_auto_20180113_1606.cpython-36.pyc differ diff --git a/weblog/migrations/__pycache__/0003_auto_20180119_0156.cpython-36.pyc b/weblog/migrations/__pycache__/0003_auto_20180119_0156.cpython-36.pyc new file mode 100755 index 0000000..92a494b Binary files /dev/null and b/weblog/migrations/__pycache__/0003_auto_20180119_0156.cpython-36.pyc differ diff --git a/weblog/migrations/__pycache__/0004_auto_20180119_0156.cpython-36.pyc b/weblog/migrations/__pycache__/0004_auto_20180119_0156.cpython-36.pyc new file mode 100755 index 0000000..c19f139 Binary files /dev/null and b/weblog/migrations/__pycache__/0004_auto_20180119_0156.cpython-36.pyc differ diff --git a/weblog/migrations/__pycache__/0005_auto_20180119_0231.cpython-36.pyc b/weblog/migrations/__pycache__/0005_auto_20180119_0231.cpython-36.pyc new file mode 100755 index 0000000..d3ab56c Binary files /dev/null and b/weblog/migrations/__pycache__/0005_auto_20180119_0231.cpython-36.pyc differ diff --git a/weblog/migrations/__pycache__/0006_auto_20180121_1002.cpython-36.pyc b/weblog/migrations/__pycache__/0006_auto_20180121_1002.cpython-36.pyc new file mode 100755 index 0000000..11fd025 Binary files /dev/null and b/weblog/migrations/__pycache__/0006_auto_20180121_1002.cpython-36.pyc differ diff --git a/weblog/migrations/__pycache__/0007_auto_20180122_1943.cpython-36.pyc b/weblog/migrations/__pycache__/0007_auto_20180122_1943.cpython-36.pyc new file mode 100755 index 0000000..21d3e78 Binary files /dev/null and b/weblog/migrations/__pycache__/0007_auto_20180122_1943.cpython-36.pyc differ diff --git a/weblog/migrations/__pycache__/0008_auto_20180531_0329.cpython-36.pyc b/weblog/migrations/__pycache__/0008_auto_20180531_0329.cpython-36.pyc new file mode 100644 index 0000000..915bf26 Binary files /dev/null and b/weblog/migrations/__pycache__/0008_auto_20180531_0329.cpython-36.pyc differ diff --git a/weblog/migrations/__pycache__/__init__.cpython-36.pyc b/weblog/migrations/__pycache__/__init__.cpython-36.pyc new file mode 100755 index 0000000..2e5cba0 Binary files /dev/null and b/weblog/migrations/__pycache__/__init__.cpython-36.pyc differ diff --git a/weblog/models.py b/weblog/models.py old mode 100644 new mode 100755 index 80e917e..3c4935e --- a/weblog/models.py +++ b/weblog/models.py @@ -11,7 +11,7 @@ class Category(models.Model): def get_absolute_url(self): return reverse('weblog:CategoryIndex', kwargs={'category_slug': self.slug}) - + def __str__(self): return self.name @@ -44,6 +44,8 @@ class BlogPost(models.Model): original_language = models.CharField(max_length=5, verbose_name=_('Original language (ISO)'), blank=True) slug = models.SlugField(max_length=100, verbose_name=_('Slug (URL)'), db_index=True, unique=True) categories = models.ManyToManyField(Category, verbose_name=pgettext_lazy('Post categories', 'Categories'), blank=True) + pinned = models.BooleanField(verbose_name=_('Pin blog post'), default=False) + pin_priority = models.IntegerField(verbose_name=_('Pinned post priority (if pinned)'), default=0) published = models.BooleanField(verbose_name=pgettext_lazy('Make post viewable', 'Published')) publish_date = models.DateTimeField(verbose_name=_('Publish date')) @@ -90,4 +92,4 @@ class PostCommentForm(ModelForm): labels = {'content': ''} widgets = { 'content': Textarea(attrs={'class': 'form-control', 'rows': '5'}), - } \ No newline at end of file + } diff --git a/weblog/static/weblog/css/weblog.css b/weblog/static/weblog/css/weblog.css old mode 100644 new mode 100755 diff --git a/weblog/static/weblog/js/weblog.js b/weblog/static/weblog/js/weblog.js old mode 100644 new mode 100755 diff --git a/weblog/templates/weblog/index.html b/weblog/templates/weblog/index.html old mode 100644 new mode 100755 index c46da38..7231cf7 --- a/weblog/templates/weblog/index.html +++ b/weblog/templates/weblog/index.html @@ -8,7 +8,7 @@ {{ category.name }} {% endif %} {% else %} -{{ blog_title }} +{% trans "Home" context "Home page" %} {% endif %} {% endblock %} {% block blog_content_block %} @@ -18,9 +18,32 @@ {% else %}

{% blocktrans with category_name=category.name context 'Posts in category' %}Posts in {{ category_name }}{% endblocktrans %}

{% endif %} +{% elif year %} +{% if month %} +

{% blocktrans with category_name=category.name context 'Posts from archive (year/month,year)' %}Posts from {{ month }}, {{ year }}{% endblocktrans %}

{% else %} -

{{ blog_title }}

+

{% blocktrans with category_name=category.name context 'Posts from archive (year/month,year)' %}Posts from {{ year }}{% endblocktrans %}

{% endif %} +{% else %} +

{{ blog_title }} - {% trans "Home" context "Home page" %}

+{% endif %} + {% if posts or pinned_posts %} + {% if pinned_posts %} + {% for post in pinned_posts %} +
+

{% trans 'Important post' %}

+

{{ post.title }}

+

{% blocktrans with publish_date=post.publish_date %}Published on {{ publish_date }}{% endblocktrans %}{% if post.author %}{% blocktrans with author=post.author context 'Written by (Author)' %}, by {{ author }}{% endblocktrans %}{% endif %}

+
+ {% if post.preview_image %}{% endif %} + {{ post.preview_text|safe }} +
+ +
+ {% endfor %} + {% endif %} {% if posts %} {% for post in posts %}
@@ -72,7 +95,8 @@ {% endif %} {% endif %} + {% endif %} {% else %}

{% trans 'Nothing has been posted yet.' %}

{% endif %} -{% endblock %} \ No newline at end of file +{% endblock %} diff --git a/weblog/templates/weblog/post.html b/weblog/templates/weblog/post.html old mode 100644 new mode 100755 diff --git a/weblog/templates/weblog/sidebar_archive.html b/weblog/templates/weblog/sidebar_archive.html old mode 100644 new mode 100755 diff --git a/weblog/templates/weblog/sidebar_categories.html b/weblog/templates/weblog/sidebar_categories.html old mode 100644 new mode 100755 diff --git a/weblog/templates/weblog/weblog.html b/weblog/templates/weblog/weblog.html old mode 100644 new mode 100755 index 9980b54..e24c918 --- a/weblog/templates/weblog/weblog.html +++ b/weblog/templates/weblog/weblog.html @@ -3,18 +3,18 @@ {% load weblog_extras %} {% block title_block %}{% endblock %} {% block blog_block %} - +
{% block blog_content_block %} @@ -39,4 +39,4 @@
{% endif %}
-{% endblock %} \ No newline at end of file +{% endblock %} diff --git a/weblog/templates/weblog_base.html b/weblog/templates/weblog_base.html old mode 100644 new mode 100755 index 536e736..9a739cb --- a/weblog/templates/weblog_base.html +++ b/weblog/templates/weblog_base.html @@ -3,19 +3,20 @@ - Simple blog - {% block title_block %} Home {% endblock %} - + + {{ blog_title }} - {% block title_block %} Home {% endblock %} + + - + + + - -