{"action":"created","comment":{"url":"https://api.github.com/repos/chrisshayan/TechLooper/pulls/comments/28219633","id":28219633,"diff_hunk":"@@ -1,30 +1,77 @@\n-techlooper.controller(\"companyProfileController\", function ($scope, companyProfileService, $routeParams, $http, jsonValue, $timeout) {\n+techlooper.controller(\"companyProfileController\", function ($scope, $sce, companyProfileService, $routeParams,\n+                                                            $http, jsonValue, $timeout, utils, $rootScope, $location) {\n   $scope.follow = companyProfileService.followManager;\n \n   var companyName = $routeParams.companyName;\n-  $http.get(jsonValue.httpUri.company + \"/\" + companyName).success(function(data) {\n-    $.each(data.benefits, function(i, benefit) {\n-      benefit.name = jsonValue.benefits[benefit.benefitId].name;\n-      benefit.iconName = jsonValue.benefits[benefit.benefitId].iconName;\n-    });\n-    $.each(data.industries, function(i, industry) {\n-      industry.value = jsonValue.industries[industry.industryId].value;\n-    });\n+  var parts = companyName.split(\"-\");\n+  if (parts.length < 3) {\n+    $location.path(\"/\");\n+    return;\n+  }\n+\n+  if (parts[parts.length - 1] === \"cp\") {\n+    var companyId = parts[parts.length - 2];\n+  }\n+\n+  if (companyId === undefined) {\n+    $location.path(\"/\");\n+    return;\n+  }\n+\n+  if (utils.hasNonAsciiChar(companyName)) {\n+    $location.path(\"/companies/\" +utils.toAscii(companyName));\n+    return;\n+  }\n+\n+  $http.get(jsonValue.httpUri.companyId + \"/\" + companyId)\n+    .success(function (data) {\n+      $.each(data.benefits, function (i, benefit) {\n+        benefit.name = jsonValue.benefits[benefit.benefitId].name;\n+        benefit.iconName = jsonValue.benefits[benefit.benefitId].iconName;\n+      });\n+      $.each(data.industries, function (i, industry) {\n+        industry.value = jsonValue.industries[industry.industryId].value;\n+      });\n+\n+      data.totalViews = 0;\n+      data.totalApplications = 0;\n+      $.each(data.jobs, function (i, job) {\n+        data.totalViews += job.numOfViews;\n+        data.totalApplications += job.numOfApplications;\n+      });\n+      data.totalViews = data.totalViews.toLocaleString();\n+      data.totalApplications = data.totalApplications.toLocaleString();\n+      data.companySize = jsonValue.companySizes[data.companySizeId];\n+      $scope.companyInfo = data;\n+      console.log($scope.companyInfo)\n+      if(data.jobVideoURLs != null){","path":"src/main/webapp/assets/modules/talent-search/company-profile/company-profile.con.js","position":56,"original_position":56,"commit_id":"653a88c8241ccef94a7a44c7e5f0a06e52002558","original_commit_id":"653a88c8241ccef94a7a44c7e5f0a06e52002558","user":{"login":"houndci","id":6697940,"avatar_url":"https://avatars.githubusercontent.com/u/6697940?v=3","gravatar_id":"","url":"https://api.github.com/users/houndci","html_url":"https://github.com/houndci","followers_url":"https://api.github.com/users/houndci/followers","following_url":"https://api.github.com/users/houndci/following{/other_user}","gists_url":"https://api.github.com/users/houndci/gists{/gist_id}","starred_url":"https://api.github.com/users/houndci/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/houndci/subscriptions","organizations_url":"https://api.github.com/users/houndci/orgs","repos_url":"https://api.github.com/users/houndci/repos","events_url":"https://api.github.com/users/houndci/events{/privacy}","received_events_url":"https://api.github.com/users/houndci/received_events","type":"User","site_admin":false},"body":"Use '!==' to compare with 'null'.","created_at":"2015-04-13T07:46:21Z","updated_at":"2015-04-13T07:46:21Z","html_url":"https://github.com/chrisshayan/TechLooper/pull/220#discussion_r28219633","pull_request_url":"https://api.github.com/repos/chrisshayan/TechLooper/pulls/220","_links":{"self":{"href":"https://api.github.com/repos/chrisshayan/TechLooper/pulls/comments/28219633"},"html":{"href":"https://github.com/chrisshayan/TechLooper/pull/220#discussion_r28219633"},"pull_request":{"href":"https://api.github.com/repos/chrisshayan/TechLooper/pulls/220"}}},"pull_request":{"url":"https://api.github.com/repos/chrisshayan/TechLooper/pulls/220","id":33141725,"html_url":"https://github.com/chrisshayan/TechLooper/pull/220","diff_url":"https://github.com/chrisshayan/TechLooper/pull/220.diff","patch_url":"https://github.com/chrisshayan/TechLooper/pull/220.patch","issue_url":"https://api.github.com/repos/chrisshayan/TechLooper/issues/220","number":220,"state":"open","locked":false,"title":"Please pull the latest code","user":{"login":"khoa-nd","id":1620282,"avatar_url":"https://avatars.githubusercontent.com/u/1620282?v=3","gravatar_id":"","url":"https://api.github.com/users/khoa-nd","html_url":"https://github.com/khoa-nd","followers_url":"https://api.github.com/users/khoa-nd/followers","following_url":"https://api.github.com/users/khoa-nd/following{/other_user}","gists_url":"https://api.github.com/users/khoa-nd/gists{/gist_id}","starred_url":"https://api.github.com/users/khoa-nd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/khoa-nd/subscriptions","organizations_url":"https://api.github.com/users/khoa-nd/orgs","repos_url":"https://api.github.com/users/khoa-nd/repos","events_url":"https://api.github.com/users/khoa-nd/events{/privacy}","received_events_url":"https://api.github.com/users/khoa-nd/received_events","type":"User","site_admin":false},"body":"- Implement company profile page","created_at":"2015-04-13T07:46:13Z","updated_at":"2015-04-13T07:46:21Z","closed_at":null,"merged_at":null,"merge_commit_sha":"600ea62c1d73eb4cd8432391587e68362a6b23e6","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/chrisshayan/TechLooper/pulls/220/commits","review_comments_url":"https://api.github.com/repos/chrisshayan/TechLooper/pulls/220/comments","review_comment_url":"https://api.github.com/repos/chrisshayan/TechLooper/pulls/comments{/number}","comments_url":"https://api.github.com/repos/chrisshayan/TechLooper/issues/220/comments","statuses_url":"https://api.github.com/repos/chrisshayan/TechLooper/statuses/653a88c8241ccef94a7a44c7e5f0a06e52002558","head":{"label":"khoa-nd:master","ref":"master","sha":"653a88c8241ccef94a7a44c7e5f0a06e52002558","user":{"login":"khoa-nd","id":1620282,"avatar_url":"https://avatars.githubusercontent.com/u/1620282?v=3","gravatar_id":"","url":"https://api.github.com/users/khoa-nd","html_url":"https://github.com/khoa-nd","followers_url":"https://api.github.com/users/khoa-nd/followers","following_url":"https://api.github.com/users/khoa-nd/following{/other_user}","gists_url":"https://api.github.com/users/khoa-nd/gists{/gist_id}","starred_url":"https://api.github.com/users/khoa-nd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/khoa-nd/subscriptions","organizations_url":"https://api.github.com/users/khoa-nd/orgs","repos_url":"https://api.github.com/users/khoa-nd/repos","events_url":"https://api.github.com/users/khoa-nd/events{/privacy}","received_events_url":"https://api.github.com/users/khoa-nd/received_events","type":"User","site_admin":false},"repo":{"id":25450824,"name":"TechLooper","full_name":"khoa-nd/TechLooper","owner":{"login":"khoa-nd","id":1620282,"avatar_url":"https://avatars.githubusercontent.com/u/1620282?v=3","gravatar_id":"","url":"https://api.github.com/users/khoa-nd","html_url":"https://github.com/khoa-nd","followers_url":"https://api.github.com/users/khoa-nd/followers","following_url":"https://api.github.com/users/khoa-nd/following{/other_user}","gists_url":"https://api.github.com/users/khoa-nd/gists{/gist_id}","starred_url":"https://api.github.com/users/khoa-nd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/khoa-nd/subscriptions","organizations_url":"https://api.github.com/users/khoa-nd/orgs","repos_url":"https://api.github.com/users/khoa-nd/repos","events_url":"https://api.github.com/users/khoa-nd/events{/privacy}","received_events_url":"https://api.github.com/users/khoa-nd/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/khoa-nd/TechLooper","description":"This is VietnamWorks Open Source project. TechLooper is an aggregator which will detects the market demands and trends for IT jobs.","fork":true,"url":"https://api.github.com/repos/khoa-nd/TechLooper","forks_url":"https://api.github.com/repos/khoa-nd/TechLooper/forks","keys_url":"https://api.github.com/repos/khoa-nd/TechLooper/keys{/key_id}","collaborators_url":"https://api.github.com/repos/khoa-nd/TechLooper/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/khoa-nd/TechLooper/teams","hooks_url":"https://api.github.com/repos/khoa-nd/TechLooper/hooks","issue_events_url":"https://api.github.com/repos/khoa-nd/TechLooper/issues/events{/number}","events_url":"https://api.github.com/repos/khoa-nd/TechLooper/events","assignees_url":"https://api.github.com/repos/khoa-nd/TechLooper/assignees{/user}","branches_url":"https://api.github.com/repos/khoa-nd/TechLooper/branches{/branch}","tags_url":"https://api.github.com/repos/khoa-nd/TechLooper/tags","blobs_url":"https://api.github.com/repos/khoa-nd/TechLooper/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/khoa-nd/TechLooper/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/khoa-nd/TechLooper/git/refs{/sha}","trees_url":"https://api.github.com/repos/khoa-nd/TechLooper/git/trees{/sha}","statuses_url":"https://api.github.com/repos/khoa-nd/TechLooper/statuses/{sha}","languages_url":"https://api.github.com/repos/khoa-nd/TechLooper/languages","stargazers_url":"https://api.github.com/repos/khoa-nd/TechLooper/stargazers","contributors_url":"https://api.github.com/repos/khoa-nd/TechLooper/contributors","subscribers_url":"https://api.github.com/repos/khoa-nd/TechLooper/subscribers","subscription_url":"https://api.github.com/repos/khoa-nd/TechLooper/subscription","commits_url":"https://api.github.com/repos/khoa-nd/TechLooper/commits{/sha}","git_commits_url":"https://api.github.com/repos/khoa-nd/TechLooper/git/commits{/sha}","comments_url":"https://api.github.com/repos/khoa-nd/TechLooper/comments{/number}","issue_comment_url":"https://api.github.com/repos/khoa-nd/TechLooper/issues/comments{/number}","contents_url":"https://api.github.com/repos/khoa-nd/TechLooper/contents/{+path}","compare_url":"https://api.github.com/repos/khoa-nd/TechLooper/compare/{base}...{head}","merges_url":"https://api.github.com/repos/khoa-nd/TechLooper/merges","archive_url":"https://api.github.com/repos/khoa-nd/TechLooper/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/khoa-nd/TechLooper/downloads","issues_url":"https://api.github.com/repos/khoa-nd/TechLooper/issues{/number}","pulls_url":"https://api.github.com/repos/khoa-nd/TechLooper/pulls{/number}","milestones_url":"https://api.github.com/repos/khoa-nd/TechLooper/milestones{/number}","notifications_url":"https://api.github.com/repos/khoa-nd/TechLooper/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/khoa-nd/TechLooper/labels{/name}","releases_url":"https://api.github.com/repos/khoa-nd/TechLooper/releases{/id}","created_at":"2014-10-20T04:32:02Z","updated_at":"2015-04-13T07:42:59Z","pushed_at":"2015-04-13T07:42:59Z","git_url":"git://github.com/khoa-nd/TechLooper.git","ssh_url":"git@github.com:khoa-nd/TechLooper.git","clone_url":"https://github.com/khoa-nd/TechLooper.git","svn_url":"https://github.com/khoa-nd/TechLooper","homepage":null,"size":28782,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"chrisshayan:Release20","ref":"Release20","sha":"87e9e26af1b28bc3431bf9f9e23b065663f2e83f","user":{"login":"chrisshayan","id":4226119,"avatar_url":"https://avatars.githubusercontent.com/u/4226119?v=3","gravatar_id":"","url":"https://api.github.com/users/chrisshayan","html_url":"https://github.com/chrisshayan","followers_url":"https://api.github.com/users/chrisshayan/followers","following_url":"https://api.github.com/users/chrisshayan/following{/other_user}","gists_url":"https://api.github.com/users/chrisshayan/gists{/gist_id}","starred_url":"https://api.github.com/users/chrisshayan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chrisshayan/subscriptions","organizations_url":"https://api.github.com/users/chrisshayan/orgs","repos_url":"https://api.github.com/users/chrisshayan/repos","events_url":"https://api.github.com/users/chrisshayan/events{/privacy}","received_events_url":"https://api.github.com/users/chrisshayan/received_events","type":"User","site_admin":false},"repo":{"id":21732596,"name":"TechLooper","full_name":"chrisshayan/TechLooper","owner":{"login":"chrisshayan","id":4226119,"avatar_url":"https://avatars.githubusercontent.com/u/4226119?v=3","gravatar_id":"","url":"https://api.github.com/users/chrisshayan","html_url":"https://github.com/chrisshayan","followers_url":"https://api.github.com/users/chrisshayan/followers","following_url":"https://api.github.com/users/chrisshayan/following{/other_user}","gists_url":"https://api.github.com/users/chrisshayan/gists{/gist_id}","starred_url":"https://api.github.com/users/chrisshayan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chrisshayan/subscriptions","organizations_url":"https://api.github.com/users/chrisshayan/orgs","repos_url":"https://api.github.com/users/chrisshayan/repos","events_url":"https://api.github.com/users/chrisshayan/events{/privacy}","received_events_url":"https://api.github.com/users/chrisshayan/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/chrisshayan/TechLooper","description":"This is VietnamWorks Open Source project. TechLooper is an aggregator which will detects the market demands and trends for IT jobs.","fork":false,"url":"https://api.github.com/repos/chrisshayan/TechLooper","forks_url":"https://api.github.com/repos/chrisshayan/TechLooper/forks","keys_url":"https://api.github.com/repos/chrisshayan/TechLooper/keys{/key_id}","collaborators_url":"https://api.github.com/repos/chrisshayan/TechLooper/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/chrisshayan/TechLooper/teams","hooks_url":"https://api.github.com/repos/chrisshayan/TechLooper/hooks","issue_events_url":"https://api.github.com/repos/chrisshayan/TechLooper/issues/events{/number}","events_url":"https://api.github.com/repos/chrisshayan/TechLooper/events","assignees_url":"https://api.github.com/repos/chrisshayan/TechLooper/assignees{/user}","branches_url":"https://api.github.com/repos/chrisshayan/TechLooper/branches{/branch}","tags_url":"https://api.github.com/repos/chrisshayan/TechLooper/tags","blobs_url":"https://api.github.com/repos/chrisshayan/TechLooper/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/chrisshayan/TechLooper/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/chrisshayan/TechLooper/git/refs{/sha}","trees_url":"https://api.github.com/repos/chrisshayan/TechLooper/git/trees{/sha}","statuses_url":"https://api.github.com/repos/chrisshayan/TechLooper/statuses/{sha}","languages_url":"https://api.github.com/repos/chrisshayan/TechLooper/languages","stargazers_url":"https://api.github.com/repos/chrisshayan/TechLooper/stargazers","contributors_url":"https://api.github.com/repos/chrisshayan/TechLooper/contributors","subscribers_url":"https://api.github.com/repos/chrisshayan/TechLooper/subscribers","subscription_url":"https://api.github.com/repos/chrisshayan/TechLooper/subscription","commits_url":"https://api.github.com/repos/chrisshayan/TechLooper/commits{/sha}","git_commits_url":"https://api.github.com/repos/chrisshayan/TechLooper/git/commits{/sha}","comments_url":"https://api.github.com/repos/chrisshayan/TechLooper/comments{/number}","issue_comment_url":"https://api.github.com/repos/chrisshayan/TechLooper/issues/comments{/number}","contents_url":"https://api.github.com/repos/chrisshayan/TechLooper/contents/{+path}","compare_url":"https://api.github.com/repos/chrisshayan/TechLooper/compare/{base}...{head}","merges_url":"https://api.github.com/repos/chrisshayan/TechLooper/merges","archive_url":"https://api.github.com/repos/chrisshayan/TechLooper/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/chrisshayan/TechLooper/downloads","issues_url":"https://api.github.com/repos/chrisshayan/TechLooper/issues{/number}","pulls_url":"https://api.github.com/repos/chrisshayan/TechLooper/pulls{/number}","milestones_url":"https://api.github.com/repos/chrisshayan/TechLooper/milestones{/number}","notifications_url":"https://api.github.com/repos/chrisshayan/TechLooper/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/chrisshayan/TechLooper/labels{/name}","releases_url":"https://api.github.com/repos/chrisshayan/TechLooper/releases{/id}","created_at":"2014-07-11T10:34:18Z","updated_at":"2015-03-14T16:50:04Z","pushed_at":"2015-04-13T07:46:13Z","git_url":"git://github.com/chrisshayan/TechLooper.git","ssh_url":"git@github.com:chrisshayan/TechLooper.git","clone_url":"https://github.com/chrisshayan/TechLooper.git","svn_url":"https://github.com/chrisshayan/TechLooper","homepage":null,"size":27950,"stargazers_count":10,"watchers_count":10,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":8,"mirror_url":null,"open_issues_count":1,"forks":8,"open_issues":1,"watchers":10,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/chrisshayan/TechLooper/pulls/220"},"html":{"href":"https://github.com/chrisshayan/TechLooper/pull/220"},"issue":{"href":"https://api.github.com/repos/chrisshayan/TechLooper/issues/220"},"comments":{"href":"https://api.github.com/repos/chrisshayan/TechLooper/issues/220/comments"},"review_comments":{"href":"https://api.github.com/repos/chrisshayan/TechLooper/pulls/220/comments"},"review_comment":{"href":"https://api.github.com/repos/chrisshayan/TechLooper/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/chrisshayan/TechLooper/pulls/220/commits"},"statuses":{"href":"https://api.github.com/repos/chrisshayan/TechLooper/statuses/653a88c8241ccef94a7a44c7e5f0a06e52002558"}}}}