Quellcode durchsuchen

Added snowflake image, changed mod to moderator, gave moderator rights to /admin to manage songs.

KrisVos130 vor 9 Jahren
Ursprung
Commit
71bed5eb2b

+ 15 - 1
app/client/app.css

@@ -263,9 +263,13 @@ ul {
   margin-top: 20px;
 }
 
-.admin-container h1 {
+.admin-container div {
+  padding-bottom: 10px;
   text-align: center;
+}
+.admin-container h1 {
   margin: 0;
+  display: inline-block;
 }
 
 .admin-container p {
@@ -277,6 +281,16 @@ ul {
   font-size: 16px;
 }
 
+.queueTable th {
+  font-size: 22px;
+  text-align: center;
+}
+
+.queueTable td {
+  padding: 10px;
+  font-size: 18px;
+}
+
 .container {
     max-width: 600px;
     margin: 0 auto;

+ 16 - 15
app/client/client.js

@@ -944,9 +944,6 @@ Template.admin.helpers({
   },
   queues: function() {
     var queues = Queues.find({}).fetch();
-    queues.map(function(queue) {
-      return queue;
-    });
     return queues;
   },
   users: function(){
@@ -983,18 +980,6 @@ Template.admin.helpers({
 });
 
 Template.stations.helpers({
-    queues: function() {
-        var queues = Queues.find({}).fetch();
-        queues.map(function(queue) {
-            if (Rooms.find({type: queue.type}).count() !== 1) {
-                return;
-            } else {
-                queue.display = Rooms.findOne({type: queue.type}).display;
-                return queue;
-            }
-        });
-        return queues;
-    },
     playlists: function() {
         var playlists = Playlists.find({}).fetch();
         playlists.map(function(playlist) {
@@ -1009,6 +994,21 @@ Template.stations.helpers({
     }
 });
 
+Template.queues.helpers({
+  queues: function() {
+      var queues = Queues.find({}).fetch();
+      queues.map(function(queue) {
+          if (Rooms.find({type: queue.type}).count() !== 1) {
+              return;
+          } else {
+              queue.display = Rooms.findOne({type: queue.type}).display;
+              return queue;
+          }
+      });
+      return queues;
+  }
+})
+
 var yt_player = undefined;
 var _sound = undefined;
 var previewEndSongTimeout = undefined;
@@ -1059,6 +1059,7 @@ Template.stations.events({
     },
     "click .deny-song-button": function(e){
         var genre = $(e.toElement).data("genre") || $(e.toElement).parent().data("genre");
+        console.log(genre);
         Meteor.call("removeSongFromQueue", genre, this.mid);
     },
     "click .remove-song-button": function(e){

+ 5 - 1
app/client/routes.js

@@ -89,7 +89,7 @@ Router.route("/admin", {
     }
 });
 
-Router.route("/stations", {
+Router.route("/admin/stations", {
     waitOn: function() {
         return [Meteor.subscribe("isModerator", Meteor.userId()), Meteor.subscribe("isAdmin", Meteor.userId())];
     },
@@ -124,3 +124,7 @@ Router.route("/:type", {
 Router.route("/u/:user", {
     template: "profile"
 });
+
+Router.route("/admin/queues", {
+  template: "queues"
+});

+ 25 - 18
app/client/templates/admin.html

@@ -4,8 +4,9 @@
         {{> header}}
           <div class="row" style="margin-top: 20px; height: 100%;">
             <div class="col-md-5 col-md-offset-1 admin-container" style="height: 50%;">
-              <h1>Playlists</h1>
               <div>
+                <h1>Playlists</h1>
+              </div>
               {{#each playlists}}
                 <p>{{display}} playlist</p>
                 <table class="table" style="border-bottom: 1px solid white;">
@@ -22,42 +23,48 @@
                     <td></td>
                     <td></td>
                     <td>{{queueCount display}}</td>
-                    <td><a href="/stations">Edit</a></td>
+                    <td><a href="/admin/stations">Edit</a></td>
                   </tr>
                 </table>
               {{/each}}
-              </div>
             </div>
             <div class="col-md-4 col-md-offset-1 admin-container" style="height: 30%;">
-              <h1>Site statistics</h1>
+              <div>
+                <h1>Site statistics</h1>
+              </div>
               <p>Total Users Online: {{users}}</p>
             </div>
             <div style="clear: both;"></div>
                 <div class="col-md-5 col-md-offset-1 admin-container" style="height: 50%;">
-                    <h1>Queue</h1>
-                    {{#each queues}}
-                    <p>{{type}} playlist</p>
-                    <table class="table" style="border-bottom: 1px solid white;">
+                  <div>
+                    <h1>Song Requests</h1><a href="/admin/queues" style="margin-left:10px;">(review)</a>
+                  </div>
+                    <table class="table queueTable">
                       <tr>
+                        <th>Playlist</th>
                         <th>Title</th>
                         <th>Artist</th>
                         <th>Duration</th>
                         <th>Type</th>
                       </tr>
-                      {{#each songs}}
-                      <tr>
-                        <td>{{this.title}}</td>
-                        <td>{{this.artist}}</td>
-                        <td>{{this.duration}}</td>
-                        <td>{{this.type}}</td>
-                        <!--<td><a href="/stations">Edit</a></td>-->
-                      </tr>
+                      {{#each queues}}
+                        {{#each songs}}
+                          <tr>
+                            <td>{{../type}}</td>
+                            <td>{{title}}</td>
+                            <td>{{artist}}</td>
+                            <td>{{duration}}</td>
+                            <td>{{type}}</td>
+                            <!--<td><a href="/stations">Edit</a></td>-->
+                          </tr>
+                          {{/each}}
                       {{/each}}
-                    </table>
-                    {{/each}}
+                      </table>
                 </div>
                 <div class="col-md-4 col-md-offset-1 admin-container" style="height: 50%">
+                  <div>
                     <h1>Reports</h1>
+                  </div>
                     {{#each reports}}
                       <p>{{reports}}</p>
                     {{/each}}

+ 65 - 0
app/client/templates/queues.html

@@ -0,0 +1,65 @@
+<template name="queues">
+    {{> alerts}}
+    <div class="landing">
+        {{> header}}
+        <div class="row">
+          {{#each queues}}
+              <div class="col-md-8 col-md-offset-2 admin-queue-panel">
+                  <div class="panel panel-danger">
+                      <div class="panel-heading">
+                          <h3 class="panel-title">{{display}} review queue</h3>
+                      </div>
+                      <div class="panel-body admin-panel-body">
+                          <table class="table table-striped">
+                              <thead>
+                                  <tr>
+                                      <th>Title</th>
+                                      <th>Artist(s)</th>
+                                      <th>Type</th>
+                                      <th>Id</th>
+                                      <th>Likes</th>
+                                      <th>Dislikes</th>
+                                      <th>Img</th>
+                                      <th>Preview</th>
+                                      <th>Edit</th>
+                                      <th>Add</th>
+                                      <th colspan="10">Remove</th>
+                                  </tr>
+                              </thead>
+                              <tbody>
+                                  {{#each songs}}
+                                      <tr>
+                                          <th scope="row">{{title}}</th>
+                                          <td>{{artist}}</td>
+                                          <td>{{type}}</td>
+                                          <td>{{id}}</td>
+                                          <td>{{likes}}</td>
+                                          <td>{{dislikes}}</td>
+                                          <td class="column-small"><button class="btn btn-primary preview-button" id="previewImageButton" data-toggle="modal" data-target="#previewImageModal">Preview Image</button></td>
+                                          <td class="column-small"><button class="btn btn-primary preview-button" data-toggle="modal" data-target="#previewModal">Preview</button></td>
+                                          <td class="column-small"><button class="btn btn-primary edit-queue-button" data-genre="{{../type}}" data-toggle="modal" data-target="#editModal">Edit</button></td>
+                                          <td class="column-small"><button class="btn btn-success add-song-button" data-genre="{{../type}}"><i class="fa fa-check-circle"></i></button></td>
+                                          <td class="column-small"><button class="btn btn-danger deny-song-button" data-genre="{{../type}}"><i class="fa fa-ban"></i></button></td>
+                                      </tr>
+                                  {{/each}}
+                              </tbody>
+                          </table>
+                      </div>
+                  </div>
+              </div>
+          {{/each}}
+        </div>
+          <ul class="bg-bubbles">
+            <li></li>
+            <li></li>
+            <li></li>
+            <li></li>
+            <li></li>
+            <li></li>
+            <li></li>
+            <li></li>
+            <li></li>
+            <li></li>
+          </ul>
+    </div>
+</template>

+ 1 - 48
app/client/templates/stations.html

@@ -2,52 +2,6 @@
     {{> alerts}}
   <div class="landing">
     {{> header}}
-    <div class="row">
-      {{#each queues}}
-          <div class="col-md-8 col-md-offset-2 admin-queue-panel">
-              <div class="panel panel-danger">
-                  <div class="panel-heading">
-                      <h3 class="panel-title">{{display}} review queue</h3>
-                  </div>
-                  <div class="panel-body admin-panel-body">
-                      <table class="table table-striped">
-                          <thead>
-                              <tr>
-                                  <th>Title</th>
-                                  <th>Artist(s)</th>
-                                  <th>Type</th>
-                                  <th>Id</th>
-                                  <th>Likes</th>
-                                  <th>Dislikes</th>
-                                  <th>Img</th>
-                                  <th>Preview</th>
-                                  <th>Edit</th>
-                                  <th>Add</th>
-                                  <th colspan="10">Remove</th>
-                              </tr>
-                          </thead>
-                          <tbody>
-                              {{#each songs}}
-                                  <tr>
-                                      <th scope="row">{{title}}</th>
-                                      <td>{{artist}}</td>
-                                      <td>{{type}}</td>
-                                      <td>{{id}}</td>
-                                      <td>{{likes}}</td>
-                                      <td>{{dislikes}}</td>
-                                      <td class="column-small"><button class="btn btn-primary preview-button" id="previewImageButton" data-toggle="modal" data-target="#previewImageModal">Preview Image</button></td>
-                                      <td class="column-small"><button class="btn btn-primary preview-button" data-toggle="modal" data-target="#previewModal">Preview</button></td>
-                                      <td class="column-small"><button class="btn btn-primary edit-queue-button" data-genre="{{../type}}" data-toggle="modal" data-target="#editModal">Edit</button></td>
-                                      <td class="column-small"><button class="btn btn-success add-song-button" data-genre="{{../type}}"><i class="fa fa-check-circle"></i></button></td>
-                                      <td class="column-small"><button class="btn btn-danger deny-song-button" data-genre="{{../type}}"><i class="fa fa-ban"></i></button></td>
-                                  </tr>
-                              {{/each}}
-                          </tbody>
-                      </table>
-                  </div>
-              </div>
-          </div>
-      {{/each}}
       <h1 class="col-md-8 col-md-offset-2 admin-header">Playlists:</h1>
       {{#each playlists}}
           <div class="col-md-8 col-md-offset-2 admin-playlist-panel">
@@ -95,7 +49,7 @@
           </div>
       {{/each}}
 
-        <button class="btn btn-danger col-md-6 col-md-offset-3" id="rrating" data-toggle="modal" data-target="#confirmModal">Reset Rating</button>
+      <button class="btn btn-danger col-md-6 col-md-offset-3" id="rrating" data-toggle="modal" data-target="#confirmModal">Reset Rating</button>
 
       <div class="col-md-4 col-md-offset-4">
           <div id="croom_container">
@@ -214,5 +168,4 @@
           </div>
       </div>
     </div>
-  </div>
 </template>

BIN
app/public/Snowflake.png