Skip to content

Saleor Core: the high performance, composable, headless commerce API.

Fix search view

dominik-zeglen7c8f9de2d11f
diff --git a/templates/dashboard/search/results.html b/templates/dashboard/search/results.html
index 809d71261c..ce5ab8886f 100644
--- a/templates/dashboard/search/results.html
+++ b/templates/dashboard/search/results.html
@@ -21,42 +21,51 @@
<div class="row">
<div class="col s12">
<div class="card search-form">
- <form class="hide-on-med-and-up" method="get" action="{% url "dashboard:search" %}">
- <input id="icon_prefix" type="text" class="validate left" placeholder="{% trans "Search" context "Dashboard search" %}" name="q" value="{% if query %}{{ query }}{% endif %}">
+ <form class="hide-on-med-and-up" method="get"
+ action="{% url "dashboard:search" %}">
+ <input id="icon_prefix" type="text" class="validate left"
+ placeholder="{% trans "Search" context "Dashboard search" %}"
+ name="q" value="{% if query %}{{ query }}{% endif %}">
<button class="btn-flat" type="submit">
- <svg data-src="{% static "dashboard/images/search.svg" %}" width="20" height="20" fill="#E57373" />
+ <svg data-src="{% static "dashboard/images/search.svg" %}"
+ width="20" height="20" fill="#E57373"/>
</button>
</form>
- <form class="hide-on-med-and-up row" method="get" action="{% url "dashboard:search" %}">
- <input type="hidden" class="validate" name="q" value="{% if query %}{{ query }}{% endif %}">
+ <form class="hide-on-med-and-up row" method="get"
+ action="{% url "dashboard:search" %}">
+ <input type="hidden" class="validate" name="q"
+ value="{% if query %}{{ query }}{% endif %}">
</form>
</div>
- <ul class="collection list">
- <li class="collection-item avatar list-item">
- {% if products or orders or users %}
- {% for product in products %}
- <a href="{% url 'dashboard:product-detail' pk=product.pk %}">
- <img src="{% product_first_image product size="60x60" method="crop" %}"
- srcset="{% product_first_image product size="60x60" method="crop" %} 1x, {% product_first_image product size="120x120" method="crop" %} 2x"
- class="circle" alt="{{ product.name }}">
- <span class="list-item-name">
+ {% if products or orders or users %}
+ <ul class="collection list">
+ {% for product in products %}
+ <li class="collection-item avatar list-item">
+ <a href="{% url 'dashboard:product-detail' pk=product.pk %}">
+ <img
+ src="{% product_first_image product size="60x60" method="crop" %}"
+ srcset="{% product_first_image product size="60x60" method="crop" %} 1x, {% product_first_image product size="120x120" method="crop" %} 2x"
+ class="circle" alt="{{ product.name }}">
+ <span class="list-item-name">
{{ product.name }}
</span>
- <p class="list-item-price">
- <small>
- {% gross product.price html=True %}
- </small>
- </p>
- </a>
- {% endfor %}
- {% for order in orders %}
+ <p class="list-item-price">
+ <small>
+ {% gross product.price html=True %}
+ </small>
+ </p>
+ </a>
+ </li>
+ {% endfor %}
+ {% for order in orders %}
+ <li class="collection-item avatar list-item">
<a href="{% url 'dashboard:order-details' order_pk=order.pk %}">
<i class="small material-icons circle">payment</i>
<span class="list-item-name">
- {% blocktrans trimmed with order_number=order.pk context "Dashboard order" %}
- Order #{{ order_number }}
- {% endblocktrans %}
- </span>
+ {% blocktrans trimmed with order_number=order.pk context "Dashboard order" %}
+ Order #{{ order_number }}
+ {% endblocktrans %}
+ </span>
<p class="list-item-price">
<small>
{% blocktrans trimmed context "Dashboard customer" with email=order.user_email %}
@@ -70,34 +79,36 @@
</small>
</p>
</a>
- {% endfor %}
- {% for user in users %}
+ <li class="collection-item avatar list-item">
+ {% endfor %}
+ {% for user in users %}
+ <li class="collection-item avatar list-item">
<a href="{% url 'dashboard:customer-details' pk=user.pk %}">
<i class="small material-icons circle">perm_identity</i>
<span class="list-item-name">
- {% blocktrans trimmed with full_name=user.get_full_name context "Dashboard user" %}
- User {{ full_name }}
- {% endblocktrans %}
- </span>
+ {% blocktrans trimmed with full_name=user.get_full_name context "Dashboard user" %}
+ User {{ full_name }}
+ {% endblocktrans %}
+ </span>
<p class="list-item-price">
<small>
{% trans "Customer" context "Dashboard customer" %}
</small>
</p>
</a>
- {% endfor %}
- </li>
- </ul>
- {% include "dashboard/includes/_pagination.html" with page_obj=results %}
- {% elif query %}
- <div class="not-found">
+ </li>
+ {% endfor %}
+ </ul>
+ {% include "dashboard/includes/_pagination.html" with page_obj=results %}
+ {% elif query %}
+ <div class="not-found">
<p class="grey-text">
{% blocktrans trimmed with full_name=result.get_full_name context "No Search result message" %}
No results for query "{{ query }}".
- {% endblocktrans %}
+ {% endblocktrans %}
</p>
- </div>
- {% endif %}
+ </div>
+ {% endif %}
</div>
</div>
{% endblock %}