dashboard.ejs 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392
  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 id="menuShifter2" onclick="changeMenu()">&#8801;</button>
  27. </div>
  28. <button class="menuButton active" id="homeBtn" class="active" onclick="changeStrand(1)">
  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 class="menuButton" id="ingredientsBtn" onclick="changeStrand(2)">
  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 class="menuButton" id="recipeBookBtn" onclick="changeStrand(3)">
  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 class="menuButton" id="ordersBtn" onclick="changeStrand(4)">
  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 class="menuButton" id="transactionsBtn" onclick="changeStrand(5)">
  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="menuButton" href="/logout">
  66. <svg width="25" height="25" 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. <p>LOGOUT</p>
  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. <div class="strandHead">
  85. <h1 class="strandTitle">DASHBOARD</h1>
  86. </div>
  87. <div class="flexRow">
  88. <div id="revenueCard" class="card">
  89. <p>Total Revenue (month)</p>
  90. <p id="revenue"></p>
  91. <div id="revenueChange">
  92. <img alt="revenue">
  93. <p></p>
  94. </div>
  95. </div>
  96. <div id="graphCard" class="card">
  97. <canvas id="graphCanvas">
  98. </div>
  99. </div>
  100. <div class="flexRow">
  101. <div id="inventoryCheckCard" class="card">
  102. <p>Inventory Check</p>
  103. <ul></ul>
  104. <button class="button" onclick="homeStrandObj.submitInventoryCheck()">Update</button>
  105. </div>
  106. <div id=popularIngredientsCard class="card">
  107. <p>Most Popular Ingredients (month)</p>
  108. <canvas id="popularCanvas"></canvas>
  109. </div>
  110. </div>
  111. <template id="ingredientCheck">
  112. <li class="ingredientCheck flexRow">
  113. <p></p>
  114. <div class="numberInput">
  115. <button>-</button>
  116. <input type="number" min="0" step="0.01">
  117. <button>+</button>
  118. </div>
  119. <p></p>
  120. </li>
  121. </template>
  122. </div>
  123. <div id="ingredientsStrand" class="strand">
  124. <div class="strandHead">
  125. <h1 class="strandTitle">INGREDIENT INVENTORY</h1>
  126. <button class="button mobileHide" onclick="addIngredientsComp.display()">NEW</button>
  127. </div>
  128. <div class="searchBar">
  129. <div class="searchAndIcon">
  130. <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">
  131. <circle cx="11" cy="11" r="8"></circle>
  132. <line x1="21" y1="21" x2="16.65" y2="16.65"></line>
  133. </svg>
  134. <input id="ingredientSearch" type="text" placeholder="FILTER" oninput="ingredientsStrandObj.search()">
  135. </div>
  136. <button id="ingredientClearButton" class="clearButton" onclick="ingredientsStrandObj.clearSorting()" style="display: none;">
  137. <svg width="30" height="30" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
  138. <circle cx="12" cy="12" r="10"></circle>
  139. <line x1="15" y1="9" x2="9" y2="15"></line>
  140. <line x1="9" y1="9" x2="15" y2="15"></line>
  141. </svg>
  142. </button>
  143. <select id="ingredientSelect" class="mobileHide" onchange="ingredientsStrandObj.sort(this.value)">Sort Bys:
  144. <option value="" selected disabled>Sort By:</option>
  145. <option value="_name">Ingredient</option>
  146. <option value="category">Category</option>
  147. <option value="unit">Unit of Measurement</option>
  148. </select>
  149. </div>
  150. <div id="categoryList"></div>
  151. <template id="categoryDiv">
  152. <div class="categoryDiv">
  153. <div>
  154. <p></p>
  155. <button>
  156. <svg width="32" height="32" viewBox="0 0 24 24" fill="none" stroke="black" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
  157. <polyline points="6 9 12 15 18 9"></polyline>
  158. </svg>
  159. </button>
  160. </div>
  161. <div class="ingredientsDiv"></div>
  162. </div>
  163. </template>
  164. <template id="ingredient">
  165. <div class="ingredient">
  166. <p></p>
  167. <hr class="ingredientSpacer mobileHide">
  168. <p></p>
  169. </div>
  170. </template>
  171. </div>
  172. <div id="recipeBookStrand" class="strand">
  173. <div class="strandHead">
  174. <h1 class="strandTitle">RECIPE BOOK</h1>
  175. <% if(merchant.pos === "none"){ %>
  176. <button class="button mobileHide" onclick="newRecipeComp.display()">NEW</button>
  177. <% }else if(merchant.pos === "clover"){ %>
  178. <button class="button mobileHide" onclick="recipeBookStrandObj.posUpdate()">UPDATE</button>
  179. <% } %>
  180. </div>
  181. <div class="searchBar">
  182. <div class="searchAndIcon">
  183. <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">
  184. <circle cx="11" cy="11" r="8"></circle>
  185. <line x1="21" y1="21" x2="16.65" y2="16.65"></line>
  186. </svg>
  187. <input id="recipeSearch" type="text" placeholder="FILTER" oninput="recipeBookStrandObj.search()">
  188. </div>
  189. <button id="recipeClearButton" class="clearButton" onclick="recipeBookStrandObj.clearSorting()" style="display: none;">
  190. <svg width="30" height="30" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
  191. <circle cx="12" cy="12" r="10"></circle>
  192. <line x1="15" y1="9" x2="9" y2="15"></line>
  193. <line x1="9" y1="9" x2="15" y2="15"></line>
  194. </svg>
  195. </button>
  196. </div>
  197. <div id="recipeList"></div>
  198. <template id="recipe">
  199. <div class="itemDisplay">
  200. <p></p>
  201. <p></p>
  202. </div>
  203. </template>
  204. </div>
  205. <div id="ordersStrand" class="strand">
  206. <div class="strandHead">
  207. <h1 class="strandTitle">ORDERS</h1>
  208. <button class="button mobileHide" onclick="newOrderComp.display()">NEW</button>
  209. </div>
  210. <form onsubmit="ordersStrandObj.submitFilter()" class="filterForm">
  211. <h2>Search</h2>
  212. <div>
  213. <div class="dropdown">
  214. <div class="dropdownHead">
  215. <p>DATES</p>
  216. <button id="dateFilterBtnOrder">
  217. <svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
  218. <polyline points="6 9 12 15 18 9"></polyline>
  219. </svg>
  220. </button>
  221. </div>
  222. <div class="dropdownContents" id="dateDropdownOrder">
  223. <label>From:
  224. <input id="orderFilDate1"type="date">
  225. </label>
  226. <label>To:
  227. <input id="orderFilDate2" type="date">
  228. </label>
  229. </div>
  230. </div>
  231. <div class="dropdown">
  232. <div class="dropdownHead">
  233. <p>INGREDIENTS</p>
  234. <button id="ingredientFilterBtn">
  235. <svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
  236. <polyline points="6 9 12 15 18 9"></polyline>
  237. </svg>
  238. </button>
  239. </div>
  240. <div class="dropdownContents" id="ingredientDropdown"></div>
  241. </div>
  242. </div>
  243. <input class="button" type="submit" value="SUBMIT">
  244. </form>
  245. <div id="orderList"></div>
  246. <template id="order">
  247. <div class="itemDisplay">
  248. <p></p>
  249. <p></p>
  250. <p></p>
  251. <p></p>
  252. </div>
  253. </template>
  254. </div>
  255. <div id="transactionsStrand" class="strand transactions">
  256. <div class="strandHead">
  257. <h1 class="strandTitle">TRANSACTIONS</h1>
  258. <button class="button mobileHide" onclick="newTransactionComp.display()">NEW</button>
  259. </div>
  260. <form onsubmit="transactionsStrandObj.submitFilter()" class="filterForm">
  261. <h2>Search</h2>
  262. <div>
  263. <div class="dropdown">
  264. <div class="dropdownHead">
  265. <p>DATES</p>
  266. <button id="dateFilterBtn">
  267. <svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
  268. <polyline points="6 9 12 15 18 9"></polyline>
  269. </svg>
  270. </button>
  271. </div>
  272. <div class="dropdownContents" id="dateDropdown">
  273. <label>From:
  274. <input id="transFilDate1"type="date">
  275. </label>
  276. <label>To:
  277. <input id="transFilDate2" type="date">
  278. </label>
  279. </div>
  280. </div>
  281. <div class="dropdown">
  282. <div class="dropdownHead">
  283. <p>RECIPES</p>
  284. <button id="recipeFilterBtn">
  285. <svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
  286. <polyline points="6 9 12 15 18 9"></polyline>
  287. </svg>
  288. </button>
  289. </div>
  290. <div class="dropdownContents" id="recipeDropDown"></div>
  291. </div>
  292. </div>
  293. <input class="button" type="submit" value="SUBMIT">
  294. </form>
  295. <div id="transactionsList" class="transactionsList"></div>
  296. <template id="transaction">
  297. <div class="itemDisplay">
  298. <p></p>
  299. <p></p>
  300. <p></p>
  301. </div>
  302. </template>
  303. </div>
  304. </div>
  305. <div id="sidebarDiv" class="sidebarHide">
  306. <% include ./sidebars/addIngredients %>
  307. <% include ./sidebars/newIngredient %>
  308. <% include ./sidebars/ingredientDetails %>
  309. <% include ./sidebars/recipeDetails %>
  310. <% include ./sidebars/addRecipe %>
  311. <% include ./sidebars/orderDetails %>
  312. <% include ./sidebars/newOrder %>
  313. <% include ./sidebars/transactionDetails %>
  314. <% include ./sidebars/newTransaction %>
  315. </div>
  316. <% include ../shared/loader %>
  317. <script>
  318. let data = {
  319. merchant: <%- JSON.stringify(merchant) %>,
  320. transactions: <%- JSON.stringify(transactions) %>
  321. }
  322. </script>
  323. <script src="./dashboardPage/bundle.js"></script>
  324. <noscript>Please turn on javascript for this site to work properly</noscript>
  325. </body>
  326. </html>