dashboard.ejs 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta content="width=device-width, initial-scale=1" name="viewport"/>
  6. <meta http-equiv="ScreenOrientation" content="autoRotate:disabled">
  7. <title>The Subline</title>
  8. <link rel="icon" type="img/png" href="/shared/images/logo.png">
  9. <link rel="stylesheet" href="/shared/shared.css">
  10. <link rel="stylesheet" href="/dashboardPage/dashboard.css">
  11. <link rel="stylesheet" href="/dashboardPage/sidebars.css">
  12. <link href="https://fonts.googleapis.com/css?family=Saira&display=swap" rel="stylesheet">
  13. <script src="https://cdn.plot.ly/plotly-latest.min.js"></script>
  14. </head>
  15. <body>
  16. <div id="menu" class="menu">
  17. <div id="max" class="menuHead">
  18. <a href="/">
  19. <img class="menuLogo" src="/shared/images/logo.png" alt="The Subline">
  20. <p>THE SUBLINE</p>
  21. </a>
  22. <button class="menuShifter" onclick="controller.changeMenu()">&#8801;</button>
  23. </div>
  24. <div id="min" class="menuHead menuHeadMin">
  25. <a href="/">
  26. <img class="menuLogoMin" src="/shared/images/logo.png" alt="The Subline">
  27. </a>
  28. <button id="menuShifter2" onclick="controller.changeMenu()">&#8801;</button>
  29. </div>
  30. <button class="menuButton active" id="homeBtn">
  31. <svg width="25" height="25" viewBox="0 0 24 24" fill="none" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
  32. <path d="M3 9l9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z"></path>
  33. <polyline points="9 22 9 12 15 12 15 22"></polyline>
  34. </svg>
  35. <p>DASHBOARD</p>
  36. </button>
  37. <button class="menuButton" id="ingredientsBtn">
  38. <svg width="25" height="25" viewBox="0 0 24 24" fill="none" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
  39. <polyline points="21 8 21 21 3 21 3 8"></polyline>
  40. <rect x="1" y="3" width="22" height="5"></rect>
  41. <line x1="10" y1="12" x2="14" y2="12"></line>
  42. </svg>
  43. <p>INGREDIENTS</p>
  44. </button>
  45. <button class="menuButton" id="recipeBookBtn">
  46. <svg width="25" height="25" viewBox="0 0 24 24" fill="none" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
  47. <path d="M4 19.5A2.5 2.5 0 0 1 6.5 17H20"></path>
  48. <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>
  49. </svg>
  50. <p>RECIPE BOOK</p>
  51. </button>
  52. <button class="menuButton" id="analyticsBtn">
  53. <svg width="25" height="25" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
  54. <polyline points="23 6 13.5 15.5 8.5 10.5 1 18"></polyline>
  55. <polyline points="17 6 23 6 23 12"></polyline>
  56. </svg>
  57. <p>ANALYTICS</p>
  58. </button>
  59. <button class="menuButton" id="ordersBtn">
  60. <svg width="25" height="25" viewBox="0 0 24 24" fill="none" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
  61. <circle cx="9" cy="21" r="1"></circle>
  62. <circle cx="20" cy="21" r="1"></circle>
  63. <path d="M1 1h4l2.68 13.39a2 2 0 0 0 2 1.61h9.72a2 2 0 0 0 2-1.61L23 6H6"></path>
  64. </svg>
  65. <p>ORDERS</p>
  66. </button>
  67. <button class="menuButton" id="transactionsBtn">
  68. <svg width="25" height="25" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
  69. <rect x="1" y="4" width="22" height="16" rx="2" ry="2"></rect>
  70. <line x1="1" y1="10" x2="23" y2="10"></line>
  71. </svg>
  72. <p>TRANSACTIONS</p>
  73. </button>
  74. <a class="menuButton" href="/logout">
  75. <svg width="25" height="25" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
  76. <path d="M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4"></path>
  77. <polyline points="16 17 21 12 16 7"></polyline>
  78. <line x1="21" y1="12" x2="9" y2="12"></line>
  79. </svg>
  80. <p>LOGOUT</p>
  81. </a>
  82. </div>
  83. <div id="mobileMenuSelector" class="mobileMenuSelector" onclick="controller.openMenu()">&#8801;</div>
  84. <button id="sidebarCloser" style="display: none;" onclick="controller.closeSidebar()">
  85. <svg width="30" height="30" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
  86. <line x1="18" y1="6" x2="6" y2="18"></line>
  87. <line x1="6" y1="6" x2="18" y2="18"></line>
  88. </svg>
  89. </button>
  90. <div class="contentBlock">
  91. <div id="bannerContainer">
  92. <template id="banner">
  93. <div class="banner">
  94. <div>
  95. <svg style="display:none;" width="50" height="50" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
  96. <circle cx="12" cy="12" r="10"></circle>
  97. <line x1="15" y1="9" x2="9" y2="15"></line>
  98. <line x1="9" y1="9" x2="15" y2="15"></line>
  99. </svg>
  100. <svg style="display:none;" width="50" height="50" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
  101. <circle cx="12" cy="12" r="10"></circle>
  102. <line x1="12" y1="8" x2="12" y2="12"></line>
  103. <line x1="12" y1="16" x2="12.01" y2="16"></line>
  104. </svg>
  105. <svg style="display:none;" width="50" height="50" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
  106. <path d="M22 11.08V12a10 10 0 1 1-5.93-9.14"></path>
  107. <polyline points="22 4 12 14.01 9 11.01"></polyline>
  108. </svg>
  109. </div>
  110. <p></p>
  111. <button>
  112. <svg width="18" height="18" viewBox="0 0 24 24" fill="rgb(200, 0, 0)" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
  113. <circle cx="12" cy="12" r="10"></circle>
  114. <line x1="15" y1="9" x2="9" y2="15"></line>
  115. <line x1="9" y1="9" x2="15" y2="15"></line>
  116. </svg>
  117. </button>
  118. </div>
  119. </template>
  120. </div>
  121. <div id="homeStrand" class="strand">
  122. <div class="strandHead">
  123. <h1 class="strandTitle">DASHBOARD</h1>
  124. </div>
  125. <div class="flexRow">
  126. <div id="revenueCard" class="card">
  127. <p>Total Revenue (month)</p>
  128. <p id="revenue"></p>
  129. <div id="revenueChange">
  130. <img alt="revenue">
  131. <p></p>
  132. </div>
  133. </div>
  134. <div id="graphCard" class="card mobileHide"></div>
  135. </div>
  136. <div class="flexRow">
  137. <div id="inventoryCheckCard" class="card">
  138. <p>Inventory Check</p>
  139. <ul></ul>
  140. <button id="inventoryCheck" class="button">Update</button>
  141. </div>
  142. <div id=popularIngredientsCard class="card"></div>
  143. </div>
  144. <template id="ingredientCheck">
  145. <li class="ingredientCheck flexRow">
  146. <p></p>
  147. <div class="numberInput">
  148. <button>-</button>
  149. <input type="number" min="0" step="0.01">
  150. <button>+</button>
  151. </div>
  152. <p></p>
  153. </li>
  154. </template>
  155. </div>
  156. <div id="ingredientsStrand" class="strand">
  157. <div class="strandHead">
  158. <h1 class="strandTitle">INGREDIENT INVENTORY</h1>
  159. <button class="button mobileHide" onclick="controller.openSidebar('newIngredient')">NEW</button>
  160. </div>
  161. <div class="searchBar">
  162. <svg class="searchButton" width="30" height="30" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
  163. <circle cx="11" cy="11" r="8"></circle>
  164. <line x1="21" y1="21" x2="16.65" y2="16.65"></line>
  165. </svg>
  166. <input id="ingredientSearch" class="searchInput" type="text" placeholder="SEARCH">
  167. </div>
  168. <div id="categoryList"></div>
  169. <template id="categoryDiv">
  170. <div class="categoryDiv">
  171. <div>
  172. <p></p>
  173. <button>
  174. <svg width="32" height="32" viewBox="0 0 24 24" fill="none" stroke="black" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
  175. <polyline points="6 9 12 15 18 9"></polyline>
  176. </svg>
  177. </button>
  178. </div>
  179. <div class="ingredientsDiv"></div>
  180. </div>
  181. </template>
  182. <template id="ingredient">
  183. <div class="ingredient choosable tall">
  184. <p></p>
  185. <hr class="ingredientSpacer mobileHide">
  186. <p></p>
  187. </div>
  188. </template>
  189. </div>
  190. <div id="recipeBookStrand" class="strand">
  191. <div class="strandHead">
  192. <h1 class="strandTitle">RECIPE BOOK</h1>
  193. <% if(merchant.pos === "none"){ %>
  194. <button class="button mobileHide" onclick="controller.openSidebar('addRecipe')">NEW</button>
  195. <% }else{ %>
  196. <button id="posUpdateRecipe" class="button mobileHide">UPDATE</button>
  197. <% } %>
  198. </div>
  199. <div class="searchBar">
  200. <svg class="searchButton" width="30" height="30" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
  201. <circle cx="11" cy="11" r="8"></circle>
  202. <line x1="21" y1="21" x2="16.65" y2="16.65"></line>
  203. </svg>
  204. <input id="recipeSearch" class="searchInput" type="text" placeholder="SEARCH">
  205. </div>
  206. <div id="recipeList"></div>
  207. <template id="recipe">
  208. <div class="choosable tall">
  209. <p></p>
  210. <p></p>
  211. </div>
  212. </template>
  213. </div>
  214. <div id="analyticsStrand" class="strand">
  215. <div class="strandHead">
  216. <h1 class="strandTitle">ANALYTICS</h1>
  217. <label class="switch">
  218. <input id="analSlider" type="checkbox">
  219. <span class="slider"><p>INGREDIENTS</p><p>RECIPES</p></span>
  220. </label>
  221. <div class="dateRange">
  222. <h3 class="mobileHide">Date Range:</h3>
  223. <div class="dateRangeInput">
  224. <input id="analStartDate" type="date">
  225. <p> - </p>
  226. <input id="analEndDate" type="date">
  227. </div>
  228. <button id="analDateBtn" class="button-small">SUBMIT</button>
  229. </div>
  230. </div>
  231. <div id="analIngredientContent" class="analContent">
  232. <div id="analIngredientList" class="itemsList"></div>
  233. <div class="analData">
  234. <div id="itemUseGraph" class="card analCard mobileHide"></div>
  235. <div class="dataRow">
  236. <div class="card analCard">
  237. <p>MINIMUM DAILY USE</p>
  238. <h1 id="analMinUse"></h1>
  239. </div>
  240. <div class="card analCard">
  241. <p>AVERAGE DAILY USE</p>
  242. <h1 id="analAvgUse"></h1>
  243. </div>
  244. <div class="card analCard">
  245. <p>MAXIMUM DAILY USE</p>
  246. <h1 id="analMaxUse"></h1>
  247. </div>
  248. </div>
  249. <div class="mobileHide dataRow">
  250. <div class="card analCard">
  251. <p>Sunday Average</p>
  252. <h1 id="analDayOne"></h1>
  253. </div>
  254. <div class="card analCard">
  255. <p>Monday Average</p>
  256. <h1 id="analDayTwo"></h1>
  257. </div>
  258. <div class="card analCard">
  259. <p>Tuesday Average</p>
  260. <h1 id="analDayThree"></h1>
  261. </div>
  262. <div class="card analCard">
  263. <p>Wednesday Average</p>
  264. <h1 id="analDayFour"></h1>
  265. </div>
  266. <div class="card analCard">
  267. <p>Thursday Average</p>
  268. <h1 id="analDayFive"></h1>
  269. </div>
  270. <div class="card analCard">
  271. <p>Friday Average</p>
  272. <h1 id="analDaySix"></h1>
  273. </div>
  274. <div class="card analCard">
  275. <p>Saturday Average</p>
  276. <h1 id="analDaySeven"></h1>
  277. </div>
  278. </div>
  279. </div>
  280. </div>
  281. <div id="analRecipeContent" class="analContent">
  282. <ul id="analRecipeList" class="itemsList"></ul>
  283. <div class="analData">
  284. <div id="recipeSalesGraph" class="card analCard mobileHide"></div>
  285. <div class="dataRow">
  286. <div class="card analCard">
  287. <p>Average Daily Sales</p>
  288. <h1 id="recipeAvgUse"></h1>
  289. </div>
  290. <div class="card analCard">
  291. <p>Average Daily Revenue</p>
  292. <h1 id="recipeAvgRevenue"></h1>
  293. </div>
  294. </div>
  295. </div>
  296. </div>
  297. </div>
  298. <div id="ordersStrand" class="strand">
  299. <div class="strandHead">
  300. <h1 class="strandTitle">ORDERS</h1>
  301. <div class="buttonBox">
  302. <button id="orderFilterBtn" class="button mobileHide">FILTER</button>
  303. <button id="newOrderBtn" class="button mobileHide">NEW</button>
  304. <button id="orderCalcBtn" class="button mobileHide">CALCULATOR</button>
  305. </div>
  306. </div>
  307. <div id="orderList"></div>
  308. <template id="order">
  309. <div class="choosable tall">
  310. <p></p>
  311. <p></p>
  312. <p></p>
  313. <p></p>
  314. </div>
  315. </template>
  316. </div>
  317. <div id="transactionsStrand" class="strand transactions">
  318. <div class="strandHead">
  319. <h1 class="strandTitle">TRANSACTIONS</h1>
  320. <div class="buttonBox">
  321. <button id="filterTransactionsButton" class="button">FILTER</button>
  322. <button id="newTransactionButton" class="button mobileHide">NEW</button>
  323. </div>
  324. </div>
  325. <div id="transactionsList" class="transactionsList"></div>
  326. <template id="transaction">
  327. <div class="choosable tall">
  328. <p></p>
  329. <p></p>
  330. <p></p>
  331. </div>
  332. </template>
  333. </div>
  334. </div>
  335. <div id="sidebarDiv" class="sidebarHide">
  336. <% include ./sidebars/newIngredient %>
  337. <% include ./sidebars/ingredientDetails %>
  338. <% include ./sidebars/editIngredient %>
  339. <% include ./sidebars/recipeDetails %>
  340. <% include ./sidebars/newRecipe %>
  341. <% include ./sidebars/orderDetails %>
  342. <% include ./sidebars/newOrder %>
  343. <% include ./sidebars/orderCalculator %>
  344. <% include ./sidebars/transactionDetails %>
  345. <% include ./sidebars/newTransaction %>
  346. <% include ./sidebars/editRecipe %>
  347. <% include ./sidebars/orderFilter %>
  348. <% include ./sidebars/transactionFilter %>
  349. </div>
  350. <% include ../shared/loader %>
  351. <% include ./modal %>
  352. <script>
  353. let data = {
  354. merchant: <%- JSON.stringify(merchant) %>,
  355. transactions: <%- JSON.stringify(transactions) %>
  356. }
  357. </script>
  358. <script src="./dashboardPage/bundle.js"></script>
  359. <noscript>Please turn on javascript for this site to work properly</noscript>
  360. </body>
  361. </html>