{"action":"created","comment":{"url":"https://api.github.com/repos/projectjellyfish/api/pulls/comments/35563979","id":35563979,"diff_hunk":"@@ -0,0 +1,96 @@\n+(function() {\n+  'use strict';\n+\n+  angular.module('app.components')\n+    .directive('contentPageForm', ContentPageFormDirective);\n+\n+  /** @ngInject */\n+  function ContentPageFormDirective() {\n+    var directive = {\n+      restrict: 'AE',\n+      scope: {\n+        contentPageRecord: '=?',\n+        heading: '@?',\n+        home: '=?',\n+        homeParams: '=?'\n+      },\n+      link: link,\n+      templateUrl: 'app/components/content-page-form/content-page-form.html',\n+      controller: ContentPageFormController,\n+      controllerAs: 'vm',\n+      bindToController: true\n+    };\n+\n+    return directive;\n+\n+    function link(scope, element, attrs, vm, transclude) {\n+      vm.activate();\n+    }\n+\n+    /** @ngInject */\n+    function ContentPageFormController($rootScope, $scope, $state, Toasts, ContentPage, lodash) {\n+      var vm = this;\n+\n+      // SO FORM DOESN'T PRELOAD VALIDATION ERRORS\n+      vm.showValidationMessages = false;\n+\n+      // METHODS\n+      vm.backToList = backToList;\n+      vm.showErrors = showErrors;\n+      vm.hasErrors = hasErrors;\n+      vm.onSubmit = onSubmit;\n+      vm.activate = activate;\n+\n+      activate();\n+\n+      function activate() {\n+      }\n+\n+      function backToList() {\n+        $state.go(vm.home, vm.homeParams);\n+      }\n+\n+      function showErrors() {\n+        return vm.showValidationMessages;\n+      }\n+\n+      function hasErrors(field) {\n+        if (angular.isUndefined(field)) {\n+          return vm.showValidationMessages && vm.form.$invalid;\n+        }\n+\n+        return vm.showValidationMessages && vm.form[field].$invalid;\n+      }\n+\n+      function onSubmit() {\n+        vm.showValidationMessages = true;\n+\n+        // This is so errors can be displayed for 'untouched' angular-schema-form fields\n+        $scope.$broadcast('schemaFormValidate');\n+\n+        if (vm.form.$valid) {\n+          // If editing update rather than save\n+          if (vm.contentPageRecord.id) {\n+            ContentPage.update(vm.contentPageRecord).$promise.then(updateSuccess, saveFailure);","path":"src/client/app/components/content-page-form/content-page-form.directive.js","position":null,"original_position":74,"commit_id":"49cf8a493158fa02ae72d4128b84ea94e673f17f","original_commit_id":"27aa526586208b4dcc3b2b52e806eb381ac0524b","user":{"login":"mafernando","id":9356425,"avatar_url":"https://avatars.githubusercontent.com/u/9356425?v=3","gravatar_id":"","url":"https://api.github.com/users/mafernando","html_url":"https://github.com/mafernando","followers_url":"https://api.github.com/users/mafernando/followers","following_url":"https://api.github.com/users/mafernando/following{/other_user}","gists_url":"https://api.github.com/users/mafernando/gists{/gist_id}","starred_url":"https://api.github.com/users/mafernando/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mafernando/subscriptions","organizations_url":"https://api.github.com/users/mafernando/orgs","repos_url":"https://api.github.com/users/mafernando/repos","events_url":"https://api.github.com/users/mafernando/events{/privacy}","received_events_url":"https://api.github.com/users/mafernando/received_events","type":"User","site_admin":false},"body":"Addressed. 1ca1c60","created_at":"2015-07-27T17:43:28Z","updated_at":"2015-07-27T17:43:28Z","html_url":"https://github.com/projectjellyfish/api/pull/861#discussion_r35563979","pull_request_url":"https://api.github.com/repos/projectjellyfish/api/pulls/861","_links":{"self":{"href":"https://api.github.com/repos/projectjellyfish/api/pulls/comments/35563979"},"html":{"href":"https://github.com/projectjellyfish/api/pull/861#discussion_r35563979"},"pull_request":{"href":"https://api.github.com/repos/projectjellyfish/api/pulls/861"}}},"pull_request":{"url":"https://api.github.com/repos/projectjellyfish/api/pulls/861","id":40707135,"html_url":"https://github.com/projectjellyfish/api/pull/861","diff_url":"https://github.com/projectjellyfish/api/pull/861.diff","patch_url":"https://github.com/projectjellyfish/api/pull/861.patch","issue_url":"https://api.github.com/repos/projectjellyfish/api/issues/861","number":861,"state":"open","locked":false,"title":"Feature/ux for cms","user":{"login":"mafernando","id":9356425,"avatar_url":"https://avatars.githubusercontent.com/u/9356425?v=3","gravatar_id":"","url":"https://api.github.com/users/mafernando","html_url":"https://github.com/mafernando","followers_url":"https://api.github.com/users/mafernando/followers","following_url":"https://api.github.com/users/mafernando/following{/other_user}","gists_url":"https://api.github.com/users/mafernando/gists{/gist_id}","starred_url":"https://api.github.com/users/mafernando/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mafernando/subscriptions","organizations_url":"https://api.github.com/users/mafernando/orgs","repos_url":"https://api.github.com/users/mafernando/repos","events_url":"https://api.github.com/users/mafernando/events{/privacy}","received_events_url":"https://api.github.com/users/mafernando/received_events","type":"User","site_admin":false},"body":"Adds Admin CRUD UX and Sidebar Nav Item for Content Pages.","created_at":"2015-07-23T19:12:19Z","updated_at":"2015-07-27T17:43:28Z","closed_at":null,"merged_at":null,"merge_commit_sha":"ede216867364125cb8979bcdf842ae15f35895a5","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/projectjellyfish/api/pulls/861/commits","review_comments_url":"https://api.github.com/repos/projectjellyfish/api/pulls/861/comments","review_comment_url":"https://api.github.com/repos/projectjellyfish/api/pulls/comments{/number}","comments_url":"https://api.github.com/repos/projectjellyfish/api/issues/861/comments","statuses_url":"https://api.github.com/repos/projectjellyfish/api/statuses/49cf8a493158fa02ae72d4128b84ea94e673f17f","head":{"label":"projectjellyfish:feature/ux-for-cms","ref":"feature/ux-for-cms","sha":"49cf8a493158fa02ae72d4128b84ea94e673f17f","user":{"login":"projectjellyfish","id":10867673,"avatar_url":"https://avatars.githubusercontent.com/u/10867673?v=3","gravatar_id":"","url":"https://api.github.com/users/projectjellyfish","html_url":"https://github.com/projectjellyfish","followers_url":"https://api.github.com/users/projectjellyfish/followers","following_url":"https://api.github.com/users/projectjellyfish/following{/other_user}","gists_url":"https://api.github.com/users/projectjellyfish/gists{/gist_id}","starred_url":"https://api.github.com/users/projectjellyfish/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/projectjellyfish/subscriptions","organizations_url":"https://api.github.com/users/projectjellyfish/orgs","repos_url":"https://api.github.com/users/projectjellyfish/repos","events_url":"https://api.github.com/users/projectjellyfish/events{/privacy}","received_events_url":"https://api.github.com/users/projectjellyfish/received_events","type":"Organization","site_admin":false},"repo":{"id":25487089,"name":"api","full_name":"projectjellyfish/api","owner":{"login":"projectjellyfish","id":10867673,"avatar_url":"https://avatars.githubusercontent.com/u/10867673?v=3","gravatar_id":"","url":"https://api.github.com/users/projectjellyfish","html_url":"https://github.com/projectjellyfish","followers_url":"https://api.github.com/users/projectjellyfish/followers","following_url":"https://api.github.com/users/projectjellyfish/following{/other_user}","gists_url":"https://api.github.com/users/projectjellyfish/gists{/gist_id}","starred_url":"https://api.github.com/users/projectjellyfish/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/projectjellyfish/subscriptions","organizations_url":"https://api.github.com/users/projectjellyfish/orgs","repos_url":"https://api.github.com/users/projectjellyfish/repos","events_url":"https://api.github.com/users/projectjellyfish/events{/privacy}","received_events_url":"https://api.github.com/users/projectjellyfish/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/projectjellyfish/api","description":"Project Jellyfish API","fork":false,"url":"https://api.github.com/repos/projectjellyfish/api","forks_url":"https://api.github.com/repos/projectjellyfish/api/forks","keys_url":"https://api.github.com/repos/projectjellyfish/api/keys{/key_id}","collaborators_url":"https://api.github.com/repos/projectjellyfish/api/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/projectjellyfish/api/teams","hooks_url":"https://api.github.com/repos/projectjellyfish/api/hooks","issue_events_url":"https://api.github.com/repos/projectjellyfish/api/issues/events{/number}","events_url":"https://api.github.com/repos/projectjellyfish/api/events","assignees_url":"https://api.github.com/repos/projectjellyfish/api/assignees{/user}","branches_url":"https://api.github.com/repos/projectjellyfish/api/branches{/branch}","tags_url":"https://api.github.com/repos/projectjellyfish/api/tags","blobs_url":"https://api.github.com/repos/projectjellyfish/api/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/projectjellyfish/api/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/projectjellyfish/api/git/refs{/sha}","trees_url":"https://api.github.com/repos/projectjellyfish/api/git/trees{/sha}","statuses_url":"https://api.github.com/repos/projectjellyfish/api/statuses/{sha}","languages_url":"https://api.github.com/repos/projectjellyfish/api/languages","stargazers_url":"https://api.github.com/repos/projectjellyfish/api/stargazers","contributors_url":"https://api.github.com/repos/projectjellyfish/api/contributors","subscribers_url":"https://api.github.com/repos/projectjellyfish/api/subscribers","subscription_url":"https://api.github.com/repos/projectjellyfish/api/subscription","commits_url":"https://api.github.com/repos/projectjellyfish/api/commits{/sha}","git_commits_url":"https://api.github.com/repos/projectjellyfish/api/git/commits{/sha}","comments_url":"https://api.github.com/repos/projectjellyfish/api/comments{/number}","issue_comment_url":"https://api.github.com/repos/projectjellyfish/api/issues/comments{/number}","contents_url":"https://api.github.com/repos/projectjellyfish/api/contents/{+path}","compare_url":"https://api.github.com/repos/projectjellyfish/api/compare/{base}...{head}","merges_url":"https://api.github.com/repos/projectjellyfish/api/merges","archive_url":"https://api.github.com/repos/projectjellyfish/api/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/projectjellyfish/api/downloads","issues_url":"https://api.github.com/repos/projectjellyfish/api/issues{/number}","pulls_url":"https://api.github.com/repos/projectjellyfish/api/pulls{/number}","milestones_url":"https://api.github.com/repos/projectjellyfish/api/milestones{/number}","notifications_url":"https://api.github.com/repos/projectjellyfish/api/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/projectjellyfish/api/labels{/name}","releases_url":"https://api.github.com/repos/projectjellyfish/api/releases{/id}","created_at":"2014-10-20T21:17:09Z","updated_at":"2015-07-24T04:16:17Z","pushed_at":"2015-07-27T17:42:02Z","git_url":"git://github.com/projectjellyfish/api.git","ssh_url":"git@github.com:projectjellyfish/api.git","clone_url":"https://github.com/projectjellyfish/api.git","svn_url":"https://github.com/projectjellyfish/api","homepage":"","size":70545,"stargazers_count":28,"watchers_count":28,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":13,"mirror_url":null,"open_issues_count":35,"forks":13,"open_issues":35,"watchers":28,"default_branch":"master"}},"base":{"label":"projectjellyfish:master","ref":"master","sha":"a1e60ccde730102846c0ea33e779d6243c192ecc","user":{"login":"projectjellyfish","id":10867673,"avatar_url":"https://avatars.githubusercontent.com/u/10867673?v=3","gravatar_id":"","url":"https://api.github.com/users/projectjellyfish","html_url":"https://github.com/projectjellyfish","followers_url":"https://api.github.com/users/projectjellyfish/followers","following_url":"https://api.github.com/users/projectjellyfish/following{/other_user}","gists_url":"https://api.github.com/users/projectjellyfish/gists{/gist_id}","starred_url":"https://api.github.com/users/projectjellyfish/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/projectjellyfish/subscriptions","organizations_url":"https://api.github.com/users/projectjellyfish/orgs","repos_url":"https://api.github.com/users/projectjellyfish/repos","events_url":"https://api.github.com/users/projectjellyfish/events{/privacy}","received_events_url":"https://api.github.com/users/projectjellyfish/received_events","type":"Organization","site_admin":false},"repo":{"id":25487089,"name":"api","full_name":"projectjellyfish/api","owner":{"login":"projectjellyfish","id":10867673,"avatar_url":"https://avatars.githubusercontent.com/u/10867673?v=3","gravatar_id":"","url":"https://api.github.com/users/projectjellyfish","html_url":"https://github.com/projectjellyfish","followers_url":"https://api.github.com/users/projectjellyfish/followers","following_url":"https://api.github.com/users/projectjellyfish/following{/other_user}","gists_url":"https://api.github.com/users/projectjellyfish/gists{/gist_id}","starred_url":"https://api.github.com/users/projectjellyfish/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/projectjellyfish/subscriptions","organizations_url":"https://api.github.com/users/projectjellyfish/orgs","repos_url":"https://api.github.com/users/projectjellyfish/repos","events_url":"https://api.github.com/users/projectjellyfish/events{/privacy}","received_events_url":"https://api.github.com/users/projectjellyfish/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/projectjellyfish/api","description":"Project Jellyfish API","fork":false,"url":"https://api.github.com/repos/projectjellyfish/api","forks_url":"https://api.github.com/repos/projectjellyfish/api/forks","keys_url":"https://api.github.com/repos/projectjellyfish/api/keys{/key_id}","collaborators_url":"https://api.github.com/repos/projectjellyfish/api/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/projectjellyfish/api/teams","hooks_url":"https://api.github.com/repos/projectjellyfish/api/hooks","issue_events_url":"https://api.github.com/repos/projectjellyfish/api/issues/events{/number}","events_url":"https://api.github.com/repos/projectjellyfish/api/events","assignees_url":"https://api.github.com/repos/projectjellyfish/api/assignees{/user}","branches_url":"https://api.github.com/repos/projectjellyfish/api/branches{/branch}","tags_url":"https://api.github.com/repos/projectjellyfish/api/tags","blobs_url":"https://api.github.com/repos/projectjellyfish/api/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/projectjellyfish/api/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/projectjellyfish/api/git/refs{/sha}","trees_url":"https://api.github.com/repos/projectjellyfish/api/git/trees{/sha}","statuses_url":"https://api.github.com/repos/projectjellyfish/api/statuses/{sha}","languages_url":"https://api.github.com/repos/projectjellyfish/api/languages","stargazers_url":"https://api.github.com/repos/projectjellyfish/api/stargazers","contributors_url":"https://api.github.com/repos/projectjellyfish/api/contributors","subscribers_url":"https://api.github.com/repos/projectjellyfish/api/subscribers","subscription_url":"https://api.github.com/repos/projectjellyfish/api/subscription","commits_url":"https://api.github.com/repos/projectjellyfish/api/commits{/sha}","git_commits_url":"https://api.github.com/repos/projectjellyfish/api/git/commits{/sha}","comments_url":"https://api.github.com/repos/projectjellyfish/api/comments{/number}","issue_comment_url":"https://api.github.com/repos/projectjellyfish/api/issues/comments{/number}","contents_url":"https://api.github.com/repos/projectjellyfish/api/contents/{+path}","compare_url":"https://api.github.com/repos/projectjellyfish/api/compare/{base}...{head}","merges_url":"https://api.github.com/repos/projectjellyfish/api/merges","archive_url":"https://api.github.com/repos/projectjellyfish/api/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/projectjellyfish/api/downloads","issues_url":"https://api.github.com/repos/projectjellyfish/api/issues{/number}","pulls_url":"https://api.github.com/repos/projectjellyfish/api/pulls{/number}","milestones_url":"https://api.github.com/repos/projectjellyfish/api/milestones{/number}","notifications_url":"https://api.github.com/repos/projectjellyfish/api/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/projectjellyfish/api/labels{/name}","releases_url":"https://api.github.com/repos/projectjellyfish/api/releases{/id}","created_at":"2014-10-20T21:17:09Z","updated_at":"2015-07-24T04:16:17Z","pushed_at":"2015-07-27T17:42:02Z","git_url":"git://github.com/projectjellyfish/api.git","ssh_url":"git@github.com:projectjellyfish/api.git","clone_url":"https://github.com/projectjellyfish/api.git","svn_url":"https://github.com/projectjellyfish/api","homepage":"","size":70545,"stargazers_count":28,"watchers_count":28,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":13,"mirror_url":null,"open_issues_count":35,"forks":13,"open_issues":35,"watchers":28,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/projectjellyfish/api/pulls/861"},"html":{"href":"https://github.com/projectjellyfish/api/pull/861"},"issue":{"href":"https://api.github.com/repos/projectjellyfish/api/issues/861"},"comments":{"href":"https://api.github.com/repos/projectjellyfish/api/issues/861/comments"},"review_comments":{"href":"https://api.github.com/repos/projectjellyfish/api/pulls/861/comments"},"review_comment":{"href":"https://api.github.com/repos/projectjellyfish/api/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/projectjellyfish/api/pulls/861/commits"},"statuses":{"href":"https://api.github.com/repos/projectjellyfish/api/statuses/49cf8a493158fa02ae72d4128b84ea94e673f17f"}}}}