From 0d7e5d8c81627cd73133e6efca61519c16695b1e Mon Sep 17 00:00:00 2001 From: zubair-ce07 Date: Thu, 7 Sep 2023 16:38:11 +0500 Subject: [PATCH] fix: fixed css issues and category namespace issue --- .../dashboard/catalogue/category_form.html | 118 ++ .../catalogue/category_row_actions.html | 44 +- .../oscar/dashboard/orders/order_detail.html | 1341 ++++++++--------- 3 files changed, 806 insertions(+), 697 deletions(-) create mode 100644 ecommerce/templates/oscar/dashboard/catalogue/category_form.html diff --git a/ecommerce/templates/oscar/dashboard/catalogue/category_form.html b/ecommerce/templates/oscar/dashboard/catalogue/category_form.html new file mode 100644 index 00000000000..0803148fee3 --- /dev/null +++ b/ecommerce/templates/oscar/dashboard/catalogue/category_form.html @@ -0,0 +1,118 @@ +{% extends 'oscar/dashboard/layout.html' %} +{% load category_tags %} +{% load i18n %} + +{% block body_class %}{{ block.super }} create-page catalogue{% endblock %} + +{% block title %} + {{ title }} | {% trans "Categories" %} | {{ block.super }} +{% endblock %} + +{% block breadcrumbs %} + +{% endblock %} + +{% block headertext %}{{ title }}{% endblock %} + +{% block dashboard_content %} +
+ {% csrf_token %} +
+ {% block tab_nav %} +
+
+
+

{% trans "Sections" %}

+
+ +
+
+ {% endblock tab_nav %} +
+
+ {% block tab_content %} + {% block category_details %} +
+
+

{% trans "Category details" %}

+
+
+ {% block category_details_content %} + {{ form.non_field_errors }} + {% for field in form.hidden_fields %} + {{ field }} + {% endfor %} + {% for field in form.primary_form_fields %} + {% if 'attr' not in field.id_for_label %} + {% include 'oscar/dashboard/partials/form_field.html' with field=field %} + {% endif %} + {% endfor %} + {% endblock category_details_content %} +
+
+ {% endblock category_details %} + {% block seo %} +
+
+

{% trans "Search engine optimisation" %}

+
+
+ {% block seo_content %} + {% for field in form.seo_form_fields %} + {% if 'attr' not in field.id_for_label %} + {% include 'oscar/dashboard/partials/form_field.html' with field=field %} + {% endif %} + {% endfor %} + {% endblock seo_content %} +
+
+ {% endblock seo %} + {% endblock tab_content %} +
+
+
+ {% block fixed_actions_group %} +
+
+
+ + {% trans "Cancel" %} + + {% trans "or" %} + + +
+
+
+ {% endblock fixed_actions_group %} +
+{% endblock dashboard_content %} diff --git a/ecommerce/templates/oscar/dashboard/catalogue/category_row_actions.html b/ecommerce/templates/oscar/dashboard/catalogue/category_row_actions.html index 983527c086a..cc557611c4a 100644 --- a/ecommerce/templates/oscar/dashboard/catalogue/category_row_actions.html +++ b/ecommerce/templates/oscar/dashboard/catalogue/category_row_actions.html @@ -1,32 +1,24 @@ {% load django_tables2 %} {% load i18n %}
-
diff --git a/ecommerce/templates/oscar/dashboard/orders/order_detail.html b/ecommerce/templates/oscar/dashboard/orders/order_detail.html index 5e4582c714e..96427e9b76a 100644 --- a/ecommerce/templates/oscar/dashboard/orders/order_detail.html +++ b/ecommerce/templates/oscar/dashboard/orders/order_detail.html @@ -1,738 +1,737 @@ {% extends 'oscar/dashboard/layout.html' %} {% load i18n %} -{% load compress %} -{% load static %} {% load currency_filters %} {% block body_class %}{{ block.super }} orders{% endblock %} {% block title %} - {% filter force_escape %}{% blocktrans with number=order.number %}Order {{ number }}{% endblocktrans %} {% endfilter %} | {{ block.super }} + {% blocktrans with number=order.number %}Order {{ number }}{% endblocktrans %} | {{ block.super }} {% endblock %} -{% block extrascripts %} - {{ block.super }} - - {# Translation support for JavaScript strings. #} - - - {% compress js %} - - - - {% endcompress %} -{% endblock extrascripts %} - {% block breadcrumbs %} - + {% endblock %} {% block headertext %} - {% filter force_escape %}{% blocktrans with number=order.number %}Order #{{ number }}{% endblocktrans %}{% endfilter %} -{% endblock %} + {% blocktrans with number=order.number %}Order #{{ number }}{% endblocktrans %} +{% endblock %} {% block dashboard_content %} - {% block customer_information %} - - - {% if order.user %} - - - - - - - - - - - {% else %} - - - - {% endif %} -
{% trans "Customer Information" as tmsg %}{{ tmsg | force_escape }}
{% trans "Username" as tmsg %}{{ tmsg | force_escape }}{% trans "Full name" as tmsg %}{{ tmsg | force_escape }}{% trans "Email address" as tmsg %}{{ tmsg | force_escape }}
{{ order.user.username }}{{ order.user.get_full_name }}{{ order.user.email }}
{% trans "Customer has deleted their account." as tmsg %}{{ tmsg | force_escape }}
- {% endblock customer_information %} - - {% block order_information %} - - - - - - - - {% if order.is_fulfillable %} - - {% endif %} - - - - - - - {% if order.is_fulfillable %} - - {% endif %} - -
{% trans "Order information" as tmsg %}{{ tmsg | force_escape }}
{% trans "Order Total" as tmsg %}{{ tmsg | force_escape }}{% trans "Date of purchase" as tmsg %}{{ tmsg | force_escape }}{% trans "Time of purchase" as tmsg %}{{ tmsg | force_escape }}{% trans "Status" as tmsg %}{{ tmsg | force_escape }} Actions
{{ order.total_incl_tax|currency:order.currency }}{{ order.date_placed|date }}{{ order.date_placed|time }}{{ order.status|default:"N/A" }} - {% trans "Retry Fulfillment" as tmsg %}{{ tmsg | force_escape }} -
- {% endblock order_information %} - - {% block additional_order_information %} - {% endblock additional_order_information %} + {% block customer_information %} + + + {% if order.guest_email %} + + + + + + + + + {% elif order.user %} + + + + + + + + + {% else %} + + {% endif %} +
{% trans "Customer Information" %}
{% trans "Name" %}{% trans "Email address" %}
+ {% trans "Customer checked out as a guest." %} + {{ order.email }}
{% trans "Name" %}{% trans "Email address" %}
{{ order.user.get_full_name|default:"-" }}{{ order.user.email|default:"-" }}
{% trans "Customer has deleted their account." %}
+ {% endblock customer_information %} + + {% block order_information %} + + + + + + + + + + + + + + +
{% trans "Order information" %}
{% trans "Order Total" %}{% trans "Date of purchase" %}{% trans "Time of purchase" %}{% trans "Status" %}
{{ order.total_incl_tax|currency:order.currency }}{{ order.date_placed|date }}{{ order.date_placed|time }}{{ order.status|default:"N/A" }}
+ {% endblock order_information %} + + {% block additional_order_information %} + {% endblock additional_order_information %}
-

{% trans "Order Details" as tmsg %}{{ tmsg | force_escape }}

+

{% trans "Order Details" %}

-
+ {% endblock line_actions %} -
- {% csrf_token %} - {% block order_actions %} -
-

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

- {% if order_status_form.has_choices %} - {% include "oscar/partials/form_fields.html" with form=order_status_form %} - - - {% else %} - {% trans "This order can't have its status changed." as tmsg %}{{ tmsg | force_escape }} - {% endif %} -
- {% endblock %} + + {% csrf_token %} + {% block order_actions %} +
+

{% trans "Change order status" %}:

+ {% if order_status_form.has_choices %} + {% include "oscar/dashboard/partials/form_fields.html" with form=order_status_form %} + +
+ +
+ {% else %} + {% trans "This order can't have its status changed." %} + {% endif %} +
+ {% endblock %}
- {% block shipping_events %} -
-

{% trans "Shipping Events" as tmsg %}{{ tmsg | force_escape }}

-
- {% with events=order.shipping_events.all %} - - {% if events %} - - - - - - - - - - {% for event in events %} - {% with line_qtys=event.line_quantities.all %} - - - - - - - {% endwith %} - {% endfor %} - - {% else %} - - - - - - {% endif %} -
{% trans "Date" as tmsg %}{{ tmsg | force_escape }}{% trans "Event" as tmsg %}{{ tmsg | force_escape }}{% trans "Lines" as tmsg %}{{ tmsg | force_escape }}{% trans "Reference" as tmsg %}{{ tmsg | force_escape }}
{{ event.date_created }}{{ event.event_type.name }} - {% for line_qty in event.line_quantities.all %} - - {% filter force_escape %} - {% blocktrans with title=line_qty.line.title event_qty=line_qty.quantity total_qty=line_qty.line.quantity %} - {{ title }} (quantity {{ event_qty }}/{{ total_qty }}) - {% endblocktrans %} - {% endfilter %} - - {% endfor %} - {{ event.notes|default:"-" }}
{% trans "No shipping events." as tmsg %}{{ tmsg | force_escape }}
- {% endwith %} - {% endblock %} - - {% block payment_events %} -
-

{% trans "Payment Events" as tmsg %}{{ tmsg | force_escape }}

-
- {% with events=order.payment_events.all %} - - {% if events %} - - - - - - - - - - - {% for event in events %} - {% with line_qtys=event.line_quantities.all %} - - - - - - - - {% endwith %} - {% endfor %} - - {% else %} - - - - - - {% endif %} -
{% trans "Date" as tmsg %}{{ tmsg | force_escape }}{% trans "Event" as tmsg %}{{ tmsg | force_escape }}{% trans "Amount" as tmsg %}{{ tmsg | force_escape }}{% trans "Lines" as tmsg %}{{ tmsg | force_escape }}{% trans "Reference" as tmsg %}{{ tmsg | force_escape }}
{{ event.date_created }}{{ event.event_type.name }}{{ event.amount|currency:order.currency }} - {% for line_qty in event.line_quantities.all %} - {% trans "Product:" as tmsg %}{{ tmsg | force_escape }} {{ line_qty.line.title }} - {% trans "quantity" as tmsg %}{{ tmsg | force_escape }} - {{ line_qty.quantity }}
- {% endfor %} -
{{ event.reference|default:"-" }}
{% trans "No payment events." as tmsg %}{{ tmsg | force_escape }}
- {% endwith %} - {% endblock %} - - -
- {% block tab_shipping %} -
-

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

-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
{% trans "Method name" as tmsg %}{{ tmsg | force_escape }}{{ order.shipping_method }}
{% trans "Method code" as tmsg %}{{ tmsg | force_escape }}{{ order.shipping_code|upper }}
{% trans "Charge (incl tax)" as tmsg %}{{ tmsg | force_escape }}{{ order.shipping_incl_tax|currency:order.currency }}
{% trans "Charge (excl tax)" as tmsg %}{{ tmsg | force_escape }}{{ order.shipping_excl_tax|currency:order.currency }}
{% trans "Address" as tmsg %}{{ tmsg | force_escape }} - {% for field in order.shipping_address.active_address_fields %} - {{ field }}
- {% endfor %} - - {% trans "Update" as tmsg %}{{ tmsg | force_escape }} - -
{% trans "Phone" as tmsg %}{{ tmsg | force_escape }}{{ order.shipping_address.phone_number|default:"-" }}
{% trans "Instructions" as tmsg %}{{ tmsg | force_escape }}{{ order.shipping_address.notes|default:"-"|linebreaks }}
- {% endblock %} -
- -
- {% block tab_payment %} - - {% if order.billing_address %} -
-

{% trans "Billing address" as tmsg %}{{ tmsg | force_escape }}

-
-

- {% for field in order.billing_address.active_address_fields %} - {{ field }}
- {% endfor %} -

- {% endif %} - - {% with sources=order.sources.all %} + {% block order_status_changes %}
-

{% trans "Payment sources" as tmsg %}{{ tmsg | force_escape }}

+

{% trans "Status Changes" %}

- {% if sources %} - - - - - - - - - - - - {% for source in sources %} - - - - - - - - {% endfor %} - -
{% trans "Source" as tmsg %}{{ tmsg | force_escape }}{% trans "Allocation" as tmsg %}{{ tmsg | force_escape }}{% trans "Amount debited" as tmsg %}{{ tmsg | force_escape }}{% trans "Amount refunded" as tmsg %}{{ tmsg | force_escape }}{% trans "Reference" as tmsg %}{{ tmsg | force_escape }}
{{ source.source_type }}{{ source.amount_allocated|currency:order.currency }}{{ source.amount_debited|currency:order.currency }}{{ source.amount_refunded|currency:order.currency }}{{ source.reference|default:"-" }}
- {% else %} - - - - -
{% trans "No payment sources found for this order." as tmsg %}{{ tmsg | force_escape }}
- {% endif %} - {% endwith %} - - {% block payment_transactions %} - {% if payment_transactions %} -
-

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

-
- - - - - - - - - - - - {% for txn in payment_transactions %} - - - - - - - - {% endfor %} - -
{% trans "Source" as tmsg %}{{ tmsg | force_escape }}{% trans "Amount" as tmsg %}{{ tmsg | force_escape }}{% trans "Reference" as tmsg %}{{ tmsg | force_escape }}{% trans "Status" as tmsg %}{{ tmsg | force_escape }}{% trans "Date" as tmsg %}{{ tmsg | force_escape }}
{{ txn.source.source_type }}{{ txn.amount|currency:order.currency }}{{ txn.reference|default:"-" }}{{ txn.status|default:"-" }}{{ txn.date_created }}
- {% endif %} + {% with status_changes=order.status_changes.all %} + + {% if status_changes %} + + + + + + + + + {% for status_change in status_changes %} + + + + + + {% endfor %} + + {% else %} + + + + + + {% endif %} +
{% trans "From" %}{% trans "To" %}{% trans "Date" %}
{{ status_change.old_status }}{{ status_change.new_status }}{{ status_change.date_created }}
{% trans "No status changes." %}
+ {% endwith %} {% endblock %} - {% endblock %} -
- -
- {% block tab_discounts %} + {% block shipping_events %} +
+

{% trans "Shipping Events" %}

+
+ {% with events=order.shipping_events.all %} + + {% if events %} + + + + + + + + + + {% for event in events %} + {% with line_qtys=event.line_quantities.all %} + + + + + + + {% endwith %} + {% endfor %} + + {% else %} + + + + + + {% endif %} +
{% trans "Date" %}{% trans "Event" %}{% trans "Lines" %}{% trans "Reference" %}
{{ event.date_created }}{{ event.event_type.name }} + {% for line_qty in event.line_quantities.all %} + + {% blocktrans with title=line_qty.line.title event_qty=line_qty.quantity total_qty=line_qty.line.quantity %} + {{ title }} (quantity {{ event_qty }}/{{ total_qty }}) + {% endblocktrans %} + + {% endfor %} + {{ event.notes|default:"-" }}
{% trans "No shipping events." %}
+ {% endwith %} + {% endblock %} - {% with discounts=order.discounts.all %} + {% block payment_events %}
-

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

+

{% trans "Payment Events" %}

- {% if discounts %} - - - - - - - - - - - - - {% for discount in discounts %} - - - - - - - - - {% endfor %} - -
{% trans "Type" as tmsg %}{{ tmsg | force_escape }}{% trans "Voucher" as tmsg %}{{ tmsg | force_escape }}{% trans "Offer name" as tmsg %}{{ tmsg | force_escape }}{% trans "Frequency" as tmsg %}{{ tmsg | force_escape }}{% trans "Message" as tmsg %}{{ tmsg | force_escape }}{% trans "Amount" as tmsg %}{{ tmsg | force_escape }}
{{ discount.get_category_display }} - {{ discount.voucher.code|default:"-" }} - - {% if discount.offer %} - {{ discount.offer.name }} - {% else %} - {{ discount.offer_name }} - {% endif %} - {{ discount.frequency }}{{ discount.message|default:"-" }}{{ discount.amount|currency:order.currency }}
- {% else %} - - - - -
{% trans "No discounts were applied to this order." as tmsg %}{{ tmsg | force_escape }}
- {% endif %} - {% endwith %} - - {% endblock %} + {% with events=order.payment_events.all %} + + {% if events %} + + + + + + + + + + + {% for event in events %} + {% with line_qtys=event.line_quantities.all %} + + + + + + + + {% endwith %} + {% endfor %} + + {% else %} + + + + {% endif %} +
{% trans "Date" %}{% trans "Event" %}{% trans "Amount" %}{% trans "Lines" %}{% trans "Reference" %}
{{ event.date_created }}{{ event.event_type.name }}{{ event.amount|currency:order.currency }} + {% for line_qty in event.line_quantities.all %} + {% trans "Product:" %} {{ line_qty.line.title }} - {% trans "quantity" %} {{ line_qty.quantity }}
+ {% endfor %} +
{{ event.reference|default:"-" }}
{% trans "No payment events." %}
+ {% endwith %} + {% endblock %}
-
- {% block tab_notes %} -
-

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

-
- {% with notes=order.notes.all %} +
+ {% block tab_shipping %} +
+

{% trans "Shipping" %}

+
- {% if notes %} - - - - - - - - {% for note in notes %} + + + + + + + + + + + + + - - - - - + + + + + - {% endfor %} - {% else %} - - - - {% endif %} + + + + + + + + +
{% trans "Date" as tmsg %}{{ tmsg | force_escape }}{% trans "User" as tmsg %}{{ tmsg | force_escape }}{% trans "Type" as tmsg %}{{ tmsg | force_escape }}{% trans "Message" as tmsg %}{{ tmsg | force_escape }}{% trans "Admin" as tmsg %}{{ tmsg | force_escape }}
{% trans "Method name" %}{{ order.shipping_method }}
{% trans "Method code" %}{{ order.shipping_code|upper }}
{% trans "Charge (incl tax)" %}{{ order.shipping_incl_tax|currency:order.currency }}
{{ note.date_created }}{{ note.user|default:"-" }}{{ note.note_type|default:"-" }}{{ note.message|linebreaks }} - {% if note.is_editable %} -   - {% trans "Edit" as tmsg %}{{ tmsg | force_escape }} -
- {% csrf_token %} - - - -
- {% endif %} +
{% trans "Charge (excl tax)" %}{{ order.shipping_excl_tax|currency:order.currency }}
{% trans "Address" %} + {% for field in order.shipping_address.active_address_fields %} + {{ field }}
+ {% endfor %} + + {% trans "Update" %} +
{% trans "No notes available." as tmsg %}{{ tmsg | force_escape }}
{% trans "Phone" %}{{ order.shipping_address.phone_number|default:"-" }}
{% trans "Instructions" %}{{ order.shipping_address.notes|default:"-"|linebreaks }}
- {% endwith %} + {% endblock %} +
-
- {% csrf_token %} - - {% include "oscar/partials/form_fields.html" with form=note_form %} -
- - {% trans "Notes are only editable for 5 minutes after being saved." as tmsg %}{{ tmsg | force_escape }} -
-
- {% endblock %} +
+ {% block tab_payment %} + + {% if order.billing_address %} +
+

{% trans "Billing address" %}

+
+

+ {% for field in order.billing_address.active_address_fields %} + {{ field }}
+ {% endfor %} +

+ {% endif %} + + {% with sources=order.sources.all %} +
+

{% trans "Payment sources" %}

+
+ {% if sources %} + + + + + + + + + + + + {% for source in sources %} + + + + + + + + {% endfor %} + +
{% trans "Source" %}{% trans "Allocation" %}{% trans "Amount debited" %}{% trans "Amount refunded" %}{% trans "Reference" %}
{{ source.source_type }}{{ source.amount_allocated|currency:order.currency }}{{ source.amount_debited|currency:order.currency }}{{ source.amount_refunded|currency:order.currency }}{{ source.reference|default:"-" }}
+ {% else %} + + +
{% trans "No payment sources found for this order." %}
+ {% endif %} + {% endwith %} + + {% block payment_transactions %} + {% if payment_transactions %} +
+

{% trans "Transactions" %}

+
+ + + + + + + + + + + + {% for txn in payment_transactions %} + + + + + + + + {% endfor %} + +
{% trans "Source" %}{% trans "Amount" %}{% trans "Reference" %}{% trans "Status" %}{% trans "Date" %}
{{ txn.source.source_type }}{{ txn.amount|currency:order.currency }}{{ txn.reference|default:"-" }}{{ txn.status|default:"-" }}{{ txn.date_created }}
+ {% endif %} + {% endblock %} + + {% endblock %} +
+ +
+ {% block tab_discounts %} + + {% with discounts=order.discounts.all %} +
+

{% trans "Discounts" %}

+
+ {% if discounts %} + + + + + + + + + + + + + {% for discount in discounts %} + + + + + + + + + {% endfor %} + +
{% trans "Type" %}{% trans "Voucher" %}{% trans "Offer name" %}{% trans "Frequency" %}{% trans "Message" %}{% trans "Amount" %}
{{ discount.get_category_display }} + {{ discount.voucher.code|default:"-" }} + + {% if discount.offer %} + {{ discount.offer.name }} + {% else %} + {{ discount.offer_name }} + {% endif %} + {{ discount.frequency }}{{ discount.message|default:"-" }}{{ discount.amount|currency:order.currency }}
+ {% else %} + + +
{% trans "No discounts were applied to this order." %}
+ {% endif %} + {% endwith %} + + {% endblock %} +
+ +
+ {% block tab_notes %} +
+

{% trans "Notes" %}

+
+ {% with notes=order.notes.all %} + + {% if notes %} + + + + + + + + {% for note in notes %} + + + + + + + + {% endfor %} + {% else %} + + + + {% endif %} +
{% trans "Date" %}{% trans "User" %}{% trans "Type" %}{% trans "Message" %}{% trans "Admin" %}
{{ note.date_created }}{{ note.user|default:"-" }}{{ note.note_type|default:"-" }}{{ note.message|linebreaks }} + {% if note.is_editable %} + {% trans "Edit" %} +
+ {% csrf_token %} + + + +
+ {% endif %} +
{% trans "No notes available." %}
+ {% endwith %} + +
+ {% csrf_token %} + + {% include "oscar/dashboard/partials/form_fields.html" with form=note_form %} +
+ + {% trans "Notes are only editable for 5 minutes after being saved." %} +
+
+ {% endblock %}
- {% block extra_tabs %} -
- {% include "oscar/dashboard/partials/refund_table.html" with refunds=order.refunds.all %} -
- {% endblock %} + {% block extra_tabs %}{% endblock %}
{% endblock dashboard_content %} {% block onbodyload %} - {{ block.super }} - oscar.dashboard.orders.initTabs(); - oscar.dashboard.orders.initTable(); + {{ block.super }} + oscar.dashboard.orders.initTabs(); + oscar.dashboard.orders.initTable(); {% endblock %}