{"action":"opened","issue":{"url":"https://api.github.com/repos/master7net/web/issues/1","repository_url":"https://api.github.com/repos/master7net/web","labels_url":"https://api.github.com/repos/master7net/web/issues/1/labels{/name}","comments_url":"https://api.github.com/repos/master7net/web/issues/1/comments","events_url":"https://api.github.com/repos/master7net/web/issues/1/events","html_url":"https://github.com/master7net/web/issues/1","id":137232478,"number":1,"title":"Set login event","user":{"login":"master7net","id":16624172,"avatar_url":"https://avatars.githubusercontent.com/u/16624172?v=3","gravatar_id":"","url":"https://api.github.com/users/master7net","html_url":"https://github.com/master7net","followers_url":"https://api.github.com/users/master7net/followers","following_url":"https://api.github.com/users/master7net/following{/other_user}","gists_url":"https://api.github.com/users/master7net/gists{/gist_id}","starred_url":"https://api.github.com/users/master7net/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/master7net/subscriptions","organizations_url":"https://api.github.com/users/master7net/orgs","repos_url":"https://api.github.com/users/master7net/repos","events_url":"https://api.github.com/users/master7net/events{/privacy}","received_events_url":"https://api.github.com/users/master7net/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-02-29T11:51:37Z","updated_at":"2016-02-29T11:51:37Z","closed_at":null,"body":"appControllers.controller('LoginCtrl', ['$scope', '$http', '$mdToast', '$document', '$mdDialog',\r\n    function($scope, $http, $mdToast, $document, $mdDialog) {\r\n\r\n              $scope.loginBackground = {\"background-color\": \"#fff\"};\r\n              $scope.loginColor = {\"color\": \"#ba131a\", \"border-bottom-color\" : \"#ba131a\"};\r\n\r\n              $scope.showAlert = function(ev) {\r\n                $mdDialog.show(\r\n                  $mdDialog.alert()\r\n                    .parent(angular.element(document.querySelector('#popupContainer')))\r\n                    .clickOutsideToClose(true)\r\n                    .title('Wrong credentials')\r\n                    .ok('OK')\r\n                    .targetEvent(ev)\r\n                );\r\n              };\r\n\r\n            $scope.doLogin = function() {\r\n                $http({\r\n                    method: 'POST',\r\n                    url: '/login',\r\n                    data: 'username=' + $scope.username + '&password=' + $scope.password,\r\n                    headers: {'Content-Type': 'application/x-www-form-urlencoded'}\r\n                }).success(function (data) {\r\n                    window.location.href = 'index.html#/main';\r\n                }).error(function (data, status, headers, config) {\r\n                  $scope.username = \"\";\r\n                  $scope.password = \"\";\r\n                  $scope.showAlert();\r\n                });\r\n            };\r\n\r\n    }]);"}}