From 34af5dc7aba9d93eeb8559bfbb0fb4873b08899c Mon Sep 17 00:00:00 2001 From: Guillaume Pellerin Date: Mon, 4 Apr 2016 13:12:23 +0200 Subject: [PATCH] add video and event cards --- .../templates/festival/inc/video_card.html | 9 +++ .../templates/festival/video_detail.html | 4 +- .../templates/festival/video_list.html | 10 +-- app/templates/agenda/event_detail.html | 2 +- app/templates/agenda/event_list.html | 70 +----------------- app/templates/agenda/includes/event_card.html | 71 +++++++++++++++++++ 6 files changed, 86 insertions(+), 80 deletions(-) create mode 100644 app/festival/templates/festival/inc/video_card.html create mode 100644 app/templates/agenda/includes/event_card.html diff --git a/app/festival/templates/festival/inc/video_card.html b/app/festival/templates/festival/inc/video_card.html new file mode 100644 index 00000000..1b35317c --- /dev/null +++ b/app/festival/templates/festival/inc/video_card.html @@ -0,0 +1,9 @@ +
+
+ +
+
+

{{ video.title }}

+
+ Lire la video +
diff --git a/app/festival/templates/festival/video_detail.html b/app/festival/templates/festival/video_detail.html index fcfe533a..404a80e6 100644 --- a/app/festival/templates/festival/video_detail.html +++ b/app/festival/templates/festival/video_detail.html @@ -22,7 +22,9 @@

{% trans 'Related event' %}

- {{ video.event.title }} + {% with video.event as event %} + {% include 'agenda/includes/event_card.html' %} + {% endwith %}
{% endblock %} diff --git a/app/festival/templates/festival/video_list.html b/app/festival/templates/festival/video_list.html index ca98f6b3..7365168b 100644 --- a/app/festival/templates/festival/video_list.html +++ b/app/festival/templates/festival/video_list.html @@ -9,15 +9,7 @@ {% block main %}
{% for video in object_list %} -
-
- -
-
-

{{ video.title }}

-
- Lire la video -
+ {% include 'festival/inc/video_card.html'} {% endfor %}
{% endblock %} diff --git a/app/templates/agenda/event_detail.html b/app/templates/agenda/event_detail.html index ed619d52..4e1db0b3 100644 --- a/app/templates/agenda/event_detail.html +++ b/app/templates/agenda/event_detail.html @@ -169,7 +169,7 @@

{% trans "Videos" %}

{% for video in event.videos.all %} -{{ video.title }} + {% include 'festival/inc/video_card.html' %} {% endfor %} {% endblock %} diff --git a/app/templates/agenda/event_list.html b/app/templates/agenda/event_list.html index 627352b9..9ed2d398 100644 --- a/app/templates/agenda/event_list.html +++ b/app/templates/agenda/event_list.html @@ -69,75 +69,7 @@
{% for event in events.object_list %} - {% block event_list_event_title %} -
- {% if event.featured_image %} - {% block event_list_event_featured_image %} - - - - {% endblock %} - {% endif %} -

- {{ event.title }} -

- {% 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 %} -
- {{ event.description_from_content|safe }} - {% trans "read more" %} -
- {% endcomment %} - {% endblock %} - - {% block booking %} - - {% trans "Booking" %} - - {% endblock %} - -{% block event_list_event_links %} -
- {% keywords_for event as tags %} - {% if tags %} -
    - {% trans "Tags" %}: - {% spaceless %} - {% for tag in tags %} -
  • {{ tag }}
  • - {% endfor %} - {% endspaceless %} -
- {% endif %} -

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

-
-{% endblock %} -
+ {% include 'agenda/includes/event_card.html' %} {% endfor %}
diff --git a/app/templates/agenda/includes/event_card.html b/app/templates/agenda/includes/event_card.html new file mode 100644 index 00000000..cb6e7d1d --- /dev/null +++ b/app/templates/agenda/includes/event_card.html @@ -0,0 +1,71 @@ +{% load i18n future mezzanine_tags event_tags keyword_tags disqus_tags %} + +{% block event_list_event_title %} +
+ {% if event.featured_image %} + {% block event_list_event_featured_image %} + + + + {% endblock %} + {% endif %} +

+ {{ event.title }} +

+{% 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 %} +
+ {{ event.description_from_content|safe }} + {% trans "read more" %} +
+ {% endcomment %} +{% endblock %} + +{% block booking %} + + {% trans "Booking" %} + +{% endblock %} + +{% block event_list_event_links %} +
+{% keywords_for event as tags %} +{% if tags %} +
    +{% trans "Tags" %}: +{% spaceless %} +{% for tag in tags %} +
  • {{ tag }}
  • +{% endfor %} +{% endspaceless %} +
+{% endif %} +

+{% if event.allow_comments %} +/ +{% if settings.COMMENTS_DISQUS_SHORTNAME %} + + {% trans "Comments" %} + +{% else %} + + {% blocktrans count comments_count=event.comments_count %}{{ comments_count }} comment{% plural %}{{ comments_count }} comments{% endblocktrans %} + +{% endif %} +{% endif %} +

+
+{% endblock %} +
-- 2.39.5