dashboard.ejs 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="UTF-8">
  5. <title>The Subline</title>
  6. <link rel="icon" type="img/png" href="/shared/images/logo.png">
  7. <link rel="stylesheet" href="/shared/shared.css">
  8. <link rel="stylesheet" href="/dashboardPage/dashboard.css">
  9. <link rel="stylesheet" href="/dashboardPage/sidebars/sidebars.css">
  10. <link href="https://fonts.googleapis.com/css?family=Saira&display=swap" rel="stylesheet">
  11. </head>
  12. <body>
  13. <div class="menu">
  14. <div id="max" class="menuHead">
  15. <a href="/">
  16. <img class="menuLogo" src="/shared/images/logo.png" alt="The Subline">
  17. <p>The Subline</p>
  18. </a>
  19. <button onclick="changeMenu()">&#8801;</button>
  20. </div>
  21. <div id="min" class="menuHead menuHeadMin">
  22. <a href="/">
  23. <img class="menuLogoMin" src="/shared/images/logo.png" alt="The Subline">
  24. </a>
  25. <button onclick="changeMenu()">&#8801;</button>
  26. </div>
  27. <button id="homeBtn" class="active" onclick="changeStrand('homeStrand')">
  28. <svg width="25" height="25" viewBox="0 0 24 24" fill="none" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
  29. <path d="M3 9l9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z"></path>
  30. <polyline points="9 22 9 12 15 12 15 22"></polyline>
  31. </svg>
  32. <p>Home</p>
  33. </button>
  34. <button id="ingredientsBtn" onclick="changeStrand('ingredientsStrand')">
  35. <svg width="25" height="25" viewBox="0 0 24 24" fill="none" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
  36. <polyline points="21 8 21 21 3 21 3 8"></polyline>
  37. <rect x="1" y="3" width="22" height="5"></rect>
  38. <line x1="10" y1="12" x2="14" y2="12"></line>
  39. </svg>
  40. <p>Ingredients</p>
  41. </button>
  42. <button id="recipeBookBtn" onclick="changeStrand('recipeBookStrand')">
  43. <svg width="25" height="25" viewBox="0 0 24 24" fill="none" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
  44. <path d="M4 19.5A2.5 2.5 0 0 1 6.5 17H20"></path>
  45. <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>
  46. </svg>
  47. <p>Recipe Book</p>
  48. </button>
  49. <button id="ordersBtn" onclick="changeStrand('ordersStrand')">
  50. <svg width="25" height="25" viewBox="0 0 24 24" fill="none" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
  51. <circle cx="9" cy="21" r="1"></circle>
  52. <circle cx="20" cy="21" r="1"></circle>
  53. <path d="M1 1h4l2.68 13.39a2 2 0 0 0 2 1.61h9.72a2 2 0 0 0 2-1.61L23 6H6"></path>
  54. </svg>
  55. <p>Orders</p>
  56. </button>
  57. <a class="logout" href="/logout">
  58. <p>Logout</p>
  59. <svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
  60. <path d="M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4"></path>
  61. <polyline points="16 17 21 12 16 7"></polyline>
  62. <line x1="21" y1="12" x2="9" y2="12"></line>
  63. </svg>
  64. </a>
  65. </div>
  66. <div class="contentBlock">
  67. <% include ../shared/banner %>
  68. <div id="homeStrand" class="strand">
  69. <h1 class="strandTitle">Dashboard</h1>
  70. <div class="flexRow">
  71. <div id="revenueCard" class="card">
  72. <p>Total Revenue (month)</p>
  73. <p id="revenue"></p>
  74. <div id="revenueChange">
  75. <img alt="revenue">
  76. <p></p>
  77. </div>
  78. </div>
  79. <div id="graphCard" class="card">
  80. <canvas id="graphCanvas">
  81. </div>
  82. </div>
  83. <div class="flexRow">
  84. <div id="inventoryCheckCard" class="card">
  85. <p>Inventory Check</p>
  86. <ul></ul>
  87. <button class="button" onclick="homeStrandObj.submitInventoryCheck()">Update</button>
  88. </div>
  89. <div id=popularIngredientsCard class="card">
  90. <p>Most Popular Ingredients (month)</p>
  91. <canvas id="popularCanvas"></canvas>
  92. </div>
  93. </div>
  94. <template id="ingredientCheck">
  95. <li class="ingredientCheck flexRow">
  96. <p></p>
  97. <div class="numberInput">
  98. <button>-</button>
  99. <input type="number" min="0" step="0.01">
  100. <button>+</button>
  101. </div>
  102. <p></p>
  103. </li>
  104. </template>
  105. </div>
  106. <div id="ingredientsStrand" class="strand">
  107. <div class="strandHead">
  108. <h1 class="strandTitle">Ingredient Inventory</h1>
  109. <button class="button" onclick="addIngredientsComp.display()">
  110. <svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
  111. <line x1="12" y1="5" x2="12" y2="19"></line>
  112. <line x1="5" y1="12" x2="19" y2="12"></line>
  113. </svg>
  114. add
  115. </button>
  116. </div>
  117. <div class="searchBar">
  118. <div class="searchAndIcon">
  119. <svg width="30" height="30" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
  120. <circle cx="11" cy="11" r="8"></circle>
  121. <line x1="21" y1="21" x2="16.65" y2="16.65"></line>
  122. </svg>
  123. <input id="ingredientSearch" type="text" placeholder="FILTER" oninput="ingredientsStrandObj.search()">
  124. </div>
  125. <button id="ingredientClearButton" class="clearButton" onclick="ingredientsStrandObj.clearSorting()" style="display: none;">
  126. <svg width="30" height="30" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
  127. <circle cx="12" cy="12" r="10"></circle>
  128. <line x1="15" y1="9" x2="9" y2="15"></line>
  129. <line x1="9" y1="9" x2="15" y2="15"></line>
  130. </svg>
  131. </button>
  132. <select id="ingredientSelect" onchange="ingredientsStrandObj.sort(this.value)">Sort Bys:
  133. <option value="" selected disabled>Sort By:</option>
  134. <option value="_name">Ingredient</option>
  135. <option value="category">Category</option>
  136. <option value="unit">Unit of Measurement</option>
  137. </select>
  138. </div>
  139. <div id="categoryList"></div>
  140. <template id="categoryDiv">
  141. <div class="categoryDiv">
  142. <div>
  143. <p></p>
  144. <button>
  145. <svg width="32" height="32" viewBox="0 0 24 24" fill="none" stroke="black" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
  146. <polyline points="6 9 12 15 18 9"></polyline>
  147. </svg>
  148. </button>
  149. </div>
  150. <div class="ingredientsDiv"></div>
  151. </div>
  152. </template>
  153. <template id="ingredient">
  154. <div class="ingredient">
  155. <p></p>
  156. <hr class="ingredientSpacer">
  157. <p></p>
  158. </div>
  159. </template>
  160. </div>
  161. <div id="recipeBookStrand" class="strand">
  162. <div class="strandHead">
  163. <h1 class="strandTitle">Recipe Book</h1>
  164. <% if(merchant.pos === "none"){ %>
  165. <button class="button" onclick="newRecipeComp.display()">
  166. <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>
  167. add
  168. </button>
  169. <% } %>
  170. </div>
  171. <div class="searchBar">
  172. <div class="searchAndIcon">
  173. <svg width="30" height="30" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
  174. <circle cx="11" cy="11" r="8"></circle>
  175. <line x1="21" y1="21" x2="16.65" y2="16.65"></line>
  176. </svg>
  177. <input id="recipeSearch" type="text" placeholder="FILTER" oninput="recipeBookStrandObj.search()">
  178. </div>
  179. <button id="recipeClearButton" class="clearButton" onclick="recipeBookStrandObj.clearSorting()" style="display: none;">
  180. <svg width="30" height="30" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
  181. <circle cx="12" cy="12" r="10"></circle>
  182. <line x1="15" y1="9" x2="9" y2="15"></line>
  183. <line x1="9" y1="9" x2="15" y2="15"></line>
  184. </svg>
  185. </button>
  186. </div>
  187. <div id="recipeList"></div>
  188. <template id="recipe">
  189. <div class="itemDisplay">
  190. <p></p>
  191. <p></p>
  192. </div>
  193. </template>
  194. </div>
  195. <div id="ordersStrand" class="strand">
  196. <div class="strandHead">
  197. <h1 class="strandTitle">Orders</h1>
  198. <button class="button" onclick="newOrderComp.display()">
  199. <svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
  200. <line x1="12" y1="5" x2="12" y2="19"></line>
  201. <line x1="5" y1="12" x2="19" y2="12"></line>
  202. </svg>
  203. add
  204. </button>
  205. </div>
  206. <div id="orderList"></div>
  207. <template id="order">
  208. <div class="itemDisplay">
  209. <p></p>
  210. <p></p>
  211. <p></p>
  212. <p></p>
  213. </div>
  214. </template>
  215. </div>
  216. </div>
  217. <div id="sidebarDiv" class="sidebarHide">
  218. <% include ./sidebars/addIngredients %>
  219. <% include ./sidebars/newIngredient %>
  220. <% include ./sidebars/ingredientDetails %>
  221. <% include ./sidebars/recipeDetails %>
  222. <% include ./sidebars/addRecipe %>
  223. <% include ./sidebars/orderDetails %>
  224. <% include ./sidebars/newOrder %>
  225. </div>
  226. <% include ../shared/loader %>
  227. <script src="/dashboardPage/Merchant.js"></script>
  228. <script>
  229. let merchant = new Merchant(
  230. <%- JSON.stringify(merchant) %>,
  231. <%- JSON.stringify(transactions) %>
  232. );
  233. </script>
  234. <script src="../shared/graphs.js"></script>
  235. <script src="/dashboardPage/home.js"></script>
  236. <script src="/dashboardPage/ingredients.js"></script>
  237. <script src="/dashboardPage/recipeBook.js"></script>
  238. <script src="/dashboardPage/sidebars/sidebars.js"></script>
  239. <script src="/dashboardPage/controller.js"></script>
  240. <script src="/dashboardPage/orders.js"></script>
  241. <script src="../shared/validation.js"></script>
  242. <noscript>Please turn on javascript for this site to work properly</noscript>
  243. </body>
  244. </html>