From 28b67ad39af15d27bad7e55a0ae7fafe91139239 Mon Sep 17 00:00:00 2001 From: Yaroslsav-95 Date: Wed, 31 Jan 2018 08:27:11 +0300 Subject: Initial --- weblog/templates/weblog/index.html | 78 +++++++++++++++++++++++++ weblog/templates/weblog/post.html | 67 +++++++++++++++++++++ weblog/templates/weblog/sidebar_archive.html | 13 +++++ weblog/templates/weblog/sidebar_categories.html | 11 ++++ weblog/templates/weblog/weblog.html | 42 +++++++++++++ weblog/templates/weblog_base.html | 28 +++++++++ weblog/templates/weblog_base_old.html | 35 +++++++++++ 7 files changed, 274 insertions(+) create mode 100644 weblog/templates/weblog/index.html create mode 100644 weblog/templates/weblog/post.html create mode 100644 weblog/templates/weblog/sidebar_archive.html create mode 100644 weblog/templates/weblog/sidebar_categories.html create mode 100644 weblog/templates/weblog/weblog.html create mode 100644 weblog/templates/weblog_base.html create mode 100644 weblog/templates/weblog_base_old.html (limited to 'weblog/templates') diff --git a/weblog/templates/weblog/index.html b/weblog/templates/weblog/index.html new file mode 100644 index 0000000..c46da38 --- /dev/null +++ b/weblog/templates/weblog/index.html @@ -0,0 +1,78 @@ +{% extends 'weblog/weblog.html' %} +{% load i18n %} +{% block title_block %} +{% if category %} +{% if category == 'misc' %} +{% trans 'Uncategorized' context 'Posts without category' %} +{% else %} +{{ category.name }} +{% endif %} +{% else %} +{{ blog_title }} +{% endif %} +{% endblock %} +{% block blog_content_block %} +{% if category %} +{% if category == 'misc' %} +

{% trans 'Uncategorized posts' context 'Uncategorized page title' %}

+{% else %} +

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

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

{{ blog_title }}

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

{{ 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 %} + {% if last_page > 1 %} + + {% endif %} + {% else %} +

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

+ {% endif %} +{% endblock %} \ No newline at end of file diff --git a/weblog/templates/weblog/post.html b/weblog/templates/weblog/post.html new file mode 100644 index 0000000..364e17c --- /dev/null +++ b/weblog/templates/weblog/post.html @@ -0,0 +1,67 @@ +{% extends 'weblog/weblog.html' %} +{% load i18n %} +{% block title_block %}{% if post_translation %}{{ post_translation.title }}{% else %}{{ post.title }}{% endif %}{% endblock %} +{% block blog_content_block %} +
+

{% if post_translation %}{{ post_translation.title }}{% else %}{{ post.title }}{% endif %}

+

{% 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_translation %} + {{ post_translation.content|safe }} + {% else %} + {{ post.content|safe }} + {% endif %} + {% if post_categories %} +
+

{% trans 'Categories' context 'Post categories' %}: + {% for post_category in post_categories %} + {{ post_category.name }} + {% endfor %} +

{% endif %} + {% if enable_comments %} +
+ {% if user.is_authenticated or allow_anon_comments %} +

{% trans 'Leave a comment' %}

+
+ {% csrf_token %} +
+ {{ comment_form }} +
+
+ +
+
+ {% else %} +

{% trans 'To leave a comment you need to sign in' %}

+ {% endif %} + {% if comments %} + {% if comment_submission %} + {% if comment_submission_error %} +
+ × + {{ comment_submission_error }} +
+ {% else %} +
+ × + {% trans 'Comment submited successfully' %} +
+ {% endif %} + {% endif %} + {% for comment in comments %} +
+
+

{% if comment.author %}{{ comment.author.get_username }}{% else %}{% trans 'Anonymous' context 'Unauthenticated comment poster' %}{% endif %}

+

{{ comment.content }}

+
+
+ {% endfor %} + {% else %} +
+
+

{% trans 'Nobody has left a comment on this post yet' %}

+
+ {% endif %} + {% endif %} +
+{% endblock %} \ No newline at end of file diff --git a/weblog/templates/weblog/sidebar_archive.html b/weblog/templates/weblog/sidebar_archive.html new file mode 100644 index 0000000..5953bfe --- /dev/null +++ b/weblog/templates/weblog/sidebar_archive.html @@ -0,0 +1,13 @@ +{% load i18n %} +

{% trans 'Archive' context 'Blog archive' %}

+ \ No newline at end of file diff --git a/weblog/templates/weblog/sidebar_categories.html b/weblog/templates/weblog/sidebar_categories.html new file mode 100644 index 0000000..7e7fa5c --- /dev/null +++ b/weblog/templates/weblog/sidebar_categories.html @@ -0,0 +1,11 @@ +{% load i18n %} +{% if categories %} +

{% trans 'Categories' context 'Post categories' %}

+
+ {% for category in categories %} + + {{ category.name }} + + {% endfor %} +
+{% endif %} \ No newline at end of file diff --git a/weblog/templates/weblog/weblog.html b/weblog/templates/weblog/weblog.html new file mode 100644 index 0000000..9980b54 --- /dev/null +++ b/weblog/templates/weblog/weblog.html @@ -0,0 +1,42 @@ +{% extends base_template %} +{% load i18n %} +{% load weblog_extras %} +{% block title_block %}{% endblock %} +{% block blog_block %} + +
+
+ {% block blog_content_block %} + {% endblock %} +
+ {% if show_sidebar %} +
+ {% if show_categories %} + {% if category %} + {% if category == 'misc' %} + {% get_sidebar_categories category %} + {% else %} + {% get_sidebar_categories category.slug %} + {% endif %} + {% else %} + {% get_sidebar_categories %} + {% endif %} + {% endif %} + {% if show_archive %} + {% get_sidebar_archive %} + {% endif %} +
+ {% endif %} +
+{% endblock %} \ No newline at end of file diff --git a/weblog/templates/weblog_base.html b/weblog/templates/weblog_base.html new file mode 100644 index 0000000..536e736 --- /dev/null +++ b/weblog/templates/weblog_base.html @@ -0,0 +1,28 @@ + +{% load static %} + + + + Simple blog - {% block title_block %} Home {% endblock %} + + + + + + + + +
+ {% block content_block %} + {% block blog_block %} + {% endblock %} + {% endblock %} +
+ + \ No newline at end of file diff --git a/weblog/templates/weblog_base_old.html b/weblog/templates/weblog_base_old.html new file mode 100644 index 0000000..a4dbd30 --- /dev/null +++ b/weblog/templates/weblog_base_old.html @@ -0,0 +1,35 @@ + +{% load static %} + + + + Simple blog - {% block title_block %} Home {% endblock %} + + + + + + + + +
+ {% block content_block %} + {% block blog_block %} + {% endblock %} + {% endblock %} +
+ + \ No newline at end of file -- cgit v1.2.3