Procházet zdrojové kódy

Added in basic reports UI. Will work on cleaning up report insertion, display reports in UI better, and get Kris report structure next.

Wesley McCann před 10 roky
rodič
revize
94053175e1
2 změnil soubory, kde provedl 22 přidání a 21 odebrání
  1. 6 1
      app/client/client.js
  2. 16 20
      app/client/templates/stations.html

+ 6 - 1
app/client/client.js

@@ -1270,11 +1270,16 @@ Template.stations.helpers({
     playlist: function() {
       var query = {type: Session.get("playlistToEdit").toLowerCase()};
       var playlists = Playlists.find(query).fetch();
-      console.log(Session.get("playlistToEdit"), query, playlists);
       return playlists;
     },
     whichStation: function(){
       return Session.get("playlistToEdit");
+    },
+    reports: function() {
+      var query = {room: Session.get("playlistToEdit").toLowerCase()};
+      var reports = Reports.find(query).fetch();
+      console.log(reports);
+      return reports;
     }
 });
 

+ 16 - 20
app/client/templates/stations.html

@@ -3,7 +3,6 @@
   <div class="landing">
     {{> header}}
       <h1 class="col-md-8 col-md-offset-2 admin-header">Playlist for {{whichStation}}</h1>
-      {{#each playlist}}
           <div class="col-md-8 col-md-offset-2 admin-playlist-panel">
               <div class="panel panel-primary">
                   <div class="panel-heading">
@@ -47,33 +46,30 @@
                   </div>
               </div>
           </div>
-      {{/each}}
       <div class="row" style="margin-top: 20px; height: 100%;">
-        <div class="col-md-6 col-md-offset-1 admin-container" style="height: 80%;">
+        <div class="col-md-8 col-md-offset-2 admin-container">
           <div>
-            <h1>Stations</h1><a href="#" data-toggle="modal" data-target="#addStation">(+)</a>
+            <h1>Reports</h1>
           </div>
-          {{#each playlists}}
             <p>{{display}}</p>
             <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>{{reportsCount display}}</td>
-                <td>{{queueCount display}}</td>
-                <td><a href="/admin/stations" id={{display}}>Edit</a></td>
+                <th>Song mid</th>
+                <th>Report Type</th>
+                <th>Report Reason</th>
+                <th>Comments</th>
               </tr>
+              {{#each reports}}
+                {{#each report}}
+                <tr>
+                  <td>{{song}}</td>
+                  <td>{{type}}</td>
+                  <td>{{reason}}</td>
+                  <td>{{other}}</td>
+                </tr>
+                {{/each}}
+              {{/each}}
             </table>
-          {{/each}}
-          <button class="btn btn-danger col-md-6 col-md-offset-3" id="rrating" data-toggle="modal" data-target="#confirmModal">Reset All Ratings</button>
         </div>
       </div>