inventory.ejs 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <link rel="stylesheet" href="/inventoryPage/inventory.css">
  5. <link rel="stylesheet" href="/shared/shared.css">
  6. </head>
  7. <body>
  8. <% include ../shared/header %>
  9. <% include ../shared/banner %>
  10. <div id="inventoryStrand">
  11. <h1><%= merchant.name %> inventory</h1>
  12. <a href="/recipes">View Recipes</a>
  13. <button onclick="inventoryPage.displayAdd()">Add Ingredient</button>
  14. <input id="filter" onkeyup="inventoryPage.filter()" type="text" placeholder="Start typing to filter">
  15. <table>
  16. <thead>
  17. <tr>
  18. <th onclick="inventoryPage.sortIngredients('name')">Item</th>
  19. <th onclick="inventoryPage.sortIngredients('category')">Category</th>
  20. <th onclick="inventoryPage.sortIngredients('quantity')">Quantity</th>
  21. <th onclick="inventoryPage.sortIngredients('unit')">Unit</th>
  22. <th></th>
  23. </tr>
  24. <tbody></tbody>
  25. </thead>
  26. </table>
  27. </div>
  28. <div id="recipeStrand"></div>
  29. <div id="addIngredientStrand" class="add-ingredient">
  30. <div class="modal-content" onclick="event.stopPropagation()">
  31. <div id="existingIngredient">
  32. <button id="createNew">Create New</button>
  33. <table>
  34. <thead>
  35. <tr>
  36. <th>Ingredient</th>
  37. <th>Category</th>
  38. <th>Unit</th>
  39. <th></th>
  40. </tr>
  41. </thead>
  42. <tbody></tbody>
  43. </table>
  44. </div>
  45. <div id="quantityInput">
  46. <h3 id="quantityInputTitle"></h3>
  47. <input type="number" step="0.01" required>
  48. <button id="addIngredient">Add Ingredient</button>
  49. </div>
  50. <div id="newIngredient">
  51. <label>Ingredient Name:
  52. <input id="newName" type="text">
  53. </label>
  54. <label>Category:
  55. <input id="newCategory" type="text">
  56. </label>
  57. <label>Quantity:
  58. <input id="newQuantity" type="number" step="0.01">
  59. </label>
  60. <label>Unit:
  61. <input id="newUnit" type="text">
  62. </label>
  63. <button id="createIngredient">Create Ingredient</button>
  64. </div>
  65. </div>
  66. </div>
  67. <script>let merchant = <%- JSON.stringify(merchant) %>;</script>
  68. <script src="https://unpkg.com/axios/dist/axios.min.js"></script>
  69. <script src="../shared/validation.js"></script>
  70. <script src="/inventoryPage/inventory.js"></script>
  71. <script src="/inventoryPage/recipe.js"></script>
  72. <script src="/inventoryPage/addIngredient.js"></script>
  73. <script src="/inventoryPage/controller.js"></script>
  74. </body>
  75. </html>