room.html 29 KB

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