From 3acb1654915e820c51953929bebf0805da9c05eb Mon Sep 17 00:00:00 2001 From: zubair-ce07 Date: Fri, 8 Sep 2023 12:44:48 +0500 Subject: [PATCH] fix: fixed css issues and dependency version --- .../oscar/dashboard/orders/order_list.html | 247 ++++++++++-------- .../oscar/dashboard/refunds/refund_list.html | 15 +- requirements/base.txt | 2 +- requirements/dev.txt | 2 +- requirements/production.txt | 2 +- requirements/test.txt | 2 +- 6 files changed, 147 insertions(+), 123 deletions(-) diff --git a/ecommerce/templates/oscar/dashboard/orders/order_list.html b/ecommerce/templates/oscar/dashboard/orders/order_list.html index e6db3c69681..5db54b093d4 100644 --- a/ecommerce/templates/oscar/dashboard/orders/order_list.html +++ b/ecommerce/templates/oscar/dashboard/orders/order_list.html @@ -1,158 +1,181 @@ {% extends 'oscar/dashboard/layout.html' %} -{% load compress %} {% load currency_filters %} -{% load static %} {% load sorting_tags %} {% load i18n %} +{% load widget_tweaks %} {% block body_class %}{{ block.super }} orders{% endblock %} {% block title %} - {% trans "Orders" as tmsg %}{{ tmsg | force_escape }} | {{ block.super }} -{% endblock %} - -{% block extrascripts %} - {{ block.super }} - - {# Translation support for JavaScript strings. #} - - - {% compress js %} - - - - {% endcompress %} + {% trans "Orders" %} | {{ block.super }} {% endblock %} {% block breadcrumbs %} - + {% endblock %} {% block header %} {% endblock header %} {% block dashboard_content %} - {% include "oscar/dashboard/partials/search_form.html" %} +
+

{% trans "Search" %}

+
+
+
+ {% for field in form %} + {% if "order" in field.id_for_label %} + {% if field.is_hidden %} + {% render_field field class+='form-control' %} + {% else %} +
+ {{ field.label_tag }} + {% render_field field class+='form-control' %} + {% for error in field.errors %} +
    +
  • {{ error }}
  • +
+ {% endfor %} +
+ {% endif %} + {% endif %} + {% endfor %} + + {% trans "Advanced Search" %} +
+ + {# Search modal, if there are form errors the form is automatically openend #} + {% include "oscar/dashboard/partials/advanced_search_modal.html" with form=form style='horizontal' %} + + {% if search_filters %} +
+ + {% for filter in search_filters %} + {{ filter }} + {% endfor %} +
+ + {% endif %} +
- {% if orders %} -
- {% csrf_token %} + {% if orders %} + + {% csrf_token %} - {% block order_list %} + {% block order_list %} - - - - - - - - - - - + + + + + + + + + + + + {% for order in orders %} - - - + + + - + - + + {% endfor %}
-

{{ queryset_description }} +

+ {% if search_filters %} + {% trans "Order Search Results" %} + {% else %} + {% trans "All Orders" %} + {% endif %}

- -
+
- - + +
{% anchor 'number' _("Order number") as tmsg %}{{ tmsg | force_escape }}{% anchor 'total_incl_tax' _("Total inc tax") as tmsg %}{{ tmsg | force_escape }}{% trans "Number of items" as tmsg %}{{ tmsg | force_escape }}{% trans "Status" as tmsg %}{{ tmsg | force_escape }}{% trans "Username" as tmsg %}{{ tmsg | force_escape }}{% trans "Email" as tmsg %}{{ tmsg | force_escape }}{% trans "Date of purchase" as tmsg %}{{ tmsg | force_escape }}
{% anchor 'number' _("Order number") %}{% anchor 'total_incl_tax' _("Total inc tax") %}{% trans "Number of items" %}{% trans "Status" %}{% trans "Customer" %}{% trans "Shipping address" %}{% trans "Billing address" %}{% trans "Date of purchase" %}
{{ order.number }} -
{{ order.number }} {{ order.total_incl_tax|currency:order.currency }} {{ order.num_items }}{{ order.status|default:"-" }}{{ order.status|default:"-" }} - {% if order.user %} - {{ order.user.username }} + {% if order.guest_email %} + {{ order.guest_email }} + {% elif order.user %} + {{ order.user.get_full_name|default:"-" }} {% else %} - <{% trans "Deleted" as tmsg %}{{ tmsg | force_escape }}> + <{% trans "Deleted" %}> {% endif %} - {% if order.user %} - {{ order.user.email }} - {% else %} - <{% trans "Deleted" as tmsg %}{{ tmsg | force_escape }}> - {% endif %} - {{ order.shipping_address|default:"-" }}{{ order.billing_address|default:"-" }} {{ order.date_placed }} - {% trans "View" as tmsg %}{{ tmsg | force_escape }} - {% if order.is_fulfillable %} - {% trans "Retry Fulfillment" as tmsg %}{{ tmsg | force_escape }} - {% endif %} + {% trans "View" %}
- {% endblock order_list %} - - {% block order_actions %} -
-

{% trans "Change order status" as tmsg %}{{ tmsg | force_escape }}:

- {% if order_statuses %} -
-
- - - -
-
- - {% else %} - {% trans "This order can't have its status changed." as tmsg %}{{ tmsg | force_escape }} - {% endif %} -
- {% endblock %} - - - {% include "oscar/partials/pagination.html" %} -
- {% else %} - - - - - -
{{ queryset_description }}
{% trans "No orders found." as tmsg %}{{ tmsg | force_escape }}
- {% endif %} - -{% endblock dashboard_content %} - -{% block onbodyload %} - {{ block.super }} - oscar.dashboard.orders.initTable(); - oscar.dashboard.search.init(); -{% endblock onbodyload %} + {% endblock order_list %} + {% block order_actions %} +
+

{% trans "Change order status" %}:

+ {% if order_statuses %} +
+
+ +
+
+
+ +
+ {% else %} + {% trans "This order can't have its status changed." %} + {% endif %} +
+ {% endblock %} + + {% include "oscar/dashboard/partials/pagination.html" %} + + {% else %} + + + +
+ {% if search_filters %} + {% trans "Order Search Results" %} + {% else %} + {% trans "All Orders" %} + {% endif %} +
{% trans "No orders found." %}
+ {% endif %} + + {% endblock dashboard_content %} + + {% block onbodyload %} + {{ block.super }} + oscar.dashboard.orders.initTable(); + {% if form.errors %} + $('#SearchModal').modal('show'); + {% endif %} + {% endblock onbodyload %} diff --git a/ecommerce/templates/oscar/dashboard/refunds/refund_list.html b/ecommerce/templates/oscar/dashboard/refunds/refund_list.html index adf46e5ee85..a8d29ddf198 100644 --- a/ecommerce/templates/oscar/dashboard/refunds/refund_list.html +++ b/ecommerce/templates/oscar/dashboard/refunds/refund_list.html @@ -25,17 +25,17 @@ {% endblock extrascripts %} {% block breadcrumbs %} - + {% endblock breadcrumbs %} {% block header %} {% endblock header %} @@ -45,6 +45,7 @@

{% trans "Refunds" as tmsg %}{{ tmsg | force_escape }}

{% if refunds %} {% include "oscar/dashboard/partials/refund_action_modal.html" %} {% block refund_list %} +

diff --git a/requirements/base.txt b/requirements/base.txt index ec6bee3692b..4703e190843 100644 --- a/requirements/base.txt +++ b/requirements/base.txt @@ -248,7 +248,7 @@ extras==1.0.0 # via # cybersource-rest-client-python # python-subunit -factory-boy==3.2.1 +factory-boy==3.0.0 # via django-oscar faker==18.10.1 # via factory-boy diff --git a/requirements/dev.txt b/requirements/dev.txt index 480a38f2e0b..5715560b9cd 100644 --- a/requirements/dev.txt +++ b/requirements/dev.txt @@ -358,7 +358,7 @@ extras==1.0.0 # -r requirements/test.txt # cybersource-rest-client-python # python-subunit -factory-boy==3.2.1 +factory-boy==3.0.0 # via # -r requirements/test.txt # django-oscar diff --git a/requirements/production.txt b/requirements/production.txt index a2b87cd0a91..a634d84498f 100644 --- a/requirements/production.txt +++ b/requirements/production.txt @@ -253,7 +253,7 @@ extras==1.0.0 # via # cybersource-rest-client-python # python-subunit -factory-boy==3.2.1 +factory-boy==3.0.0 # via django-oscar faker==18.10.1 # via factory-boy diff --git a/requirements/test.txt b/requirements/test.txt index a7e3c1134c7..deee0f5ac45 100644 --- a/requirements/test.txt +++ b/requirements/test.txt @@ -350,7 +350,7 @@ extras==1.0.0 # -r requirements/base.txt # cybersource-rest-client-python # python-subunit -factory-boy==3.2.1 +factory-boy==3.0.0 # via # -r requirements/base.txt # -r requirements/test.in