Przeglądaj źródła

added number of users in each room on dashboard

Akira Laine 9 lat temu
rodzic
commit
6c9e8c37cc
3 zmienionych plików z 17 dodań i 3 usunięć
  1. 7 1
      app/client/app.css
  2. 5 0
      app/client/client.js
  3. 5 2
      app/client/templates/dashboard.html

+ 7 - 1
app/client/app.css

@@ -684,8 +684,9 @@ footer .fa {
 }
 
 .station > h3 {
-    line-height: 200px;
+    line-height: 0px;
     font-size: 42px;
+    margin-bottom: 90px;
 }
 
 .station > h5 {
@@ -1553,4 +1554,9 @@ input[type="checkbox"]:checked + #two-label:after {
     margin-left: auto;
     color: rgba(253, 253, 254, 1);
     display: block;
+}
+
+.user-num{
+    font-size: 2em !important;
+    line-height: 100px;
 }

+ 5 - 0
app/client/client.js

@@ -468,6 +468,11 @@ Template.dashboard.helpers({
         } else {
             return {};
         }
+    },
+    userNum: function(){
+        var type = this.type;
+        var userNum = Rooms.findOne({type: type}).users;
+        return userNum;
     }
 });
 

+ 5 - 2
app/client/templates/dashboard.html

@@ -17,10 +17,13 @@
             {{else}}
                 <div class="col-md-4 col-sm-6 col-xs-12">
                     <div class="station">
+                        {{#with type=type}}
+                            <i class="fa fa-user user-num"></i> <span class="user-num">{{userNum}}</span>
+                        {{/with}}
                         <h3>{{display}}</h3>
                         {{#with type=type}}
-                        <h5>{{currentSong.song.title}}</h5>
-                        <h6>{{currentSong.song.artist}}</h6>
+                            <h5>{{currentSong.song.title}}</h5>
+                            <h6>{{currentSong.song.artist}}</h6>
                         {{/with}}
                         <a href="/{{type}}" class="station_link"></a>
                     </div>