From 8e5834b2dd710f9fc3b73661c52668d88b37bf1b Mon Sep 17 00:00:00 2001 From: Levi <levinoelvm@gmail.com> Date: Tue, 31 Jan 2017 10:09:24 -0500 Subject: [PATCH] fixed blog posts css issue --- .../templates/digitalglarus/post_detail.html | 48 +++++++++++++++++++ .../templates/digitalglarus/supportus.html | 2 +- digitalglarus/views.py | 1 - 3 files changed, 49 insertions(+), 2 deletions(-) create mode 100644 digitalglarus/templates/digitalglarus/post_detail.html diff --git a/digitalglarus/templates/digitalglarus/post_detail.html b/digitalglarus/templates/digitalglarus/post_detail.html new file mode 100644 index 00000000..f59cec48 --- /dev/null +++ b/digitalglarus/templates/digitalglarus/post_detail.html @@ -0,0 +1,48 @@ +{% load i18n thumbnail cms_tags %} + +<div class="post-preview"> + + + <div class="row"> + <div class="col-md-4"> + <a href="{{ post.get_absolute_url }}"> + <img style="margin-top:11%"src="{% thumbnail post.main_image 240x235 crop upscale subject_location=post.main_image.subject_location %}"/> + </a> + </div> + <div class="col-md-6 col-md-offset-2 col-lg-offset-1"> + <a href="{{ post.get_absolute_url }}"> + <h2 class="post-title"> + {{ post.title }} + </h2> + </a> + <p class="post-meta" style="font-size:0.9em;"> + 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> + + <p class="post-subtitle"> + {% if not TRUNCWORDS_COUNT %} + {% render_model post "abstract" %} + {% else %} + {% render_model post "abstract" "" "" 'truncatewords_html:TRUNCWORDS_COUNT' %} + {% endif %} + </p> + + + + </div> + </div> + + +</div> +<hr> diff --git a/digitalglarus/templates/digitalglarus/supportus.html b/digitalglarus/templates/digitalglarus/supportus.html index 28659e23..6089da99 100644 --- a/digitalglarus/templates/digitalglarus/supportus.html +++ b/digitalglarus/templates/digitalglarus/supportus.html @@ -152,7 +152,7 @@ <div class="col-md-7 col-md-offset-3 supportus-posts"> <div class="blog-list"> {% for post in post_list %} - {% include "ungleich/djangocms_blog/includes/blog_item.html" with post=post image="true" TRUNCWORDS_COUNT=TRUNCWORDS_COUNT %} + {% include "digitalglarus/post_detail.html" with post=post image="true" TRUNCWORDS_COUNT=TRUNCWORDS_COUNT %} {% endfor %} </div> </div> diff --git a/digitalglarus/views.py b/digitalglarus/views.py index 8474b7a4..a33775c9 100644 --- a/digitalglarus/views.py +++ b/digitalglarus/views.py @@ -40,7 +40,6 @@ class SupportusView(TemplateView): def get_context_data(self, *args, **kwargs): context = super(SupportusView, self).get_context_data(**kwargs) tags = ["dg-renovation"] - import pdb;pdb.set_trace() posts = Post.objects.filter(tags__name__in=tags, publish=True).translated(get_language()) context.update({ 'post_list': posts