]> git.parisson.com Git - mezzo.git/commitdiff
link blog_post to external URL if the content contains a URL only
authorGuillaume Pellerin <guillaume.pellerin@ircam.fr>
Tue, 10 May 2016 15:43:22 +0000 (17:43 +0200)
committerGuillaume Pellerin <guillaume.pellerin@ircam.fr>
Tue, 10 May 2016 15:43:22 +0000 (17:43 +0200)
app/templates/blog/includes/post_card.html
lib/mezzanine-agenda

index 8b432391af863b9a22b328812076ae4284e4f937..43c3c8ddb5901f0d01091e686fa9108850df64fd 100644 (file)
@@ -2,7 +2,7 @@
 
 <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">
+        <a {% if post.content|removetags:"p"|slice:"4" == 'http' %}href="{{ post.content|removetags:'p' }}" target="_blank"{% else %}href="{% url 'blog_post_detail' post.slug %}"{% endif %} 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 }}">
index ab2706be3718922f05bf24207ea010f88b8b9bf1..b3bd1a965454d31ffb15291b159abf68fe0cbebf 160000 (submodule)
@@ -1 +1 @@
-Subproject commit ab2706be3718922f05bf24207ea010f88b8b9bf1
+Subproject commit b3bd1a965454d31ffb15291b159abf68fe0cbebf