From c10ddab30c0e037bf926bdcd74ad7a0bf3f42a29 Mon Sep 17 00:00:00 2001 From: Oliver Walters Date: Mon, 6 May 2019 08:09:29 +1000 Subject: [PATCH] Improve display of Build index --- .../build/templates/build/build_list.html | 10 ++++ InvenTree/build/templates/build/index.html | 60 ++++++++++--------- 2 files changed, 41 insertions(+), 29 deletions(-) diff --git a/InvenTree/build/templates/build/build_list.html b/InvenTree/build/templates/build/build_list.html index 890dd551b1..b423d214d9 100644 --- a/InvenTree/build/templates/build/build_list.html +++ b/InvenTree/build/templates/build/build_list.html @@ -12,6 +12,11 @@ Part Quantity Status + {% if completed %} + Completed + {% else %} + Created + {% endif %} @@ -21,6 +26,11 @@ {{ build.part.name }} {{ build.quantity }} {% include "build_status.html" with build=build %} + {% if completed %} + {{ build.completion_date }} + {% else %} + {{ build.creation_date }} + {% endif %} {% endfor %} diff --git a/InvenTree/build/templates/build/index.html b/InvenTree/build/templates/build/index.html index 46d3533651..f49499ab66 100644 --- a/InvenTree/build/templates/build/index.html +++ b/InvenTree/build/templates/build/index.html @@ -3,39 +3,26 @@ {% block content %} -

Active Builds

- -
-
- +
+
+

Part Builds

+
+
+
+
+ +
+
- - - - - - - - - - -{% for build in active %} - - - - - -{% endfor %} - -
BuildPartQuantityStatus
{{ build.title }}{{ build.part.name }}{{ build.quantity }}{% include "build_status.html" with build=build %} -
+
-

-{% include "build/build_list.html" with builds=completed title="Completed Builds" collapse_id="complete" %} -

-{% include "build/build_list.html" with builds=cancelled title="Cancelled Builds" collapse_id="cancelled" %} +{% include "build/build_list.html" with builds=active title="Active Builds" completed=False collapse_id='active' %} + +{% include "build/build_list.html" with builds=completed completed=True title="Completed Builds" collapse_id="complete" %} + +{% include "build/build_list.html" with builds=cancelled title="Cancelled Builds" completed=False collapse_id="cancelled" %} {% include 'modals.html' %} @@ -75,6 +62,21 @@ title: 'Status', sortable: true, } + { + title: 'Created', + sortable: true, + }, + { + title: 'Completed', + sortable: true, + formatter: function(value, row, index, field) { + if (value) { + return 'hello'; + } else { + return "---"; + } + }, + } ] });