|
|
@@ -0,0 +1,256 @@
|
|
|
+<!DOCTYPE html>
|
|
|
+<html lang="en">
|
|
|
+ <head>
|
|
|
+ <meta charset="UTF-8">
|
|
|
+ <title>The Subline</title>
|
|
|
+ <link rel="icon" type="img/png" href="/shared/images/logo.png">
|
|
|
+ <link rel="stylesheet" href="/dashboardPage/dashboard.css">
|
|
|
+ <link rel="stylesheet" href="/shared/shared.css">
|
|
|
+ </head>
|
|
|
+ <body>
|
|
|
+ <% include ../shared/header %>
|
|
|
+
|
|
|
+ <% include ../shared/banner %>
|
|
|
+
|
|
|
+ <h1 id="title"><%=merchant.name%></h1>
|
|
|
+
|
|
|
+ <strand-selector></strand-selector>
|
|
|
+
|
|
|
+ <div id="inventoryStrand" class="strand">
|
|
|
+ <div class="buttonBox">
|
|
|
+ <button class="button" onclick="addIngredientObj.display()">Add Ingredient</button>
|
|
|
+
|
|
|
+ <button class="button" onclick="enterPurchaseObj.display()">Enter Purchases</button>
|
|
|
+
|
|
|
+ <% if(merchant.pos === "none"){ %>
|
|
|
+ <button class="button" onclick="enterTransactionsObj.display()">Enter Transactions</button>
|
|
|
+ <% } %>
|
|
|
+
|
|
|
+ <a class="button" href="/data">Analyze data</a>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <input id="filter" onkeyup="inventoryObj.filter()" type="text" placeholder="FILTER INGREDIENTS">
|
|
|
+
|
|
|
+ <table>
|
|
|
+ <thead>
|
|
|
+ <tr>
|
|
|
+ <th class="cursor" onclick="inventoryObj.sortIngredients('name')">Item</th>
|
|
|
+ <th class="cursor" onclick="inventoryObj.sortIngredients('category')">Category</th>
|
|
|
+ <th class="cursor" onclick="inventoryObj.sortIngredients('quantity')">Quantity</th>
|
|
|
+ <th class="cursor" onclick="inventoryObj.sortIngredients('unit')">Unit</th>
|
|
|
+ <th>Actions</th>
|
|
|
+ </tr>
|
|
|
+ <tbody></tbody>
|
|
|
+ </thead>
|
|
|
+ </table>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div id="recipesStrand" class="strand">
|
|
|
+ <div>
|
|
|
+ <% if(merchant.pos === "none"){ %>
|
|
|
+ <button class="button" onclick="window.recipesObj.showInput()">Add a Recipe</button>
|
|
|
+ <% }else{%>
|
|
|
+ <button class="button" id="recipeUpdate" onclick="recipesObj.updateRecipes()">Update Recipes</button>
|
|
|
+ <% } %>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div id="newRecipe">
|
|
|
+ <label>Name:
|
|
|
+ <input id="newName" type="text">
|
|
|
+ </label>
|
|
|
+
|
|
|
+ <label>Price:
|
|
|
+ <input id="newPrice" type="number" step="0.01">
|
|
|
+ </label>
|
|
|
+
|
|
|
+ <button class="button-small" onclick="window.recipesObj.submitNew()">Create</button>
|
|
|
+
|
|
|
+ <button class="button-small" onclick="window.recipesObj.cancelAdd()">Cancel</button>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div id="recipesContainer"></div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div id="accountStrand" class="strand">
|
|
|
+ <form id="accountDisplay" onsubmit="accountObj.editAccount()">
|
|
|
+ <label>Name:
|
|
|
+ <p><%=merchant.name%></p>
|
|
|
+ </label>
|
|
|
+
|
|
|
+ <label>Email:
|
|
|
+ <p><%=merchant.email%></p>
|
|
|
+ </label>
|
|
|
+
|
|
|
+ <button class="button" onclick="accountObj.editAccount()">Edit</button>
|
|
|
+ </form>
|
|
|
+
|
|
|
+ <form id="accountEdit">
|
|
|
+ <label>Name:
|
|
|
+ <input id="accountName" type="text" value="<%=merchant.name%>">
|
|
|
+ </label>
|
|
|
+
|
|
|
+ <label>Email:
|
|
|
+ <input id="accountEmail" type="email" value="<%=merchant.email%>">
|
|
|
+ </label>
|
|
|
+
|
|
|
+ <div class="buttonBox">
|
|
|
+ <button class="button" onclick="accountObj.updateAccount()">Save</button>
|
|
|
+
|
|
|
+ <button class="button" onclick="accountObj.editAccountCancel()">Cancel</button>
|
|
|
+ </div>
|
|
|
+ </form>
|
|
|
+
|
|
|
+ <form id="passwordEdit" onsubmit="accountObj.updatePassword()">
|
|
|
+ <label>Old password:
|
|
|
+ <input id="oldPass" type="password" required>
|
|
|
+ </label>
|
|
|
+
|
|
|
+ <label>New password:
|
|
|
+ <input id="newPass" type="password" required>
|
|
|
+ </label>
|
|
|
+
|
|
|
+ <label>Confirm new password:
|
|
|
+ <input id="confirmNewPass" type="password" required>
|
|
|
+ </label>
|
|
|
+
|
|
|
+
|
|
|
+ <div class="buttonBox">
|
|
|
+ <input class="button" type="submit" value="Submit">
|
|
|
+
|
|
|
+ <button class="button" onclick="accountObj.editPasswordCancel()">Cancel</button>
|
|
|
+ </div>
|
|
|
+ </form>
|
|
|
+
|
|
|
+ <button class="button" onclick="accountObj.editPassword()">Change password</button>
|
|
|
+ </div>
|
|
|
+
|
|
|
+
|
|
|
+ <div id="addIngredientAction" class="action">
|
|
|
+ <div class="container">
|
|
|
+ <div>
|
|
|
+ <h2>Choose Ingredients</h2>
|
|
|
+
|
|
|
+ <input id="addFilter" type="text" placeholder="FILTER INGREDIENTS" onkeyup="window.addIngredientObj.filterAndDisplay()">
|
|
|
+
|
|
|
+ <table>
|
|
|
+ <thead>
|
|
|
+ <tr>
|
|
|
+ <th>Add</th>
|
|
|
+ <th class="cursor" onclick="window.addIngredientObj.sort(1)">Ingredient</th>
|
|
|
+ <th class="cursor" onclick="window.addIngredientObj.sort(2)">Category</th>
|
|
|
+ <th class="cursor" onclick="window.addIngredientObj.sort(3)">Unit</th>
|
|
|
+ <th>Quantity</th>
|
|
|
+ </tr>
|
|
|
+ </thead>
|
|
|
+ <tbody></tbody>
|
|
|
+ </table>
|
|
|
+
|
|
|
+ <button class="button" onclick="addIngredientObj.submitAdd()">Submit</button>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <h1>Or</h1>
|
|
|
+
|
|
|
+ <form id="createIngredientInput" onsubmit="addIngredientObj.submitNew()">
|
|
|
+ <h2>Create New Ingredient</h2>
|
|
|
+
|
|
|
+ <label>Name
|
|
|
+ <input id="newIngName" type="text" required>
|
|
|
+ </label>
|
|
|
+
|
|
|
+ <label>Category
|
|
|
+ <input id="newCategory" type="text" required>
|
|
|
+ </label>
|
|
|
+
|
|
|
+ <label>Unit
|
|
|
+ <input id="newUnit" type="text" required>
|
|
|
+ </label>
|
|
|
+
|
|
|
+ <label>Quantity
|
|
|
+ <input id="newQuantity" type="number" step="0.01" required>
|
|
|
+ </label>
|
|
|
+
|
|
|
+ <button class="button">Create Ingredient</button>
|
|
|
+ </form>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+
|
|
|
+ <div id="enterTransactionsAction" class="action">
|
|
|
+ <h1>Enter all sales</h1>
|
|
|
+ <h3>Last updated: <span id="updated"></span></h3>
|
|
|
+
|
|
|
+ <table>
|
|
|
+ <thead>
|
|
|
+ <tr>
|
|
|
+ <th>Recipe</th>
|
|
|
+ <th>Number sold</th>
|
|
|
+ </tr>
|
|
|
+ </thead>
|
|
|
+ <tbody></tbody>
|
|
|
+ </table>
|
|
|
+
|
|
|
+ <button class="button" onclick="enterTransactionsObj.submit()">Submit</button>
|
|
|
+ </div>
|
|
|
+
|
|
|
+
|
|
|
+ <div id="enterPurchaseAction" class="action">
|
|
|
+ <h1>Enter Purchases</h1>
|
|
|
+
|
|
|
+ <table>
|
|
|
+ <thead>
|
|
|
+ <tr>
|
|
|
+ <th>Ingredient</th>
|
|
|
+ <th>Amount</th>
|
|
|
+ </tr>
|
|
|
+ </thead>
|
|
|
+ <tbody></tbody>
|
|
|
+ </table>
|
|
|
+
|
|
|
+ <button class="button" onclick="enterPurchaseObj.submit()">Submit</button>
|
|
|
+ </div>
|
|
|
+
|
|
|
+
|
|
|
+ <div id="singleRecipeAction" class="action">
|
|
|
+ <h2 id="recipeName"></h2>
|
|
|
+
|
|
|
+ <div class="buttonBox">
|
|
|
+ <button class="button" id="addButton">Add Ingredient</button>
|
|
|
+ <% if(merchant.pos === "none"){ %>
|
|
|
+ <button class="button" id="removeButton">Remove</button>
|
|
|
+ <% } %>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <table>
|
|
|
+ <thead>
|
|
|
+ <tr>
|
|
|
+ <th>Name</th>
|
|
|
+ <th>Quantity</th>
|
|
|
+ <th>Actions</th>
|
|
|
+ </tr>
|
|
|
+ </thead>
|
|
|
+ <tbody></tbody>
|
|
|
+ </table>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <%- include ../shared/footer %>
|
|
|
+
|
|
|
+ <script>
|
|
|
+ <% if(locals.error){ %>
|
|
|
+ let error = <%- JSON.stringify(error) %>;
|
|
|
+ <% }else{ %>
|
|
|
+ let error = undefined;
|
|
|
+ <% } %>
|
|
|
+ </script>
|
|
|
+ <script>let merchant = <%- JSON.stringify(merchant) %>;</script>
|
|
|
+ <script src="https://unpkg.com/axios/dist/axios.min.js"></script>
|
|
|
+ <script src="../shared/validation.js"></script>
|
|
|
+ <script src="/dashboardPage/inventory.js"></script>
|
|
|
+ <script src="/dashboardPage/recipes.js"></script>
|
|
|
+ <script src="/dashboardPage/account.js"></script>
|
|
|
+ <script src="/dashboardPage/addIngredient.js"></script>
|
|
|
+ <script src="/dashboardPage/enterTransactions.js"></script>
|
|
|
+ <script src="/dashboardPage/enterPurchase.js"></script>
|
|
|
+ <script src="/dashboardPage/singleRecipe.js"></script>
|
|
|
+ <script src="/shared/controller.js"></script>
|
|
|
+ </body>
|
|
|
+</html>
|