]> git.parisson.com Git - mezzo.git/commitdiff
use cards for blog list
authorGuillaume Pellerin <guillaume.pellerin@ircam.fr>
Tue, 19 Apr 2016 14:54:20 +0000 (16:54 +0200)
committerGuillaume Pellerin <guillaume.pellerin@ircam.fr>
Tue, 19 Apr 2016 14:54:20 +0000 (16:54 +0200)
app/templates/agenda/event_location_list.html
app/templates/blog/blog_post_list.html
app/templates/blog/includes/post_card.html

index c220f516291f58ab2dbf5c35f7ceb66d886a661d..6766dcaa4f70a2c8c17a8efc7f525502e68dcb8b 100644 (file)
@@ -40,6 +40,7 @@
           {% include "agenda/includes/event_location.html" %}
       </div>
   {% endfor %}
+</div>
 {% endblock %}
 
 {% block right_panel %}
index a7131ba126b734a3098a0ac6eb161380d46e2181..ac3abe9c7a6db4e3e545c266b44576168b631a5f 100644 (file)
     </p>
 {% 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 %}
-<h2>
-    <a href="{{ blog_post.get_absolute_url }}">{{ blog_post.title }}</a>
-</h2>
-{% endeditable %}
-{% endblock %}
-{% block blog_post_list_post_metainfo %}
-{% editable blog_post.publish_date %}
-<h6 class="post-meta">
-    {% comment %}
-    {% trans "Posted by" %}:
-    {% with blog_post.user as author %}
-    <a href="{% url "blog_post_list_author" author %}">{{ author.get_full_name|default:author.username }}</a>
-    {% endwith %}
-    {% endcomment %}
-    {% with blog_post.categories.all as categories %}
-    {% if categories %}
-    {% trans "in" %}
-    {% for category in categories %}
-    <a href="{% url "blog_post_list_category" category.slug %}">{{ category }}</a>{% if not forloop.last %}, {% endif %}
-    {% endfor %}
+    {% else %}
+        {% blog_categories as categories %}
+        {% if categories %}
+        <p>{% trans "Categories" %} :
+        {% for category in categories %}
+        <a href="{% url "blog_post_list_category" category.slug %}">{{ category }}</a> ({{ category.post_count }}){% if not forloop.last and categories|length > 1 %} | {% endif %}
+        {% endfor %}
+        </p>
+        {% endif %}
     {% endif %}
-    {% endwith %}
-    {% blocktrans with sometime=blog_post.publish_date|timesince %}{{ sometime }} ago{% endblocktrans %}
-</h6>
-{% endeditable %}
-{% endblock %}
-
-{% if settings.BLOG_USE_FEATURED_IMAGE and blog_post.featured_image %}
-{% block blog_post_list_post_featured_image %}
-<a href="{{ blog_post.get_absolute_url }}">
-    <img class="img-thumbnail pull-left" src="{{ MEDIA_URL }}{% thumbnail blog_post.featured_image 450 450 %}">
-</a>
-{% 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 %}
-<div class="blog-list-detail">
-    {% keywords_for blog_post as tags %}
-    {% if tags %}
-    <ul class="list-inline tags">
-    {% trans "Tags" %}:
-    {% spaceless %}
-    {% for tag in tags %}
-    <li><a href="{% url "blog_post_list_tag" tag.slug %}" class="tag">{{ tag }}</a>{% if not forloop.last %}, {% endif %}</li>
-    {% endfor %}
-    {% endspaceless %}
-    </ul>
-    {% endif %}
-    <p>
-    <a href="{{ blog_post.get_absolute_url }}">{% trans "read more" %}</a>
-    {% if blog_post.allow_comments %}
-    /
-    {% if settings.COMMENTS_DISQUS_SHORTNAME %}
-    <a href="{{ blog_post.get_absolute_url }}#disqus_thread"
-        data-disqus-identifier="{% disqus_id_for blog_post %}">
-        {% trans "Comments" %}
-    </a>
-    {% else %}
-    <a href="{{ blog_post.get_absolute_url }}#comments">
-        {% blocktrans count comments_count=blog_post.comments_count %}{{ comments_count }} comment{% plural %}{{ comments_count }} comments{% endblocktrans %}
-    </a>
-    {% endif %}
-    {% endif %}
-    </p>
+<div class="msry__container">
+  <div class="msry__sizer"></div>
+  {% for blog_post in blog_posts.object_list %}
+  {% with blog_post as post %}
+       {# <span>{% trans "Article" %}</span>#}
+       {% include 'blog/includes/post_card.html' %}
+  {% endwith %}
+  {% endfor %}
 </div>
-{% endblock %}
-{% endfor %}
-
-{% pagination_for blog_posts %}
 
 {% if settings.COMMENTS_DISQUS_SHORTNAME %}
 {% include "generic/includes/disqus_counts.html" %}
index 0bc60a18bbf523f76b61ac71615f8ceac8211cce..fe2fc96af7dfc2f0a0a2f46ef167aec0624d49e5 100644 (file)
@@ -3,9 +3,11 @@
 <div class="artist__item {% if not on_home %}msry__item {% endif %}">
     <div class="artist__item__inner">
         <a href="{% url 'blog_post_detail' post.slug %}" class="artist__item__inner">
+            {% if post.featured_image %}
             <figure class="artist__item__img">
                 <img src="{{ MEDIA_URL }}{% thumbnail post.featured_image 500 0 %}" alt="Article: {{ post.title }}">
             </figure>
+            {% endif %}
             <h3 class="artist__item__name">
                 <span>
                     {{ post.title }}