{"action":"created","comment":{"url":"https://api.github.com/repos/Aleksgav/angular-travel/pulls/comments/42944094","id":42944094,"diff_hunk":"@@ -0,0 +1,62 @@\n+/**\n+ * Created by alex on 22/10/15.\n+ */\n+\n+angular.module('tourApp').controller('adminCountriesController', function($scope) {\n+  'use strict';\n+\n+  $scope.countries = getCountryValues();\n+  $scope.newCountry = { title: null };\n+  $scope.countriesOldValues = [];\n+\n+  $scope.addCountry = function() {\n+    $scope.countries.push(angular.copy($scope.newCountry));\n+    $scope.newCountry = {};\n+    localStorage.setItem(\"countriesList\", angular.toJson($scope.countries));\n+  };\n+\n+  $scope.addCountryFormShowStatus = false;\n+\n+  $scope.showCreateCountryForm = function() {\n+    $scope.addCountryFormShowStatus = true;\n+  };\n+\n+  $scope.hideCreateCountryForm = function() {\n+    $scope.addCountryFormShowStatus = false;\n+  };\n+\n+  $scope.showEditCountryForm = function(country) {\n+    country.editStatus = true;\n+    var index = $scope.countries.indexOf(country);\n+    $scope.countriesOldValues[index] = angular.copy(country);\n+  };\n+\n+  $scope.hideEditCountryForm = function(country) {\n+    country.editStatus = true;\n+  };\n+\n+  $scope.cancelEditCountry = function(country) {\n+    var index = $scope.countries.indexOf(country);\n+    if (index !== -1) {\n+      $scope.countries[index] = angular.copy($scope.countriesOldValues[index]);\n+      $scope.countries[index].editStatus = false;\n+      delete $scope.countriesOldValues[index];\n+    }\n+  };\n+\n+  $scope.saveCountry = function(country) {\n+    country.editStatus = false;\n+    var index = $scope.countries.indexOf(country);\n+    if (index !== -1) {\n+      delete $scope.countriesOldValues[index];\n+    }\n+    localStorage.setItem(\"countriesList\", angular.toJson($scope.countries));","path":"src/app/admin-countries-controller.js","position":53,"original_position":53,"commit_id":"8187a08f3abebc072656a2192e20c053efcaa4cb","original_commit_id":"8187a08f3abebc072656a2192e20c053efcaa4cb","user":{"login":"anaumov","id":1510570,"avatar_url":"https://avatars.githubusercontent.com/u/1510570?v=3","gravatar_id":"","url":"https://api.github.com/users/anaumov","html_url":"https://github.com/anaumov","followers_url":"https://api.github.com/users/anaumov/followers","following_url":"https://api.github.com/users/anaumov/following{/other_user}","gists_url":"https://api.github.com/users/anaumov/gists{/gist_id}","starred_url":"https://api.github.com/users/anaumov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/anaumov/subscriptions","organizations_url":"https://api.github.com/users/anaumov/orgs","repos_url":"https://api.github.com/users/anaumov/repos","events_url":"https://api.github.com/users/anaumov/events{/privacy}","received_events_url":"https://api.github.com/users/anaumov/received_events","type":"User","site_admin":false},"body":"Сохранение в localStorage можно вынести в отдельный метод.","created_at":"2015-10-25T12:00:34Z","updated_at":"2015-10-25T12:00:34Z","html_url":"https://github.com/Aleksgav/angular-travel/pull/2#discussion_r42944094","pull_request_url":"https://api.github.com/repos/Aleksgav/angular-travel/pulls/2","_links":{"self":{"href":"https://api.github.com/repos/Aleksgav/angular-travel/pulls/comments/42944094"},"html":{"href":"https://github.com/Aleksgav/angular-travel/pull/2#discussion_r42944094"},"pull_request":{"href":"https://api.github.com/repos/Aleksgav/angular-travel/pulls/2"}}},"pull_request":{"url":"https://api.github.com/repos/Aleksgav/angular-travel/pulls/2","id":48646710,"html_url":"https://github.com/Aleksgav/angular-travel/pull/2","diff_url":"https://github.com/Aleksgav/angular-travel/pull/2.diff","patch_url":"https://github.com/Aleksgav/angular-travel/pull/2.patch","issue_url":"https://api.github.com/repos/Aleksgav/angular-travel/issues/2","number":2,"state":"open","locked":false,"title":"Second routing","user":{"login":"Aleksgav","id":5208072,"avatar_url":"https://avatars.githubusercontent.com/u/5208072?v=3","gravatar_id":"","url":"https://api.github.com/users/Aleksgav","html_url":"https://github.com/Aleksgav","followers_url":"https://api.github.com/users/Aleksgav/followers","following_url":"https://api.github.com/users/Aleksgav/following{/other_user}","gists_url":"https://api.github.com/users/Aleksgav/gists{/gist_id}","starred_url":"https://api.github.com/users/Aleksgav/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Aleksgav/subscriptions","organizations_url":"https://api.github.com/users/Aleksgav/orgs","repos_url":"https://api.github.com/users/Aleksgav/repos","events_url":"https://api.github.com/users/Aleksgav/events{/privacy}","received_events_url":"https://api.github.com/users/Aleksgav/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-10-24T02:25:40Z","updated_at":"2015-10-25T12:00:34Z","closed_at":null,"merged_at":null,"merge_commit_sha":"ddfbecc1e79724e8a9c42ce8848bc895bf360262","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/Aleksgav/angular-travel/pulls/2/commits","review_comments_url":"https://api.github.com/repos/Aleksgav/angular-travel/pulls/2/comments","review_comment_url":"https://api.github.com/repos/Aleksgav/angular-travel/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Aleksgav/angular-travel/issues/2/comments","statuses_url":"https://api.github.com/repos/Aleksgav/angular-travel/statuses/8187a08f3abebc072656a2192e20c053efcaa4cb","head":{"label":"Aleksgav:second-routing","ref":"second-routing","sha":"8187a08f3abebc072656a2192e20c053efcaa4cb","user":{"login":"Aleksgav","id":5208072,"avatar_url":"https://avatars.githubusercontent.com/u/5208072?v=3","gravatar_id":"","url":"https://api.github.com/users/Aleksgav","html_url":"https://github.com/Aleksgav","followers_url":"https://api.github.com/users/Aleksgav/followers","following_url":"https://api.github.com/users/Aleksgav/following{/other_user}","gists_url":"https://api.github.com/users/Aleksgav/gists{/gist_id}","starred_url":"https://api.github.com/users/Aleksgav/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Aleksgav/subscriptions","organizations_url":"https://api.github.com/users/Aleksgav/orgs","repos_url":"https://api.github.com/users/Aleksgav/repos","events_url":"https://api.github.com/users/Aleksgav/events{/privacy}","received_events_url":"https://api.github.com/users/Aleksgav/received_events","type":"User","site_admin":false},"repo":{"id":44062788,"name":"angular-travel","full_name":"Aleksgav/angular-travel","owner":{"login":"Aleksgav","id":5208072,"avatar_url":"https://avatars.githubusercontent.com/u/5208072?v=3","gravatar_id":"","url":"https://api.github.com/users/Aleksgav","html_url":"https://github.com/Aleksgav","followers_url":"https://api.github.com/users/Aleksgav/followers","following_url":"https://api.github.com/users/Aleksgav/following{/other_user}","gists_url":"https://api.github.com/users/Aleksgav/gists{/gist_id}","starred_url":"https://api.github.com/users/Aleksgav/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Aleksgav/subscriptions","organizations_url":"https://api.github.com/users/Aleksgav/orgs","repos_url":"https://api.github.com/users/Aleksgav/repos","events_url":"https://api.github.com/users/Aleksgav/events{/privacy}","received_events_url":"https://api.github.com/users/Aleksgav/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Aleksgav/angular-travel","description":"","fork":false,"url":"https://api.github.com/repos/Aleksgav/angular-travel","forks_url":"https://api.github.com/repos/Aleksgav/angular-travel/forks","keys_url":"https://api.github.com/repos/Aleksgav/angular-travel/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Aleksgav/angular-travel/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Aleksgav/angular-travel/teams","hooks_url":"https://api.github.com/repos/Aleksgav/angular-travel/hooks","issue_events_url":"https://api.github.com/repos/Aleksgav/angular-travel/issues/events{/number}","events_url":"https://api.github.com/repos/Aleksgav/angular-travel/events","assignees_url":"https://api.github.com/repos/Aleksgav/angular-travel/assignees{/user}","branches_url":"https://api.github.com/repos/Aleksgav/angular-travel/branches{/branch}","tags_url":"https://api.github.com/repos/Aleksgav/angular-travel/tags","blobs_url":"https://api.github.com/repos/Aleksgav/angular-travel/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Aleksgav/angular-travel/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Aleksgav/angular-travel/git/refs{/sha}","trees_url":"https://api.github.com/repos/Aleksgav/angular-travel/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Aleksgav/angular-travel/statuses/{sha}","languages_url":"https://api.github.com/repos/Aleksgav/angular-travel/languages","stargazers_url":"https://api.github.com/repos/Aleksgav/angular-travel/stargazers","contributors_url":"https://api.github.com/repos/Aleksgav/angular-travel/contributors","subscribers_url":"https://api.github.com/repos/Aleksgav/angular-travel/subscribers","subscription_url":"https://api.github.com/repos/Aleksgav/angular-travel/subscription","commits_url":"https://api.github.com/repos/Aleksgav/angular-travel/commits{/sha}","git_commits_url":"https://api.github.com/repos/Aleksgav/angular-travel/git/commits{/sha}","comments_url":"https://api.github.com/repos/Aleksgav/angular-travel/comments{/number}","issue_comment_url":"https://api.github.com/repos/Aleksgav/angular-travel/issues/comments{/number}","contents_url":"https://api.github.com/repos/Aleksgav/angular-travel/contents/{+path}","compare_url":"https://api.github.com/repos/Aleksgav/angular-travel/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Aleksgav/angular-travel/merges","archive_url":"https://api.github.com/repos/Aleksgav/angular-travel/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Aleksgav/angular-travel/downloads","issues_url":"https://api.github.com/repos/Aleksgav/angular-travel/issues{/number}","pulls_url":"https://api.github.com/repos/Aleksgav/angular-travel/pulls{/number}","milestones_url":"https://api.github.com/repos/Aleksgav/angular-travel/milestones{/number}","notifications_url":"https://api.github.com/repos/Aleksgav/angular-travel/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Aleksgav/angular-travel/labels{/name}","releases_url":"https://api.github.com/repos/Aleksgav/angular-travel/releases{/id}","created_at":"2015-10-11T17:48:28Z","updated_at":"2015-10-11T17:53:53Z","pushed_at":"2015-10-24T02:25:42Z","git_url":"git://github.com/Aleksgav/angular-travel.git","ssh_url":"git@github.com:Aleksgav/angular-travel.git","clone_url":"https://github.com/Aleksgav/angular-travel.git","svn_url":"https://github.com/Aleksgav/angular-travel","homepage":null,"size":400,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"Aleksgav:master","ref":"master","sha":"5bf501265b3cfb96b89536ceeb8e8a16cadcd8b3","user":{"login":"Aleksgav","id":5208072,"avatar_url":"https://avatars.githubusercontent.com/u/5208072?v=3","gravatar_id":"","url":"https://api.github.com/users/Aleksgav","html_url":"https://github.com/Aleksgav","followers_url":"https://api.github.com/users/Aleksgav/followers","following_url":"https://api.github.com/users/Aleksgav/following{/other_user}","gists_url":"https://api.github.com/users/Aleksgav/gists{/gist_id}","starred_url":"https://api.github.com/users/Aleksgav/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Aleksgav/subscriptions","organizations_url":"https://api.github.com/users/Aleksgav/orgs","repos_url":"https://api.github.com/users/Aleksgav/repos","events_url":"https://api.github.com/users/Aleksgav/events{/privacy}","received_events_url":"https://api.github.com/users/Aleksgav/received_events","type":"User","site_admin":false},"repo":{"id":44062788,"name":"angular-travel","full_name":"Aleksgav/angular-travel","owner":{"login":"Aleksgav","id":5208072,"avatar_url":"https://avatars.githubusercontent.com/u/5208072?v=3","gravatar_id":"","url":"https://api.github.com/users/Aleksgav","html_url":"https://github.com/Aleksgav","followers_url":"https://api.github.com/users/Aleksgav/followers","following_url":"https://api.github.com/users/Aleksgav/following{/other_user}","gists_url":"https://api.github.com/users/Aleksgav/gists{/gist_id}","starred_url":"https://api.github.com/users/Aleksgav/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Aleksgav/subscriptions","organizations_url":"https://api.github.com/users/Aleksgav/orgs","repos_url":"https://api.github.com/users/Aleksgav/repos","events_url":"https://api.github.com/users/Aleksgav/events{/privacy}","received_events_url":"https://api.github.com/users/Aleksgav/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Aleksgav/angular-travel","description":"","fork":false,"url":"https://api.github.com/repos/Aleksgav/angular-travel","forks_url":"https://api.github.com/repos/Aleksgav/angular-travel/forks","keys_url":"https://api.github.com/repos/Aleksgav/angular-travel/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Aleksgav/angular-travel/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Aleksgav/angular-travel/teams","hooks_url":"https://api.github.com/repos/Aleksgav/angular-travel/hooks","issue_events_url":"https://api.github.com/repos/Aleksgav/angular-travel/issues/events{/number}","events_url":"https://api.github.com/repos/Aleksgav/angular-travel/events","assignees_url":"https://api.github.com/repos/Aleksgav/angular-travel/assignees{/user}","branches_url":"https://api.github.com/repos/Aleksgav/angular-travel/branches{/branch}","tags_url":"https://api.github.com/repos/Aleksgav/angular-travel/tags","blobs_url":"https://api.github.com/repos/Aleksgav/angular-travel/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Aleksgav/angular-travel/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Aleksgav/angular-travel/git/refs{/sha}","trees_url":"https://api.github.com/repos/Aleksgav/angular-travel/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Aleksgav/angular-travel/statuses/{sha}","languages_url":"https://api.github.com/repos/Aleksgav/angular-travel/languages","stargazers_url":"https://api.github.com/repos/Aleksgav/angular-travel/stargazers","contributors_url":"https://api.github.com/repos/Aleksgav/angular-travel/contributors","subscribers_url":"https://api.github.com/repos/Aleksgav/angular-travel/subscribers","subscription_url":"https://api.github.com/repos/Aleksgav/angular-travel/subscription","commits_url":"https://api.github.com/repos/Aleksgav/angular-travel/commits{/sha}","git_commits_url":"https://api.github.com/repos/Aleksgav/angular-travel/git/commits{/sha}","comments_url":"https://api.github.com/repos/Aleksgav/angular-travel/comments{/number}","issue_comment_url":"https://api.github.com/repos/Aleksgav/angular-travel/issues/comments{/number}","contents_url":"https://api.github.com/repos/Aleksgav/angular-travel/contents/{+path}","compare_url":"https://api.github.com/repos/Aleksgav/angular-travel/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Aleksgav/angular-travel/merges","archive_url":"https://api.github.com/repos/Aleksgav/angular-travel/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Aleksgav/angular-travel/downloads","issues_url":"https://api.github.com/repos/Aleksgav/angular-travel/issues{/number}","pulls_url":"https://api.github.com/repos/Aleksgav/angular-travel/pulls{/number}","milestones_url":"https://api.github.com/repos/Aleksgav/angular-travel/milestones{/number}","notifications_url":"https://api.github.com/repos/Aleksgav/angular-travel/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Aleksgav/angular-travel/labels{/name}","releases_url":"https://api.github.com/repos/Aleksgav/angular-travel/releases{/id}","created_at":"2015-10-11T17:48:28Z","updated_at":"2015-10-11T17:53:53Z","pushed_at":"2015-10-24T02:25:42Z","git_url":"git://github.com/Aleksgav/angular-travel.git","ssh_url":"git@github.com:Aleksgav/angular-travel.git","clone_url":"https://github.com/Aleksgav/angular-travel.git","svn_url":"https://github.com/Aleksgav/angular-travel","homepage":null,"size":400,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Aleksgav/angular-travel/pulls/2"},"html":{"href":"https://github.com/Aleksgav/angular-travel/pull/2"},"issue":{"href":"https://api.github.com/repos/Aleksgav/angular-travel/issues/2"},"comments":{"href":"https://api.github.com/repos/Aleksgav/angular-travel/issues/2/comments"},"review_comments":{"href":"https://api.github.com/repos/Aleksgav/angular-travel/pulls/2/comments"},"review_comment":{"href":"https://api.github.com/repos/Aleksgav/angular-travel/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Aleksgav/angular-travel/pulls/2/commits"},"statuses":{"href":"https://api.github.com/repos/Aleksgav/angular-travel/statuses/8187a08f3abebc072656a2192e20c053efcaa4cb"}}}}