dashboard.ejs 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434
  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="controller.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="controller.changeMenu()">&#8801;</button>
  27. </div>
  28. <button class="menuButton active" id="homeBtn" onclick="controller.openStrand('home')">
  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="controller.openStrand('ingredients')">
  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="controller.openStrand('recipeBook')">
  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="analyticsBtn" onclick="controller.openStrand('analytics')">
  51. <svg width="25" height="25" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
  52. <polyline points="23 6 13.5 15.5 8.5 10.5 1 18"></polyline>
  53. <polyline points="17 6 23 6 23 12"></polyline>
  54. </svg>
  55. <p>ANALYTICS</p>
  56. </button>
  57. <button class="menuButton" id="ordersBtn" onclick="controller.openStrand('orders')">
  58. <svg width="25" height="25" viewBox="0 0 24 24" fill="none" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
  59. <circle cx="9" cy="21" r="1"></circle>
  60. <circle cx="20" cy="21" r="1"></circle>
  61. <path d="M1 1h4l2.68 13.39a2 2 0 0 0 2 1.61h9.72a2 2 0 0 0 2-1.61L23 6H6"></path>
  62. </svg>
  63. <p>ORDERS</p>
  64. </button>
  65. <button class="menuButton" id="transactionsBtn" onclick="controller.openStrand('transactions')">
  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. <rect x="1" y="4" width="22" height="16" rx="2" ry="2"></rect>
  68. <line x1="1" y1="10" x2="23" y2="10"></line>
  69. </svg>
  70. <p>TRANSACTIONS</p>
  71. </button>
  72. <a class="menuButton" href="/logout">
  73. <svg width="25" height="25" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
  74. <path d="M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4"></path>
  75. <polyline points="16 17 21 12 16 7"></polyline>
  76. <line x1="21" y1="12" x2="9" y2="12"></line>
  77. </svg>
  78. <p>LOGOUT</p>
  79. </a>
  80. </div>
  81. <div id="mobileMenuSelector" class="mobileMenuSelector" onclick="controller.openMenu()">&#8801;</div>
  82. <button id="sidebarCloser" style="display: none;" onclick="controller.closeSidebar()">
  83. <svg width="30" height="30" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
  84. <line x1="18" y1="6" x2="6" y2="18"></line>
  85. <line x1="6" y1="6" x2="18" y2="18"></line>
  86. </svg>
  87. </button>
  88. <div class="contentBlock">
  89. <% include ../shared/banner %>
  90. <div id="homeStrand" class="strand">
  91. <div class="strandHead">
  92. <h1 class="strandTitle">DASHBOARD</h1>
  93. </div>
  94. <div class="flexRow">
  95. <div id="revenueCard" class="card">
  96. <p>Total Revenue (month)</p>
  97. <p id="revenue"></p>
  98. <div id="revenueChange">
  99. <img alt="revenue">
  100. <p></p>
  101. </div>
  102. </div>
  103. <div id="graphCard" class="card">
  104. <canvas id="graphCanvas">
  105. </div>
  106. </div>
  107. <div class="flexRow">
  108. <div id="inventoryCheckCard" class="card">
  109. <p>Inventory Check</p>
  110. <ul></ul>
  111. <button id="inventoryCheck" class="button">Update</button>
  112. </div>
  113. <div id=popularIngredientsCard class="card">
  114. <p>Most Popular Ingredients (month)</p>
  115. <canvas id="popularCanvas"></canvas>
  116. </div>
  117. </div>
  118. <template id="ingredientCheck">
  119. <li class="ingredientCheck flexRow">
  120. <p></p>
  121. <div class="numberInput">
  122. <button>-</button>
  123. <input type="number" min="0" step="0.01">
  124. <button>+</button>
  125. </div>
  126. <p></p>
  127. </li>
  128. </template>
  129. </div>
  130. <div id="ingredientsStrand" class="strand">
  131. <div class="strandHead">
  132. <h1 class="strandTitle">INGREDIENT INVENTORY</h1>
  133. <button class="button mobileHide" onclick="controller.openSidebar('newIngredient')">NEW</button>
  134. </div>
  135. <div class="searchBar">
  136. <div class="searchAndIcon">
  137. <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">
  138. <circle cx="11" cy="11" r="8"></circle>
  139. <line x1="21" y1="21" x2="16.65" y2="16.65"></line>
  140. </svg>
  141. <input id="ingredientSearch" type="text" placeholder="FILTER">
  142. </div>
  143. <button id="ingredientClearButton" class="clearButton" style="display: none;">
  144. <svg width="30" height="30" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
  145. <circle cx="12" cy="12" r="10"></circle>
  146. <line x1="15" y1="9" x2="9" y2="15"></line>
  147. <line x1="9" y1="9" x2="15" y2="15"></line>
  148. </svg>
  149. </button>
  150. <select id="ingredientSelect" class="mobileHide">Sort By:
  151. <option value="" selected disabled>Sort By:</option>
  152. <option value="_name">Ingredient</option>
  153. <option value="category">Category</option>
  154. <option value="unit">Unit of Measurement</option>
  155. </select>
  156. </div>
  157. <div id="categoryList"></div>
  158. <template id="categoryDiv">
  159. <div class="categoryDiv">
  160. <div>
  161. <p></p>
  162. <button>
  163. <svg width="32" height="32" viewBox="0 0 24 24" fill="none" stroke="black" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
  164. <polyline points="6 9 12 15 18 9"></polyline>
  165. </svg>
  166. </button>
  167. </div>
  168. <div class="ingredientsDiv"></div>
  169. </div>
  170. </template>
  171. <template id="ingredient">
  172. <div class="ingredient">
  173. <p></p>
  174. <hr class="ingredientSpacer mobileHide">
  175. <p></p>
  176. </div>
  177. </template>
  178. </div>
  179. <div id="recipeBookStrand" class="strand">
  180. <div class="strandHead">
  181. <h1 class="strandTitle">RECIPE BOOK</h1>
  182. <% if(merchant.pos === "none"){ %>
  183. <button class="button mobileHide" onclick="controller.openSidebar('addRecipe')">NEW</button>
  184. <% }else{ %>
  185. <button id="posUpdateRecipe" class="button mobileHide">UPDATE</button>
  186. <% } %>
  187. </div>
  188. <div class="searchBar">
  189. <div class="searchAndIcon">
  190. <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">
  191. <circle cx="11" cy="11" r="8"></circle>
  192. <line x1="21" y1="21" x2="16.65" y2="16.65"></line>
  193. </svg>
  194. <input id="recipeSearch" type="text" placeholder="FILTER">
  195. </div>
  196. <button id="recipeClearButton" class="clearButton" style="display: none;">
  197. <svg width="30" height="30" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
  198. <circle cx="12" cy="12" r="10"></circle>
  199. <line x1="15" y1="9" x2="9" y2="15"></line>
  200. <line x1="9" y1="9" x2="15" y2="15"></line>
  201. </svg>
  202. </button>
  203. </div>
  204. <div id="recipeList"></div>
  205. <template id="recipe">
  206. <div class="itemDisplay">
  207. <p></p>
  208. <p></p>
  209. </div>
  210. </template>
  211. </div>
  212. <div id="analyticsStrand" class="strand">
  213. <div class="strandHead">
  214. <h1 class="strandTitle">ANALYTICS</h1>
  215. <div>
  216. <label>FROM:
  217. <input id="analStartDate" type="date">
  218. </label>
  219. <label>TO:
  220. <input id="analEndDate" type="date">
  221. </label>
  222. <button id="analDateBtn" class="button">SUBMIT</button>
  223. </div>
  224. </div>
  225. <div class="analContent">
  226. <ul id="itemsList" class="itemsList"></ul>
  227. <div class="analData">
  228. <div id="itemUseGraph" class="card"></div>
  229. <div class="dataRow">
  230. <div class="card analCard">
  231. <p>AVERAGE DAILY USE</p>
  232. <h1 id="analAvgUse"></h1>
  233. </div>
  234. </div>
  235. </div>
  236. </div>
  237. </div>
  238. <div id="ordersStrand" class="strand">
  239. <div class="strandHead">
  240. <h1 class="strandTitle">ORDERS</h1>
  241. <button class="button mobileHide" onclick="controller.openSidebar('newOrder')">NEW</button>
  242. </div>
  243. <form id="orderSubmitForm" class="filterForm">
  244. <h2>Search</h2>
  245. <div>
  246. <div class="dropdown">
  247. <div class="dropdownHead">
  248. <p>DATES</p>
  249. <button id="dateFilterBtnOrder">
  250. <svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
  251. <polyline points="6 9 12 15 18 9"></polyline>
  252. </svg>
  253. </button>
  254. </div>
  255. <div class="dropdownContents" id="dateDropdownOrder">
  256. <label>From:
  257. <input id="orderFilDate1"type="date">
  258. </label>
  259. <label>To:
  260. <input id="orderFilDate2" type="date">
  261. </label>
  262. </div>
  263. </div>
  264. <div class="dropdown">
  265. <div class="dropdownHead">
  266. <p>INGREDIENTS</p>
  267. <button id="ingredientFilterBtn">
  268. <svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
  269. <polyline points="6 9 12 15 18 9"></polyline>
  270. </svg>
  271. </button>
  272. </div>
  273. <div class="dropdownContents" id="ingredientDropdown"></div>
  274. </div>
  275. </div>
  276. <input class="button" type="submit" value="SUBMIT">
  277. </form>
  278. <div id="orderList"></div>
  279. <template id="order">
  280. <div class="itemDisplay">
  281. <p></p>
  282. <p></p>
  283. <p></p>
  284. <p></p>
  285. </div>
  286. </template>
  287. </div>
  288. <div id="transactionsStrand" class="strand transactions">
  289. <div class="strandHead">
  290. <h1 class="strandTitle">TRANSACTIONS</h1>
  291. <button class="button mobileHide" onclick="controller.openSidebar('newTransaction')">NEW</button>
  292. </div>
  293. <form id="transFormSubmit" class="filterForm">
  294. <h2>Search</h2>
  295. <div>
  296. <div class="dropdown">
  297. <div class="dropdownHead">
  298. <p>DATES</p>
  299. <button id="dateFilterBtn">
  300. <svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
  301. <polyline points="6 9 12 15 18 9"></polyline>
  302. </svg>
  303. </button>
  304. </div>
  305. <div class="dropdownContents" id="dateDropdown">
  306. <label>From:
  307. <input id="transFilDate1"type="date">
  308. </label>
  309. <label>To:
  310. <input id="transFilDate2" type="date">
  311. </label>
  312. </div>
  313. </div>
  314. <div class="dropdown">
  315. <div class="dropdownHead">
  316. <p>RECIPES</p>
  317. <button id="recipeFilterBtn">
  318. <svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
  319. <polyline points="6 9 12 15 18 9"></polyline>
  320. </svg>
  321. </button>
  322. </div>
  323. <div class="dropdownContents" id="recipeDropDown"></div>
  324. </div>
  325. </div>
  326. <input class="button" type="submit" value="SUBMIT">
  327. </form>
  328. <div id="transactionsList" class="transactionsList"></div>
  329. <template id="transaction">
  330. <div class="itemDisplay">
  331. <p></p>
  332. <p></p>
  333. <p></p>
  334. </div>
  335. </template>
  336. </div>
  337. </div>
  338. <div id="sidebarDiv" class="sidebarHide">
  339. <% include ./sidebars/newIngredient %>
  340. <% include ./sidebars/ingredientDetails %>
  341. <% include ./sidebars/recipeDetails %>
  342. <% include ./sidebars/newRecipe %>
  343. <% include ./sidebars/orderDetails %>
  344. <% include ./sidebars/newOrder %>
  345. <% include ./sidebars/transactionDetails %>
  346. <% include ./sidebars/newTransaction %>
  347. </div>
  348. <% include ../shared/loader %>
  349. <script>
  350. let data = {
  351. merchant: <%- JSON.stringify(merchant) %>,
  352. transactions: <%- JSON.stringify(transactions) %>
  353. }
  354. </script>
  355. <script src="./dashboardPage/bundle.js"></script>
  356. <script src="https://cdn.plot.ly/plotly-latest.min.js"></script>
  357. <noscript>Please turn on javascript for this site to work properly</noscript>
  358. </body>
  359. </html>