]> git.parisson.com Git - mezzo.git/commitdiff
Product : external link in search
authorEmilie <zawadzki@ircam.fr>
Tue, 8 Nov 2016 14:37:33 +0000 (15:37 +0100)
committerEmilie <zawadzki@ircam.fr>
Tue, 8 Nov 2016 14:37:33 +0000 (15:37 +0100)
app/templates/core/inc/search_card.html
app/templates/pages/page/includes/page_search.html
app/templates/search_results.html
app/templates/shop/product/includes/product_search.html [new file with mode: 0644]

index 6235e83de6aaa5046e0593b8ffe657ba2bf78b66..5081ac32f6bcb9a248e6883be755a3520ec21adc 100644 (file)
@@ -7,7 +7,7 @@
         {% block tags %}
         {% endblock %}
 
-        <a href="{% block url %}{% endblock %}">
+        <a href="{% block url %}{% endblock %}" target="_blank">
             <h2 class="search-box__title dotted">
                 {% block title %}
                 {% endblock %}
index 160ee9a096ef7f045467ed268a9c5968440eb8e5..6bb6205eb7755b495331d1f657a09c8498a8e710 100644 (file)
@@ -24,7 +24,7 @@
         {% elif page|classname == "Project"  %}
             <div class="event-line-box__tags">
                 <div class="tag tag--small dashed">
-                    {{ page|classname }}
+                    {% trans 'Project' %}
                 </div>
             </div>
         {% else %}
index 35c65e0122239e94adf6ab2119d168707914ffe5..8d52dc5c6c01297a5004b6dd13e1626c2a2313b8 100644 (file)
                             {% with result as playlist %}
                                 {% include 'media/inc/playlist_search.html' %}
                             {% endwith %}
+                        {% elif result|classname == 'Product' %}
+                            {% with result as product %}
+                                {% include 'shop/product/includes/product_search.html' %}
+                            {% endwith %}
                         {% else %}
                             {% with result as page %}
                                 {% include 'pages/page/includes/page_search.html' %}
diff --git a/app/templates/shop/product/includes/product_search.html b/app/templates/shop/product/includes/product_search.html
new file mode 100644 (file)
index 0000000..edf444f
--- /dev/null
@@ -0,0 +1,30 @@
+{% extends "core/inc/search_card.html" %}
+{% load i18n mezzanine_tags organization_tags %}
+
+{% block title %}
+    {{ result.title }}
+{% endblock %}
+
+{% block icon %}files-o{% endblock %}
+
+{% block tags %}
+    <div class="event-line-box__tags">
+        <div class="tag tag--small dashed">
+            {% trans 'Software' %}
+        </div>
+    </div>
+{% endblock %}
+
+{% block url %}
+    {% with product.links.all as products %}
+        {% if products %}
+            {{ products|get_type_link:'link'|first }}
+        {% endif %}
+    {% endwith %}
+{% endblock %}
+
+{% block content %}
+    {% if result.description != result|stringformat:"s" %}
+        {{ result.description|truncatewords_html:200|safe }}
+    {% endif %}
+{% endblock %}