admin.html 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. <template name="admin">
  2. {{> alerts}}
  3. <div class="landing">
  4. {{> header}}
  5. <div class="row" style="margin-top: 20px; height: 100%;">
  6. <div class="col s12 l6 m10 offset-l1 offset-m1 card-panel teal accent-3 white-text" style="height: 80%;">
  7. <div>
  8. <h2 class="center-align">Stations</h2>
  9. </div>
  10. <p>{{display}}</p>
  11. <table>
  12. <thead>
  13. <tr>
  14. <th>Type</th>
  15. <th>Songs</th>
  16. <th>Users</th>
  17. <th>Admins</th>
  18. <th>Reports</th>
  19. <th>Queue</th>
  20. </tr>
  21. </thead>
  22. <tbody>
  23. {{#each playlists}}
  24. <tr>
  25. <td>{{display}}</td>
  26. <td>{{songs.length}}</td>
  27. <td>{{roomUserNum}}</td>
  28. <td></td>
  29. <td>{{reportsCount display}}</td>
  30. <td>{{queueCount display}}</td>
  31. <td><a href="/{{type}}/manage" class="btn right" id="manage-{{display}}">Manage</a></td> <!-- TODO Make this redirect to playlist -->
  32. </tr>
  33. {{/each}}
  34. </tbody>
  35. </table>
  36. <div class="row">
  37. <button class="btn col m6 s6 l6 waves-effect waves-light" id="rrating" data-toggle="modal"
  38. data-target="#confirmModal">Reset All Ratings
  39. </button>
  40. <a class="waves-effect waves-light btn col m6 s6 l6 modal-trigger" id="new_room" href="#addStation"> <!-- TODO Make this actually open the new room modal -->
  41. Add Room
  42. </a>
  43. </div>
  44. </div>
  45. <div class="col s12 m8 l3 offset-l1 offset-m2 card-panel teal accent-3 white-text" style="height: 80%;">
  46. <div>
  47. <h2 class="center-align">Site statistics</h2>
  48. </div>
  49. <div class="section">
  50. <p class="flow-text">Total Users Online: {{usersOnline}}</p>
  51. <p class="flow-text">Total Registered Users: {{allUsers}}</p>
  52. </div>
  53. <div class="row">
  54. <a class="btn col l12 s12 m12 waves-effect waves-light" href="/admin/queues">Manage Queues</a> <!-- TODO Make this redirect to the queues -->
  55. <a class="btn col l12 s12 m12 waves-effect waves-light" href="/admin/news">Manage News</a>
  56. </div>
  57. </div>
  58. </div>
  59. <div id="addStation" class="modal">
  60. <!-- Modal content-->
  61. <div class="modal-content">
  62. <div class="modal-body">
  63. <h4>Add Room</h4>
  64. <div class="input-field">
  65. <input type="text" class="croom" id="croom_display" name="croom" required/>
  66. <label for="croom_display" class="white-text">Room Display Name</label>
  67. </div>
  68. <div class="input-field">
  69. <input type="text" class="croom" id="croom_tag" name="croom" required/>
  70. <label for="croom_tag" class="white-text">Room Tag</label>
  71. </div>
  72. <input type="checkbox" name="croom_private" id="croom_private"/>
  73. <label for="croom_private" class="white-text">Make Room Private?</label>
  74. <div class="section">
  75. <button class="btn btn-warning btn-block waves-effect waves-light" id="croom_create">Create</button>
  76. </div>
  77. <div class="divider"></div>
  78. </div>
  79. <div class="modal-footer">
  80. <a href="#!" class=" modal-action modal-close waves-effect waves-light btn-flat">Close</a>
  81. </div>
  82. </div>
  83. </div>
  84. </div>
  85. <script>
  86. $(document).ready(function(){
  87. // the "href" attribute of .modal-trigger must specify the modal ID that wants to be triggered
  88. $('#new_room').leanModal();
  89. });
  90. </script>
  91. <div id="confirmModal" class="modal fade" role="dialog">
  92. <div class="modal-dialog">
  93. <!-- Modal content-->
  94. <div class="modal-content">
  95. <div class="modal-header">
  96. <button type="button" class="close" data-dismiss="modal">&times;</button>
  97. <h4 class="modal-title">Confirm Reset</h4>
  98. </div>
  99. <div class="modal-body">
  100. <h3 style="margin-top: 0">Are you sure you want to reset all likes and dislikes?</h3>
  101. <button id="rreset_confirm" class="btn btn-danger waves-effect waves-light">Reset All Ratings</button>
  102. </div>
  103. <div class="modal-footer">
  104. <button id="close-modal" type="button" class="btn btn-default waves-effect waves-light" data-dismiss="modal">Close</button>
  105. </div>
  106. </div>
  107. </div>
  108. </div>
  109. </template>