dashboard.ejs 21 KB

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