Просмотр исходного кода

Update styles. Fix logout button.

Lee Morgan 6 лет назад
Родитель
Сommit
fab3f00f8e

+ 0 - 1
controllers/merchantData.js

@@ -329,7 +329,6 @@ module.exports = {
                         quantity: req.body[i].quantity
                     }));
 
-                    console.log(updateIngredient);
                     updateIngredient.quantity += req.body[i].quantity;
                 }
 

+ 25 - 4
views/dashboardPage/components/menu.ejs

@@ -17,27 +17,42 @@
     </div>
 
     <button id="homeBtn" class="active" onclick="changeStrand('homeStrand')">
-        <svg xmlns="http://www.w3.org/2000/svg" width="25" height="25" viewBox="0 0 24 24" fill="none" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-home"><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>
+        <svg width="25" height="25" viewBox="0 0 24 24" fill="none" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
+            <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>
     </button>
 
     <button id="ingredientsBtn" onclick="changeStrand('ingredientsStrand')">
-        <svg xmlns="http://www.w3.org/2000/svg" width="25" height="25" viewBox="0 0 24 24" fill="none" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-archive"><polyline points="21 8 21 21 3 21 3 8"></polyline><rect x="1" y="3" width="22" height="5"></rect><line x1="10" y1="12" x2="14" y2="12"></line></svg>
+        <svg width="25" height="25" viewBox="0 0 24 24" fill="none" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
+            <polyline points="21 8 21 21 3 21 3 8"></polyline>
+            <rect x="1" y="3" width="22" height="5"></rect>
+            <line x1="10" y1="12" x2="14" y2="12"></line>
+        </svg>
         <p>Ingredients</p>
     </button>
 
     <button id="recipeBookBtn" onclick="changeStrand('recipeBookStrand')">
-        <svg xmlns="http://www.w3.org/2000/svg" width="25" height="25" viewBox="0 0 24 24" fill="none" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-book"><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>
+        <svg width="25" height="25" viewBox="0 0 24 24" fill="none" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
+            <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>
     </button>
 
     <button id="ordersBtn" onclick="changeStrand('ordersStrand')">
-        <svg xmlns="http://www.w3.org/2000/svg" width="25" height="25" viewBox="0 0 24 24" fill="none" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-shopping-cart"><circle cx="9" cy="21" r="1"></circle><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>
+        <svg width="25" height="25" viewBox="0 0 24 24" fill="none" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
+            <circle cx="9" cy="21" r="1"></circle>
+            <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>
     </button>
 
     <a class="logout" href="/logout">
         <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>
             <polyline points="16 17 21 12 16 7"></polyline>
@@ -56,8 +71,12 @@
                     button.children[1].style.display = "none";
                 }
 
+                document.querySelector(".logout p").style.display = "none"
+
                 document.querySelector("#max").style.display = "none";
                 document.querySelector("#min").style.display = "flex";
+
+                
             }else if(menu.classList.contains("menuMinimized")){
                 menu.classList = "menu";
 
@@ -65,6 +84,8 @@
                     button.children[1].style.display = "block";
                 }
 
+                document.querySelector(".logout p").style.display = "flex"
+
                 setTimeout(()=>{
                     document.querySelector("#max").style.display = "flex";
                     document.querySelector("#min").style.display = "none";

+ 2 - 3
views/dashboardPage/controller.js

@@ -1,5 +1,5 @@
 /* 
-Changes to a different strand
+Switches to a different strand
 Input:
  name: name of the strand.  Must end with "Strand"
 */
@@ -36,7 +36,6 @@ Inputs:
  remove: if true, remove ingredient from inventory
  */
 let updateInventory = (ingredients, remove = false)=>{
-    console.log(ingredients);
     for(let i = 0; i < ingredients.length; i++){
         let isNew = true;
         for(let j = 0; j < merchant.inventory.length; j++){
@@ -44,7 +43,7 @@ let updateInventory = (ingredients, remove = false)=>{
                 if(remove){
                     merchant.inventory.splice(j, 1);
                 }else{
-                    
+
                     merchant.inventory[j].quantity += ingredients[i].quantity;
                 }
 

+ 1 - 0
views/dashboardPage/dashboard.css

@@ -300,6 +300,7 @@ body{
     #orderList{
         width: 50%;
         margin-top: 50px;
+        overflow: auto;
     }
 
         #orderList p:first-of-type{