From c499946400c775f311d52236d9d1fef3f19a68ff Mon Sep 17 00:00:00 2001
From: Adam Carpenter <atc@53hor.net>
Date: Thu, 30 Apr 2020 21:31:30 -0400
Subject: moved search into InventorySearch and started work on filters;
 updated quantity display

---
 iridescence/src/components/InventoryCard.vue | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

(limited to 'iridescence/src/components/InventoryCard.vue')

diff --git a/iridescence/src/components/InventoryCard.vue b/iridescence/src/components/InventoryCard.vue
index 75e683a..6bcc548 100644
--- a/iridescence/src/components/InventoryCard.vue
+++ b/iridescence/src/components/InventoryCard.vue
@@ -15,7 +15,7 @@
           <p class="subtitle is-4">
             {{ dollars(cents) }}
           </p>
-          <p class="subtitle is-6">{{ quantity }} in stock.</p>
+          <p class="subtitle is-6">{{ stock }}</p>
         </div>
 
         <div class="content">
@@ -37,6 +37,17 @@ export default {
     imgPath: String,
     description: String
   },
+  computed: {
+    stock() {
+      if (this.quantity < 0) {
+        return "Made to order";
+      } else if (this.quantity == 0) {
+        return "Out of stock";
+      } else {
+        return [this.quantity, "in stock"].join(" ");
+      }
+    }
+  },
   methods: {
     dollars: cents => "$ " + (cents / 100).toFixed(2)
   }
-- 
cgit v1.2.3

