From c1577ff34f6783a7f9de939364f6c493c2282255 Mon Sep 17 00:00:00 2001 From: Kevin Primat Date: Thu, 5 Feb 2015 15:57:59 -0800 Subject: [PATCH 1/5] Add back GitHub and LinkedIn keys --- .gitignore | 2 +- client/app/profile-page/profile.controller.js | 2 +- client/app/profile-page/profile.html | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 6eae8cf..f69781f 100644 --- a/.gitignore +++ b/.gitignore @@ -2,5 +2,5 @@ node_modules .tmp .idea client/bower_components -/server/config/nope.local.env.js +/server/config/local.env.js dist diff --git a/client/app/profile-page/profile.controller.js b/client/app/profile-page/profile.controller.js index 2c26017..646e8ec 100644 --- a/client/app/profile-page/profile.controller.js +++ b/client/app/profile-page/profile.controller.js @@ -140,7 +140,7 @@ angular.module('tikrApp') // ], columns: data, - type: 'donut', + type: 'pie', }, pie: { width: 20, diff --git a/client/app/profile-page/profile.html b/client/app/profile-page/profile.html index ea29a68..8c343b9 100644 --- a/client/app/profile-page/profile.html +++ b/client/app/profile-page/profile.html @@ -34,7 +34,7 @@

{{'@'+userProfile.github.login}}

-

Languages

+
Languages
From 62ec7828b06e19cc1a6ab1feaef1b8865b179aee Mon Sep 17 00:00:00 2001 From: Kevin Primat Date: Fri, 6 Feb 2015 13:46:46 -0800 Subject: [PATCH 2/5] Change layout page to have three columns showing well --- client/app/main/main.html | 12 +- client/app/profile-page/profile.controller.js | 13 ++- client/app/profile-page/profile.css | 8 +- client/app/profile-page/profile.html | 109 +++++++++--------- client/index.html | 2 +- server/api/user/user.controller.js | 6 +- server/config/local.copy.env.js | 20 ++++ 7 files changed, 98 insertions(+), 72 deletions(-) create mode 100644 server/config/local.copy.env.js diff --git a/client/app/main/main.html b/client/app/main/main.html index 6397cb6..97de92f 100644 --- a/client/app/main/main.html +++ b/client/app/main/main.html @@ -2,17 +2,17 @@
diff --git a/client/app/profile-page/profile.controller.js b/client/app/profile-page/profile.controller.js index 646e8ec..682eef9 100644 --- a/client/app/profile-page/profile.controller.js +++ b/client/app/profile-page/profile.controller.js @@ -124,6 +124,9 @@ angular.module('tikrApp') }); }; + $scope.helloWorld = function(){ + }; + $scope.setupChart = function() { var data = []; _.each($scope.languages, function(val, key) { @@ -133,21 +136,19 @@ angular.module('tikrApp') var chart = c3.generate({ data: { - // Example: - // columns: [ - // ['data1',40, 30, 200, 100, 400, 150, 250, 50, 100, 250,67,190,48,123,76,54,254], - // ['x','Travel and Hospitality','Life Science and Pharma', 'Saas and Cloud', 'Hi-tech Manufacturing', 'Software', 'Business Services', 'Govt/Public Sector', 'Energy', 'Manufacturing', 'Healthcare','Media','Internet','Retail','Biotech','Automobile','Consumer Goods','Financial Services'] - // ], - columns: data, type: 'pie', }, + legend: { + position: 'right' + }, pie: { width: 20, zerobased: true, title: "Languages" } }); + }; $scope.getUserProfile(); diff --git a/client/app/profile-page/profile.css b/client/app/profile-page/profile.css index 5413ea5..110bfba 100644 --- a/client/app/profile-page/profile.css +++ b/client/app/profile-page/profile.css @@ -1,7 +1,3 @@ -.row{ - display: block; -} - #profilePic { display: block; max-width: 200px; @@ -16,8 +12,10 @@ padding: 30px 0; margin-top: 70px; border-top: 1px solid #E5E5E5; + background-color: #000; } h1, h3, h4 { text-align: center -} \ No newline at end of file +} + diff --git a/client/app/profile-page/profile.html b/client/app/profile-page/profile.html index 8c343b9..ce1f663 100644 --- a/client/app/profile-page/profile.html +++ b/client/app/profile-page/profile.html @@ -6,12 +6,12 @@

{{'@'+userProfile.github.login}}

--> -
+
-
- - -
+
+ + +
  • {{'@'+userProfile.github.login}}

  • @@ -26,51 +26,15 @@

    {{'@'+userProfile.github.login}}

  • Followers: {{userProfile.github.followers}}
  • Following: {{userProfile.github.following}}
  • -
-
- - - -
- -
-
Languages
-
-
-
-
- -
- - - -
- -
- -

Public Repositories

- -
- -
- +
  • Hireable: + + {{userProfile.github.hireable ? 'Yes' : 'No'}} + +
  • - -
    - -
    - -

    More graph

    -
    Stuff
    -
    - -
    - + - -
    +

    Skills

    @@ -81,7 +45,7 @@

    {{'@'+userProfile.github.login}}

    You haven't added any skills yet

    -

    {{currentUsername}} hasn't added any skills yet :-(

    +

    {{currentUsername}} hasn't added any skills yet

    @@ -103,19 +67,60 @@

    {{cur

    -
    + + +
    + + + +
    + +
    +

    Languages

    +
    +
    +
    +
    + + + +
    +

    Graph

    +
    +
    +
    +
    + +
    - + + + +
    -
    +
    \ No newline at end of file diff --git a/client/index.html b/client/index.html index 03185d4..9f1f2a8 100644 --- a/client/index.html +++ b/client/index.html @@ -104,5 +104,5 @@ - + diff --git a/server/api/user/user.controller.js b/server/api/user/user.controller.js index 29ebf04..cb40731 100644 --- a/server/api/user/user.controller.js +++ b/server/api/user/user.controller.js @@ -95,11 +95,13 @@ exports.changePassword = function(req, res, next) { }); }; -exports.getReposPromise = function(user, username) { +// numRepos gives the number of repos showed about a user +exports.getReposPromise = function(user, username, numRepos) { + numRepos = numRepos || "12"; return new Promise(function(resolve, reject) { var repoOptions = { url: user.repos_url + "?client_id=" + (process.env.GITHUB_ID || githubKeys.GITHUB_ID) - + "&client_secret=" + (process.env.GITHUB_SECRET || githubKeys.GITHUB_SECRET) + "&page=1&per_page=3", + + "&client_secret=" + (process.env.GITHUB_SECRET || githubKeys.GITHUB_SECRET) + "&page=1&per_page=" + numRepos, headers: { 'User-Agent': username } diff --git a/server/config/local.copy.env.js b/server/config/local.copy.env.js new file mode 100644 index 0000000..5e40f8c --- /dev/null +++ b/server/config/local.copy.env.js @@ -0,0 +1,20 @@ +'use strict'; + +// Use local.env.js for environment variables that grunt will set when the server starts locally. +// Use for your api keys, secrets, etc. This file should not be tracked by git. +// +// You will need to set these on the server you deploy to. + +module.exports = { + DOMAIN: 'http://localhost:9000', + SESSION_SECRET: 'tikr-secret', + + GITHUB_ID: '4e9a2516481e2037b80c', + GITHUB_SECRET: '1a5549b437b4d9e872bed24b39243b008b5e1f4f', + + LINKEDIN_API_KEY: '75kxsb2sjdx84e', + LINKEDIN_SECRET_KEY: 'SMdcuC3uqIkzW67D', + + // Control debug level for modules using visionmedia/debug + DEBUG: '' +}; From b8afe681e45a34d5bf1e37e13474bbbfaed7080a Mon Sep 17 00:00:00 2001 From: Kevin Primat Date: Fri, 6 Feb 2015 15:53:01 -0800 Subject: [PATCH 3/5] Add second graph, dummy data --- client/app/profile-page/profile.controller.js | 37 ++++++++++++++++++- client/app/profile-page/profile.html | 4 +- 2 files changed, 37 insertions(+), 4 deletions(-) diff --git a/client/app/profile-page/profile.controller.js b/client/app/profile-page/profile.controller.js index 1eb9b55..895da73 100644 --- a/client/app/profile-page/profile.controller.js +++ b/client/app/profile-page/profile.controller.js @@ -29,6 +29,7 @@ angular.module('tikrApp') }); $scope.setupChart(); + $scope.reposChart(); return; }). @@ -95,16 +96,48 @@ angular.module('tikrApp') }); }; - $scope.helloWorld = function(){ + $scope.reposChart = function(){ + var data = []; + // Assign each repo and its stargazer value to an array + // _.each($scope.repositories, function(val, key){ + // // Need to associate a repo name to an integer + // data.push([key, val[1], 'test']); + // }); + + // Generate graph + var chart = c3.generate({ + bindto: "#reposChart", + data: { + columns: [ + ['Repo1', 2], + ['Repo2', 1], + ['Repo3', 6], + ['Repo4', 3], + ['Repo5', 1], + ['Repo6', 1], + ['Repo7', 2], + ['Repo8', 3], + ['Repo9', 2], + ['Repo10', 2], + ], + type: 'bar' + }, + bar: { + width: { + ratio: 0.95 + } + } + }); }; $scope.setupChart = function() { var data = []; _.each($scope.languages, function(val, key) { - data.push([key, val[1], 'test']); + data.push([key, val[1]]); }); var chart = c3.generate({ + bindto: "#chart", data: { columns: data, diff --git a/client/app/profile-page/profile.html b/client/app/profile-page/profile.html index 97f61c7..8c060ba 100644 --- a/client/app/profile-page/profile.html +++ b/client/app/profile-page/profile.html @@ -100,9 +100,9 @@

    {{cur
    -

    Graph

    +

    Top 10 Most Starred Repositories

    -
    +
    From cf2e841babc957d09eb796db61bffdff2890187e Mon Sep 17 00:00:00 2001 From: Kevin Primat Date: Fri, 6 Feb 2015 16:01:32 -0800 Subject: [PATCH 4/5] Remove local.copy.env.js --- client/app/profile-page/profile.controller.js | 16 ++++++++------- server/config/local.copy.env.js | 20 ------------------- 2 files changed, 9 insertions(+), 27 deletions(-) delete mode 100644 server/config/local.copy.env.js diff --git a/client/app/profile-page/profile.controller.js b/client/app/profile-page/profile.controller.js index 895da73..0492ffc 100644 --- a/client/app/profile-page/profile.controller.js +++ b/client/app/profile-page/profile.controller.js @@ -108,14 +108,16 @@ angular.module('tikrApp') var chart = c3.generate({ bindto: "#reposChart", data: { + // Dummy data + // TODO: Get stargazers from GitHub API columns: [ - ['Repo1', 2], - ['Repo2', 1], - ['Repo3', 6], - ['Repo4', 3], - ['Repo5', 1], - ['Repo6', 1], - ['Repo7', 2], + ['FatalBadgers', 2], + ['soundTab', 1], + ['HexGL', 6], + ['tikr', 3], + ['web-api-auth-examples', 1], + ['Blog', 1], + ['GhostAzureSetup', 2], ['Repo8', 3], ['Repo9', 2], ['Repo10', 2], diff --git a/server/config/local.copy.env.js b/server/config/local.copy.env.js deleted file mode 100644 index 5e40f8c..0000000 --- a/server/config/local.copy.env.js +++ /dev/null @@ -1,20 +0,0 @@ -'use strict'; - -// Use local.env.js for environment variables that grunt will set when the server starts locally. -// Use for your api keys, secrets, etc. This file should not be tracked by git. -// -// You will need to set these on the server you deploy to. - -module.exports = { - DOMAIN: 'http://localhost:9000', - SESSION_SECRET: 'tikr-secret', - - GITHUB_ID: '4e9a2516481e2037b80c', - GITHUB_SECRET: '1a5549b437b4d9e872bed24b39243b008b5e1f4f', - - LINKEDIN_API_KEY: '75kxsb2sjdx84e', - LINKEDIN_SECRET_KEY: 'SMdcuC3uqIkzW67D', - - // Control debug level for modules using visionmedia/debug - DEBUG: '' -}; From d256dd009abff91d2d7f122e76cc2d9a41342a68 Mon Sep 17 00:00:00 2001 From: Kevin Primat Date: Fri, 6 Feb 2015 16:08:00 -0800 Subject: [PATCH 5/5] Remove two elem on chart2 --- client/app/profile-page/profile.controller.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/client/app/profile-page/profile.controller.js b/client/app/profile-page/profile.controller.js index 0492ffc..7511f37 100644 --- a/client/app/profile-page/profile.controller.js +++ b/client/app/profile-page/profile.controller.js @@ -118,9 +118,7 @@ angular.module('tikrApp') ['web-api-auth-examples', 1], ['Blog', 1], ['GhostAzureSetup', 2], - ['Repo8', 3], - ['Repo9', 2], - ['Repo10', 2], + ['javascript_koans', 3], ], type: 'bar' },