dashboard.ejs 14 KB

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