Browse Source

Working on Admin panel. Continued to work on main admin screen. Completed the structure of the playlist overview panel. Next up is reporting panel.

Wesley McCann 10 năm trước cách đây
mục cha
commit
4ffdbacbfc
3 tập tin đã thay đổi với 34 bổ sung38 xóa
  1. 8 2
      app/client/app.css
  2. 8 17
      app/client/client.js
  3. 18 19
      app/client/templates/admin.html

+ 8 - 2
app/client/app.css

@@ -254,8 +254,9 @@ ul {
 }
 
 .admin-container {
-  background-color: black;
+  background-color: rgb(102, 205, 170);
   color: white;
+  overflow-y: scroll;
 }
 
 .admin-container h1 {
@@ -263,8 +264,13 @@ ul {
   margin: 0;
 }
 
+.admin-container p {
+  font-size: 22px;
+}
+
 .admin-container a {
   color: white;
+  font-size: 16px;
 }
 
 .container {
@@ -1205,4 +1211,4 @@ nav form input[type="image"]{
 .navbar-default .navbar-nav > .open > a, .navbar-default .navbar-nav > .open > a:hover, .navbar-default .navbar-nav > .open > a:focus {
     background-color: transparent;
     color:#ffffff;
-}
+}

+ 8 - 17
app/client/client.js

@@ -652,17 +652,15 @@ Template.room.helpers({
 });
 
 Template.admin.helpers({
-  queues: function() {
+  queueCount: function(i) {
       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;
+      
+      if (!queues[i]) {
+        return 0;
+      }
+      else {
+        return queues[i].songs.length;
+      }
   },
   users: function(){
       Meteor.call("getUserNum", function(err, num){
@@ -684,13 +682,6 @@ Template.admin.helpers({
           }
       });
       return playlists;
-  },
-  playlistCount: function() {
-    var playlists = Playlists.find({}).fetch();
-    playlists.map(function(playlist){
-      playlist.songs = Rooms.findOne({type: playlist.type}).songs.length;
-      return playlist;
-    });
   }
 });
 

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

@@ -2,33 +2,32 @@
     <div class="landing">
         {{> header}}
           <div class="row" style="margin-top: 20px;">
-            <div class="col-md-5 col-md-offset-1 admin-container">
-              <a href="/stations"><h1>Playlists</h1></a>
+            <div class="col-md-5 col-md-offset-1 admin-container" style="height: 400px">
+              <h1>Playlists</h1>
               {{#each playlists}}
                 <p>{{display}} playlist</p>
-                <table class="table">
-                    <thead>
-                    <tr>
-                        <th>Song Count</th>
-                        <th>Edit</th>
-                    </tr>
-                    </thead>
-                    <tbody>
-                    <tr>
-                        <th scope="row">{{songs}}</th>
-                        <td>{{artist}}</td>
-                        <td>{{type}}</td>
-                        <td>{{id}}</td>
-                    </tr>
-                    </tbody>
+                <table class="table" style="border-bottom: 1px solid white;">
+                  <tr>
+                    <th>Songs</th>
+                    <th>Users</th>
+                    <th>Admins</th>
+                    <th>Reports</th>
+                    <th>Queue</th>
+                  </tr>
+                  <tr>
+                    <td>{{songs.length}}</td>
+                    <td></td>
+                    <td></td>
+                    <td></td>
+                    <td>{{queueCount @index}}</td>
+                    <td><a href="/stations">Edit</a></td>
+                  </tr>
                 </table>
               {{/each}}
             </div>
             <div class="col-md-3 col-md-offset-2 admin-container">
               <h1>Site statistics</h1>
               <p>Total Users: {{{users}}}</p>
-              <p></p>
-              <p>Queues:</p>
             </div>
           </div>