dashboard.ejs 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317
  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()">NEW</button>
  117. </div>
  118. <div class="searchBar">
  119. <div class="searchAndIcon">
  120. <svg width="30" height="30" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
  121. <circle cx="11" cy="11" r="8"></circle>
  122. <line x1="21" y1="21" x2="16.65" y2="16.65"></line>
  123. </svg>
  124. <input id="ingredientSearch" type="text" placeholder="FILTER" oninput="ingredientsStrandObj.search()">
  125. </div>
  126. <button id="ingredientClearButton" class="clearButton" onclick="ingredientsStrandObj.clearSorting()" style="display: none;">
  127. <svg width="30" height="30" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
  128. <circle cx="12" cy="12" r="10"></circle>
  129. <line x1="15" y1="9" x2="9" y2="15"></line>
  130. <line x1="9" y1="9" x2="15" y2="15"></line>
  131. </svg>
  132. </button>
  133. <select id="ingredientSelect" onchange="ingredientsStrandObj.sort(this.value)">Sort Bys:
  134. <option value="" selected disabled>Sort By:</option>
  135. <option value="_name">Ingredient</option>
  136. <option value="category">Category</option>
  137. <option value="unit">Unit of Measurement</option>
  138. </select>
  139. </div>
  140. <div id="categoryList"></div>
  141. <template id="categoryDiv">
  142. <div class="categoryDiv">
  143. <div>
  144. <p></p>
  145. <button>
  146. <svg width="32" height="32" viewBox="0 0 24 24" fill="none" stroke="black" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
  147. <polyline points="6 9 12 15 18 9"></polyline>
  148. </svg>
  149. </button>
  150. </div>
  151. <div class="ingredientsDiv"></div>
  152. </div>
  153. </template>
  154. <template id="ingredient">
  155. <div class="ingredient">
  156. <p></p>
  157. <hr class="ingredientSpacer">
  158. <p></p>
  159. </div>
  160. </template>
  161. </div>
  162. <div id="recipeBookStrand" class="strand">
  163. <div class="strandHead">
  164. <h1 class="strandTitle">RECIPE BOOK</h1>
  165. <% if(merchant.pos === "none"){ %>
  166. <button class="button" onclick="newRecipeComp.display()">NEW</button>
  167. <% } %>
  168. </div>
  169. <div class="searchBar">
  170. <div class="searchAndIcon">
  171. <svg width="30" height="30" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
  172. <circle cx="11" cy="11" r="8"></circle>
  173. <line x1="21" y1="21" x2="16.65" y2="16.65"></line>
  174. </svg>
  175. <input id="recipeSearch" type="text" placeholder="FILTER" oninput="recipeBookStrandObj.search()">
  176. </div>
  177. <button id="recipeClearButton" class="clearButton" onclick="recipeBookStrandObj.clearSorting()" style="display: none;">
  178. <svg width="30" height="30" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
  179. <circle cx="12" cy="12" r="10"></circle>
  180. <line x1="15" y1="9" x2="9" y2="15"></line>
  181. <line x1="9" y1="9" x2="15" y2="15"></line>
  182. </svg>
  183. </button>
  184. </div>
  185. <div id="recipeList"></div>
  186. <template id="recipe">
  187. <div class="itemDisplay">
  188. <p></p>
  189. <p></p>
  190. </div>
  191. </template>
  192. </div>
  193. <div id="ordersStrand" class="strand">
  194. <div class="strandHead">
  195. <h1 class="strandTitle">ORDERS</h1>
  196. <button class="button" onclick="newOrderComp.display()">NEW</button>
  197. </div>
  198. <div id="orderList"></div>
  199. <template id="order">
  200. <div class="itemDisplay">
  201. <p></p>
  202. <p></p>
  203. <p></p>
  204. <p></p>
  205. </div>
  206. </template>
  207. </div>
  208. <div id="transactionsStrand" class="strand transactions">
  209. <div class="strandHead">
  210. <h1 class="strandTitle">TRANSACTIONS</h1>
  211. <button class="button" onclick="newTransactionComp.display()">NEW</button>
  212. </div>
  213. <div id="transactionsList" class="transactionsList"></div>
  214. <template id="transaction">
  215. <div class="itemDisplay">
  216. <p></p>
  217. <p></p>
  218. <p></p>
  219. </div>
  220. </template>
  221. </div>
  222. </div>
  223. <div id="sidebarDiv" class="sidebarHide">
  224. <% include ./sidebars/addIngredients %>
  225. <% include ./sidebars/newIngredient %>
  226. <% include ./sidebars/ingredientDetails %>
  227. <% include ./sidebars/recipeDetails %>
  228. <% include ./sidebars/addRecipe %>
  229. <% include ./sidebars/orderDetails %>
  230. <% include ./sidebars/newOrder %>
  231. <% include ./sidebars/transactionDetails %>
  232. <% include ./sidebars/newTransaction %>
  233. </div>
  234. <% include ../shared/loader %>
  235. <script src="/dashboardPage/Merchant.js"></script>
  236. <script>
  237. let merchant = new Merchant(
  238. <%- JSON.stringify(merchant) %>,
  239. <%- JSON.stringify(transactions) %>
  240. );
  241. </script>
  242. <script src="../shared/graphs.js"></script>
  243. <script src="/dashboardPage/home.js"></script>
  244. <script src="/dashboardPage/ingredients.js"></script>
  245. <script src="/dashboardPage/recipeBook.js"></script>
  246. <script src="/dashboardPage/sidebars/sidebars.js"></script>
  247. <script src="/dashboardPage/controller.js"></script>
  248. <script src="/dashboardPage/orders.js"></script>
  249. <script src="/dashboardPage/transactions.js"></script>
  250. <script src="../shared/validation.js"></script>
  251. <noscript>Please turn on javascript for this site to work properly</noscript>
  252. </body>
  253. </html>