Skip to content

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

Hide 'drop images...' on mobile, fix orders filtering

weronka3e4a098e6af6
diff --git a/saleor/dashboard/order/views.py b/saleor/dashboard/order/views.py
index 654de19694..2d421410fc 100644
--- a/saleor/dashboard/order/views.py
+++ b/saleor/dashboard/order/views.py
@@ -24,15 +24,17 @@ from .forms import (CancelGroupForm, CancelItemsForm, CancelOrderForm,
@staff_member_required
def order_list(request):
- orders = Order.objects.prefetch_related(
+ orders_all = Order.objects.prefetch_related(
'groups', 'payments', 'groups__items', 'user').all()
active_status = request.GET.get('status')
if active_status:
- orders = orders.filter(status=active_status)
+ orders = orders_all.filter(status=active_status)
+ else:
+ orders = orders_all
page = get_paginator_items(orders, 20, request.GET.get('page'))
form = OrderFilterForm(
request.POST or None, initial={'status': active_status or None})
- ctx = {'object_list': page.object_list, 'page_obj': page,
+ ctx = {'object_list': page.object_list, 'orders_all': orders_all, 'page_obj': page,
'is_paginated': page.has_other_pages(), 'form': form}
return TemplateResponse(request, 'dashboard/order/list.html', ctx)
diff --git a/templates/dashboard/order/list.html b/templates/dashboard/order/list.html
index 56b80f9282..24dbc5aca0 100644
--- a/templates/dashboard/order/list.html
+++ b/templates/dashboard/order/list.html
@@ -16,16 +16,19 @@
{% endblock %}
{% block content %}
- {% if object_list %}
- {% include "dashboard/includes/_status_filters.html" %}
- <div class="card">
- {% include "dashboard/includes/_orders_table.html" with orders=object_list %}
- </div>
-
- <div class="row">
- {% include "dashboard/includes/_pagination.html" %}
- </div>
+ {% if orders_all %}
+ {% include "dashboard/includes/_status_filters.html" %}
+ {% if object_list %}
+ <div class="card">
+ {% include "dashboard/includes/_orders_table.html" with orders=object_list %}
+ </div>
+ <div class="row">
+ {% include "dashboard/includes/_pagination.html" %}
+ </div>
+ {% else %}
+ <p class="not-found grey-text">{% trans "No orders found." context "Empty order list message" %}</p>
+ {% endif %}
{% else %}
- <p class="not-found grey-text">{% trans "No orders." context "Empty order list message" %}</p>
+ <p class="not-found grey-text">{% trans "No orders." context "Empty order list message" %}</p>
{% endif %}
{% endblock %}
diff --git a/templates/dashboard/product/product_form.html b/templates/dashboard/product/product_form.html
index f1bc7d93bf..aef4105d8f 100644
--- a/templates/dashboard/product/product_form.html
+++ b/templates/dashboard/product/product_form.html
@@ -374,7 +374,7 @@
<div class="col s6 m3 product-gallery-item dropzone-message">
<div class="row">
<span class="product-gallery-item-title product-gallery-item-title--noclip card-title black-text">
- <span class="grey-text">
+ <span class="grey-text hide-on-med-and-down">
{% trans "Drop images here to upload" context "Image gallery upload box text" %}
</span>
</span>