room.html 30 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550
  1. <template name="room">
  2. <header>
  3. <nav>
  4. <div class="nav-wrapper light-blue accent-4">
  5. <ul class="left hide-on-med-and-down">
  6. <li><a href="/"><i class="material-icons">home</i></a></li>
  7. <li><a href="#add_song_modal" class="tooltipped" data-position="bottom" data-delay="50" data-tooltip="Request a song" id="add-song-modal-button"><i class="material-icons">playlist_add</i></a></li>
  8. <li><a href="#report_modal" class="tooltipped" data-position="bottom" data-delay="50" data-tooltip="Flag a song" id="report-modal-button"><i class="material-icons">flag</i></a></li>
  9. <li><a id="vote-skip" class="tooltipped" data-position="bottom" data-delay="50" data-tooltip="Vote to skip this song"><i class="material-icons left">skip_next</i>{{votes}}</a></li>
  10. {{#if isAdmin}}
  11. <li><a class='dropdown-button' data-activates='admin-dropdown'><i class="material-icons">control_point</i></a></li>
  12. {{/if}}
  13. </ul>
  14. <span class="brand-logo center">{{type}}</span>
  15. <ul class="right hide-on-med-and-down">
  16. <li><a href="#" data-position="bottom" data-delay="50" data-tooltip="Playlist" id="playlist-slideout" data-activates="playlist-slide-out" class="tooltipped header-collapse"><i class="material-icons">queue_music</i></a></li>
  17. <li><a href="#" data-position="bottom" data-delay="50" data-tooltip="Chat" id="chat-slideout" data-activates="chat-slide-out" class="tooltipped header-collapse"><i class="material-icons">chat</i></a></li>
  18. <li><a href="#" data-position="bottom" data-delay="50" data-tooltip="Users" id="users-slideout" data-activates="users-slide-out" class="tooltipped header-collapse"><i class="material-icons">people</i></a></li>
  19. </ul>
  20. </div>
  21. </nav>
  22. </header>
  23. {{> alerts}}
  24. <main id="room-content">
  25. <div class="container room-container">
  26. <div class="row">
  27. <div class="col s12 m10 l8 offset-l2 offset-m1" id="media-container">
  28. <div class="video-container">
  29. <div id="player"></div>
  30. </div>
  31. </div>
  32. <div class="col s12 m10 l8 offset-l2 offset-m1">
  33. <div class="row">
  34. <div class="col s12 m12 l8">
  35. <h4 id="time-display"><span id="time-elapsed"></span> / <span id="time-total"></span></h4>
  36. <h3>{{{title}}}</h3>
  37. <h4 class="thin" style="margin-left: 0">{{{artist}}}</h4>
  38. <div class="row">
  39. <form action="#" class="left col s4 m4 l4">
  40. <p class="range-field" style="margin-top: 0">
  41. <input type="range" id="volume_slider" min="0" max="100"/>
  42. </p>
  43. </form>
  44. <div class="right col s8 m5 l5">
  45. <ul>
  46. <li id="like" class="right"><span class="flow-text">{{likes}} </span> <i id="thumbs_up" class="material-icons grey-text {{liked}}">thumb_up</i></li>
  47. <li style="margin-right: 10px;" id="dislike" class="right"><span class="flow-text">{{dislikes}} </span><i id="thumbs_down" class="material-icons grey-text {{disliked}}">thumb_down</i></li>
  48. </ul>
  49. </div>
  50. </div>
  51. <div class="seeker-bar-container white" id="preview-progress">
  52. <div class="seeker-bar light-blue" style="width: 0%"></div>
  53. </div>
  54. </div>
  55. <img alt="Not loading" class="responsive-img song-img col s12 m12 l4"
  56. onError="this.src='/notes.png'"
  57. id="song-img" style="margin-top: 10px !important"/>
  58. </div>
  59. </div>
  60. </div>
  61. </div>
  62. </main>
  63. {{> footer}}
  64. <!--Chat slideout-->
  65. <div id="chat-slide-out" class="side-nav room-slideout">
  66. <h5>Chat</h5>
  67. <ul class="chat-ul">
  68. {{#each globalChat}}
  69. {{#emojione}}
  70. <li class="chat-message" style="line-height: 30px">
  71. <span title="{{time}}" style="float: right; margin-top: 15px">{{rtime time}}</span>
  72. <a style="text-decoration: none; font-size: 0.9em; height: 0.9em; font-weight: 500" href="/u/{{this.username}}" target="_blank"><span class="rank-{{this.rawrank}}">{{this.rank}}</span>{{this.username}}</a>
  73. <p style="clear: both; line-height: 1.2em; margin-left: 13px; margin-bottom: 0; font-size: 1.2em">{{{this.message}}}</p>
  74. </li>
  75. {{/emojione}}
  76. <div class="divider" style="margin-top: 15px;"></div>
  77. {{/each}}
  78. </ul>
  79. <div>
  80. <div class="row" id="chat-input-div">
  81. <div class="input-field col s12">
  82. {{#if currentUser}}
  83. <input id="chat-message" type="text">
  84. <label for="chat-message">Send a message</label>
  85. {{else}}
  86. <input id="chat-message" class="disabled" disabled type="text">
  87. <label for="chat-message">You have to be logged in to chat.</label>
  88. {{/if}}
  89. </div>
  90. </div>
  91. {{#if currentUser}}
  92. <a id="submit" class="waves-effect waves-light btn">Send</a>
  93. {{else}}
  94. <a id="submit" class="waves-effect waves-light btn disabled" disabled>Send</a>
  95. {{/if}}
  96. </div>
  97. </div>
  98. <!--Playlist slideout-->
  99. <div id="playlist-slide-out" class="side-nav room-slideout">
  100. <h5>Playlist</h5>
  101. {{> playlist}}
  102. </div>
  103. <div id="users-slide-out" class="side-nav room-slideout">
  104. <h5>Users In Room</h5>
  105. <ul style="margin-bottom: 64px;">
  106. {{#each usersInRoom}}
  107. <li><a href=/u/{{this}} target="_blank">{{this}}</a></li>
  108. {{/each}}
  109. </ul>
  110. {{#if currentUser}}
  111. <a class="btn btn-block musare white-text waves-effect waves-light" href="#" id="logout" style="position: fixed; bottom: 0; width: 342px;">Logout</a>
  112. {{else}}
  113. <a class="btn btn-block musare white-text waves-effect waves-light" href="/login" style="position: fixed; bottom: 0; width: 342px;">Login / Register</a>
  114. {{/if}}
  115. </div>
  116. <!--Admin room controls-->
  117. <ul id='admin-dropdown' style="background-color: rgb(3, 169, 244) !important; display: none">
  118. {{#if paused}}
  119. <li><a id="play"><i class="material-icons">play_arrow</i></a></li>
  120. {{else}}
  121. <li><a id="pause"><i class="material-icons">pause</i></a></li>
  122. {{/if}}
  123. <li><a id="skip"><i class="material-icons">skip_next</i></a></li>
  124. <li><a id="shuffle"><i class="material-icons">shuffle</i></a></li>
  125. {{#if private}}
  126. <li><a id="unlock"><i class="material-icons">lock_outline</i></a></li>
  127. {{else}}
  128. <li><a id="lock"><i class="material-icons">lock_open</i></a></li>
  129. {{/if}}
  130. </ul>
  131. <!--Add song modal-->
  132. <div id="add_song_modal" class="modal">
  133. <div class="modal-content container">
  134. <div class="row">
  135. <form class="black-text" id="search-info">
  136. <div class="row">
  137. <div class="input-field">
  138. <select id="si_or_pl">
  139. <option value="singleVideo" selected>Single Song</option>
  140. <option value="importPlaylist">Import Playlist</option>
  141. <label>Import Type</label>
  142. </select>
  143. </div>
  144. </div>
  145. {{#if singleVideo}}
  146. {{#if editingSong}}
  147. <div class="row">
  148. <button type="button" id="return-button" style="margin-bottom: 20px;"
  149. class="btn btn-small col l4 m4 s8 offset-l4 offset-m4 offset-s2 center waves-effect waves-light">
  150. Return
  151. </button>
  152. <h4 class="center-align col l12 m12 s12">Add Song</h4>
  153. <div class="input-field col l8 m8 s12 offset-l2 offset-m2">
  154. <select multiple id="genres">
  155. <option value="" disabled selected>Select Genre(s):</option>
  156. <option value="edm">EDM</option>
  157. <option value="chill">Chill</option>
  158. <option value="pop">Pop</option>
  159. <option value="country">Country</option>
  160. <option value="rock">Rock</option>
  161. <option value="randb">R&B</option>
  162. <option value="rap">Rap</option>
  163. <option value="heavymetal">Heavy Metal</option>
  164. <option value="christmas">Christmas</option>
  165. <option value="alternative">Alternative</option>
  166. </select>
  167. <label class="white-text">Genre(s)</label>
  168. </div>
  169. <div class="input-field col l8 m8 s12 offset-l2 offset-m2">
  170. <i class="material-icons prefix">vpn_key</i>
  171. <label for="id" class="light-blue-text">Song ID</label>
  172. <input class="validate" name="id" id="id" type="text" pattern=".{11}"/>
  173. </div>
  174. <div class="input-field col l8 m8 s12 offset-l2 offset-m2">
  175. <i class="material-icons prefix">person</i>
  176. <label for="artist" class="light-blue-text">Song Artist</label>
  177. <input class="validate" name="artist" id="artist" aria-required="true"
  178. type="text"/>
  179. </div>
  180. <div class="input-field col l8 m8 s12 offset-l2 offset-m2">
  181. <i class="material-icons prefix">subject</i>
  182. <label for="title" class="light-blue-text">Song Title</label>
  183. <input class="validate required" name="title" id="title" type="text"/>
  184. </div>
  185. <button type="button" id="add-song-button"
  186. class="btn btn-large col l6 m6 s10 offset-l3 offset-m3 offset-s1 waves-effect waves-light">
  187. Add Song
  188. </button>
  189. </div>
  190. <script>
  191. $('#genres').material_select();
  192. </script>
  193. {{else}}
  194. <div class="row" id="single-video">
  195. <div class="input-field">
  196. <input id="song-input" type="text" class="validate">
  197. <label for="search_for_song">Search for song</label>
  198. </div>
  199. <a class="waves-effect waves-light btn" id="search-song"><i
  200. class="material-icons left">search</i>Search</a>
  201. {{#if singleVideoResultsActive}}
  202. <div id="single-video-results">
  203. <div style="overflow: auto; height: 30vh; margin-top: 1rem;">
  204. <ul class="collection light-blue-text">
  205. {{#each result in singleVideoResults}}
  206. <li class="collection-item avatar youtube-search-result-li">
  207. <img src="{{result.image}}"
  208. onerror="this.src='/notes.png'"
  209. alt="" class="video-import-thumbnail">
  210. <span class="title video-import-text">{{result.title}}</span>
  211. <p class="video-import-text">{{result.artist}} <br>
  212. <a href="https://youtube.com/watch?v={{result.id}}"
  213. target="_blank">View Video In YouTube</a>
  214. </p>
  215. <a href="#" class="secondary-content" id="addSong"
  216. data-result="{{result.id}}"><i class="material-icons"
  217. data-result="{{result.id}}">add</i></a>
  218. </li>
  219. {{/each}}
  220. </ul>
  221. </div>
  222. </div>
  223. {{/if}}
  224. </div>
  225. {{/if}}
  226. {{else}}
  227. <div class="row" id="import-playlist">
  228. <div class="input-field">
  229. <input id="playlist-url" type="text" class="validate">
  230. <label for="search_for_song">Playlist URL</label>
  231. </div>
  232. <div class="progress">
  233. <div class="determinate" id="import-progress" style="width: 0%"></div>
  234. </div>
  235. <a class="waves-effect waves-light btn" id="import-playlist-button">Import
  236. Playlist</a>
  237. {{#if playlistImportVideosActive}}
  238. <a class="waves-effect waves-light btn" id="confirm-import">Confirm selection
  239. and add songs to queue</a>
  240. <div class="input-field col l12 m12 s12">
  241. <select multiple id="genres_pl">
  242. <option value="" disabled selected>Select Genre(s):</option>
  243. <option value="edm">EDM</option>
  244. <option value="chill">Chill</option>
  245. <option value="pop">Pop</option>
  246. <option value="country">Country</option>
  247. <option value="rock">Rock</option>
  248. <option value="randb">R&B</option>
  249. <option value="rap">Rap</option>
  250. <option value="heavymetal">Heavy Metal</option>
  251. <option value="christmas">Christmas</option>
  252. <option value="alternative">Alternative</option>
  253. </select>
  254. <label class="white-text">Genre(s)</label>
  255. </div>
  256. <script>
  257. $('#genres_pl').material_select();
  258. </script>
  259. <div id="import-playlist-results">
  260. <ul class="collection light-blue-text">
  261. {{#each result in importPlaylistVideos}}
  262. <li class="collection-item avatar youtube-search-result-li">
  263. <img src="{{result.image}}"
  264. onerror="this.src='/notes.png'"
  265. alt="" class="video-import-thumbnail">
  266. <span class="title video-import-text">{{result.title}}</span>
  267. <p class="video-import-text">{{result.artist}} <br>
  268. <a href="https://youtube.com/watch?v={{result.id}}"
  269. target="_blank">View Video In YouTube</a>
  270. </p>
  271. <a href="#" class="secondary-content" id="removeSong"
  272. data-result="{{result.id}}"><i class="material-icons"
  273. data-result="{{result.id}}">remove</i></a>
  274. </li>
  275. {{/each}}
  276. </ul>
  277. </div>
  278. {{/if}}
  279. </div>
  280. {{/if}}
  281. </form>
  282. <div id="song-results"></div>
  283. </div>
  284. <div class="row">
  285. <form class="black-text hide" id="add-info">
  286. <div class="row">
  287. <div class="input-field">
  288. <input id="song-id" type="text" class="validate">
  289. <label for="song-id">Song ID</label>
  290. </div>
  291. </div>
  292. <div class="row">
  293. <a class="waves-effect waves-light btn" id="add-song-button"><i
  294. class="material-icons left">playlist_add</i>Request Song</a>
  295. </div>
  296. </form>
  297. </div>
  298. </div>
  299. <div class="divider"></div>
  300. <div class="modal-footer">
  301. <a href="#" class="modal-action modal-close waves-effect btn">Close</a>
  302. </div>
  303. </div>
  304. <!--Report modal-->
  305. <div id="report_modal" class="modal">
  306. <div class="modal-content">
  307. <h4>Reporting:</h4>
  308. <h5 id="report-which">{{reportingSong.title}} <span class="thin">by</span> {{reportingSong.artist}}</h5>
  309. <div class="report-layer-1">
  310. <div>
  311. <input type="checkbox" id="report-song">
  312. <label for="report-song">
  313. Song
  314. </label>
  315. </div>
  316. <!-- Layer2 -->
  317. {{#if reportSong}}
  318. <div class="report-layer-2" id="report-song-list">
  319. <p>
  320. <input type="checkbox" id="report-song-not-playing">
  321. <label for="report-song-not-playing">
  322. Not playing
  323. </label>
  324. </p>
  325. <p>
  326. <input type="checkbox" id="report-song-does-not-exist">
  327. <label for="report-song-does-not-exist">
  328. Does not exist
  329. </label>
  330. </p>
  331. <p>
  332. <input type="checkbox" id="report-song-other">
  333. <label for="report-song-other">
  334. Other:
  335. </label>
  336. {{#if reportSongOther}}
  337. <div class="input-field">
  338. <textarea class="materialize-textarea" id="report-song-other-ta" type="text"></textarea>
  339. <label for="report-song-other-ta">What is the issue?</label>
  340. </div>
  341. {{/if}}
  342. </p>
  343. </div>
  344. {{/if}}
  345. <div class="checkbox">
  346. <input type="checkbox" id="report-title">
  347. <label for="report-title">
  348. Title
  349. </label>
  350. </div>
  351. <!-- Layer2 -->
  352. {{#if reportTitle}}
  353. <div class="report-layer-2" id="report-title-list">
  354. <p>
  355. <input type="checkbox" id="report-title-incorrect">
  356. <label for="report-title-incorrect">
  357. Incorrect
  358. </label>
  359. </p>
  360. <p>
  361. <input type="checkbox" id="report-title-inappropriate">
  362. <label for="report-title-inappropriate">
  363. Inappropriate
  364. </label>
  365. </p>
  366. <p>
  367. <input type="checkbox" id="report-title-other">
  368. <label for="report-title-other">
  369. Other:
  370. </label>
  371. {{#if reportTitleOther}}
  372. <div class="input-field">
  373. <textarea class="materialize-textarea" id="report-title-other-ta" type="text"></textarea>
  374. <label for="report-title-other-ta">What is the issue?</label>
  375. </div>
  376. {{/if}}
  377. </p>
  378. </div>
  379. {{/if}}
  380. <div>
  381. <input type="checkbox" id="report-artist">
  382. <label for="report-artist">
  383. Artist
  384. </label>
  385. </div>
  386. <!-- Layer2 -->
  387. {{#if reportArtist}}
  388. <div class="report-layer-2" id="report-artist-list">
  389. <p>
  390. <input type="checkbox" id="report-artist-incorrect">
  391. <label for="report-artist-incorrect">
  392. Incorrect
  393. </label>
  394. </p>
  395. <p>
  396. <input type="checkbox" id="report-artist-inappropriate">
  397. <label for="report-artist-inappropriate">
  398. Inappropriate
  399. </label>
  400. </p>
  401. <p>
  402. <input type="checkbox" id="report-artist-other">
  403. <label for="report-artist-other">
  404. Other:
  405. </label>
  406. {{#if reportArtistOther}}
  407. <div class="input-field">
  408. <textarea class="materialize-textarea" id="report-artist-other-ta" type="text"></textarea>
  409. <label for="report-artist-other-ta">What is the issue?</label>
  410. </div>
  411. {{/if}}
  412. </p>
  413. </div>
  414. {{/if}}
  415. <div class="checkbox">
  416. <input type="checkbox" id="report-duration">
  417. <label for="report-duration">
  418. Duration
  419. </label>
  420. </div>
  421. <!-- Layer2 -->
  422. {{#if reportDuration}}
  423. <div class="report-layer-2" id="report-duration-list">
  424. <div class="checkbox">
  425. <input type="checkbox" id="report-duration-long">
  426. <label for="report-duration-long">
  427. Too long
  428. </label>
  429. </div>
  430. <div class="checkbox">
  431. <input type="checkbox" id="report-duration-short">
  432. <label for="report-duration-short">
  433. Too short
  434. </label>
  435. </div>
  436. <div class="checkbox">
  437. <input type="checkbox" id="report-duration-other">
  438. <label for="report-duration-other">
  439. Other: <br>
  440. </label>
  441. {{#if reportDurationOther}}
  442. <div class="input-field">
  443. <textarea class="materialize-textarea" id="report-duration-other-ta" type="text"></textarea>
  444. <label for="report-duration-other-ta">What is the issue?</label>
  445. </div>
  446. {{/if}}
  447. </div>
  448. </div>
  449. {{/if}}
  450. <div class="checkbox">
  451. <input type="checkbox" id="report-albumart">
  452. <label for="report-albumart">
  453. Albumart
  454. </label>
  455. </div>
  456. <!-- Layer2 -->
  457. {{#if reportAlbumart}}
  458. <div class="report-layer-2" id="report-albumart-list">
  459. <div class="checkbox">
  460. <input type="checkbox" id="report-albumart-incorrect">
  461. <label for="report-albumart-incorrect">
  462. Incorrect
  463. </label>
  464. </div>
  465. <div class="checkbox">
  466. <input type="checkbox" id="report-albumart-inappropriate">
  467. <label for="report-albumart-inappropriate">
  468. Inappropriate
  469. </label>
  470. </div>
  471. <div class="checkbox">
  472. <input type="checkbox" id="report-albumart-not-showing">
  473. <label for="report-albumart-not-showing">
  474. Not showing
  475. </label>
  476. </div>
  477. <div class="checkbox">
  478. <input type="checkbox" id="report-albumart-other">
  479. <label for="report-albumart-other">
  480. Other:
  481. </label>
  482. {{#if reportAlbumartOther}}
  483. <div class="input-field">
  484. <textarea class="materialize-textarea" id="report-albumart-other-ta" type="text"></textarea>
  485. <label for="report-albumart-other-ta">What is the issue?</label>
  486. </div>
  487. {{/if}}
  488. </div>
  489. </div>
  490. {{/if}}
  491. <div class="checkbox">
  492. <input type="checkbox" id="report-other">
  493. <label for="report-other">
  494. Other: <br>
  495. </label>
  496. {{#if reportOther}}
  497. <div class="input-field">
  498. <textarea class="materialize-textarea" id="report-other-ta" type="text"></textarea>
  499. <label for="report-other-ta">What is the issue?</label>
  500. </div>
  501. {{/if}}
  502. </div>
  503. </div>
  504. <a id="report-song-button" class="waves-effect waves-light btn btn-block red">Submit Song Report</a>
  505. {{#if previousSongR}}
  506. <a id="report-prev" class="waves-effect waves-light btn btn-block">Report Previous Song</a>
  507. {{/if}}
  508. <a id="report-curr" class="waves-effect waves-light btn btn-block">Report Current Song</a>
  509. </div>
  510. <div class="divider"></div>
  511. <div class="modal-footer">
  512. <a class="modal-action modal-close waves-effect btn">Close</a>
  513. </div>
  514. </div>
  515. <script>
  516. $("#add-song-modal-button").leanModal({
  517. dismissible: true,
  518. opacity: .5,
  519. in_duration: 500,
  520. out_duration: 200
  521. });
  522. $("#report-modal-button").leanModal({
  523. dismissible: true,
  524. opacity: .5,
  525. in_duration: 500,
  526. out_duration: 200,
  527. ready: function() {
  528. Session.set("currentSongR", Session.get("currentSong"));
  529. Session.set("previousSongR", Session.get("previousSong"));
  530. }
  531. });
  532. $(".dropdown-button").dropdown({
  533. belowOrigin: true
  534. });
  535. $('select').material_select();
  536. $("#chat-slideout").sideNav({
  537. menuWidth: 350,
  538. edge: 'right'
  539. });
  540. $("#playlist-slideout").sideNav({
  541. menuWidth: 350,
  542. edge: 'right'
  543. });
  544. $("#users-slideout").sideNav({
  545. menuWidth: 350,
  546. edge: 'right'
  547. });
  548. $('.tooltipped').tooltip({delay: 50});
  549. </script>
  550. </template>