inventory.ejs 3.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  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 class="container">
  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 class="add-ingredient">
  29. <div class="modal-content" onclick="event.stopPropagation()">
  30. <div id="existingIngredient">
  31. <button id="createNew">Create New</button>
  32. <table>
  33. <thead>
  34. <tr>
  35. <th>Ingredient</th>
  36. <th>Category</th>
  37. <th>Unit</th>
  38. <th></th>
  39. </tr>
  40. </thead>
  41. <tbody></tbody>
  42. </table>
  43. </div>
  44. <div id="quantityInput">
  45. <h3 id="quantityInputTitle"></h3>
  46. <input type="number" step="0.01" required>
  47. <button id="addIngredient">Add Ingredient</button>
  48. </div>
  49. <div id="newIngredient">
  50. <label>Ingredient Name:
  51. <input id="newName" type="text">
  52. </label>
  53. <label>Category:
  54. <input id="newCategory" type="text">
  55. </label>
  56. <label>Quantity:
  57. <input id="newQuantity" type="number" step="0.01">
  58. </label>
  59. <label>Unit:
  60. <input id="newUnit" type="text">
  61. </label>
  62. <button id="createIngredient">Create Ingredient</button>
  63. </div>
  64. </div>
  65. </div>
  66. <script>let merchant = <%- JSON.stringify(merchant) %>;</script>
  67. <script src="https://unpkg.com/axios/dist/axios.min.js"></script>
  68. <script src="../shared/validation.js"></script>
  69. <script src="/inventoryPage/inventory.js"></script>
  70. </body>
  71. </html>