home.html 9.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168
  1. <template name="home">
  2. {{> header}}
  3. <main>
  4. {{> alerts}}
  5. <div style="margin-left: 5%;margin-right: 5%;">
  6. <hr class="center-block" style="width: 99%">
  7. <div class="row">
  8. {{#each rooms}}
  9. {{#if private}}
  10. {{#if isModerator}}
  11. <div class="col s12 m6 l3">
  12. <div class="card hoverable red white-text">
  13. <div class="card-image waves-effect waves-block waves-light">
  14. <a href=/{{type}}>
  15. <img onerror="this.src='/notes.png'" src={{currentSong.song.img}} style="width: 100%; height: auto;">
  16. <figcaption class="caption center-align">
  17. <h5>{{currentSong.song.title}}</h5>
  18. <h5>{{currentSong.song.artist}}</h5>
  19. </figcaption>
  20. </a>
  21. </div>
  22. <div class="card-content">
  23. <span class="card-title white-text">{{display}}</span><div><span class="user-num">{{userNum}}</span> <i class="material-icons">perm_identity</i></div>
  24. <p>{{roomDesc}}</p>
  25. </div>
  26. <div class="card-action">
  27. <a href=/{{type}} class="white-text">Join Room</a>
  28. </div>
  29. </div>
  30. </div>
  31. {{/if}}
  32. {{else}}
  33. <div class="col s12 m6 l3">
  34. <div class="card hoverable">
  35. <div class="card-image waves-effect waves-block waves-light">
  36. <a href=/{{type}}>
  37. <img onerror="this.src='/notes.png'" src={{currentSong.song.img}}>
  38. <figcaption class="caption center-align">
  39. <h5>{{currentSong.song.title}}</h5>
  40. <h5>{{currentSong.song.artist}}</h5>
  41. </figcaption>
  42. </a>
  43. </div>
  44. <div class="card-content">
  45. <span class="card-title grey-text text-darken-4">{{display}}</span><div><span class="user-num">{{userNum}}</span> <i class="material-icons">perm_identity</i></div>
  46. <p>{{roomDesc}}</p>
  47. </div>
  48. <div class="card-action">
  49. <a href=/{{type}} class="light-blue-text text-accent-4">Join Room</a>
  50. </div>
  51. </div>
  52. </div>
  53. {{/if}}
  54. {{/each}}
  55. </div>
  56. <h3 class="center-align">
  57. Community Rooms
  58. {{#if currentUser}}
  59. <a href="#create_community_station" id="create_community_station_modal_button"><i class="material-icons">add</i></a>
  60. {{/if}}
  61. </h3>
  62. <hr class="center-block" style="width: 99%">
  63. <div class="row">
  64. {{#each room in communityStations}}
  65. {{#if equals room.privacy 'private'}}
  66. {{#if isAllowedInCommunityStation room.name}}
  67. <div class="col s12 m6 l3">
  68. <div class="card hoverable light-blue white-text">
  69. <div class="card-image waves-effect waves-block waves-light">
  70. <a href=/community/{{room.name}}>
  71. <img src='/notes.png'>
  72. <figcaption class="caption center-align">
  73. <h5>{{room.currentSong.song.title}}</h5>
  74. </figcaption>
  75. </a>
  76. </div>
  77. <div class="card-content" style="overflow-x: hidden;">
  78. <span class="card-title white-text">{{room.displayName}}</span><div><span class="user-num">{{room.users}}</span> <i class="material-icons">perm_identity</i></div>
  79. <p>{{room.roomDesc}}</p>
  80. </div>
  81. <div class="card-action">
  82. <a href=/community/{{room.name}} class="white-text">Join Room</a>
  83. </div>
  84. </div>
  85. </div>
  86. {{/if}}
  87. {{else}}
  88. {{#if equals room.privacy 'unlisted'}}
  89. {{#if isAllowedInCommunityStation room.name}}
  90. <div class="col s12 m6 l3">
  91. <div class="card hoverable light-blue white-text">
  92. <div class="card-image waves-effect waves-block waves-light">
  93. <a href=/community/{{room.name}}>
  94. <img src='/notes.png'>
  95. <figcaption class="caption center-align">
  96. <h5>{{room.currentSong.song.title}}</h5>
  97. </figcaption>
  98. </a>
  99. </div>
  100. <div class="card-content" style="overflow-x: hidden;">
  101. <span class="card-title white-text">{{room.displayName}}</span><div><span class="user-num">{{room.users}}</span> <i class="material-icons">perm_identity</i></div>
  102. <p>{{room.roomDesc}}</p>
  103. </div>
  104. <div class="card-action">
  105. <a href=/community/{{room.name}} class="white-text">Join Room</a>
  106. </div>
  107. </div>
  108. </div>
  109. {{/if}}
  110. {{else}}
  111. <div class="col s12 m6 l3">
  112. <div class="card hoverable">
  113. <div class="card-image waves-effect waves-block waves-light">
  114. <a href=/community/{{room.name}}>
  115. <img src='/notes.png'>
  116. <figcaption class="caption center-align">
  117. <h5>{{room.currentSong.song.title}}</h5>
  118. </figcaption>
  119. </a>
  120. </div>
  121. <div class="card-content">
  122. <span class="card-title grey-text text-darken-4">{{room.displayName}}</span><div><span class="user-num">{{room.users}}</span> <i class="material-icons">perm_identity</i></div>
  123. <p>{{room.roomDesc}}</p>
  124. </div>
  125. <div class="card-action">
  126. <a href=/community/{{room.name}} class="light-blue-text text-accent-4">Join Room</a>
  127. </div>
  128. </div>
  129. </div>
  130. {{/if}}
  131. {{/if}}
  132. {{/each}}
  133. </div>
  134. </div>
  135. </main>
  136. {{> footer}}
  137. <div id="create_community_station" class="modal">
  138. <div class="modal-content">
  139. <h4>Create Community Room</h4>
  140. <div class="input-field">
  141. <input id="create_community_station_name" type="text">
  142. <label for="create_community_station_name">Name</label>
  143. </div>
  144. <div class="input-field">
  145. <input id="create_community_station_display_name" type="text">
  146. <label for="create_community_station_display_name">Display Name</label>
  147. </div>
  148. <div class="input-field">
  149. <input id="create_community_station_description" type="text">
  150. <label for="create_community_station_description">Description</label>
  151. </div>
  152. <button class="btn waves-effect waves-light" id="create_community_station_submit">Create</button>
  153. </div>
  154. <div class="divider"></div>
  155. <div class="modal-footer">
  156. <a class="modal-action modal-close waves-effect btn">Close</a>
  157. </div>
  158. </div>
  159. <script>
  160. $("#create_community_station_modal_button").leanModal({
  161. dismissible: true,
  162. opacity: .5,
  163. in_duration: 500,
  164. out_duration: 200
  165. });
  166. </script>
  167. </template>