浏览代码

Added requested song count to profile

James 9 年之前
父节点
当前提交
e43c055e3a
共有 3 个文件被更改,包括 5 次插入0 次删除
  1. 3 0
      app/client/scripts/helpers.js
  2. 1 0
      app/client/scripts/onCreated.js
  3. 1 0
      app/client/templates/profile.html

+ 3 - 0
app/client/scripts/helpers.js

@@ -167,6 +167,9 @@ Template.profile.helpers({
     "rank": function () {
         return Session.get("rank");
     },
+    "songs_requested": function () {
+        return Session.get("songs_requested");
+    },
     loaded: function () {
         return Session.get("loaded");
     },

+ 1 - 0
app/client/scripts/onCreated.js

@@ -61,6 +61,7 @@ Template.profile.onCreated(function() {
             Session.set("username", data.profile.username);
             Session.set("first_joined", data.createdAt);
             Session.set("rank", data.profile.rank);
+            Session.set("songs_requested", data.profile.statistics.songsRequested);
             Session.set("liked", data.profile.liked);
             Session.set("disliked", data.profile.disliked);
             Session.set("loaded", true);

+ 1 - 0
app/client/templates/profile.html

@@ -11,6 +11,7 @@
                         <p>Username: {{username}}</p>
                         <p>First Joined: {{first_joined}}</p>
                         <p>Rank: {{rank}}</p>
+                        <p>Requested Songs: {{songs_requested}}</p>
                     </div>
                 </div>
             </div>