diff --git a/ordr3/templates/orders/list.jinja2 b/ordr3/templates/orders/list.jinja2
index d7d0ea0..1cbd7ed 100644
--- a/ordr3/templates/orders/list.jinja2
+++ b/ordr3/templates/orders/list.jinja2
@@ -59,9 +59,13 @@
Unit Price
- Ordered by
+ Category
Account
|
+
+ Ordered by
+
+ |
Status
diff --git a/ordr3/templates/orders/list_content.jinja2 b/ordr3/templates/orders/list_content.jinja2
index d36aaad..a2877c9 100644
--- a/ordr3/templates/orders/list_content.jinja2
+++ b/ordr3/templates/orders/list_content.jinja2
@@ -21,9 +21,13 @@
|
- {{ order.model.created_by}}
+ {{ order.model.category.name|title }}
|
+
+ {{ order.model.created_by}}
+
+ |
{{ macros.status_label(order.model.status) }}
diff --git a/ordr3/views/orders.py b/ordr3/views/orders.py
index 9bfccb3..061a808 100644
--- a/ordr3/views/orders.py
+++ b/ordr3/views/orders.py
@@ -9,6 +9,8 @@ from .. import events, models, services, resources
# from ..schemas import account
+QUERY_LIMIT = 25
+
def get_status(request):
status_param = request.GET.get("status", "")
@@ -42,7 +44,7 @@ def get_multiple_orders(context, request):
renderer="ordr3:templates/orders/list_content.jinja2",
)
def order_list(context, request):
- limit = 25
+ limit = QUERY_LIMIT
offset = get_offset(request)
status = get_status(request)
username = request.GET.get("user", None)
@@ -105,10 +107,11 @@ def batch_delete(context, request):
if not orders:
return HTTPFound(request.resource_path(context))
- if len(orders) > 100:
+ if len(orders) > QUERY_LIMIT:
request.emit(
events.FlashMessage.warning(
- f"You cannot delete more than 100 orders in one sweep."
+ f"You cannot delete more than "
+ f"{QUERY_LIMIT} orders in one sweep."
)
)
return HTTPFound(request.resource_path(context))
@@ -133,10 +136,11 @@ def batch_delete_confirmed(context, request):
if not orders:
return HTTPFound(request.resource_path(context))
- if len(orders) > 100:
+ if len(orders) > QUERY_LIMIT:
request.emit(
events.FlashMessage.warning(
- f"You cannot delete more than 100 orders in one sweep."
+ f"You cannot delete more than "
+ f"{QUERY_LIMIT} orders in one sweep."
)
)
else:
@@ -164,10 +168,10 @@ def batch_edit(context, request):
if not orders:
return HTTPFound(request.resource_path(context))
- if len(orders) > 100:
+ if len(orders) > QUERY_LIMIT:
request.emit(
events.FlashMessage.warning(
- f"You cannot edit more than 100 orders in one sweep."
+ f"You cannot edit more than {QUERY_LIMIT} orders in one sweep."
)
)
return HTTPFound(request.resource_path(context))
@@ -197,10 +201,10 @@ def batch_edit_confirm(context, request):
if not orders:
return HTTPFound(request.resource_path(context))
- if len(orders) > 100:
+ if len(orders) > QUERY_LIMIT:
request.emit(
events.FlashMessage.warning(
- f"You cannot edit more than 100 orders in one sweep."
+ f"You cannot edit more than {QUERY_LIMIT} orders in one sweep."
)
)
return HTTPFound(request.resource_path(context))
|