room.html 28 KB

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