]> git.parisson.com Git - mezzo.git/commitdiff
Page: add custom and team card
authorEmilie <zawadzki@ircam.fr>
Mon, 7 Nov 2016 11:03:00 +0000 (12:03 +0100)
committerEmilie <zawadzki@ircam.fr>
Mon, 7 Nov 2016 11:03:00 +0000 (12:03 +0100)
app/templates/pages/custompage/includes/custompage_card.html [new file with mode: 0644]
app/templates/pages/teampage/includes/teampage_card.html [new file with mode: 0644]

diff --git a/app/templates/pages/custompage/includes/custompage_card.html b/app/templates/pages/custompage/includes/custompage_card.html
new file mode 100644 (file)
index 0000000..92f46ee
--- /dev/null
@@ -0,0 +1,41 @@
+{% extends "core/inc/generic_card.html" %}
+{% load i18n pages_tags mezzanine_tags media_tags organization_tags %}
+
+{% block metatitle %}
+    {{ object.title }}
+{% endblock %}
+
+{% block title %}
+    {{ object.title }}
+{% endblock %}
+
+{% block url %}
+    {{ object.get_absolute_url }}
+{% endblock %}
+{% block image %}
+    {% with object.images.all|get_type:'card' as images %}
+        {% if images %}
+            <figure class="article-box__image">
+                <img src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==" data-original="{{ MEDIA_URL }}{% thumbnail images.0.file 427 286 top=0.5 left=article.photo_alignment|get_photo_alignment %}" class="lazyload" />
+            </figure>
+        {% else %}
+            <figure class="article-box__image">
+                {% with object.get_ascendants|last as top_level_parent %}
+                    {% if top_level_parent.get_content_model %}
+                        <div class="article-box__placeholder {{top_level_parent.get_content_model|slugify}}"></div>
+                    {% else %}
+                        <div class="article-box__placeholder"></div>
+                    {% endif %}
+                {% endwith %}
+            </figure>
+        {% endif %}
+    {% endwith %}
+{% endblock %}
+
+{% block content %}
+    {{ object.description|richtext_filters|safe|truncatechars_html:200 }}
+{% endblock %}
+
+{% block subtitle %}
+    {{ object.sub_title }}
+{% endblock %}
diff --git a/app/templates/pages/teampage/includes/teampage_card.html b/app/templates/pages/teampage/includes/teampage_card.html
new file mode 100644 (file)
index 0000000..92f46ee
--- /dev/null
@@ -0,0 +1,41 @@
+{% extends "core/inc/generic_card.html" %}
+{% load i18n pages_tags mezzanine_tags media_tags organization_tags %}
+
+{% block metatitle %}
+    {{ object.title }}
+{% endblock %}
+
+{% block title %}
+    {{ object.title }}
+{% endblock %}
+
+{% block url %}
+    {{ object.get_absolute_url }}
+{% endblock %}
+{% block image %}
+    {% with object.images.all|get_type:'card' as images %}
+        {% if images %}
+            <figure class="article-box__image">
+                <img src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==" data-original="{{ MEDIA_URL }}{% thumbnail images.0.file 427 286 top=0.5 left=article.photo_alignment|get_photo_alignment %}" class="lazyload" />
+            </figure>
+        {% else %}
+            <figure class="article-box__image">
+                {% with object.get_ascendants|last as top_level_parent %}
+                    {% if top_level_parent.get_content_model %}
+                        <div class="article-box__placeholder {{top_level_parent.get_content_model|slugify}}"></div>
+                    {% else %}
+                        <div class="article-box__placeholder"></div>
+                    {% endif %}
+                {% endwith %}
+            </figure>
+        {% endif %}
+    {% endwith %}
+{% endblock %}
+
+{% block content %}
+    {{ object.description|richtext_filters|safe|truncatechars_html:200 }}
+{% endblock %}
+
+{% block subtitle %}
+    {{ object.sub_title }}
+{% endblock %}