dashboard.ejs 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326
  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. <button id="transactionsBtn" onclick="changeStrand('transactionsStrand')">
  58. <svg width="25" height="25" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
  59. <rect x="1" y="4" width="22" height="16" rx="2" ry="2"></rect>
  60. <line x1="1" y1="10" x2="23" y2="10"></line>
  61. </svg>
  62. <p>Transactions</p>
  63. </button>
  64. <a class="logout" href="/logout">
  65. <p>Logout</p>
  66. <svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
  67. <path d="M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4"></path>
  68. <polyline points="16 17 21 12 16 7"></polyline>
  69. <line x1="21" y1="12" x2="9" y2="12"></line>
  70. </svg>
  71. </a>
  72. </div>
  73. <div class="contentBlock">
  74. <% include ../shared/banner %>
  75. <div id="homeStrand" class="strand">
  76. <h1 class="strandTitle">Dashboard</h1>
  77. <div class="flexRow">
  78. <div id="revenueCard" class="card">
  79. <p>Total Revenue (month)</p>
  80. <p id="revenue"></p>
  81. <div id="revenueChange">
  82. <img alt="revenue">
  83. <p></p>
  84. </div>
  85. </div>
  86. <div id="graphCard" class="card">
  87. <canvas id="graphCanvas">
  88. </div>
  89. </div>
  90. <div class="flexRow">
  91. <div id="inventoryCheckCard" class="card">
  92. <p>Inventory Check</p>
  93. <ul></ul>
  94. <button class="button" onclick="homeStrandObj.submitInventoryCheck()">Update</button>
  95. </div>
  96. <div id=popularIngredientsCard class="card">
  97. <p>Most Popular Ingredients (month)</p>
  98. <canvas id="popularCanvas"></canvas>
  99. </div>
  100. </div>
  101. <template id="ingredientCheck">
  102. <li class="ingredientCheck flexRow">
  103. <p></p>
  104. <div class="numberInput">
  105. <button>-</button>
  106. <input type="number" min="0" step="0.01">
  107. <button>+</button>
  108. </div>
  109. <p></p>
  110. </li>
  111. </template>
  112. </div>
  113. <div id="ingredientsStrand" class="strand">
  114. <div class="strandHead">
  115. <h1 class="strandTitle">Ingredient Inventory</h1>
  116. <button class="button" onclick="addIngredientsComp.display()">
  117. <svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
  118. <line x1="12" y1="5" x2="12" y2="19"></line>
  119. <line x1="5" y1="12" x2="19" y2="12"></line>
  120. </svg>
  121. add
  122. </button>
  123. </div>
  124. <div class="searchBar">
  125. <div class="searchAndIcon">
  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="11" cy="11" r="8"></circle>
  128. <line x1="21" y1="21" x2="16.65" y2="16.65"></line>
  129. </svg>
  130. <input id="ingredientSearch" type="text" placeholder="FILTER" oninput="ingredientsStrandObj.search()">
  131. </div>
  132. <button id="ingredientClearButton" class="clearButton" onclick="ingredientsStrandObj.clearSorting()" style="display: none;">
  133. <svg width="30" height="30" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
  134. <circle cx="12" cy="12" r="10"></circle>
  135. <line x1="15" y1="9" x2="9" y2="15"></line>
  136. <line x1="9" y1="9" x2="15" y2="15"></line>
  137. </svg>
  138. </button>
  139. <select id="ingredientSelect" onchange="ingredientsStrandObj.sort(this.value)">Sort Bys:
  140. <option value="" selected disabled>Sort By:</option>
  141. <option value="_name">Ingredient</option>
  142. <option value="category">Category</option>
  143. <option value="unit">Unit of Measurement</option>
  144. </select>
  145. </div>
  146. <div id="categoryList"></div>
  147. <template id="categoryDiv">
  148. <div class="categoryDiv">
  149. <div>
  150. <p></p>
  151. <button>
  152. <svg width="32" height="32" viewBox="0 0 24 24" fill="none" stroke="black" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
  153. <polyline points="6 9 12 15 18 9"></polyline>
  154. </svg>
  155. </button>
  156. </div>
  157. <div class="ingredientsDiv"></div>
  158. </div>
  159. </template>
  160. <template id="ingredient">
  161. <div class="ingredient">
  162. <p></p>
  163. <hr class="ingredientSpacer">
  164. <p></p>
  165. </div>
  166. </template>
  167. </div>
  168. <div id="recipeBookStrand" class="strand">
  169. <div class="strandHead">
  170. <h1 class="strandTitle">Recipe Book</h1>
  171. <% if(merchant.pos === "none"){ %>
  172. <button class="button" onclick="newRecipeComp.display()">
  173. <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>
  174. add
  175. </button>
  176. <% } %>
  177. </div>
  178. <div class="searchBar">
  179. <div class="searchAndIcon">
  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="11" cy="11" r="8"></circle>
  182. <line x1="21" y1="21" x2="16.65" y2="16.65"></line>
  183. </svg>
  184. <input id="recipeSearch" type="text" placeholder="FILTER" oninput="recipeBookStrandObj.search()">
  185. </div>
  186. <button id="recipeClearButton" class="clearButton" onclick="recipeBookStrandObj.clearSorting()" style="display: none;">
  187. <svg width="30" height="30" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
  188. <circle cx="12" cy="12" r="10"></circle>
  189. <line x1="15" y1="9" x2="9" y2="15"></line>
  190. <line x1="9" y1="9" x2="15" y2="15"></line>
  191. </svg>
  192. </button>
  193. </div>
  194. <div id="recipeList"></div>
  195. <template id="recipe">
  196. <div class="itemDisplay">
  197. <p></p>
  198. <p></p>
  199. </div>
  200. </template>
  201. </div>
  202. <div id="ordersStrand" class="strand">
  203. <div class="strandHead">
  204. <h1 class="strandTitle">Orders</h1>
  205. <button class="button" onclick="newOrderComp.display()">
  206. <svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
  207. <line x1="12" y1="5" x2="12" y2="19"></line>
  208. <line x1="5" y1="12" x2="19" y2="12"></line>
  209. </svg>
  210. add
  211. </button>
  212. </div>
  213. <div id="orderList"></div>
  214. <template id="order">
  215. <div class="itemDisplay">
  216. <p></p>
  217. <p></p>
  218. <p></p>
  219. <p></p>
  220. </div>
  221. </template>
  222. </div>
  223. </div>
  224. <div id="transactionsStrand" class="strand">
  225. <div class="strandHead">
  226. <h1 class="strandTitle">Transactions</h1>
  227. </div>
  228. <div id="transactionsList"></div>
  229. <template id="transaction">
  230. <div class="itemDisplay">
  231. <p></p>
  232. <p></p>
  233. </div>
  234. </template>
  235. </div>
  236. <div id="sidebarDiv" class="sidebarHide">
  237. <% include ./sidebars/addIngredients %>
  238. <% include ./sidebars/newIngredient %>
  239. <% include ./sidebars/ingredientDetails %>
  240. <% include ./sidebars/recipeDetails %>
  241. <% include ./sidebars/addRecipe %>
  242. <% include ./sidebars/orderDetails %>
  243. <% include ./sidebars/newOrder %>
  244. </div>
  245. <% include ../shared/loader %>
  246. <script src="/dashboardPage/Merchant.js"></script>
  247. <script>
  248. console.time("Load");
  249. let merchant = new Merchant(
  250. <%- JSON.stringify(merchant) %>,
  251. <%- JSON.stringify(transactions) %>
  252. );
  253. console.timeEnd("Load");
  254. </script>
  255. <script src="../shared/graphs.js"></script>
  256. <script src="/dashboardPage/home.js"></script>
  257. <script src="/dashboardPage/ingredients.js"></script>
  258. <script src="/dashboardPage/recipeBook.js"></script>
  259. <script src="/dashboardPage/sidebars/sidebars.js"></script>
  260. <script src="/dashboardPage/controller.js"></script>
  261. <script src="/dashboardPage/orders.js"></script>
  262. <script src="/dashboardPage/transactions.js"></script>
  263. <script src="../shared/validation.js"></script>
  264. <noscript>Please turn on javascript for this site to work properly</noscript>
  265. </body>
  266. </html>