tempaltes: Added blog templates.

An override of the djangocms_blog templates.

Signed-off-by: rscnt <rascnt@gmail.com>
This commit is contained in:
rascencio 2015-05-23 04:16:38 -06:00
parent d57a8dc338
commit 280e30ad15
5 changed files with 149 additions and 0 deletions

View file

@ -0,0 +1,37 @@
{% load cms_tags staticfiles %}
<!-- Page Header -->
<!-- Set your background image for this header on the line below. -->
<header class="intro-header"
{% if post.main_image_id %}
style="background-image: url('{{ post.main_image.url }}');"
{% else %}
style="background-image: url('{% static 'blog.ungleich.ch/img/home-bg.jpg' %}');"
{% endif %}
>
<div class="container">
<div class="row">
<div class="col-lg-8 col-lg-offset-2 col-md-10 col-md-offset-1">
<div class="post-heading">
<h1> {% render_model post "title" %} </h1>
<h2 class="subheading">
{% render_model post "abstract" "" "" 'truncatewords_html:10' %}
</h2>
<span class="meta">
Posted
{% if post.author %}
by
<a href="{% url 'djangocms_blog:posts-author' post.author.get_username %}">
{% if post.author.get_full_name %}
{{ post.author.get_full_name }}
{% else %}
{{ post.author }}
{% endif %}
</a>
{% endif %}
on {{ post.date_published|date:"DATE_FORMAT" }}
</span>
</div>
</div>
</div>
</div>
</header>

View file

@ -0,0 +1,11 @@
{% extends CMS_TEMPLATE %}
{% block meta %}
{% if meta %}
{% include "meta_mixin/meta.html" %}
{% endif %}
{% endblock meta %}
{% block content %}
<div class="app app-blog span8">
{% block content_blog %}{% endblock %}
</div>
{% endblock content %}

View file

@ -0,0 +1,32 @@
{% load i18n thumbnail cms_tags %}
{% load url from future %}
<div class="post-preview">
<a href=" {{ post.get_absolute_url }} ">
<h2 class="post-title">
{{ post.title }}
</h2>
<h3 class="post-subtitle">
{% if not TRUNCWORDS_COUNT %}
{% render_model post "abstract" %}
{% else %}
{% render_model post "abstract" "" "" 'truncatewords_html:TRUNCWORDS_COUNT' %}
{% endif %}
</h3>
</a>
<p class="post-meta">
Posted
{% if post.author %}
by
<a href="{% url 'djangocms_blog:posts-author' post.author.get_username %}">
{% if post.author.get_full_name %}
{{ post.author.get_full_name }}
{% else %}
{{ post.author }}
{% endif %}
</a>
{% endif %}
on {{ post.date_published|date:"DATE_FORMAT" }}
</p>
</div>
<hr>

View file

@ -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 %}<link rel="canonical" href="{{ SITE.domain }}{{ view.get_view_url }}"/>{% endblock canonical_url %}
{% block title %}{{ post.get_title }}{% endblock %}
<!-- page header -->
{% block base_header %}
{% include "djangocms_blog/_header_post_detail.html" %}
{% endblock %}
<!-- page header -->
{% block content_blog %}
<article>
{% if use_placeholder %}
<div class="blog-content">{% render_placeholder post.content %}</div>
{% else %}
<div class="blog-content">{% render_model post "post_text" "post_text" %}</div>
{% endif %}
</article>
{% endblock content_blog %}

View file

@ -0,0 +1,47 @@
{% extends "djangocms_blog/base.html" %}
{% load i18n thumbnail %}{% spaceless %}
{% block canonical_url %}<link rel="canonical" href="{{ SITE.domain }}{{ view.get_view_url }}"/>{% endblock canonical_url %}
{% block content_blog %}
<section class="blog-list">
{% block blog_title %}
<header>
<h2>
{% if author %}{% trans "Articles by" %} {{ author.get_full_name }}
{% elif archive_date %}{% trans "Archive" %} &ndash; {% if month %}{{ archive_date|date:'F' }} {% endif %}{{ year }}
{% elif tagged_entries %}{% trans "Tag" %} &ndash; {{ tagged_entries|capfirst }}
{% elif category %}{% trans "Category" %} &ndash; {{ category }}{% endif %}
</h2>
</header>
{% endblock %}
{% for post in post_list %}
{% include "djangocms_blog/includes/blog_item.html" with post=post image="true" TRUNCWORDS_COUNT=TRUNCWORDS_COUNT %}
{% empty %}
<p class="blog-empty">{% trans "No article found." %}</p>
{% endfor %}
{% if author or archive_date or tagged_entries %}
<p class="blog-back"><a href="{% url 'djangocms_blog:posts-latest' %}">{% trans "Back" %}</a></p>
{% endif %}
{% if is_paginated %}
<!-- Pager -->
<ul class="pager">
{% if page_obj.has_previous %}
<li class="previous">
<a href="?{{ view.page_kwarg }}={{ page_obj.previous_page_number }}">
&laquo; {% trans "Newer Posts" %}
</a>
</li>
{% endif %}
{% if page_obj.has_next %}
<li class="next">
<a href="?{{ view.page_kwarg }}={{ page_obj.next_page_number }}">
{% trans "Older Posts" %} &rarr;
</a>
</li>
{% endif %}
</ul>
{% endif %}
</section>
{% endblock %}
{% endspaceless %}