From d5a838d3b320fc7ab5e8eb5e8e7244ebad0766c3 Mon Sep 17 00:00:00 2001 From: Guillaume Pellerin Date: Tue, 19 Apr 2016 16:54:20 +0200 Subject: [PATCH] use cards for blog list --- app/templates/agenda/event_location_list.html | 1 + app/templates/blog/blog_post_list.html | 96 ++++--------------- app/templates/blog/includes/post_card.html | 2 + 3 files changed, 20 insertions(+), 79 deletions(-) diff --git a/app/templates/agenda/event_location_list.html b/app/templates/agenda/event_location_list.html index c220f516..6766dcaa 100644 --- a/app/templates/agenda/event_location_list.html +++ b/app/templates/agenda/event_location_list.html @@ -40,6 +40,7 @@ {% include "agenda/includes/event_location.html" %} {% endfor %} + {% endblock %} {% block right_panel %} diff --git a/app/templates/blog/blog_post_list.html b/app/templates/blog/blog_post_list.html index a7131ba1..ac3abe9c 100644 --- a/app/templates/blog/blog_post_list.html +++ b/app/templates/blog/blog_post_list.html @@ -61,94 +61,32 @@

{% else %} {% if page %} - {% block blog_post_list_pagecontent %} {% if page.get_content_model.content %} {% editable page.get_content_model.content %} {{ page.get_content_model.content|richtext_filters|safe }} {% endeditable %} {% endif %} - {% endblock %} - {% endif %} -{% endif %} - -{% for blog_post in blog_posts.object_list %} -{% block blog_post_list_post_title %} -{% editable blog_post.title %} -

- {{ blog_post.title }} -

-{% endeditable %} -{% endblock %} -{% block blog_post_list_post_metainfo %} -{% editable blog_post.publish_date %} -
- {% comment %} - {% trans "Posted by" %}: - {% with blog_post.user as author %} - {{ author.get_full_name|default:author.username }} - {% endwith %} - {% endcomment %} - {% with blog_post.categories.all as categories %} - {% if categories %} - {% trans "in" %} - {% for category in categories %} - {{ category }}{% if not forloop.last %}, {% endif %} - {% endfor %} + {% else %} + {% blog_categories as categories %} + {% if categories %} +

{% trans "Categories" %} : + {% for category in categories %} + {{ category }} ({{ category.post_count }}){% if not forloop.last and categories|length > 1 %} | {% endif %} + {% endfor %} +

+ {% endif %} {% endif %} - {% endwith %} - {% blocktrans with sometime=blog_post.publish_date|timesince %}{{ sometime }} ago{% endblocktrans %} -
-{% endeditable %} -{% endblock %} - -{% if settings.BLOG_USE_FEATURED_IMAGE and blog_post.featured_image %} -{% block blog_post_list_post_featured_image %} - - - -{% endblock %} {% endif %} -{% block blog_post_list_post_content %} -{% editable blog_post.content %} -{{ blog_post.description_from_content|safe }} -{% endeditable %} -{% endblock %} - -{% block blog_post_list_post_links %} -
- {% keywords_for blog_post as tags %} - {% if tags %} - - {% endif %} -

- {% trans "read more" %} - {% if blog_post.allow_comments %} - / - {% if settings.COMMENTS_DISQUS_SHORTNAME %} - - {% trans "Comments" %} - - {% else %} - - {% blocktrans count comments_count=blog_post.comments_count %}{{ comments_count }} comment{% plural %}{{ comments_count }} comments{% endblocktrans %} - - {% endif %} - {% endif %} -

+
+
+ {% for blog_post in blog_posts.object_list %} + {% with blog_post as post %} + {# {% trans "Article" %}#} + {% include 'blog/includes/post_card.html' %} + {% endwith %} + {% endfor %}
-{% endblock %} -{% endfor %} - -{% pagination_for blog_posts %} {% if settings.COMMENTS_DISQUS_SHORTNAME %} {% include "generic/includes/disqus_counts.html" %} diff --git a/app/templates/blog/includes/post_card.html b/app/templates/blog/includes/post_card.html index 0bc60a18..fe2fc96a 100644 --- a/app/templates/blog/includes/post_card.html +++ b/app/templates/blog/includes/post_card.html @@ -3,9 +3,11 @@