Skip to content

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

Improve markup in customer templates

Marcin Gębala2b68fefbc409
diff --git a/saleor/dashboard/templates/dashboard/customer/detail.html b/saleor/dashboard/templates/dashboard/customer/detail.html
index eb48fa1bb8..51c44c7938 100644
--- a/saleor/dashboard/templates/dashboard/customer/detail.html
+++ b/saleor/dashboard/templates/dashboard/customer/detail.html
@@ -10,49 +10,80 @@
<h1 class="page-header"><span class="glyphicon glyphicon-user"></span> {{ customer }}</h1>
<div class="col-lg-8">
- <div class="box">
- <div class="box-header">Order history</div>
- <table class="table">
- <thead>
- <tr>
- <th>{% trans "Order" %}</th>
- <th>{% trans "Date" %}</th>
- <th>{% trans "Payment" %}</th>
- <th>{% trans "Order status" %}</th>
- <th>{% trans "Total" %}</th>
- </tr>
- </thead>
- <tbody>
- {% for order in customer.orders.all %}
- <tr>
- <td><a href="{% url 'dashboard:order-details' pk=order.pk %}">{{ order }}</a></td>
- <td>{{ order.created }}</td>
- <td>{% include 'dashboard/includes/_status_label.html' with status=order.get_last_payment_status status_display=order.get_last_payment_status_display %}</td>
- <td>{% include 'dashboard/includes/_status_label.html' with status=order.status status_display=order.get_status_display %}</td>
- <td>{% gross order.get_total %}</td>
- </tr>
- {% endfor %}
- </tbody>
- </table>
+ <div class="panel panel-default">
+ <div class="panel-heading">
+ <span class="panel-title">Order history</span>
+ </div>
+ <div class="panel-body">
+ {% with customer.orders.all as orders %}
+ {% if orders %}
+ <table class="table">
+ <thead>
+ <tr>
+ <th>{% trans "Order" %}</th>
+ <th>{% trans "Date" %}</th>
+ <th>{% trans "Payment" %}</th>
+ <th>{% trans "Order status" %}</th>
+ <th>{% trans "Total" %}</th>
+ </tr>
+ </thead>
+ <tbody>
+ {% for order in orders %}
+ <tr>
+ <td><a href="{% url 'dashboard:order-details' pk=order.pk %}">{{ order }}</a></td>
+ <td>{{ order.created }}</td>
+ <td>{% include 'dashboard/includes/_status_label.html' with status=order.get_last_payment_status status_display=order.get_last_payment_status_display %}</td>
+ <td>{% include 'dashboard/includes/_status_label.html' with status=order.status status_display=order.get_status_display %}</td>
+ <td>{% gross order.get_total %}</td>
+ </tr>
+ {% endfor %}
+ </tbody>
+ </table>
+ {% else %}
+ <span>-</span>
+ {% endif %}
+ {% endwith %}
+ </div>
</div>
- <div class="box">
- <div class="box-header">{% trans "Customer notes" %}</div>
+ <div class="panel panel-default">
+ <div class="panel-heading">
+ <span class="panel-title">{% trans "Customer notes" %}</span>
+ </div>
+ <div class="panel-body">
+ <span>-</span>
+ </div>
</div>
</div>
<div class="col-lg-4">
- <div class="box">
- <div class="box-header">{% trans "Address" %}
- <span class="glyphicon glyphicon-user pull-right"></span>
+ <div class="panel panel-default">
+ <div class="panel-heading">
+ <span class="panel-title">{% trans "Address" %}</span>
+ </div>
+ <div class="panel-body">
+ <small>Default billing address</small>
+ <div>
+ {% if customer.default_billing_address %}
+ {% with customer.default_billing_address.address as address %}
+ {% include 'dashboard/includes/_address.html' with address=address only %}
+ {% endwith %}
+ {% else %}
+ <span>No default billing address</span>
+ {% endif %}
+ </div>
+ <small>Default shipping address</small>
+ <div>
+ {% if customer.default_shipping_address %}
+ {% with customer.default_shipping_address.address as address %}
+ {% include 'dashboard/includes/_address.html' with address=address only %}
+ {% endwith %}
+ {% else %}
+ <span>No default shipping address</span>
+ {% endif %}
+ </div>
+ <div>
+ <i class="glyphicon glyphicon-envelope"></i> {{ customer.email }}
+ </div>
</div>
- <small>Default billing address</small>
- {% with customer.default_billing_address.address as address %}
- {% include 'dashboard/includes/_address.html' with address=address only %}
- <span class="glyphicon glyphicon-envelope"></span>{{ customer.email }}
- {% endwith %}
-
- </div>
- <div class="box">
- <div class="box-header">Details</div>
</div>
</div>
</div>
diff --git a/saleor/dashboard/templates/dashboard/customer/list.html b/saleor/dashboard/templates/dashboard/customer/list.html
index 39c1d10d21..5ba449087b 100644
--- a/saleor/dashboard/templates/dashboard/customer/list.html
+++ b/saleor/dashboard/templates/dashboard/customer/list.html
@@ -13,7 +13,7 @@
<table class="table">
<thead>
- <th>{% trans "Name" %}</th>
+ <th>{% trans "Email" %}</th>
<th>{% trans "Location" %}</th>
<th>{% trans "Number of orders" %}</th>
<th>{% trans "Last order" %}</th>
@@ -21,9 +21,9 @@
<tbody>
{% for customer in object_list %}
<tr>
- {% with user.default_billing_address as default_address %}
+ {% with customer.default_billing_address as default_address %}
<td>
- <a href="{% url "dashboard:customer-details" pk=customer.pk %}">{{ default_address.address }}</a>
+ <a href="{% url "dashboard:customer-details" pk=customer.pk %}">{{ customer.email }}</a>
</td>
<td>
{{ default_address.address.city }}, {{ default_address.address.get_country_display }}