admin.html 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  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. </div>
  56. </div>
  57. </div>
  58. <div id="addStation" class="modal">
  59. <!-- Modal content-->
  60. <div class="modal-content">
  61. <div class="modal-body">
  62. <h4>Add Room</h4>
  63. <div class="input-field">
  64. <input type="text" class="croom" id="croom_display" name="croom" required/>
  65. <label for="croom_display" class="white-text">Room Display Name</label>
  66. </div>
  67. <div class="input-field">
  68. <input type="text" class="croom" id="croom_tag" name="croom" required/>
  69. <label for="croom_tag" class="white-text">Room Tag</label>
  70. </div>
  71. <input type="checkbox" name="croom_private" id="croom_private"/>
  72. <label for="croom_private" class="white-text">Make Room Private?</label>
  73. <div class="section">
  74. <button class="btn btn-warning btn-block waves-effect waves-light" id="croom_create">Create</button>
  75. </div>
  76. <div class="divider"></div>
  77. </div>
  78. <div class="modal-footer">
  79. <a href="#!" class=" modal-action modal-close waves-effect waves-light btn-flat">Close</a>
  80. </div>
  81. </div>
  82. </div>
  83. </div>
  84. <script>
  85. $(document).ready(function(){
  86. // the "href" attribute of .modal-trigger must specify the modal ID that wants to be triggered
  87. $('#new_room').leanModal();
  88. });
  89. </script>
  90. <div id="confirmModal" class="modal fade" role="dialog">
  91. <div class="modal-dialog">
  92. <!-- Modal content-->
  93. <div class="modal-content">
  94. <div class="modal-header">
  95. <button type="button" class="close" data-dismiss="modal">&times;</button>
  96. <h4 class="modal-title">Confirm Reset</h4>
  97. </div>
  98. <div class="modal-body">
  99. <h3 style="margin-top: 0">Are you sure you want to reset all likes and dislikes?</h3>
  100. <button id="rreset_confirm" class="btn btn-danger waves-effect waves-light">Reset All Ratings</button>
  101. </div>
  102. <div class="modal-footer">
  103. <button id="close-modal" type="button" class="btn btn-default waves-effect waves-light" data-dismiss="modal">Close</button>
  104. </div>
  105. </div>
  106. </div>
  107. </div>
  108. </template>