Browse Source

Change most things to uppercase. Slight css changes.

Lee Morgan 6 years ago
parent
commit
badef79da3

+ 3 - 3
controllers/ingredientData.js

@@ -12,7 +12,7 @@ module.exports = {
                 return res.json(ingredients);
             })
             .catch((err)=>{
-                return res.json("Error: unable to retrieve ingredients");
+                return res.json("ERROR: UNABLE TO RETRIEVE INGREDIENTS");
             });
     },
 
@@ -31,7 +31,7 @@ module.exports = {
     */
     createIngredient: function(req, res){
         if(!req.session.user){
-            req.session.error = "Must be logged in to do that";
+            req.session.error = "MUST BE LOGGED IN TO DO THAT";
             return res.redirect("/");
         }
 
@@ -63,7 +63,7 @@ module.exports = {
                 return res.json(newIngredient);
             })
             .catch((err)=>{
-                return res.json("Error: unable to create new ingredient");
+                return res.json("ERROR: UNABLE TO CREATE NEW INGREDIENT");
             });
     }
 }

+ 22 - 22
controllers/merchantData.js

@@ -47,12 +47,12 @@ module.exports = {
                     return res.redirect("/dashboard");
                 })
                 .catch((err)=>{
-                    req.session.error = "Error: Unable to create account at this time";
+                    req.session.error = "ERROR: UNABLE TO CREATE ACCOUNT AT THIS TIME";
 
                     return res.redirect("/");
                 });
         }else{
-            req.session.error = "Error: Passwords must match";
+            req.session.error = "PASSWORDS DO NOT MATCH";
 
             return res.redirect("/");
         }
@@ -94,7 +94,7 @@ module.exports = {
 
                         Recipe.create(recipes)
                             .catch((err)=>{
-                                req.session.error = "Error: unable to create your recipes from Clover.  Try using updating your recipes on the recipe page."
+                                req.session.error = "ERROR: UNABLE TO CREATE YOUR RECIPES FROM CLOVER."
                             })
 
                         merchant.save()
@@ -105,20 +105,20 @@ module.exports = {
                                 return res.redirect("/dashboard");
                             })
                             .catch((err)=>{
-                                req.session.error = "Error: unable to save data from Clover";
+                                req.session.error = "ERROR: UNABLE TO SAVE DATA FROM CLOVER";
 
                                 return res.redirect("/");
                             });
                     })
                     .catch((err)=>{
-                        req.session.error = "Error: unable to retrieve necessary data from Clover";
+                        req.session.error = "ERROR: UNABLE TO RETRIEVE DATA FROM CLOVER";
                         return res.redirect("/");
                     })
 
                 
             })
             .catch((err)=>{
-                req.session.error = "Error: Unable to retrieve data from Clover";
+                req.session.error = "ERROR: UNABLE TO RETRIEVE DATA FROM CLOVER";
 
                 return res.redirect("/");
             });
@@ -127,14 +127,14 @@ module.exports = {
     //DELETE - removes a single recipe from the merchant
     removeRecipe: function(req, res){
         if(!req.session.user){
-            req.session.error = "Must be logged in to do that";
+            req.session.error = "MUST BE LOGGED IN TO DO THAT";
             return res.redirect("/");
         }
 
         Merchant.findOne({_id: req.session.user})
             .then((merchant)=>{
                 if(merchant.pos === "clover"){
-                    return res.json("Error: you must edit your recipes inside Clover");
+                    return res.json("YOU MUST EDIT YOUR RECIPES INSIDE CLOVER");
                 }
                 
                 for(let i = 0; i < merchant.recipes.length; i++){
@@ -149,11 +149,11 @@ module.exports = {
                         return res.json({});
                     })
                     .catch((err)=>{
-                        return res.json("Error: unable to save data")
+                        return res.json("ERROR: UNABLE TO SAVE DATA");
                     })
             })
             .catch((err)=>{
-                return res.json("Error: unable to retrieve merchant data");
+                return res.json("ERROR: UNABLE TO RETRIEVE USER DATA");
             });
     },
 
@@ -166,7 +166,7 @@ module.exports = {
     */
     addMerchantIngredient: function(req, res){
         if(!req.session.user){
-            req.session.error = "Must be logged in to do that";
+            req.session.error = "MUST BE LOGGED IN TO DO THAT";
             return res.redirect("/");
         }
 
@@ -184,7 +184,7 @@ module.exports = {
                 for(let i = 0; i < req.body.length; i++){
                     for(let j = 0; j < merchant.inventory.length; j++){
                         if(merchant.inventory[j].ingredient.toString() === req.body[i].id){
-                            return res.json("Error: Duplicate ingredient detected");
+                            return res.json("ERROR: DUPLICATE INGREDIENT DETECTED");
                         }
                     }
                     
@@ -199,18 +199,18 @@ module.exports = {
                         return res.json({});
                     })
                     .catch((err)=>{
-                        return res.json("Error: unable to save new ingredient");
+                        return res.json("ERROR: UNABLE TO SAVE NEW INGREDIENT");
                     });
             })
             .catch((err)=>{
-                return res.json("Error: unable to retrieve user data");
+                return res.json("ERROR: UNABLE TO RETRIEVE USER DATA");
             });
     },
 
     //POST - Removes an ingredient from the merchant's inventory
     removeMerchantIngredient: function(req, res){
         if(!req.session.user){
-            req.session.error = "Must be logged in to do that";
+            req.session.error = "MUST BE LOGGED IN TO DO THAT";
             return res.redirect("/");
         }
 
@@ -228,11 +228,11 @@ module.exports = {
                         return res.json({});
                     })
                     .catch((err)=>{
-                        return res.json("Error: unable to save user data");
+                        return res.json("ERROR: UNABLE TO SAVE USER DATA");
                     });
             })
             .catch((err)=>{
-                return res.json("Error: unable to retrieve user data");
+                return res.json("ERROR: UNABLE TO RETRIEVE USER DATA");
             });
     },
 
@@ -245,7 +245,7 @@ module.exports = {
     */
     updateMerchantIngredient: function(req, res){
         if(!req.session.user){
-            req.session.error = "Must be logged in to do that";
+            req.session.error = "MUST BE LOGGED IN TO DO THAT";
             return res.redirect("/");
         }
 
@@ -287,11 +287,11 @@ module.exports = {
                         return;
                     })
                     .catch((err)=>{
-                        return res.json("Error: your data could not be saved");
+                        return res.json("ERROR: UNABLE TO SAVE DATA");
                     })
             })
             .catch((err)=>{
-                return res.json("Error: your data could not be retrieved");
+                return res.json("ERROR: UNABLE TO RETRIEVE DATA");
             });        
     },
 
@@ -319,12 +319,12 @@ module.exports = {
 
                     return merchant.save();
                 }else{
-                    req.session.error = "Error: unable to retrieve merchant data";
+                    req.session.error = "ERROR: UNABLE TO RETRIEVE USER DATA";
                     return res.redirect("/");
                 }
             })
             .then((merchant)=>{
-                req.session.error = "Password successfully reset.  Please log in";
+                req.session.error = "PASSWORD SUCCESSFULLY RESET. PLEASE LOG IN";
                 return res.redirect("/");
             })
             .catch((err)=>{});

+ 6 - 6
controllers/orderData.js

@@ -20,7 +20,7 @@ module.exports = {
     */
     getOrders: function(req, res){
         if(!req.session.user){
-            req.session.error = "Must be logged in to do that";
+            req.session.error = "MUST BE LOGGED IN TO DO THAT";
             return res.redirect("/");
         }
 
@@ -38,7 +38,7 @@ module.exports = {
                 return res.json(orders);
             })
             .catch((err)=>{
-                return res.json("Error: unable to retrieve your orders");
+                return res.json("ERROR: UNABLE TO RETRIEVE YOUR ORDERS");
             });
     },
 
@@ -56,7 +56,7 @@ module.exports = {
     */ 
     createOrder: function(req, res){
         if(!req.session.user){
-            req.session.error = "Must be logged in to do that";
+            req.session.error = "MUST BE LOGGED IN TO DO THAT";
             return res.redirect("/");
         }
 
@@ -72,7 +72,7 @@ module.exports = {
                 res.json(response);
             })
             .catch((err)=>{
-                return res.json("Error: unable to save the new order");
+                return res.json("ERROR: UNABLE TO SAVE ORDER");
             });
 
         Merchant.findOne({_id: req.session.user})
@@ -98,7 +98,7 @@ module.exports = {
     */
     removeOrder: function(req, res){
         if(!req.session.user){
-            req.session.error = "Must be logged in to do that";
+            req.session.error = "MUST BE LOGGED IN TO DO THAT";
             return res.redirect("/");
         }
 
@@ -107,7 +107,7 @@ module.exports = {
                 return res.json({});
             })
             .catch((err)=>{
-                return res.json("Error: unable to delete the order");
+                return res.json("ERROR: UNABLE TO REMOVE ORDER");
             });
     }
 }

+ 5 - 5
controllers/otherData.js

@@ -21,17 +21,17 @@ module.exports = {
                             req.session.user = merchant._id;
                             return res.redirect("/dashboard");
                         }else{
-                            req.session.error = "Invalid email or password";
+                            req.session.error = "INVALID EMAIL OR PASSWORD";
                             return res.redirect("/");
                         }
                     });
                 }else{
-                    req.session.error = "Invalid email or password";
+                    req.session.error = "INVALID EMAIL OR PASSWORD";
                     return res.redirect("/");
                 }
             })
             .catch((err)=>{
-                req.session.error = "There was an error and your data could not be retrieved";
+                req.session.error = "ERROR: UNABLE TO RETRIEVE USER DATA";
 
                 return res.redirect("/");
             });
@@ -89,12 +89,12 @@ module.exports = {
                         }
                     })
                     .catch((err)=>{
-                        req.session.error = "Error: there was an oopsies";
+                        req.session.error = "ERROR: WE MADE AN OOPSIES";
                     });
                 
             })
             .catch((err)=>{
-                req.session.error = "Error: Unable to retrieve data from Clover";
+                req.session.error = "ERROR: UNABLE TO RETRIEVE DATA FROM CLOVER";
                 return res.redirect("/");
             });
     }

+ 7 - 7
controllers/recipeData.js

@@ -17,7 +17,7 @@ module.exports = {
     */
     createRecipe: function(req, res){
         if(!req.session.user){
-            req.session.error = "Must be logged in to do that";
+            req.session.error = "MUST BE LOGGED IN TO DO THAT";
             return res.redirect("/");
         }
 
@@ -39,11 +39,11 @@ module.exports = {
                 merchant.recipes.push(recipe);
                 merchant.save()
                     .catch((err)=>{
-                        return res.json("Error: unable to save recipe");
+                        return res.json("ERROR: UNABLE TO SAVE RECIPE");
                     });
             })
             .catch((err)=>{
-                return res.json("Error: unable to retrieve user data");
+                return res.json("ERROR: UNABLE TO RETRIEVE USER DATA");
             });
 
         recipe.save()
@@ -51,7 +51,7 @@ module.exports = {
                 return res.json(newRecipe);
             })
             .catch((err)=>{
-                return res.json("Error: unable to save new ingredient");
+                return res.json("ERROR: UNABLE TO SAVE INGREDIENT");
             });
     },
 
@@ -69,7 +69,7 @@ module.exports = {
     */
     updateRecipe: function(req, res){
         if(!req.session.user){
-            req.session.error = "Must be logged in to do that";
+            req.session.error = "MUST BE LOGGED IN TO DO THAT";
             return res.redirect("/");
         }
 
@@ -90,7 +90,7 @@ module.exports = {
                 return res.json({});
             })
             .catch((err)=>{
-                return res.json("Error: unable to update your recipe");
-            })
+                return res.json("ERROR: UNABLE TO UPDATE RECIPE");
+            });
     }
 }

+ 3 - 3
controllers/renderer.js

@@ -30,7 +30,7 @@ module.exports = {
     */
     displayDashboard: function(req, res){
         if(!req.session.user){
-            req.session.error = "You must be logged in to view that page";
+            req.session.error = "MUST BE LOGGED IN TO DO THAT";
             return res.redirect("/");
         }
 
@@ -148,13 +148,13 @@ module.exports = {
                         .catch((err)=>{});
                         
                 }else{
-                    req.session.error = "Error: WEBSITE PANIC";
+                    req.session.error = "ERROR: WEBSITE PANIC!";
                     
                     return res.redirect("/");
                 }
             })
             .catch((err)=>{
-                req.session.error = "Error: could not retrieve user data";
+                req.session.error = "ERROR: COULD NOT RETRIEVE USER DATA";
                 
                 return res.redirect("/");
             });

+ 3 - 3
controllers/transactionData.js

@@ -69,7 +69,7 @@ module.exports = {
     */
     createTransaction: function(req, res){
         if(!req.session.user){
-            req.session.error = "Must be logged in to do that";
+            req.session.error = "MUST BE LOGGED IN TO DO THAT";
             return res.redirect("/");
         }
 
@@ -94,7 +94,7 @@ module.exports = {
     */
     remove: function(req, res){
         if(!req.session.user){
-            req.session.error = "Must be logged in to do that";
+            req.session.error = "MUST BE LOGGED IN TO DO THAT";
             return res.redirect("/");
         }
 
@@ -103,7 +103,7 @@ module.exports = {
                 return res.json({});
             })
             .catch((err)=>{
-                return res.json("Error: unable to delete the transaction");
+                return res.json("ERROR: UNABLE TO DELETE TRANSACTION");
             });
     }
 }

+ 1 - 1
views/dashboardPage/dashboard.css

@@ -147,7 +147,7 @@ Multi-strand use classes
         border: none;
         color: blue;
         text-decoration: underline;
-        font-size: 18px;
+        font-size: 15px;
         margin-top: auto;
         cursor: pointer;
     }

+ 16 - 37
views/dashboardPage/dashboard.ejs

@@ -14,7 +14,7 @@
             <div id="max" class="menuHead">
                 <a href="/">
                     <img class="menuLogo" src="/shared/images/logo.png" alt="The Subline">
-                    <p>The Subline</p>
+                    <p>THE SUBLINE</p>
                 </a>
         
                 <button onclick="changeMenu()">&#8801;</button>
@@ -33,7 +33,7 @@
                     <path d="M3 9l9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z"></path>
                     <polyline points="9 22 9 12 15 12 15 22"></polyline>
                 </svg>
-                <p>Home</p>
+                <p>HOME</p>
             </button>
         
             <button id="ingredientsBtn" onclick="changeStrand('ingredientsStrand')">
@@ -42,7 +42,7 @@
                     <rect x="1" y="3" width="22" height="5"></rect>
                     <line x1="10" y1="12" x2="14" y2="12"></line>
                 </svg>
-                <p>Ingredients</p>
+                <p>INGREDIENTS</p>
             </button>
         
             <button id="recipeBookBtn" onclick="changeStrand('recipeBookStrand')">
@@ -50,7 +50,7 @@
                     <path d="M4 19.5A2.5 2.5 0 0 1 6.5 17H20"></path>
                     <path d="M6.5 2H20v20H6.5A2.5 2.5 0 0 1 4 19.5v-15A2.5 2.5 0 0 1 6.5 2z"></path>
                 </svg>
-                <p>Recipe Book</p>
+                <p>RECIPE BOOK</p>
             </button>
         
             <button id="ordersBtn" onclick="changeStrand('ordersStrand')">
@@ -59,7 +59,7 @@
                     <circle cx="20" cy="21" r="1"></circle>
                     <path d="M1 1h4l2.68 13.39a2 2 0 0 0 2 1.61h9.72a2 2 0 0 0 2-1.61L23 6H6"></path>
                 </svg>
-                <p>Orders</p>
+                <p>ORDERS</p>
             </button>
 
             <button id="transactionsBtn" onclick="changeStrand('transactionsStrand')">
@@ -67,11 +67,11 @@
                     <rect x="1" y="4" width="22" height="16" rx="2" ry="2"></rect>
                     <line x1="1" y1="10" x2="23" y2="10"></line>
                 </svg>
-                <p>Transactions</p>
+                <p>TRANSACTIONS</p>
             </button>
         
             <a class="logout" href="/logout">
-                <p>Logout</p>
+                <p>LOGOUT</p>
         
                 <svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
                     <path d="M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4"></path>
@@ -85,7 +85,7 @@
             <% include ../shared/banner %>
             
             <div id="homeStrand" class="strand">
-                <h1 class="strandTitle">Dashboard</h1>
+                <h1 class="strandTitle">DASHBOARD</h1>
 
                 <div class="flexRow">
                     <div id="revenueCard" class="card">
@@ -138,15 +138,9 @@
 
             <div id="ingredientsStrand" class="strand">
                 <div class="strandHead">
-                    <h1 class="strandTitle">Ingredient Inventory</h1>
+                    <h1 class="strandTitle">INGREDIENT INVENTORY</h1>
 
-                    <button class="button" onclick="addIngredientsComp.display()">
-                        <svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
-                            <line x1="12" y1="5" x2="12" y2="19"></line>
-                            <line x1="5" y1="12" x2="19" y2="12"></line>
-                        </svg>
-                        add
-                    </button>
+                    <button class="button" onclick="addIngredientsComp.display()">NEW</button>
                 </div>
 
                 <div class="searchBar">
@@ -205,13 +199,10 @@
 
             <div id="recipeBookStrand" class="strand">
                 <div class="strandHead">
-                    <h1 class="strandTitle">Recipe Book</h1>
+                    <h1 class="strandTitle">RECIPE BOOK</h1>
 
                     <% if(merchant.pos === "none"){ %>
-                        <button class="button" onclick="newRecipeComp.display()">
-                            <svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><line x1="12" y1="5" x2="12" y2="19"></line><line x1="5" y1="12" x2="19" y2="12"></line></svg>
-                            add
-                        </button>
+                        <button class="button" onclick="newRecipeComp.display()">NEW</button>
                     <% } %>
                 </div>
 
@@ -245,15 +236,9 @@
 
             <div id="ordersStrand" class="strand">
                 <div class="strandHead">
-                    <h1 class="strandTitle">Orders</h1>
+                    <h1 class="strandTitle">ORDERS</h1>
 
-                    <button class="button" onclick="newOrderComp.display()">
-                        <svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
-                            <line x1="12" y1="5" x2="12" y2="19"></line>
-                            <line x1="5" y1="12" x2="19" y2="12"></line>
-                        </svg>
-                        add
-                    </button>
+                    <button class="button" onclick="newOrderComp.display()">NEW</button>
                 </div>
 
                 <div id="orderList"></div>
@@ -270,15 +255,9 @@
 
             <div id="transactionsStrand" class="strand transactions">
                 <div class="strandHead">
-                    <h1 class="strandTitle">Transactions</h1>
+                    <h1 class="strandTitle">TRANSACTIONS</h1>
 
-                    <button class="button" onclick="newTransactionComp.display()">
-                        <svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
-                            <line x1="12" y1="5" x2="12" y2="19"></line>
-                            <line x1="5" y1="12" x2="19" y2="12"></line>
-                        </svg>
-                        add
-                    </button>
+                    <button class="button" onclick="newTransactionComp.display()">NEW</button>
                 </div>
 
                 <div id="transactionsList" class="transactionsList"></div>

+ 2 - 2
views/dashboardPage/home.js

@@ -163,7 +163,7 @@ window.homeStrandObj = {
                     });
                 }
             }else{
-                banner.createError("Cannot have negative ingredients");
+                banner.createError("CANNOT HAVE NEGATIVE INGREDIENTS");
                 return;
             }
         }
@@ -185,7 +185,7 @@ window.homeStrandObj = {
                         banner.createError(response);
                     }else{
                         merchant.editIngredients(changes);
-                        banner.createNotification("Ingredients updated");
+                        banner.createNotification("INGREDIENTS UPDATED");
                     }
                 })
                 .catch((err)=>{})

+ 1 - 1
views/dashboardPage/orders.js

@@ -35,7 +35,7 @@ window.ordersStrandObj = {
                     }
                 })
                 .catch((err)=>{
-                    banner.createError("Unable to retrieve your orders at the moment");
+                    banner.createError("SOMETHING WENT WRONG. TRY REFRESHING THE PAGE");
                 })
                 .finally(()=>{
                     loader.style.display = "none";

+ 4 - 4
views/dashboardPage/sidebars/addIngredients.ejs

@@ -8,23 +8,23 @@
         </button>
     </div>
     
-    <h2>Available Ingredients</h2>
+    <h2>AVAILABLE INGREDIENTS</h2>
 
     <div id="addIngredientList"></div>
 
     <div class="lineBorder"></div>
 
     <div id="myIngredientsDiv">
-        <h2>My Ingredients</h2>
+        <h2>MY INGREDIENTS</h2>
 
         <div id="myIngredients"></div>
 
         <div class="lineBorder"></div>
     </div>
 
-    <button id="addIngredientsBtn" class="button" onclick="addIngredientsComp.submit()">Finish</button>
+    <button id="addIngredientsBtn" class="button" onclick="addIngredientsComp.submit()">CREATE</button>
 
-    <button class="button2Link" onclick="newIngredientComp.display()">Can't find what you're looking for?  Create it.</button>
+    <button class="button2Link" onclick="newIngredientComp.display()">CAN'T FIND WHAT YOU'RE LOOKING FOR? CREATE IT...</button>
 
     <template id="addIngredientsCategory">
         <div class="addIngredientsCategory">

+ 9 - 9
views/dashboardPage/sidebars/addRecipe.ejs

@@ -8,37 +8,37 @@
         </button>
     </div>
 
-    <h1>New Recipe</h1>
+    <h1>NEW RECIPE</h1>
 
     <div class="recipeBasicInfo">
-        <label>Name:
+        <label>NAME:
             <input id="newRecipeName" type="text">
         </label>
 
-        <label>Price:
+        <label>PRICE:
             <input id="newRecipePrice" type="number" step="0.01" min="0">
         </label>
 
-        <label># of Ingredients
+        <label># OF INGREDIENTS
             <input id="ingredientCount" type="number" step="1" min="1" onchange="newRecipeComp.changeRecipeCount()">
         </label>
     </div>
 
-    <h2>Ingredients</h2>
+    <h2>INGREDIENTS</h2>
     
     <div id="recipeInputIngredients">
         <div>
-            <h4>Ingredient 1</h4>
+            <h4>INGREDIENT 1</h4>
 
-            <label>Ingredient:
+            <label>INGREDIENT:
                 <select></select>
             </label>
 
-            <label>Quantity:
+            <label>QUANTITY:
                 <input type="number" step="0.01" min="0">
             </label>
         </div>
     </div>
     
-    <button class="button" onclick="newRecipeComp.submit()">Create</button>
+    <button class="button" onclick="newRecipeComp.submit()">CREATE</button>
 </div>

+ 4 - 4
views/dashboardPage/sidebars/ingredientDetails.ejs

@@ -28,22 +28,22 @@
 
     <div class="lineBorder"></div>
 
-    <label>Current Stock
+    <label>CURRENT STOCK
         <p id="ingredientStock"></p>
         <input id="ingredientInput" type="number" min="0" step="0.01" style="display: none;">
     </label>
 
     <div class="lineBorder"></div>
 
-    <label>Average Daily Use (30 days)
+    <label>AVERAGE DAILY USE (30 DAYS)
         <p id="dailyUse"></p>
     </label>
 
     <div class="lineBorder"></div>
 
-    <label>Contained in:
+    <label>RECIPES:
         <ul id="ingredientRecipeList"></ul>
     </label>
 
-    <button id="editSubmitButton" class="button" onclick="ingredientDetailsComp.editSubmit()" style="display: none;">Save Changes</button>
+    <button id="editSubmitButton" class="button" onclick="ingredientDetailsComp.editSubmit()" style="display: none;">SAVE CHANGES</button>
 </div>

+ 6 - 6
views/dashboardPage/sidebars/newIngredient.ejs

@@ -8,23 +8,23 @@
         </button>
     </div>
 
-    <h1>New Ingredient</h1>
+    <h1>NEW INGREDIENT</h1>
 
-    <label>Name:
+    <label>NAME:
         <input id="newIngName" type="text">
     </label>
 
-    <label>Category:
+    <label>CATEGORY:
         <input id="newIngCategory" type="text">
     </label>
 
-    <label>Quantity:
+    <label>QUANTITY:
         <input id="newIngQuantity" type="number" min="0" step="0.01">
     </label>
 
-    <label>Unit:
+    <label>UNIT:
         <input id="newIngUnit" type="text">
     </label>
 
-    <button class="button" onclick="newIngredientComp.submit()">Create</button>
+    <button class="button" onclick="newIngredientComp.submit()">CREATE</button>
 </div>

+ 4 - 4
views/dashboardPage/sidebars/newOrder.ejs

@@ -8,9 +8,9 @@
         </button>
     </div>
 
-    <h1>New Order</h1>
+    <h1>NEW ORDER</h1>
 
-    <label>ID or name(optional):
+    <label>ID OR NAME(OPTIONAL):
         <input id="orderName" type="text"> 
     </label>
 
@@ -20,11 +20,11 @@
 
     <div class="lineBorder"></div>
 
-    <h2>Ingredients</h2>
+    <h2>INGREDIENTS</h2>
 
     <div id="newOrderAdded"></div>
 
     <div class="lineBorder"></div>
 
-    <button class="button" onclick="newOrderComp.submit()">Create</button>
+    <button class="button" onclick="newOrderComp.submit()">CREATE</button>
 </div>

+ 1 - 1
views/dashboardPage/sidebars/orderDetails.ejs

@@ -24,7 +24,7 @@
     <div class="lineBorder"></div>
 
     <div id="orderTotalPrice">
-        <h3>Grand Total</h3>
+        <h3>GRAND TOTAL</h3>
         <p></p>
     </div>
 

+ 1 - 0
views/dashboardPage/sidebars/recipeDetails.ejs

@@ -25,6 +25,7 @@
     </div>
 
     <h1 id="recipeName"></h1>
+    
     <input id="recipeNameIn" type="text" style="display: none;">
 
     <div id="recipeIngredientList"></div>

+ 7 - 1
views/dashboardPage/sidebars/sidebars.css

@@ -448,7 +448,7 @@ Add Recipe
         align-items: center;
         box-sizing: border-box;
         margin: 0 0 25px 0;
-        width:75%;
+        width:100%;
         overflow-y: auto;
         overflow-x: hidden;
         box-shadow: 0 0 2px gray;
@@ -466,6 +466,12 @@ Add Recipe
             text-align: center;
         }
 
+            #recipeInputIngredients div > label{
+                display: flex;
+                justify-content: space-between;
+                margin-bottom: 2px;
+            }
+
             #recipeInputIngredients div h4{
                 color: rgb(255, 99, 107);
             }

+ 54 - 56
views/dashboardPage/sidebars/sidebars.js

@@ -120,11 +120,11 @@ let recipeDetailsComp = {
                     banner.createError(response);
                 }else{
                     merchant.editRecipe(this.recipe);
-                    banner.createNotification("Recipe successfully updated");
+                    banner.createNotification("RECIPE UPDATE");
                 }
             })
             .catch((err)=>{
-                banner.createError("Something went wrong.  Please refresh the page");
+                banner.createError("SOMETHING WENT WRONG. PLEASE REFRESH THE PAGE");
             })
             .finally(()=>{
                 loader.style.display = "none";
@@ -141,11 +141,11 @@ let recipeDetailsComp = {
                     banner.createError(response);
                 }else{
                     merchant.editRecipe(this.recipe, true);
-                    banner.createNotification("Recipe removed");
+                    banner.createNotification("RECIPE REMOVED");
                 }
             })
             .catch((err)=>{
-                banner.createError("Something went wrong.  Try refreshing the page");
+                banner.createError("SOMETHING WENT WRONG. PLEASE REFRESH THE PAGE");
             });
     },
 
@@ -299,11 +299,11 @@ let newOrderComp = {
 
                     merchant.editOrders([order]);
                     merchant.editIngredients(order.ingredients, false, true);
-                    banner.createNotification("New order created");
+                    banner.createNotification("ORDER CREATED");
                 }
             })
             .catch((err)=>{
-                banner.createError("Something went wrong.  Try refreshing the page");
+                banner.createError("SOEMTHING WENT WRONG. PLEASE REFRESH THE PAGE");
             })
             .finally(()=>{
                 loader.style.display = "none";
@@ -334,39 +334,37 @@ let newIngredientComp = {
         let loader = document.getElementById("loaderContainer");
         loader.style.display = "flex";
 
-        // if(validator.ingredient(newIngredient)){
-            fetch("/ingredients/create", {
-                method: "POST",
-                headers: {
-                    "Content-Type": "application/json;charset=utf-8"
-                },
-                body: JSON.stringify(newIngredient)
+        fetch("/ingredients/create", {
+            method: "POST",
+            headers: {
+                "Content-Type": "application/json;charset=utf-8"
+            },
+            body: JSON.stringify(newIngredient)
+        })
+            .then((response) => response.json())
+            .then((response)=>{
+                if(typeof(response) === "string"){
+                    banner.createError(response);
+                }else{
+                    merchant.editIngredients([{
+                        ingredient: new Ingredient(
+                            response.ingredient._id,
+                            response.ingredient.name,
+                            response.ingredient.category,
+                            response.ingredient.unit
+                        ),
+                        quantity: response.quantity
+                    }]);
+
+                    banner.createNotification("INGREDIENT CREATED");
+                }
             })
-                .then((response) => response.json())
-                .then((response)=>{
-                    if(typeof(response) === "string"){
-                        banner.createError(response);
-                    }else{
-                        merchant.editIngredients([{
-                            ingredient: new Ingredient(
-                                response.ingredient._id,
-                                response.ingredient.name,
-                                response.ingredient.category,
-                                response.ingredient.unit
-                            ),
-                            quantity: response.quantity
-                        }]);
-
-                        banner.createNotification("Ingredient successfully created");
-                    }
-                })
-                .catch((err)=>{
-                    banner.createError("Something went wrong.  Try refreshing the page");
-                })
-                .finally(()=>{
-                    loader.style.display = "none";
-                });
-        // }
+            .catch((err)=>{
+                banner.createError("SOMETHING WENT WRONG. PLEASE REFRESH THE PAGE");
+            })
+            .finally(()=>{
+                loader.style.display = "none";
+            });
     }
 }
 
@@ -417,11 +415,11 @@ let orderDetailsComp = {
                     banner.createError(response);
                 }else{
                     merchant.editOrders([order], true);
-                    banner.createNotification("Order successfully removed");
+                    banner.createNotification("ORDER REMOVED");
                 }
             })
             .catch((err)=>{
-                banner.createError("Something went wrong, try refreshing the page");
+                banner.createError("SOMETHING WENT WRONG. PLEASE REFRESH THE PAGE");
             })
             .finally(()=>{
                 loader.style.display = "none";
@@ -472,7 +470,7 @@ let addIngredientsComp = {
                     }
                 })
                 .catch((err)=>{
-                    banner.createError("Unable to retrieve data");
+                    banner.createError("UNABLE TO RETRIEVE DATA");
                 })
                 .finally(()=>{
                     loader.style.display = "none";
@@ -586,7 +584,7 @@ let addIngredientsComp = {
 
         for(let i = 0; i < ingredients.length; i++){
             if(ingredients[i].children[1].value === ""){
-                banner.createError("Please enter a quantity for each ingredient you want to add to your inventory");
+                banner.createError("PLEASE ENTER A QUANTITY FOR EACH INGREDIENT YOU WANT TO ADD TO YOUR INVENTORY");
                 return;
             }
 
@@ -618,11 +616,11 @@ let addIngredientsComp = {
                 }else{
                     merchant.editIngredients(newIngredients);
                     this.isPopulated = false;
-                    banner.createNotification("All ingredients added successfully");
+                    banner.createNotification("ALL INGREDIENTS ADDED");
                 }
             })
             .catch((err)=>{
-                banner.createError("Something went wrong.  Try refreshing the page");
+                banner.createError("SOMETHING WENT WRONG. PLEASE REFRESH THE PAGE");
             })
             .finally(()=>{
                 loader.style.display = "none";
@@ -686,7 +684,7 @@ let ingredientDetailsComp = {
         for(let i = 0; i < merchant.recipes.length; i++){
             for(let j = 0; j < merchant.recipes[i].ingredients.length; j++){
                 if(this.ingredient.ingredient === merchant.recipes[i].ingredients[j].ingredient){
-                    banner.createError("Must remove ingredient from all recipes before removing");
+                    banner.createError("MUST REMOVE INGREDIENT FROM ALL RECIPES BEFORE REMOVING FROM INVENTORY");
                     return;
                 }
             }
@@ -703,7 +701,7 @@ let ingredientDetailsComp = {
                 if(typeof(response) === "string"){
                     banner.createError(response);
                 }else{
-                    banner.createNotification("Ingredient removed");
+                    banner.createNotification("INGREDIENT REMOVED");
                     merchant.editIngredients([this.ingredient], true);
                 }
             })
@@ -743,11 +741,11 @@ let ingredientDetailsComp = {
                         banner.createError(response);
                     }else{
                         merchant.editIngredients([this.ingredient]);
-                        banner.createNotification("Ingredient updated");
+                        banner.createNotification("INGREDIENT UPDATED");
                     }
                 })
                 .catch((err)=>{
-                    banner.createError("Something went wrong, try refreshing the page");
+                    banner.createError("SOMETHING WENT WRONG. PLEASE REFRESH THE PAGE");
                 })
                 .finally(()=>{
                     loader.style.display = "none";
@@ -798,7 +796,7 @@ let newRecipeComp = {
             }
 
             for(let i = 0; i < newCount; i++){
-                ingredientsDiv.children[i].children[0].innerText = `Ingredient ${i + 1}`;
+                ingredientsDiv.children[i].children[0].innerText = `INGREDIENT ${i + 1}`;
             }
         }else if(newCount < oldCount){
             let newDivs = oldCount - newCount;
@@ -852,11 +850,11 @@ let newRecipeComp = {
                     );
                     
                     merchant.editRecipe(recipe);
-                    banner.createNotification("New recipe successfully created");
+                    banner.createNotification("RECIPE CREATED");
                 }
             })
             .catch((err)=>{
-                banner.createError("Refresh page to update data");
+                banner.createError("SOMETHING WENT WRONG. PLEASE REFRESH THE PAGE");
             })
             .finally(()=>{
                 loader.style.display = "none";
@@ -920,11 +918,11 @@ let transactionDetailsComp = {
                     banner.createError(response);
                 }else{
                     merchant.editTransactions(this.transaction, true);
-                    banner.createNotification("Transaction removed");
+                    banner.createNotification("TRANSACTION REMOVED");
                 }
             })
             .catch((err)=>{
-                banner.createError("Something went wrong, please refresh the page");
+                banner.createError("SOMETHING WENT WRONG. PLEASE REFRESH THE PAGE");
             })
             .finally(()=>{
                 loader.style.display = "none";
@@ -958,7 +956,7 @@ let newTransactionComp = {
         console.log(recipeDivs);
         
         if(date > new Date()){
-            banner.createError("Cannot have a date in the future");
+            banner.createError("CANNOT HAVE A DATE IN THE FUTURE");
             return;
         }
         
@@ -975,7 +973,7 @@ let newTransactionComp = {
                     quantity: quantity
                 });
             }else if(quantity < 0){
-                banner.createError("Cannot have negative values");
+                banner.createError("CANNOT HAVE NEGATIVE VALUES");
                 return;
             }
         }
@@ -1008,7 +1006,7 @@ let newTransactionComp = {
                 })
                 .catch((err)=>{
                     console.log(err);
-                    banner.createError("Something went wrong, try refreshing the page");
+                    banner.createError("SOMETHING WENT WRONG. PLEASE REFRESH THE PAGE");
                 })
                 .finally(()=>{
                     loader.style.display = "none";

+ 2 - 2
views/dashboardPage/sidebars/transactionDetails.ejs

@@ -22,12 +22,12 @@
 
     <div class="lineBorder"></div>
 
-    <h3>Recipes</h3>
+    <h3>RECIPES</h3>
     <div id="transactionRecipes" class="transactionRecipes"></div>
 
     <div class="lineBorder"></div>
 
-    <h3>Totals</h3>
+    <h3>TOTALS</h3>
     <p id="totalRecipes" class="totals"></p>
     <p id="totalPrice" class="totals"></p>
 

+ 3 - 2
views/shared/shared.css

@@ -148,14 +148,15 @@ form{
     border: none;
     text-decoration: none;
     border-radius: 4px;
-    padding: 10px 29px;
+    padding: 10px;
     color: white;
     cursor: pointer;
     transition: 0.3s;
     text-align: center;
-    font-size: 18px;
+    font-size: 20px;
     font-weight: bold;
     margin-right: 33px;
+    min-width: 100px;
 } 
 
     .buttonWithBorder {