{"action":"created","comment":{"url":"https://api.github.com/repos/andela/legolas-cfh/pulls/comments/117081314","pull_request_review_id":38756126,"id":117081314,"diff_hunk":"@@ -76,4 +76,189 @@ angular.module('mean.directives', [])\n         }\n       }\n     };\n-  });\n\\ No newline at end of file\n+  }).directive('leaderboard', ['$http', $http => ({\n+    restrict: 'A',\n+    link: (scope) => {\n+      $http.get('/api/leaderboard')\n+        .success((response) => {\n+          scope.leaderboard = response;\n+        });\n+    },\n+    template:\n+    `\n+    <div class=\"no-data\" ng-show=\"leaderboard.length === 0\">\n+      No leader board yet.\n+    </div>\n+    <div class= \"leader-board\" ng-show=\"leaderboard.length>0\" >\n+    <table class=\"table table-inverse dashboard-table\">\n+      <thead>\n+        <tr>\n+          <th> Rank </th>\n+          <th class=\"bordered\"> Player </th>\n+          <th class=\"bordered\"> Number of Wins </th>\n+        </tr>\n+      </thead>\n+      <tbody>\n+        <tr ng-repeat=\"player in leaderboard track by $index\">\n+          <td> {{$index + 1}} </td>\n+          <td> {{player.name}} </td>\n+          <td> {{player.gameWins}} </td>\n+         </tr>\n+      </tbody>\n+    </table>\n+    </div>\n+    `,\n+  })])\n+  .directive('history', ['$http', '$window', ($http, $window) => ({\n+    restrict: 'A',\n+    link: (scope) => {\n+      const userName = $window.user.name;\n+      $http.get('/api/games/history', { params: { name: userName } })\n+        .success((response) => {\n+          scope.gameHistory = response;\n+        });\n+    },\n+    template:\n+    `\n+    <div class=\"no-data\" ng-show=\"gameHistory.length === 0\">\n+      You have not Played any game yet.\n+    </div>\n+      <div class=\"game-history\" ng-repeat=\"game in gameHistory\">\n+            <table class=\"table dashboard-table game-table\">\n+              <thead>\n+                <tr>\n+                  <th>Game Play date</th>\n+                  <th> Game Rounds </th>\n+                  <th class=\"bordered\"> Game Players </th>\n+                  <th class=\"bordered\"> Game Winner </th>\n+                </tr>\n+              </thead>\n+              <tbody>\n+                <tr>\n+                <td>  <p id=\"game-date\">\n+                  <i class=\"fa fa-clock-o\"></i>\n+                  {{game.gamePlayDate[1]}}&nbsp;&nbsp;\n+                  <i class=\"fa fa-calendar\"></i>\n+                  {{game.gamePlayDate[0]}}\n+                  </p></td>\n+                  <td>\n+                  <p id=\"game-rounds\"> {{game.gameRounds}} </p>\n+                  </td>\n+                  <td>\n+                    <p  class= \"players\" ng-repeat=\"player in game.gamePlayers track by $index\">\n+                      {{player}}\n+                    </p>\n+                  </td>\n+                  <td> {{game.gameWinner}} </td>\n+                </tr>\n+              </tbody>\n+            </table>\n+       </div>\n+       `,\n+  })])\n+  .directive('donations', ['$http', '$window', ($http, $window) => ({\n+    restrict: 'A',\n+    link: ($scope) => {\n+      const userName = $window.user.name;\n+      $http.get('/api/donations', { params: { name: userName } })\n+        .success((response) => {\n+          $scope.userDonations = response;\n+        });\n+    },\n+    template:\n+    `\n+    <div class=\"no-data\" ng-show=\"userDonations.length === 0\">\n+      No Donations Yet!\n+    </div>\n+    <table class=\"table dashboard-table\" ng-show=\"userDonations.length > 0\">\n+      <thead>\n+        <tr>\n+          <th>\n+            Donation ID\n+          </th>\n+          <th class=\"bordered\">\n+            Amount\n+          </th>\n+        </tr>\n+      </thead>\n+      <tbody>\n+        <tr ng-repeat=\"donation in userDonations\">\n+          <td>{{donation.crowdrise_donation_id}}</td>\n+          <td>{{donation.amount}}</td>\n+         </tr>\n+      </tbody>\n+    </table>\n+    `,\n+  })])\n+\n+  .directive('chatbox', ['socket', socket => ({\n+    restrict: 'AE',\n+    replace: true,\n+    link: (scope, element) => {\n+        // Send chat message\n+      scope.sendChatMessage = () => {\n+        const chat = {};\n+        chat.message = $('#chatInput').val();\n+        if (!chat.message) return;\n+        chat.date = new Date().toString();\n+        chat.avatar = window.localStorage.getItem('avatar');\n+        chat.username = window.localStorage.getItem('username');\n+        socket.emit('chat message', chat);\n+        $('.emojionearea-editor').html('');\n+      };\n+\n+      // display a chat message\n+      const displayChat = (chat) => {\n+        const month = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];\n+        const date = new Date(chat.date);\n+        element.append(","path":"public/js/directives.js","position":150,"original_position":150,"commit_id":"09d61af4c7091f882e9bc259ff4e875c5a99e7aa","original_commit_id":"09d61af4c7091f882e9bc259ff4e875c5a99e7aa","user":{"login":"houndci-bot","id":6697940,"avatar_url":"https://avatars3.githubusercontent.com/u/6697940?v=3","gravatar_id":"","url":"https://api.github.com/users/houndci-bot","html_url":"https://github.com/houndci-bot","followers_url":"https://api.github.com/users/houndci-bot/followers","following_url":"https://api.github.com/users/houndci-bot/following{/other_user}","gists_url":"https://api.github.com/users/houndci-bot/gists{/gist_id}","starred_url":"https://api.github.com/users/houndci-bot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/houndci-bot/subscriptions","organizations_url":"https://api.github.com/users/houndci-bot/orgs","repos_url":"https://api.github.com/users/houndci-bot/repos","events_url":"https://api.github.com/users/houndci-bot/events{/privacy}","received_events_url":"https://api.github.com/users/houndci-bot/received_events","type":"User","site_admin":false},"body":"'template literal syntax' is only available in ES6 (use 'esversion: 6').","created_at":"2017-05-17T18:47:24Z","updated_at":"2017-05-17T18:47:25Z","html_url":"https://github.com/andela/legolas-cfh/pull/46#discussion_r117081314","pull_request_url":"https://api.github.com/repos/andela/legolas-cfh/pulls/46","_links":{"self":{"href":"https://api.github.com/repos/andela/legolas-cfh/pulls/comments/117081314"},"html":{"href":"https://github.com/andela/legolas-cfh/pull/46#discussion_r117081314"},"pull_request":{"href":"https://api.github.com/repos/andela/legolas-cfh/pulls/46"}}},"pull_request":{"url":"https://api.github.com/repos/andela/legolas-cfh/pulls/46","id":121089590,"html_url":"https://github.com/andela/legolas-cfh/pull/46","diff_url":"https://github.com/andela/legolas-cfh/pull/46.diff","patch_url":"https://github.com/andela/legolas-cfh/pull/46.patch","issue_url":"https://api.github.com/repos/andela/legolas-cfh/issues/46","number":46,"state":"open","locked":false,"title":"#143342759 Integrate chat window for players and add support for emojis","user":{"login":"andela-ookwuolisa","id":26963887,"avatar_url":"https://avatars2.githubusercontent.com/u/26963887?v=3","gravatar_id":"","url":"https://api.github.com/users/andela-ookwuolisa","html_url":"https://github.com/andela-ookwuolisa","followers_url":"https://api.github.com/users/andela-ookwuolisa/followers","following_url":"https://api.github.com/users/andela-ookwuolisa/following{/other_user}","gists_url":"https://api.github.com/users/andela-ookwuolisa/gists{/gist_id}","starred_url":"https://api.github.com/users/andela-ookwuolisa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andela-ookwuolisa/subscriptions","organizations_url":"https://api.github.com/users/andela-ookwuolisa/orgs","repos_url":"https://api.github.com/users/andela-ookwuolisa/repos","events_url":"https://api.github.com/users/andela-ookwuolisa/events{/privacy}","received_events_url":"https://api.github.com/users/andela-ookwuolisa/received_events","type":"User","site_admin":false},"body":"#### What does this PR do?\r\nPlayers can chat with each other while on a game.\r\n#### Description of Task to be completed?\r\nUsers should be able to chat with the group while they are in a game and they should be able to use emojis in the chat window.\r\n#### What are the relevant pivotal tracker stories?\r\n#143342759","created_at":"2017-05-17T15:40:00Z","updated_at":"2017-05-17T18:47:25Z","closed_at":null,"merged_at":null,"merge_commit_sha":"aa16bbbcc17fad6135c886710e83ab954785f467","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/andela/legolas-cfh/pulls/46/commits","review_comments_url":"https://api.github.com/repos/andela/legolas-cfh/pulls/46/comments","review_comment_url":"https://api.github.com/repos/andela/legolas-cfh/pulls/comments{/number}","comments_url":"https://api.github.com/repos/andela/legolas-cfh/issues/46/comments","statuses_url":"https://api.github.com/repos/andela/legolas-cfh/statuses/09d61af4c7091f882e9bc259ff4e875c5a99e7aa","head":{"label":"andela:ft-chat-feature-143342759","ref":"ft-chat-feature-143342759","sha":"09d61af4c7091f882e9bc259ff4e875c5a99e7aa","user":{"login":"andela","id":4100206,"avatar_url":"https://avatars1.githubusercontent.com/u/4100206?v=3","gravatar_id":"","url":"https://api.github.com/users/andela","html_url":"https://github.com/andela","followers_url":"https://api.github.com/users/andela/followers","following_url":"https://api.github.com/users/andela/following{/other_user}","gists_url":"https://api.github.com/users/andela/gists{/gist_id}","starred_url":"https://api.github.com/users/andela/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andela/subscriptions","organizations_url":"https://api.github.com/users/andela/orgs","repos_url":"https://api.github.com/users/andela/repos","events_url":"https://api.github.com/users/andela/events{/privacy}","received_events_url":"https://api.github.com/users/andela/received_events","type":"Organization","site_admin":false},"repo":{"id":87559583,"name":"legolas-cfh","full_name":"andela/legolas-cfh","owner":{"login":"andela","id":4100206,"avatar_url":"https://avatars1.githubusercontent.com/u/4100206?v=3","gravatar_id":"","url":"https://api.github.com/users/andela","html_url":"https://github.com/andela","followers_url":"https://api.github.com/users/andela/followers","following_url":"https://api.github.com/users/andela/following{/other_user}","gists_url":"https://api.github.com/users/andela/gists{/gist_id}","starred_url":"https://api.github.com/users/andela/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andela/subscriptions","organizations_url":"https://api.github.com/users/andela/orgs","repos_url":"https://api.github.com/users/andela/repos","events_url":"https://api.github.com/users/andela/events{/privacy}","received_events_url":"https://api.github.com/users/andela/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/andela/legolas-cfh","description":null,"fork":false,"url":"https://api.github.com/repos/andela/legolas-cfh","forks_url":"https://api.github.com/repos/andela/legolas-cfh/forks","keys_url":"https://api.github.com/repos/andela/legolas-cfh/keys{/key_id}","collaborators_url":"https://api.github.com/repos/andela/legolas-cfh/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/andela/legolas-cfh/teams","hooks_url":"https://api.github.com/repos/andela/legolas-cfh/hooks","issue_events_url":"https://api.github.com/repos/andela/legolas-cfh/issues/events{/number}","events_url":"https://api.github.com/repos/andela/legolas-cfh/events","assignees_url":"https://api.github.com/repos/andela/legolas-cfh/assignees{/user}","branches_url":"https://api.github.com/repos/andela/legolas-cfh/branches{/branch}","tags_url":"https://api.github.com/repos/andela/legolas-cfh/tags","blobs_url":"https://api.github.com/repos/andela/legolas-cfh/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/andela/legolas-cfh/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/andela/legolas-cfh/git/refs{/sha}","trees_url":"https://api.github.com/repos/andela/legolas-cfh/git/trees{/sha}","statuses_url":"https://api.github.com/repos/andela/legolas-cfh/statuses/{sha}","languages_url":"https://api.github.com/repos/andela/legolas-cfh/languages","stargazers_url":"https://api.github.com/repos/andela/legolas-cfh/stargazers","contributors_url":"https://api.github.com/repos/andela/legolas-cfh/contributors","subscribers_url":"https://api.github.com/repos/andela/legolas-cfh/subscribers","subscription_url":"https://api.github.com/repos/andela/legolas-cfh/subscription","commits_url":"https://api.github.com/repos/andela/legolas-cfh/commits{/sha}","git_commits_url":"https://api.github.com/repos/andela/legolas-cfh/git/commits{/sha}","comments_url":"https://api.github.com/repos/andela/legolas-cfh/comments{/number}","issue_comment_url":"https://api.github.com/repos/andela/legolas-cfh/issues/comments{/number}","contents_url":"https://api.github.com/repos/andela/legolas-cfh/contents/{+path}","compare_url":"https://api.github.com/repos/andela/legolas-cfh/compare/{base}...{head}","merges_url":"https://api.github.com/repos/andela/legolas-cfh/merges","archive_url":"https://api.github.com/repos/andela/legolas-cfh/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/andela/legolas-cfh/downloads","issues_url":"https://api.github.com/repos/andela/legolas-cfh/issues{/number}","pulls_url":"https://api.github.com/repos/andela/legolas-cfh/pulls{/number}","milestones_url":"https://api.github.com/repos/andela/legolas-cfh/milestones{/number}","notifications_url":"https://api.github.com/repos/andela/legolas-cfh/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/andela/legolas-cfh/labels{/name}","releases_url":"https://api.github.com/repos/andela/legolas-cfh/releases{/id}","deployments_url":"https://api.github.com/repos/andela/legolas-cfh/deployments","created_at":"2017-04-07T15:17:16Z","updated_at":"2017-04-11T14:10:54Z","pushed_at":"2017-05-17T18:46:55Z","git_url":"git://github.com/andela/legolas-cfh.git","ssh_url":"git@github.com:andela/legolas-cfh.git","clone_url":"https://github.com/andela/legolas-cfh.git","svn_url":"https://github.com/andela/legolas-cfh","homepage":null,"size":11824,"stargazers_count":0,"watchers_count":0,"language":"CSS","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":5,"forks":0,"open_issues":5,"watchers":0,"default_branch":"master"}},"base":{"label":"andela:master","ref":"master","sha":"135417570e104ae4c9e438ab1dfdb8bf539ecf30","user":{"login":"andela","id":4100206,"avatar_url":"https://avatars1.githubusercontent.com/u/4100206?v=3","gravatar_id":"","url":"https://api.github.com/users/andela","html_url":"https://github.com/andela","followers_url":"https://api.github.com/users/andela/followers","following_url":"https://api.github.com/users/andela/following{/other_user}","gists_url":"https://api.github.com/users/andela/gists{/gist_id}","starred_url":"https://api.github.com/users/andela/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andela/subscriptions","organizations_url":"https://api.github.com/users/andela/orgs","repos_url":"https://api.github.com/users/andela/repos","events_url":"https://api.github.com/users/andela/events{/privacy}","received_events_url":"https://api.github.com/users/andela/received_events","type":"Organization","site_admin":false},"repo":{"id":87559583,"name":"legolas-cfh","full_name":"andela/legolas-cfh","owner":{"login":"andela","id":4100206,"avatar_url":"https://avatars1.githubusercontent.com/u/4100206?v=3","gravatar_id":"","url":"https://api.github.com/users/andela","html_url":"https://github.com/andela","followers_url":"https://api.github.com/users/andela/followers","following_url":"https://api.github.com/users/andela/following{/other_user}","gists_url":"https://api.github.com/users/andela/gists{/gist_id}","starred_url":"https://api.github.com/users/andela/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andela/subscriptions","organizations_url":"https://api.github.com/users/andela/orgs","repos_url":"https://api.github.com/users/andela/repos","events_url":"https://api.github.com/users/andela/events{/privacy}","received_events_url":"https://api.github.com/users/andela/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/andela/legolas-cfh","description":null,"fork":false,"url":"https://api.github.com/repos/andela/legolas-cfh","forks_url":"https://api.github.com/repos/andela/legolas-cfh/forks","keys_url":"https://api.github.com/repos/andela/legolas-cfh/keys{/key_id}","collaborators_url":"https://api.github.com/repos/andela/legolas-cfh/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/andela/legolas-cfh/teams","hooks_url":"https://api.github.com/repos/andela/legolas-cfh/hooks","issue_events_url":"https://api.github.com/repos/andela/legolas-cfh/issues/events{/number}","events_url":"https://api.github.com/repos/andela/legolas-cfh/events","assignees_url":"https://api.github.com/repos/andela/legolas-cfh/assignees{/user}","branches_url":"https://api.github.com/repos/andela/legolas-cfh/branches{/branch}","tags_url":"https://api.github.com/repos/andela/legolas-cfh/tags","blobs_url":"https://api.github.com/repos/andela/legolas-cfh/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/andela/legolas-cfh/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/andela/legolas-cfh/git/refs{/sha}","trees_url":"https://api.github.com/repos/andela/legolas-cfh/git/trees{/sha}","statuses_url":"https://api.github.com/repos/andela/legolas-cfh/statuses/{sha}","languages_url":"https://api.github.com/repos/andela/legolas-cfh/languages","stargazers_url":"https://api.github.com/repos/andela/legolas-cfh/stargazers","contributors_url":"https://api.github.com/repos/andela/legolas-cfh/contributors","subscribers_url":"https://api.github.com/repos/andela/legolas-cfh/subscribers","subscription_url":"https://api.github.com/repos/andela/legolas-cfh/subscription","commits_url":"https://api.github.com/repos/andela/legolas-cfh/commits{/sha}","git_commits_url":"https://api.github.com/repos/andela/legolas-cfh/git/commits{/sha}","comments_url":"https://api.github.com/repos/andela/legolas-cfh/comments{/number}","issue_comment_url":"https://api.github.com/repos/andela/legolas-cfh/issues/comments{/number}","contents_url":"https://api.github.com/repos/andela/legolas-cfh/contents/{+path}","compare_url":"https://api.github.com/repos/andela/legolas-cfh/compare/{base}...{head}","merges_url":"https://api.github.com/repos/andela/legolas-cfh/merges","archive_url":"https://api.github.com/repos/andela/legolas-cfh/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/andela/legolas-cfh/downloads","issues_url":"https://api.github.com/repos/andela/legolas-cfh/issues{/number}","pulls_url":"https://api.github.com/repos/andela/legolas-cfh/pulls{/number}","milestones_url":"https://api.github.com/repos/andela/legolas-cfh/milestones{/number}","notifications_url":"https://api.github.com/repos/andela/legolas-cfh/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/andela/legolas-cfh/labels{/name}","releases_url":"https://api.github.com/repos/andela/legolas-cfh/releases{/id}","deployments_url":"https://api.github.com/repos/andela/legolas-cfh/deployments","created_at":"2017-04-07T15:17:16Z","updated_at":"2017-04-11T14:10:54Z","pushed_at":"2017-05-17T18:46:55Z","git_url":"git://github.com/andela/legolas-cfh.git","ssh_url":"git@github.com:andela/legolas-cfh.git","clone_url":"https://github.com/andela/legolas-cfh.git","svn_url":"https://github.com/andela/legolas-cfh","homepage":null,"size":11824,"stargazers_count":0,"watchers_count":0,"language":"CSS","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":5,"forks":0,"open_issues":5,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/andela/legolas-cfh/pulls/46"},"html":{"href":"https://github.com/andela/legolas-cfh/pull/46"},"issue":{"href":"https://api.github.com/repos/andela/legolas-cfh/issues/46"},"comments":{"href":"https://api.github.com/repos/andela/legolas-cfh/issues/46/comments"},"review_comments":{"href":"https://api.github.com/repos/andela/legolas-cfh/pulls/46/comments"},"review_comment":{"href":"https://api.github.com/repos/andela/legolas-cfh/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/andela/legolas-cfh/pulls/46/commits"},"statuses":{"href":"https://api.github.com/repos/andela/legolas-cfh/statuses/09d61af4c7091f882e9bc259ff4e875c5a99e7aa"}}}}
{"actor":{"display_login":"houndci-bot"}}