Skip to content
This repository has been archived by the owner on Nov 4, 2024. It is now read-only.

Commit

Permalink
fix: fixed css issues and dependency version
Browse files Browse the repository at this point in the history
  • Loading branch information
zubair-ce07 committed Sep 8, 2023
1 parent 0d7e5d8 commit 3acb165
Show file tree
Hide file tree
Showing 6 changed files with 147 additions and 123 deletions.
247 changes: 135 additions & 112 deletions ecommerce/templates/oscar/dashboard/orders/order_list.html
Original file line number Diff line number Diff line change
@@ -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. #}
<script type="text/javascript" src="{% url 'javascript-catalog' %}"></script>

{% compress js %}
<script src="{% static 'bower_components/js-cookie/src/js.cookie.js' %}" type="text/javascript"></script>
<script src="{% static 'vendor-extensions/oscar/js/add_message.js' %}" type="text/javascript"></script>
<script src="{% static 'vendor-extensions/oscar/js/order_actions.js' %}" type="text/javascript"></script>
{% endcompress %}
{% trans "Orders" %} | {{ block.super }}
{% endblock %}

{% block breadcrumbs %}
<ul class="breadcrumb">
<li>
<a href="{% url 'dashboard:index' %}">{% trans "Dashboard" as tmsg %}{{ tmsg | force_escape }}</a>
</li>
<li class="active">{% trans "Orders" as tmsg %}{{ tmsg | force_escape }}</li>
</ul>
<nav aria-label="breadcrumb">
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="{% url 'dashboard:index' %}">{% trans "Dashboard" %}</a></li>
<li class="breadcrumb-item active" aria-current="page">{% trans "Orders" %}</li>
</ol>
</nav>
{% endblock %}

{% block header %}
<div class="page-header">
<h1>{% trans "Orders" as tmsg %}{{ tmsg | force_escape }}</h1>
<h1>{% trans "Orders" %}</h1>
</div>
{% endblock header %}

{% block dashboard_content %}
{% include "oscar/dashboard/partials/search_form.html" %}
<div class="table-header">
<h3><i class="fas fa-search"></i> {% trans "Search" %}</h3>
</div>
<div class="card card-body bg-light">
<form method="get" class="form-inline" id="search_form">
{% for field in form %}
{% if "order" in field.id_for_label %}
{% if field.is_hidden %}
{% render_field field class+='form-control' %}
{% else %}
<div class="form-group mr-2">
{{ field.label_tag }}
{% render_field field class+='form-control' %}
{% for error in field.errors %}
<ul class="error-block">
<li>{{ error }}</li>
</ul>
{% endfor %}
</div>
{% endif %}
{% endif %}
{% endfor %}
<input type="submit" value="{% trans "Search" %}" class="btn btn-primary mr-2" />
<a data-toggle="modal" data-target="#SearchModal" href="#">{% trans "Advanced Search" %}</a>
</form>

{# 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 %}
<div class="search-filter-list">
<label>Filters:</label>
{% for filter in search_filters %}
<span class="badge badge-success">{{ filter }}</span>
{% endfor %}
</div>

{% endif %}
</div>

{% if orders %}
<form action="" method="post" class="order_table" id="orders_form">
{% csrf_token %}
{% if orders %}
<form method="post" class="order_table" id="orders_form">
{% csrf_token %}

{% block order_list %}
{% block order_list %}
<table class="table table-striped table-bordered table-hover">
<caption>
<h3 class="pull-left"><i class="icon-shopping-cart icon-large"></i>{{ queryset_description }}
<h3 class="float-left"><i class="fas fa-shopping-cart"></i>
{% if search_filters %}
{% trans "Order Search Results" %}
{% else %}
{% trans "All Orders" %}
{% endif %}
</h3>

<div class="pull-right">
<div class="float-right">
<div class="form-inline">
<label>{% trans "Download selected orders as a CSV" as tmsg %}{{ tmsg | force_escape }}</label>
<button type="submit" class="btn btn-primary" name="action"
value="download_selected_orders">{% trans "Download" as tmsg %}{{ tmsg | force_escape }}</button>
<label>{% trans "Download selected orders as a CSV" %}</label>
<button type="submit" class="btn btn-primary" name="action" value="download_selected_orders" data-loading-text="{% trans 'Submitting...' %}">{% trans "Download" %}</button>
</div>
</div>
</caption>

<thead>
<tr>
<th></th>
<th>{% anchor 'number' _("Order number") as tmsg %}{{ tmsg | force_escape }}</th>
<th>{% anchor 'total_incl_tax' _("Total inc tax") as tmsg %}{{ tmsg | force_escape }}</th>
<th>{% trans "Number of items" as tmsg %}{{ tmsg | force_escape }}</th>
<th>{% trans "Status" as tmsg %}{{ tmsg | force_escape }}</th>
<th>{% trans "Username" as tmsg %}{{ tmsg | force_escape }}</th>
<th>{% trans "Email" as tmsg %}{{ tmsg | force_escape }}</th>
<th>{% trans "Date of purchase" as tmsg %}{{ tmsg | force_escape }}</th>
<th></th>
</tr>
<tr>
<th></th>
<th>{% anchor 'number' _("Order number") %}</th>
<th>{% anchor 'total_incl_tax' _("Total inc tax") %}</th>
<th>{% trans "Number of items" %}</th>
<th>{% trans "Status" %}</th>
<th>{% trans "Customer" %}</th>
<th>{% trans "Shipping address" %}</th>
<th>{% trans "Billing address" %}</th>
<th>{% trans "Date of purchase" %}</th>
<th></th>
</tr>
</thead>
<tbody>
{% for order in orders %}
<tr data-order-number="{{ order.number }}">
<td><input type="checkbox" name="selected_order" class="selected_order"
value="{{ order.id }}"/></td>
<td><a href="{% url 'dashboard:order-detail' number=order.number %}">{{ order.number }}</a>
</td>
<tr>
<td><input type="checkbox" name="selected_order" class="selected_order" value="{{ order.id }}"/></td>
<td><a href="{% url 'dashboard:order-detail' number=order.number %}">{{ order.number }}</a></td>
<td>{{ order.total_incl_tax|currency:order.currency }}</td>
<td>{{ order.num_items }}</td>
<td class="order-status">{{ order.status|default:"-" }}</td>
<td>{{ order.status|default:"-" }}</td>
<td>
{% if order.user %}
<a href="{% url 'dashboard:user-detail' pk=order.user.id %}">{{ order.user.username }}</a>
{% if order.guest_email %}
{{ order.guest_email }}
{% elif order.user %}
<a href="{% url 'dashboard:user-detail' pk=order.user.id %}">{{ order.user.get_full_name|default:"-" }}</a>
{% else %}
&lt;{% trans "Deleted" as tmsg %}{{ tmsg | force_escape }}&gt;
&lt;{% trans "Deleted" %}&gt;
{% endif %}
</td>
<td>
{% if order.user %}
<a href="{% url 'dashboard:user-detail' pk=order.user.id %}">{{ order.user.email }}</a>
{% else %}
&lt;{% trans "Deleted" as tmsg %}{{ tmsg | force_escape }}&gt;
{% endif %}
</td>
<td>{{ order.shipping_address|default:"-" }}</td>
<td>{{ order.billing_address|default:"-" }}</td>
<td>{{ order.date_placed }}</td>
<td>
<a class="btn btn-info"
href="{% url 'dashboard:order-detail' number=order.number %}">{% trans "View" as tmsg %}{{ tmsg | force_escape }}</a>
{% if order.is_fulfillable %}
<a class="btn btn-warning" data-order-number="{{ order.number }}"
data-action="retry-fulfillment">{% trans "Retry Fulfillment" as tmsg %}{{ tmsg | force_escape }}</a>
{% endif %}
<a class="btn btn-secondary" href="{% url 'dashboard:order-detail' number=order.number %}">{% trans "View" %}</a>
</td>
</tr>
{% endfor %}
</tbody>
</table>
{% endblock order_list %}

{% block order_actions %}
<div class="well">
<h3><i class="icon-warning"></i> {% trans "Change order status" as tmsg %}{{ tmsg | force_escape }}:</h3>
{% if order_statuses %}
<div class="control-group">
<div class="controls">

<select name="new_status">
<option value=""> -- {% trans "choose new status" as tmsg %}{{ tmsg | force_escape }} --</option>
{% for status in order_statuses %}
<option>{{ status }}</option>
{% endfor %}
</select>

</div>
</div>
<button type="submit" name="action" value="change_order_statuses"
class="btn btn-primary">{% trans "Change status" as tmsg %}{{ tmsg | force_escape }}</button>
{% else %}
{% trans "This order can't have its status changed." as tmsg %}{{ tmsg | force_escape }}
{% endif %}
</div>
{% endblock %}


{% include "oscar/partials/pagination.html" %}
</form>
{% else %}
<table class="table table-striped table-bordered">
<caption><i class="icon-shopping-cart icon-large"></i>{{ queryset_description }}</caption>
<tr>
<td>{% trans "No orders found." as tmsg %}{{ tmsg | force_escape }}</td>
</tr>
</table>
{% endif %}

{% endblock dashboard_content %}

{% block onbodyload %}
{{ block.super }}
oscar.dashboard.orders.initTable();
oscar.dashboard.search.init();
{% endblock onbodyload %}
{% endblock order_list %}
{% block order_actions %}
<div class="card card-body bg-light">
<h3><i class="fas fa-exclamation-circle"></i> {% trans "Change order status" %}:</h3>
{% if order_statuses %}
<div class="form-group">
<div class="controls">
<select name="new_status">
<option value=""> -- {% trans "choose new status" %} -- </option>
{% for status in order_statuses %}
<option>{{ status }}</option>
{% endfor %}
</select>
</div>
</div>
<div class="flex-nowrap">
<button type="submit" name="action" value="change_order_statuses" class="btn btn-primary" data-loading-text="{% trans 'Changing...' %}">
{% trans "Change status" %}
</button>
</div>
{% else %}
{% trans "This order can't have its status changed." %}
{% endif %}
</div>
{% endblock %}

{% include "oscar/dashboard/partials/pagination.html" %}
</form>
{% else %}
<table class="table table-striped table-bordered">
<caption><i class="fas fa-shopping-cart"></i>
{% if search_filters %}
{% trans "Order Search Results" %}
{% else %}
{% trans "All Orders" %}
{% endif %}
</caption>
<tr><td>{% trans "No orders found." %}</td></tr>
</table>
{% endif %}

{% endblock dashboard_content %}

{% block onbodyload %}
{{ block.super }}
oscar.dashboard.orders.initTable();
{% if form.errors %}
$('#SearchModal').modal('show');
{% endif %}
{% endblock onbodyload %}
15 changes: 8 additions & 7 deletions ecommerce/templates/oscar/dashboard/refunds/refund_list.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,17 @@
{% endblock extrascripts %}

{% block breadcrumbs %}
<ul class="breadcrumb">
<li>
<a href="{% url 'dashboard:index' %}">{% trans "Dashboard" as tmsg %}{{ tmsg | force_escape }}</a>
</li>
<li class="active">{% trans "Refunds" as tmsg %}{{ tmsg | force_escape }}</li>
</ul>
<nav aria-label="breadcrumb">
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="{% url 'dashboard:index' %}">{% trans "Dashboard" %}</a></li>
<li class="breadcrumb-item active" aria-current="page">{% trans "Refunds" %}</li>
</ol>
</nav>
{% endblock breadcrumbs %}

{% block header %}
<div class="page-header">
<h1>{% trans "Refunds" as tmsg %}{{ tmsg | force_escape }}</h1>
<h1>{% trans "Refunds" %}</h1>
</div>
{% endblock header %}

Expand All @@ -45,6 +45,7 @@ <h1>{% trans "Refunds" as tmsg %}{{ tmsg | force_escape }}</h1>
{% if refunds %}
{% include "oscar/dashboard/partials/refund_action_modal.html" %}
{% block refund_list %}

<table class="table table-striped table-bordered table-hover">
<caption>
<h3 class="pull-left"><i class="icon-repeat icon-large icon-flip-horizontal"></i></h3>
Expand Down
2 changes: 1 addition & 1 deletion requirements/base.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion requirements/dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion requirements/production.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion requirements/test.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 3acb165

Please sign in to comment.