Skip to content

Commit

Permalink
Merge pull request saleor#1552 from mad-anne/fix-dashboard
Browse files Browse the repository at this point in the history
Fix missing import and filters in dashboard
  • Loading branch information
Marcin Gębala authored Jan 3, 2018
2 parents 769eed6 + cefabf3 commit cbe947a
Show file tree
Hide file tree
Showing 5 changed files with 104 additions and 54 deletions.
3 changes: 3 additions & 0 deletions saleor/dashboard/product/filters.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,9 @@ class StockLocationFilter(SortedFilterSet):
'Stock location list filter label', 'Sort by'),
fields=STOCK_LOCATION_SORT_BY_FIELDS.keys(),
field_labels=STOCK_LOCATION_SORT_BY_FIELDS)
name = CharFilter(
label=pgettext_lazy('Stock location list filter label', 'Name'),
lookup_expr='icontains')

class Meta:
model = StockLocation
Expand Down
52 changes: 0 additions & 52 deletions templates/dashboard/includes/_orders_table.html

This file was deleted.

51 changes: 50 additions & 1 deletion templates/dashboard/index.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{% extends "dashboard/base.html" %}
{% load i18n %}
{% load prices_i18n %}
{% load render_status from status %}

{% block title %}
{{ block.super }}
Expand Down Expand Up @@ -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">
Expand Down
49 changes: 48 additions & 1 deletion templates/dashboard/order/list.html
Original file line number Diff line number Diff line change
Expand Up @@ -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 %}
Expand Down
3 changes: 3 additions & 0 deletions templates/dashboard/product/stock_location/list.html
Original file line number Diff line number Diff line change
Expand Up @@ -69,5 +69,8 @@
{% endif %}
{% endif %}
</div>
<div class="col s12 l3" id="filters">
{% if not is_empty %}{% filters filter_set %}{% endif %}
</div>
</div>
{% endblock %}

0 comments on commit cbe947a

Please sign in to comment.