Saleor Core: the high performance, composable, headless commerce API.
Python cartcheckoutcommercecomposablee-commerceecommercegraphqlheadlessheadless-commercemultichannelomsorder-managementpaymentspimpythonshopshopping-cartstore
Improve order details page
Patryk Zawadzki7c5078a30ecf
diff --git a/saleor/dashboard/templates/dashboard/order/detail.html b/saleor/dashboard/templates/dashboard/order/detail.htmlindex 7b4ea26770..db53399848 100644--- a/saleor/dashboard/templates/dashboard/order/detail.html+++ b/saleor/dashboard/templates/dashboard/order/detail.html@@ -14,68 +14,61 @@</div><div class="row"><div class="col-lg-8">- <div class="panel panel-default">- <div class="panel-heading">- <span class="panel-title">Order contents</span>- </div>- <div class="panel-body">- {% for group in groups %}- <table class="table">- <thead>- <tr>- <th colspan=6>- <span>Delivery group #{{ group.pk }} {% render_status group.status group.get_status_display %}</span>- </th>- </tr>- <tr>- <th class="col-sm-5">{% trans "Item" %}</th>- <th class="col-sm-2 text-right">{% trans "Price" %}</th>- <th class="col-sm-2 text-right">{% trans "Quantity" %}</th>- <th class="col-sm-2 text-right">{% trans "Total" %}</th>- <th class="col-sm-1"></th>- </tr>- </thead>- <tfoot>+ {% for group in groups %}+ <div class="panel panel-default">+ <div class="panel-heading">+ <span class="panel-title">Delivery group #{{ group.pk }} <span class="pull-right">{% render_status group.status group.get_status_display %}</span></span>+ </div>+ <table class="table">+ <thead>+ <tr>+ <th class="col-sm-5">{% trans "Item" %}</th>+ <th class="col-sm-2 text-right">{% trans "Price" %}</th>+ <th class="col-sm-2 text-right">{% trans "Quantity" %}</th>+ <th class="col-sm-2 text-right">{% trans "Total" %}</th>+ <th class="col-sm-1"></th>+ </tr>+ </thead>+ <tfoot>+ <tr>+ <td colspan="3">+ <strong>{{ group.get_method }}</strong><br>+ {% trans "Shipping address" %}: {% include "dashboard/includes/address_short.html" with address=group.address order_pk=order.pk group_pk=group.pk %}+ </td>+ <td class="text-right">+ {% gross group.price %}+ </td>+ <td class="text-right">+ <a class="btn btn-default btn-sm" data-target="#base-modal" href="{% url 'dashboard:ship-delivery-group' pk=group.pk %}" data-toggle="modal" {% if not group.can_ship %}disabled{% endif %}><i class="glyphicon glyphicon-plane"></i> {% trans "Ship" %}</a>+ </td>+ </tr>+ <tr>+ <th colspan="3">{% trans "Total" %}</th>+ <td class="text-right">+ <strong>{% gross group.get_total %}</strong>+ </td>+ <td></td>+ </tr>+ </tfoot>+ <tbody>+ {% for item in group.items.all %}<tr>- <td colspan="3">- <strong>{{ group.get_method }}</strong><br>- {% trans "Shipping address" %}: {% include "dashboard/includes/address_short.html" with address=group.address order_pk=order.pk group_pk=group.pk %}+ <td>+ {% if item.product %}<a href="{% url "dashboard:product-update" pk=item.product.id %}">{{ item.product_name }}</a>{% else %}{{ item.product_name }}{% endif %}<br>+ <strong>SKU:</strong> {{ item.product_sku }}</td>+ <td class="text-right">{% gross item.get_price_per_item %}</td>+ <td class="text-right">{{ item.quantity }}</td>+ <td class="text-right">{% gross item.get_total %}</td><td class="text-right">- {% gross group.price %}+ <a class="btn btn-primary btn-sm" data-target="#base-modal" href="{% url 'dashboard:order-line-edit' pk=item.pk %}" data-toggle="modal" {% if group.status != 'new' %}disabled{% endif %} title="{% trans "Edit" %}"><i class="glyphicon glyphicon-pencil"></i></a></td>- <td class="text-right">- <a class="btn btn-default btn-sm" data-target="#base-modal" href="{% url 'dashboard:ship-delivery-group' pk=group.pk %}" data-toggle="modal" {% if not group.can_ship %}disabled{% endif %}><i class="glyphicon glyphicon-plane"></i> {% trans "Ship" %}</a>- </td>- </tr>- <tr>- <th colspan="3">{% trans "Total" %}</th>- <td class="text-right">- <strong>{% gross group.get_total %}</strong>- </td>- <td></td></tr>- </tfoot>- <tbody>- {% for item in group.items.all %}- <tr>- <td>- {% if item.product %}<a href="{% url "dashboard:product-update" pk=item.product.id %}">{{ item.product_name }}</a>{% else %}{{ item.product_name }}{% endif %}<br>- <strong>SKU:</strong> {{ item.product_sku }}- </td>- <td class="text-right">{% gross item.get_price_per_item %}</td>- <td class="text-right">{{ item.quantity }}</td>- <td class="text-right">{% gross item.get_total %}</td>- <td class="text-right">- <a class="btn btn-primary btn-sm" data-target="#base-modal" href="{% url 'dashboard:order-line-edit' pk=item.pk %}" data-toggle="modal" {% if group.status != 'new' %}disabled{% endif %} title="{% trans "Edit" %}"><i class="glyphicon glyphicon-pencil"></i></a>- </td>- </tr>- {% endfor %}- </tbody>- </table>- {% endfor %}+ {% endfor %}+ </tbody>+ </table></div>- </div>+ {% endfor %}<div class="panel panel-default"><div class="panel-heading"><span class="panel-title">{% trans "Manage payment" %}</span></div><div class="panel-body">@@ -101,54 +94,56 @@<div class="panel-heading"><span class="panel-title">History</span></div>- <div class="panel-body">- <ul class="nav nav-tabs" role="tablist">- <li class="active"><a href="#order-history" role="tab" data-toggle="tab">{% trans "Order history" %}</a></li>- <li><a href="#payment-history" role="tab" data-toggle="tab">{% trans "Payment history" %}</a></li>- </ul>- <div class="tab-content">- <div class="tab-pane active" id="order-history">- <table class="table">- <thead>- <tr>- <th class="col-sm-3">Date</th>- <th class="col-sm-3">Order status</th>- <th class="col-sm-2">User</th>- <th class="col-sm-4">Comment</th>- </tr>- </thead>- <tbody>- {% for event in order.history.all %}- <tr>- <td>{{ event.date }}</td>- <td>{% render_status event.status event.get_status_display %}</td>- <td>{{ event.user|default:"-" }}</td>- <td>{{ event.comment|default:"-" }}</td>- </tr>- {% endfor %}- </tbody>- </table>- </div>- <div class="tab-pane" id="payment-history">- <table class="table">- <thead>- <tr>- <th class="col-sm-2">{% trans "Number" %}</th>- <th class="col-sm-3">{% trans "Date" %}</th>- <th class="col-sm-7">{% trans "Payment status" %}</th>- </tr>- </thead>- <tbody>- {% for payment in order.payments.all %}- <tr>- <td><a href="{% url "dashboard:payment-details" pk=payment.pk %}">#{{ payment.id }}</a></td>- <td>{{ payment.created }}</td>- <td>{% render_status payment.status payment.get_status_display %}</td>- </tr>- {% endfor %}- </tbody>- </table>- </div>+ <ul class="nav nav-tabs" role="tablist">+ <li class="active"><a href="#order-history" role="tab" data-toggle="tab">{% trans "Order history" %}</a></li>+ <li><a href="#payment-history" role="tab" data-toggle="tab">{% trans "Payment history" %}</a></li>+ </ul>+ <div class="tab-content">+ <div class="tab-pane active" id="order-history">+ <table class="table">+ <thead>+ <tr>+ <th class="col-sm-3">Date</th>+ <th class="col-sm-3">Order status</th>+ <th class="col-sm-2">User</th>+ <th class="col-sm-4">Comment</th>+ </tr>+ </thead>+ <tbody>+ {% for event in order.history.all %}+ <tr>+ <td>{{ event.date }}</td>+ <td>{% render_status event.status event.get_status_display %}</td>+ <td>+ {% if event.user %}+ {{ event.user }}+ {% endif %}+ </td>+ <td>{{ event.comment|default:"" }}</td>+ </tr>+ {% endfor %}+ </tbody>+ </table>+ </div>+ <div class="tab-pane" id="payment-history">+ <table class="table">+ <thead>+ <tr>+ <th class="col-sm-2">{% trans "Number" %}</th>+ <th class="col-sm-3">{% trans "Date" %}</th>+ <th class="col-sm-7">{% trans "Payment status" %}</th>+ </tr>+ </thead>+ <tbody>+ {% for payment in order.payments.all %}+ <tr>+ <td><a href="{% url "dashboard:payment-details" pk=payment.pk %}">#{{ payment.id }}</a></td>+ <td>{{ payment.created }}</td>+ <td>{% render_status payment.status payment.get_status_display %}</td>+ </tr>+ {% endfor %}+ </tbody>+ </table></div></div></div>