]> git.parisson.com Git - mezzo.git/commitdiff
add video and event cards
authorGuillaume Pellerin <guillaume.pellerin@ircam.fr>
Mon, 4 Apr 2016 11:12:23 +0000 (13:12 +0200)
committerGuillaume Pellerin <guillaume.pellerin@ircam.fr>
Mon, 4 Apr 2016 11:12:23 +0000 (13:12 +0200)
app/festival/templates/festival/inc/video_card.html [new file with mode: 0644]
app/festival/templates/festival/video_detail.html
app/festival/templates/festival/video_list.html
app/templates/agenda/event_detail.html
app/templates/agenda/event_list.html
app/templates/agenda/includes/event_card.html [new file with mode: 0644]

diff --git a/app/festival/templates/festival/inc/video_card.html b/app/festival/templates/festival/inc/video_card.html
new file mode 100644 (file)
index 0000000..1b35317
--- /dev/null
@@ -0,0 +1,9 @@
+<div class="video__card">
+    <div class="video__card__thumbnail">
+        <img src="http://source.unsplash.com/9Vx-QeC0-9Q/400x400" alt="">
+    </div>
+    <div class="video__card__info">
+        <h3 class="video__card__name">{{ video.title }}</h3>
+    </div>
+    <a href="{% url 'festival-video-detail' video.slug %}" class="video__card__link">Lire la video</a>
+</div>
index fcfe533afbff72ced2ebfab22555f52f6ef0e4d2..404a80e6f999283ecda62eee63917b1793dd65a1 100644 (file)
@@ -22,7 +22,9 @@
 
 <div class="video-event">
     <h2>{% trans 'Related event' %}</h2>
-    <a href="{{ video.event.get_absolute_url }}">{{ video.event.title }}</a>
+    {% with video.event as event %}
+    {% include 'agenda/includes/event_card.html' %}
+    {% endwith %}
 </div>
 
 {% endblock %}
index ca98f6b34dd3b4db10f8d885164900d7c8fc45ec..7365168b40873ae485109e2b25a1d83bdbed55da 100644 (file)
@@ -9,15 +9,7 @@
 {% block main %}
 <div class="video__list">
     {% for video in object_list %}
-    <div class="video__card">
-        <div class="video__card__thumbnail">
-            <img src="http://source.unsplash.com/9Vx-QeC0-9Q/400x400" alt="">
-        </div>
-        <div class="video__card__info">
-            <h3 class="video__card__name">{{ video.title }}</h3>
-        </div>
-        <a href="{% url 'festival-video-detail' video.slug %}" class="video__card__link">Lire la video</a>
-    </div>
+     {% include 'festival/inc/video_card.html'}
     {% endfor %}
 </div>
 {% endblock %}
index ed619d5231c6d137341fd4203569c4f4cea4a6af..4e1db0b3cee4503767b34ef328827a2c06e8aa4b 100644 (file)
 
 <h2>{% trans "Videos" %}</h2>
 {% for video in event.videos.all %}
-<a href="{% url 'festival-video-detail' video.slug %}">{{ video.title }}</a>
+    {% include 'festival/inc/video_card.html' %}
 {% endfor %}
 
 {% endblock %}
index 627352b93b6a015009b0268577a880769a453a4e..9ed2d398e5e7b5e454d99768a6bc80e20d9fa8a9 100644 (file)
 <div class="msry__container">
     <div class="msry__sizer">
 {% for event in events.object_list %}
-    {% block event_list_event_title %}
-        <div class="event__card msry__item">
-            {% if event.featured_image %}
-                {% block event_list_event_featured_image %}
-                    <a href="{{ event.get_absolute_url }}" class="event__thumbnail">
-                        <img src="{{ MEDIA_URL }}{% thumbnail event.featured_image 500 500 %}">
-                    </a>
-                {% endblock %}
-            {% endif %}
-            <h3 class="event__name">
-                <a href="{{ event.get_absolute_url }}">{{ event.title }}</a>
-            </h3>
-    {% endblock %}
-
-    {% block event_list_event_metainfo %}
-         {% include "agenda/includes/event_metainfo.html" %}
-        {% for child in event.children.all %}
-         {% with child as event %}
-          {% include "agenda/includes/event_metainfo.html" %}
-         {% endwith %}
-        {% endfor %}
-    {% endblock %}
-
-    {% block event_list_event_content %}
-            {% comment %}
-            <div class="event__description">
-                {{ event.description_from_content|safe }}
-                <a href="{{ event.get_absolute_url }}" class="event__meta__cta">{% trans "read more" %}</a>
-            </div>
-            {% endcomment %}
-    {% endblock %}
-
-    {% block booking %}
-    <a href="{{ event.get_absolute_url }}" class="btn btn-full">
-        <i class="icon icon__bookmark"></i> {% trans "Booking" %}
-    </a>
-    {% endblock %}
-
-{% block event_list_event_links %}
-<div class="event__detail">
-    {% keywords_for event as tags %}
-    {% if tags %}
-    <ul class="list-inline tags">
-    {% trans "Tags" %}:
-    {% spaceless %}
-    {% for tag in tags %}
-    <li><a href="{% url "event_list_tag" tag.slug %}" class="tag">{{ tag }}</a></li>
-    {% endfor %}
-    {% endspaceless %}
-    </ul>
-    {% endif %}
-    <p>
-    {% if event.allow_comments %}
-    /
-    {% if settings.COMMENTS_DISQUS_SHORTNAME %}
-    <a href="{{ event.get_absolute_url }}#disqus_thread"
-        data-disqus-identifier="{% disqus_id_for event %}">
-        {% trans "Comments" %}
-    </a>
-    {% else %}
-    <a href="{{ event.get_absolute_url }}#comments">
-        {% blocktrans count comments_count=event.comments_count %}{{ comments_count }} comment{% plural %}{{ comments_count }} comments{% endblocktrans %}
-    </a>
-    {% endif %}
-    {% endif %}
-    </p>
-</div>
-{% endblock %}
-</div>
+ {% include 'agenda/includes/event_card.html' %}
 {% endfor %}
     </div>
 </div>
diff --git a/app/templates/agenda/includes/event_card.html b/app/templates/agenda/includes/event_card.html
new file mode 100644 (file)
index 0000000..cb6e7d1
--- /dev/null
@@ -0,0 +1,71 @@
+{% load i18n future mezzanine_tags event_tags keyword_tags disqus_tags %}
+
+{% block event_list_event_title %}
+    <div class="event__card msry__item">
+        {% if event.featured_image %}
+            {% block event_list_event_featured_image %}
+                <a href="{{ event.get_absolute_url }}" class="event__thumbnail">
+                    <img src="{{ MEDIA_URL }}{% thumbnail event.featured_image 500 500 %}">
+                </a>
+            {% endblock %}
+        {% endif %}
+        <h3 class="event__name">
+            <a href="{{ event.get_absolute_url }}">{{ event.title }}</a>
+        </h3>
+{% endblock %}
+
+{% block event_list_event_metainfo %}
+     {% include "agenda/includes/event_metainfo.html" %}
+    {% for child in event.children.all %}
+     {% with child as event %}
+      {% include "agenda/includes/event_metainfo.html" %}
+     {% endwith %}
+    {% endfor %}
+{% endblock %}
+
+{% block event_list_event_content %}
+        {% comment %}
+        <div class="event__description">
+            {{ event.description_from_content|safe }}
+            <a href="{{ event.get_absolute_url }}" class="event__meta__cta">{% trans "read more" %}</a>
+        </div>
+        {% endcomment %}
+{% endblock %}
+
+{% block booking %}
+<a href="{{ event.get_absolute_url }}" class="btn btn-full">
+    <i class="icon icon__bookmark"></i> {% trans "Booking" %}
+</a>
+{% endblock %}
+
+{% block event_list_event_links %}
+<div class="event__detail">
+{% keywords_for event as tags %}
+{% if tags %}
+<ul class="list-inline tags">
+{% trans "Tags" %}:
+{% spaceless %}
+{% for tag in tags %}
+<li><a href="{% url "event_list_tag" tag.slug %}" class="tag">{{ tag }}</a></li>
+{% endfor %}
+{% endspaceless %}
+</ul>
+{% endif %}
+<p>
+{% if event.allow_comments %}
+/
+{% if settings.COMMENTS_DISQUS_SHORTNAME %}
+<a href="{{ event.get_absolute_url }}#disqus_thread"
+    data-disqus-identifier="{% disqus_id_for event %}">
+    {% trans "Comments" %}
+</a>
+{% else %}
+<a href="{{ event.get_absolute_url }}#comments">
+    {% blocktrans count comments_count=event.comments_count %}{{ comments_count }} comment{% plural %}{{ comments_count }} comments{% endblocktrans %}
+</a>
+{% endif %}
+{% endif %}
+</p>
+</div>
+{% endblock %}
+</div>