浏览代码

Admin layout, reports, queues.

I nearly got the admin layout down. Need to fix a few things with
bootstrap columns. Starting to work on a way to make the reports, and
queues show the correct data for the playlist.
Wesley McCann 9 年之前
父节点
当前提交
42b941f6a8
共有 4 个文件被更改,包括 22 次插入5 次删除
  1. 1 0
      app/client/app.css
  2. 6 1
      app/client/client.js
  3. 11 4
      app/client/templates/admin.html
  4. 4 0
      app/server/server.js

+ 1 - 0
app/client/app.css

@@ -257,6 +257,7 @@ ul {
   background-color: rgb(102, 205, 170);
   color: white;
   overflow-y: scroll;
+  margin-top: 20px;
 }
 
 .admin-container h1 {

+ 6 - 1
app/client/client.js

@@ -4,9 +4,10 @@ Meteor.startup(function() {
     });
 });
 
+Meteor.subscribe("playlists");
 Meteor.subscribe("queues");
+Meteor.subscribe("reports");
 Meteor.subscribe("chat");
-Meteor.subscribe("playlists");
 
 var minterval;
 var hpSound = undefined;
@@ -697,6 +698,10 @@ Template.admin.helpers({
           }
       });
       return playlists;
+  },
+  reports: function() {
+      var reports = Reports.find({}).fetch();
+      console.log(reports);
   }
 });
 

+ 11 - 4
app/client/templates/admin.html

@@ -1,8 +1,8 @@
 <template name="admin">
     <div class="landing">
         {{> header}}
-          <div class="row" style="margin-top: 20px;">
-            <div class="col-md-5 col-md-offset-1 admin-container" style="height: 400px">
+          <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>
               {{#each playlists}}
                 <p>{{display}} playlist</p>
@@ -18,17 +18,24 @@
                     <td>{{songs.length}}</td>
                     <td></td>
                     <td></td>
-                    <td></td>
+                    <td>{{reports}}</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">
+            <div class="col-md-4 col-md-offset-1 admin-container" style="height: 30%;">
               <h1>Site statistics</h1>
               <p>Total Users: {{{users}}}</p>
             </div>
+            <div style="clear: both;"></div>
+                <div class="col-md-5 col-md-offset-1 admin-container" style="height: 50%;">
+                    <h1>Reports</h1>
+                </div>
+                <div class="col-md-4 col-md-offset-1 admin-container" style="height: 50%">
+                    <h1>Reports</h1>
+                </div>
           </div>
 
           <ul class="bg-bubbles">

+ 4 - 0
app/server/server.js

@@ -403,6 +403,10 @@ Meteor.publish("queues", function() {
     return Queues.find({});
 });
 
+Meteor.publish("reports", function() {
+    return Reports.find({});
+});
+
 Meteor.publish("chat", function() {
     return Chat.find({});
 });