Commits

Kai Diefenbach committed df3d6d3

Cleaned up orders management; changed i18n message for "no orders".

  • Participants
  • Parent commits 31678d3

Comments (0)

Files changed (1)

lfs/templates/manage/order/orders_inline.html

 {% load i18n lfs_tags %}
 <h2>{% trans "Orders" %}</h2>
-<table class="lfs-manage-table">
-    <tr>
-        <th class="small">
-            {% trans 'Number' %}
-        </th>
-        <th class="small">
-            {% trans 'Date' %}
-        </th>
-        <th class="middle">
-			{% trans "Name" %}
-		</th>
-        <th class="small">
-            {% trans 'State' %}
-        </th>
-        <th class="tiny right-padding">
-            {% trans 'Price' %}
-        </th>
-        <th class="small right-padding">
-            {% trans 'Message' %}
-        </th>
-    </tr>
-	{% if page.object_list %}
-        {% for order in page.object_list %}
-			<tr class="clickable {% cycle 'even' 'odd' %}"
-			    onclick="window.location='{% url lfs.manage.views.order_view order.id %}'">
-                <td>
-                    {{ order.number|default_if_none:"-" }}
-                </td>
-                <td>
-                    {{ order.created|date:_("DATETIME_FORMAT") }}
-                </td>
-				<td>
-					{{ order.customer_firstname }}   {{ order.customer_lastname }}
-				</td>
-				<td>
-					{{ order.get_state_display }}
-				</td>
-                <td class="number">
-                    {{ order.price|currency:request }}
-                </td>
-                <td class="right-padding">
-                    {% if order.message %}
-                        {% trans "Yes" %}
-                    {% else %}
-                        {% trans "No" %}
-                    {% endif %}
-                </td>
-            </tr>
-        {% endfor %}
-	{% else	%}
-		<tr>
-			<td colspan="4">
-				{% trans "There are no orders" %}
-			</td>
-		</tr>
-	{% endif %}
-</table>
+
+{% if not page.object_list %}
+    <div>
+        {% trans "No orders found." %}
+    </div>
+{% else %}
+    <table class="lfs-manage-table">
+        <tr>
+            <th class="small">
+                {% trans 'Number' %}
+            </th>
+            <th class="small">
+                {% trans 'Date' %}
+            </th>
+            <th class="middle">
+                {% trans "Name" %}
+            </th>
+            <th class="small">
+                {% trans 'State' %}
+            </th>
+            <th class="tiny right-padding">
+                {% trans 'Price' %}
+            </th>
+            <th class="small right-padding">
+                {% trans 'Message' %}
+            </th>
+        </tr>
+            {% for order in page.object_list %}
+                <tr class="clickable {% cycle 'even' 'odd' %}"
+                    onclick="window.location='{% url lfs.manage.views.order_view order.id %}'">
+                    <td>
+                        {{ order.number|default_if_none:"-" }}
+                    </td>
+                    <td>
+                        {{ order.created|date:_("DATETIME_FORMAT") }}
+                    </td>
+                    <td>
+                        {{ order.customer_firstname }}   {{ order.customer_lastname }}
+                    </td>
+                    <td>
+                        {{ order.get_state_display }}
+                    </td>
+                    <td class="number">
+                        {{ order.price|currency:request }}
+                    </td>
+                    <td class="right-padding">
+                        {% if order.message %}
+                            {% trans "Yes" %}
+                        {% else %}
+                            {% trans "No" %}
+                        {% endif %}
+                    </td>
+                </tr>
+            {% endfor %}
+        </table>
+{% endif %}