From 2ca57ed4d1d9a5d8919ddc53da3cc741d5f2ae6d Mon Sep 17 00:00:00 2001 From: rscnt Date: Sat, 23 May 2015 04:16:38 -0600 Subject: [PATCH] tempaltes: Added blog templates. An override of the djangocms_blog templates. Signed-off-by: rscnt --- .../djangocms_blog/_header_post_detail.html | 37 +++++++++++++++ templates/djangocms_blog/base.html | 11 +++++ .../djangocms_blog/includes/blog_item.html | 32 +++++++++++++ templates/djangocms_blog/post_detail.html | 22 +++++++++ templates/djangocms_blog/post_list.html | 47 +++++++++++++++++++ 5 files changed, 149 insertions(+) create mode 100644 templates/djangocms_blog/_header_post_detail.html create mode 100644 templates/djangocms_blog/base.html create mode 100644 templates/djangocms_blog/includes/blog_item.html create mode 100644 templates/djangocms_blog/post_detail.html create mode 100644 templates/djangocms_blog/post_list.html diff --git a/templates/djangocms_blog/_header_post_detail.html b/templates/djangocms_blog/_header_post_detail.html new file mode 100644 index 00000000..747357aa --- /dev/null +++ b/templates/djangocms_blog/_header_post_detail.html @@ -0,0 +1,37 @@ +{% load cms_tags staticfiles %} + + +
+
+
+
+
+

{% render_model post "title" %}

+

+ {% render_model post "abstract" "" "" 'truncatewords_html:10' %} +

+ + Posted + {% if post.author %} + by + + {% if post.author.get_full_name %} + {{ post.author.get_full_name }} + {% else %} + {{ post.author }} + {% endif %} + + {% endif %} + on {{ post.date_published|date:"DATE_FORMAT" }} + +
+
+
+
+
diff --git a/templates/djangocms_blog/base.html b/templates/djangocms_blog/base.html new file mode 100644 index 00000000..7cfd39aa --- /dev/null +++ b/templates/djangocms_blog/base.html @@ -0,0 +1,11 @@ +{% extends CMS_TEMPLATE %} +{% block meta %} + {% if meta %} + {% include "meta_mixin/meta.html" %} + {% endif %} +{% endblock meta %} +{% block content %} +
+ {% block content_blog %}{% endblock %} +
+{% endblock content %} diff --git a/templates/djangocms_blog/includes/blog_item.html b/templates/djangocms_blog/includes/blog_item.html new file mode 100644 index 00000000..599b3c8c --- /dev/null +++ b/templates/djangocms_blog/includes/blog_item.html @@ -0,0 +1,32 @@ +{% load i18n thumbnail cms_tags %} +{% load url from future %} + +
+ +

+ {{ post.title }} +

+

+ {% if not TRUNCWORDS_COUNT %} + {% render_model post "abstract" %} + {% else %} + {% render_model post "abstract" "" "" 'truncatewords_html:TRUNCWORDS_COUNT' %} + {% endif %} +

+
+ +
+
diff --git a/templates/djangocms_blog/post_detail.html b/templates/djangocms_blog/post_detail.html new file mode 100644 index 00000000..e917bd36 --- /dev/null +++ b/templates/djangocms_blog/post_detail.html @@ -0,0 +1,22 @@ +{% extends "djangocms_blog/base.html" %} +{% load i18n thumbnail cms_tags %} +{% load url from future %} + +{% block meta_description %}{{ post.meta_description }}{% endblock meta_description %} +{% block meta_keywords %}{{ post.meta_keywords }}{% endblock meta_keywords %} +{% block canonical_url %}{% endblock canonical_url %} +{% block title %}{{ post.get_title }}{% endblock %} + +{% block base_header %} +{% include "djangocms_blog/_header_post_detail.html" %} +{% endblock %} + +{% block content_blog %} +
+ {% if use_placeholder %} +
{% render_placeholder post.content %}
+ {% else %} +
{% render_model post "post_text" "post_text" %}
+ {% endif %} +
+{% endblock content_blog %} diff --git a/templates/djangocms_blog/post_list.html b/templates/djangocms_blog/post_list.html new file mode 100644 index 00000000..2fae4741 --- /dev/null +++ b/templates/djangocms_blog/post_list.html @@ -0,0 +1,47 @@ +{% extends "djangocms_blog/base.html" %} +{% load i18n thumbnail %}{% spaceless %} + +{% block canonical_url %}{% endblock canonical_url %} + +{% block content_blog %} +
+ {% block blog_title %} +
+

+ {% if author %}{% trans "Articles by" %} {{ author.get_full_name }} + {% elif archive_date %}{% trans "Archive" %} – {% if month %}{{ archive_date|date:'F' }} {% endif %}{{ year }} + {% elif tagged_entries %}{% trans "Tag" %} – {{ tagged_entries|capfirst }} + {% elif category %}{% trans "Category" %} – {{ category }}{% endif %} +

+
+ {% endblock %} + {% for post in post_list %} + {% include "djangocms_blog/includes/blog_item.html" with post=post image="true" TRUNCWORDS_COUNT=TRUNCWORDS_COUNT %} + {% empty %} +

{% trans "No article found." %}

+ {% endfor %} + {% if author or archive_date or tagged_entries %} +

{% trans "Back" %}

+ {% endif %} + {% if is_paginated %} + + + {% endif %} +
+{% endblock %} +{% endspaceless %}