Skip to content

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

Inline _orders_table template

Anna Siwikcefabf3791a2
diff --git a/templates/dashboard/includes/_orders_table.html b/templates/dashboard/includes/_orders_table.html
deleted file mode 100644
index 97cf597eb2..0000000000
--- a/templates/dashboard/includes/_orders_table.html
+++ /dev/null
@@ -1,53 +0,0 @@
-{% load i18n %}
-{% load prices_i18n %}
-{% load status %}
-{% load sorting_header from utils %}
-
-<div class="data-table-container">
- <table class="bordered highlight responsive data-table last-right-align">
- <thead>
- <tr>
- {% sorting_header 'pk' '#' %}
-
- <th></th>
-
- {% trans "Customer" context "Orders table header" as label %}
- {% sorting_header 'email' label %}
-
- {% trans "Placed on" context "Orders table header" as label %}
- {% sorting_header 'created' label %}
-
- {% trans "Payment status" context "Orders table header" as label %}
- {% sorting_header 'payment_status' label %}
-
- {% trans "Total" context "Orders table header" as label %}
- {% sorting_header 'total' label %}
- </tr>
- </thead>
- <tbody>
- {% for order in orders %}
- <tr data-action-go="{% url 'dashboard:order-details' order_pk=order.pk %}">
- <td>
- #{{ order.id }}
- </td>
- <td>
- {% render_status order.status order.get_status_display %}
- </td>
- {% trans "Guest" context "Anonymous user account value" as guest %}
- <td>
- {{ order.user|default:guest }}
- </td>
- <td>
- {{ order.created }}
- </td>
- <td>
- {% render_status order.get_last_payment_status order.get_last_payment_status_display %}
- </td>
- <td class="right-align">
- {% gross order.get_total html=True %}
- </td>
- </tr>
- {% endfor %}
- </tbody>
- </table>
-</div>
diff --git a/templates/dashboard/index.html b/templates/dashboard/index.html
index a2294997eb..bbf3b4edc0 100644
--- a/templates/dashboard/index.html
+++ b/templates/dashboard/index.html
@@ -1,6 +1,7 @@
{% extends "dashboard/base.html" %}
{% load i18n %}
{% load prices_i18n %}
+{% load render_status from status %}
{% block title %}
{{ block.super }}
@@ -70,7 +71,55 @@
</span>
</div>
{% if orders_to_ship %}
- {% include "dashboard/includes/_orders_table.html" with orders=orders_to_ship %}
+ <div class="data-table-container">
+ <table class="bordered highlight responsive data-table last-right-align">
+ <thead>
+ <tr>
+ <th>
+ #
+ </th>
+ <th></th>
+ <th>
+ {% trans "Customer" context "Orders table header" %}
+ </th>
+ <th>
+ {% trans "Placed on" context "Orders table header" %}
+ </th>
+ <th>
+ {% trans "Payment status" context "Orders table header" %}
+ </th>
+ <th>
+ {% trans "Total" context "Orders table header" %}
+ </th>
+ </tr>
+ </thead>
+ <tbody>
+ {% for order in orders_to_ship %}
+ <tr data-action-go="{% url 'dashboard:order-details' order_pk=order.pk %}">
+ <td>
+ #{{ order.id }}
+ </td>
+ <td>
+ {% render_status order.status order.get_status_display %}
+ </td>
+ {% trans "Guest" context "Anonymous user account value" as guest %}
+ <td>
+ {{ order.user|default:guest }}
+ </td>
+ <td>
+ {{ order.created }}
+ </td>
+ <td>
+ {% render_status order.get_last_payment_status order.get_last_payment_status_display %}
+ </td>
+ <td class="right-align">
+ {% gross order.get_total html=True %}
+ </td>
+ </tr>
+ {% endfor %}
+ </tbody>
+ </table>
+ </div>
{% else %}
<div class="card-content card-content--no-data not-found ">
<p class="grey-text">
diff --git a/templates/dashboard/order/list.html b/templates/dashboard/order/list.html
index 12c413c42b..47e0de3fc7 100644
--- a/templates/dashboard/order/list.html
+++ b/templates/dashboard/order/list.html
@@ -21,7 +21,54 @@
<div class="col s12 l9">
{% if orders %}
<div class="card">
- {% include "dashboard/includes/_orders_table.html" with orders=orders %}
+ <div class="data-table-container">
+ <table class="bordered highlight responsive data-table last-right-align">
+ <thead>
+ <tr>
+ {% sorting_header 'pk' '#' %}
+
+ <th></th>
+
+ {% trans "Customer" context "Orders table header" as label %}
+ {% sorting_header 'email' label %}
+
+ {% trans "Placed on" context "Orders table header" as label %}
+ {% sorting_header 'created' label %}
+
+ {% trans "Payment status" context "Orders table header" as label %}
+ {% sorting_header 'payment_status' label %}
+
+ {% trans "Total" context "Orders table header" as label %}
+ {% sorting_header 'total' label %}
+ </tr>
+ </thead>
+ <tbody>
+ {% for order in orders %}
+ <tr data-action-go="{% url 'dashboard:order-details' order_pk=order.pk %}">
+ <td>
+ #{{ order.id }}
+ </td>
+ <td>
+ {% render_status order.status order.get_status_display %}
+ </td>
+ {% trans "Guest" context "Anonymous user account value" as guest %}
+ <td>
+ {{ order.user|default:guest }}
+ </td>
+ <td>
+ {{ order.created }}
+ </td>
+ <td>
+ {% render_status order.get_last_payment_status order.get_last_payment_status_display %}
+ </td>
+ <td class="right-align">
+ {% gross order.get_total html=True %}
+ </td>
+ </tr>
+ {% endfor %}
+ </tbody>
+ </table>
+ </div>
</div>
<div class="row">
{% paginate orders %}