{"action":"created","comment":{"url":"https://api.github.com/repos/BinaryStudioAcademy/bsa-2016-forum/pulls/comments/75206501","id":75206501,"diff_hunk":"@@ -0,0 +1,52 @@\n+var Backbone = require('backbone');\n+var Marionette = require('backbone.marionette');\n+var TopicModel = require('../../Models/TopicModel');\n+\n+module.exports = Marionette.ItemView.extend({\n+    template: 'topicCreateNew',\n+    model: new TopicModel(),\n+\n+    ui: {\n+        name: '[name=\"name\"]',\n+        description: '[name=\"description\"]',\n+        createForm: '.topic-form'\n+    },\n+\n+    initialize: function () {\n+        this.bindUIElements();\n+    },\n+\n+    modelEvents: {\n+        'invalid': function (model, errors, options) {\n+            $('.errors').empty();\n+            for (var error in errors) {\n+                $('[name=\"' + error + '\"]').siblings('.errors').html(errors[error]);\n+            }\n+        }\n+    },\n+\n+    events: {\n+        'change @ui.name': function () {\n+            this.model.set({name: this.ui.name.val()})\n+        },\n+        'change @ui.description': function () {\n+            this.model.set({description: this.ui.description.val()})\n+        },\n+        'submit @ui.createForm': function (e) {\n+            e.preventDefault();\n+            this.model.save({\n+                name: this.ui.name.val(),\n+                description: this.ui.description.val(),\n+                user_id: 2\n+            }, {","path":"resources/assets/js/app/views/topics/topicCreate.js","position":41,"original_position":41,"commit_id":"74141e65e313f499577d239aa8dc150415a59dc5","original_commit_id":"74141e65e313f499577d239aa8dc150415a59dc5","user":{"login":"TatsuUkraine","id":621542,"avatar_url":"https://avatars.githubusercontent.com/u/621542?v=3","gravatar_id":"","url":"https://api.github.com/users/TatsuUkraine","html_url":"https://github.com/TatsuUkraine","followers_url":"https://api.github.com/users/TatsuUkraine/followers","following_url":"https://api.github.com/users/TatsuUkraine/following{/other_user}","gists_url":"https://api.github.com/users/TatsuUkraine/gists{/gist_id}","starred_url":"https://api.github.com/users/TatsuUkraine/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TatsuUkraine/subscriptions","organizations_url":"https://api.github.com/users/TatsuUkraine/orgs","repos_url":"https://api.github.com/users/TatsuUkraine/repos","events_url":"https://api.github.com/users/TatsuUkraine/events{/privacy}","received_events_url":"https://api.github.com/users/TatsuUkraine/received_events","type":"User","site_admin":false},"body":"model should be already sync with your view, on submit you should just call save without data fill","created_at":"2016-08-17T21:02:11Z","updated_at":"2016-08-17T21:02:11Z","html_url":"https://github.com/BinaryStudioAcademy/bsa-2016-forum/pull/119#discussion_r75206501","pull_request_url":"https://api.github.com/repos/BinaryStudioAcademy/bsa-2016-forum/pulls/119","_links":{"self":{"href":"https://api.github.com/repos/BinaryStudioAcademy/bsa-2016-forum/pulls/comments/75206501"},"html":{"href":"https://github.com/BinaryStudioAcademy/bsa-2016-forum/pull/119#discussion_r75206501"},"pull_request":{"href":"https://api.github.com/repos/BinaryStudioAcademy/bsa-2016-forum/pulls/119"}}},"pull_request":{"url":"https://api.github.com/repos/BinaryStudioAcademy/bsa-2016-forum/pulls/119","id":81665703,"html_url":"https://github.com/BinaryStudioAcademy/bsa-2016-forum/pull/119","diff_url":"https://github.com/BinaryStudioAcademy/bsa-2016-forum/pull/119.diff","patch_url":"https://github.com/BinaryStudioAcademy/bsa-2016-forum/pull/119.patch","issue_url":"https://api.github.com/repos/BinaryStudioAcademy/bsa-2016-forum/issues/119","number":119,"state":"open","locked":false,"title":"Am/feature create topic","user":{"login":"11001","id":19551692,"avatar_url":"https://avatars.githubusercontent.com/u/19551692?v=3","gravatar_id":"","url":"https://api.github.com/users/11001","html_url":"https://github.com/11001","followers_url":"https://api.github.com/users/11001/followers","following_url":"https://api.github.com/users/11001/following{/other_user}","gists_url":"https://api.github.com/users/11001/gists{/gist_id}","starred_url":"https://api.github.com/users/11001/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/11001/subscriptions","organizations_url":"https://api.github.com/users/11001/orgs","repos_url":"https://api.github.com/users/11001/repos","events_url":"https://api.github.com/users/11001/events{/privacy}","received_events_url":"https://api.github.com/users/11001/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-08-17T15:36:16Z","updated_at":"2016-08-17T21:02:11Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a3e43e46da1eb9c1c80cdf4ccb945efda82004a6","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/BinaryStudioAcademy/bsa-2016-forum/pulls/119/commits","review_comments_url":"https://api.github.com/repos/BinaryStudioAcademy/bsa-2016-forum/pulls/119/comments","review_comment_url":"https://api.github.com/repos/BinaryStudioAcademy/bsa-2016-forum/pulls/comments{/number}","comments_url":"https://api.github.com/repos/BinaryStudioAcademy/bsa-2016-forum/issues/119/comments","statuses_url":"https://api.github.com/repos/BinaryStudioAcademy/bsa-2016-forum/statuses/74141e65e313f499577d239aa8dc150415a59dc5","head":{"label":"BinaryStudioAcademy:AM/feature-createTopic","ref":"AM/feature-createTopic","sha":"74141e65e313f499577d239aa8dc150415a59dc5","user":{"login":"BinaryStudioAcademy","id":13114349,"avatar_url":"https://avatars.githubusercontent.com/u/13114349?v=3","gravatar_id":"","url":"https://api.github.com/users/BinaryStudioAcademy","html_url":"https://github.com/BinaryStudioAcademy","followers_url":"https://api.github.com/users/BinaryStudioAcademy/followers","following_url":"https://api.github.com/users/BinaryStudioAcademy/following{/other_user}","gists_url":"https://api.github.com/users/BinaryStudioAcademy/gists{/gist_id}","starred_url":"https://api.github.com/users/BinaryStudioAcademy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BinaryStudioAcademy/subscriptions","organizations_url":"https://api.github.com/users/BinaryStudioAcademy/orgs","repos_url":"https://api.github.com/users/BinaryStudioAcademy/repos","events_url":"https://api.github.com/users/BinaryStudioAcademy/events{/privacy}","received_events_url":"https://api.github.com/users/BinaryStudioAcademy/received_events","type":"Organization","site_admin":false},"repo":{"id":65197608,"name":"bsa-2016-forum","full_name":"BinaryStudioAcademy/bsa-2016-forum","owner":{"login":"BinaryStudioAcademy","id":13114349,"avatar_url":"https://avatars.githubusercontent.com/u/13114349?v=3","gravatar_id":"","url":"https://api.github.com/users/BinaryStudioAcademy","html_url":"https://github.com/BinaryStudioAcademy","followers_url":"https://api.github.com/users/BinaryStudioAcademy/followers","following_url":"https://api.github.com/users/BinaryStudioAcademy/following{/other_user}","gists_url":"https://api.github.com/users/BinaryStudioAcademy/gists{/gist_id}","starred_url":"https://api.github.com/users/BinaryStudioAcademy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BinaryStudioAcademy/subscriptions","organizations_url":"https://api.github.com/users/BinaryStudioAcademy/orgs","repos_url":"https://api.github.com/users/BinaryStudioAcademy/repos","events_url":"https://api.github.com/users/BinaryStudioAcademy/events{/privacy}","received_events_url":"https://api.github.com/users/BinaryStudioAcademy/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/BinaryStudioAcademy/bsa-2016-forum","description":"BSA 2016 PHP Forum project","fork":false,"url":"https://api.github.com/repos/BinaryStudioAcademy/bsa-2016-forum","forks_url":"https://api.github.com/repos/BinaryStudioAcademy/bsa-2016-forum/forks","keys_url":"https://api.github.com/repos/BinaryStudioAcademy/bsa-2016-forum/keys{/key_id}","collaborators_url":"https://api.github.com/repos/BinaryStudioAcademy/bsa-2016-forum/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/BinaryStudioAcademy/bsa-2016-forum/teams","hooks_url":"https://api.github.com/repos/BinaryStudioAcademy/bsa-2016-forum/hooks","issue_events_url":"https://api.github.com/repos/BinaryStudioAcademy/bsa-2016-forum/issues/events{/number}","events_url":"https://api.github.com/repos/BinaryStudioAcademy/bsa-2016-forum/events","assignees_url":"https://api.github.com/repos/BinaryStudioAcademy/bsa-2016-forum/assignees{/user}","branches_url":"https://api.github.com/repos/BinaryStudioAcademy/bsa-2016-forum/branches{/branch}","tags_url":"https://api.github.com/repos/BinaryStudioAcademy/bsa-2016-forum/tags","blobs_url":"https://api.github.com/repos/BinaryStudioAcademy/bsa-2016-forum/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/BinaryStudioAcademy/bsa-2016-forum/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/BinaryStudioAcademy/bsa-2016-forum/git/refs{/sha}","trees_url":"https://api.github.com/repos/BinaryStudioAcademy/bsa-2016-forum/git/trees{/sha}","statuses_url":"https://api.github.com/repos/BinaryStudioAcademy/bsa-2016-forum/statuses/{sha}","languages_url":"https://api.github.com/repos/BinaryStudioAcademy/bsa-2016-forum/languages","stargazers_url":"https://api.github.com/repos/BinaryStudioAcademy/bsa-2016-forum/stargazers","contributors_url":"https://api.github.com/repos/BinaryStudioAcademy/bsa-2016-forum/contributors","subscribers_url":"https://api.github.com/repos/BinaryStudioAcademy/bsa-2016-forum/subscribers","subscription_url":"https://api.github.com/repos/BinaryStudioAcademy/bsa-2016-forum/subscription","commits_url":"https://api.github.com/repos/BinaryStudioAcademy/bsa-2016-forum/commits{/sha}","git_commits_url":"https://api.github.com/repos/BinaryStudioAcademy/bsa-2016-forum/git/commits{/sha}","comments_url":"https://api.github.com/repos/BinaryStudioAcademy/bsa-2016-forum/comments{/number}","issue_comment_url":"https://api.github.com/repos/BinaryStudioAcademy/bsa-2016-forum/issues/comments{/number}","contents_url":"https://api.github.com/repos/BinaryStudioAcademy/bsa-2016-forum/contents/{+path}","compare_url":"https://api.github.com/repos/BinaryStudioAcademy/bsa-2016-forum/compare/{base}...{head}","merges_url":"https://api.github.com/repos/BinaryStudioAcademy/bsa-2016-forum/merges","archive_url":"https://api.github.com/repos/BinaryStudioAcademy/bsa-2016-forum/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/BinaryStudioAcademy/bsa-2016-forum/downloads","issues_url":"https://api.github.com/repos/BinaryStudioAcademy/bsa-2016-forum/issues{/number}","pulls_url":"https://api.github.com/repos/BinaryStudioAcademy/bsa-2016-forum/pulls{/number}","milestones_url":"https://api.github.com/repos/BinaryStudioAcademy/bsa-2016-forum/milestones{/number}","notifications_url":"https://api.github.com/repos/BinaryStudioAcademy/bsa-2016-forum/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/BinaryStudioAcademy/bsa-2016-forum/labels{/name}","releases_url":"https://api.github.com/repos/BinaryStudioAcademy/bsa-2016-forum/releases{/id}","deployments_url":"https://api.github.com/repos/BinaryStudioAcademy/bsa-2016-forum/deployments","created_at":"2016-08-08T11:07:57Z","updated_at":"2016-08-08T12:28:55Z","pushed_at":"2016-08-17T20:56:06Z","git_url":"git://github.com/BinaryStudioAcademy/bsa-2016-forum.git","ssh_url":"git@github.com:BinaryStudioAcademy/bsa-2016-forum.git","clone_url":"https://github.com/BinaryStudioAcademy/bsa-2016-forum.git","svn_url":"https://github.com/BinaryStudioAcademy/bsa-2016-forum","homepage":"","size":1557,"stargazers_count":0,"watchers_count":0,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"open_issues_count":2,"forks":3,"open_issues":2,"watchers":0,"default_branch":"next"}},"base":{"label":"BinaryStudioAcademy:next","ref":"next","sha":"f3a37441872ba69a5903d60f07f1cb0f4404e0fa","user":{"login":"BinaryStudioAcademy","id":13114349,"avatar_url":"https://avatars.githubusercontent.com/u/13114349?v=3","gravatar_id":"","url":"https://api.github.com/users/BinaryStudioAcademy","html_url":"https://github.com/BinaryStudioAcademy","followers_url":"https://api.github.com/users/BinaryStudioAcademy/followers","following_url":"https://api.github.com/users/BinaryStudioAcademy/following{/other_user}","gists_url":"https://api.github.com/users/BinaryStudioAcademy/gists{/gist_id}","starred_url":"https://api.github.com/users/BinaryStudioAcademy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BinaryStudioAcademy/subscriptions","organizations_url":"https://api.github.com/users/BinaryStudioAcademy/orgs","repos_url":"https://api.github.com/users/BinaryStudioAcademy/repos","events_url":"https://api.github.com/users/BinaryStudioAcademy/events{/privacy}","received_events_url":"https://api.github.com/users/BinaryStudioAcademy/received_events","type":"Organization","site_admin":false},"repo":{"id":65197608,"name":"bsa-2016-forum","full_name":"BinaryStudioAcademy/bsa-2016-forum","owner":{"login":"BinaryStudioAcademy","id":13114349,"avatar_url":"https://avatars.githubusercontent.com/u/13114349?v=3","gravatar_id":"","url":"https://api.github.com/users/BinaryStudioAcademy","html_url":"https://github.com/BinaryStudioAcademy","followers_url":"https://api.github.com/users/BinaryStudioAcademy/followers","following_url":"https://api.github.com/users/BinaryStudioAcademy/following{/other_user}","gists_url":"https://api.github.com/users/BinaryStudioAcademy/gists{/gist_id}","starred_url":"https://api.github.com/users/BinaryStudioAcademy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BinaryStudioAcademy/subscriptions","organizations_url":"https://api.github.com/users/BinaryStudioAcademy/orgs","repos_url":"https://api.github.com/users/BinaryStudioAcademy/repos","events_url":"https://api.github.com/users/BinaryStudioAcademy/events{/privacy}","received_events_url":"https://api.github.com/users/BinaryStudioAcademy/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/BinaryStudioAcademy/bsa-2016-forum","description":"BSA 2016 PHP Forum project","fork":false,"url":"https://api.github.com/repos/BinaryStudioAcademy/bsa-2016-forum","forks_url":"https://api.github.com/repos/BinaryStudioAcademy/bsa-2016-forum/forks","keys_url":"https://api.github.com/repos/BinaryStudioAcademy/bsa-2016-forum/keys{/key_id}","collaborators_url":"https://api.github.com/repos/BinaryStudioAcademy/bsa-2016-forum/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/BinaryStudioAcademy/bsa-2016-forum/teams","hooks_url":"https://api.github.com/repos/BinaryStudioAcademy/bsa-2016-forum/hooks","issue_events_url":"https://api.github.com/repos/BinaryStudioAcademy/bsa-2016-forum/issues/events{/number}","events_url":"https://api.github.com/repos/BinaryStudioAcademy/bsa-2016-forum/events","assignees_url":"https://api.github.com/repos/BinaryStudioAcademy/bsa-2016-forum/assignees{/user}","branches_url":"https://api.github.com/repos/BinaryStudioAcademy/bsa-2016-forum/branches{/branch}","tags_url":"https://api.github.com/repos/BinaryStudioAcademy/bsa-2016-forum/tags","blobs_url":"https://api.github.com/repos/BinaryStudioAcademy/bsa-2016-forum/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/BinaryStudioAcademy/bsa-2016-forum/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/BinaryStudioAcademy/bsa-2016-forum/git/refs{/sha}","trees_url":"https://api.github.com/repos/BinaryStudioAcademy/bsa-2016-forum/git/trees{/sha}","statuses_url":"https://api.github.com/repos/BinaryStudioAcademy/bsa-2016-forum/statuses/{sha}","languages_url":"https://api.github.com/repos/BinaryStudioAcademy/bsa-2016-forum/languages","stargazers_url":"https://api.github.com/repos/BinaryStudioAcademy/bsa-2016-forum/stargazers","contributors_url":"https://api.github.com/repos/BinaryStudioAcademy/bsa-2016-forum/contributors","subscribers_url":"https://api.github.com/repos/BinaryStudioAcademy/bsa-2016-forum/subscribers","subscription_url":"https://api.github.com/repos/BinaryStudioAcademy/bsa-2016-forum/subscription","commits_url":"https://api.github.com/repos/BinaryStudioAcademy/bsa-2016-forum/commits{/sha}","git_commits_url":"https://api.github.com/repos/BinaryStudioAcademy/bsa-2016-forum/git/commits{/sha}","comments_url":"https://api.github.com/repos/BinaryStudioAcademy/bsa-2016-forum/comments{/number}","issue_comment_url":"https://api.github.com/repos/BinaryStudioAcademy/bsa-2016-forum/issues/comments{/number}","contents_url":"https://api.github.com/repos/BinaryStudioAcademy/bsa-2016-forum/contents/{+path}","compare_url":"https://api.github.com/repos/BinaryStudioAcademy/bsa-2016-forum/compare/{base}...{head}","merges_url":"https://api.github.com/repos/BinaryStudioAcademy/bsa-2016-forum/merges","archive_url":"https://api.github.com/repos/BinaryStudioAcademy/bsa-2016-forum/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/BinaryStudioAcademy/bsa-2016-forum/downloads","issues_url":"https://api.github.com/repos/BinaryStudioAcademy/bsa-2016-forum/issues{/number}","pulls_url":"https://api.github.com/repos/BinaryStudioAcademy/bsa-2016-forum/pulls{/number}","milestones_url":"https://api.github.com/repos/BinaryStudioAcademy/bsa-2016-forum/milestones{/number}","notifications_url":"https://api.github.com/repos/BinaryStudioAcademy/bsa-2016-forum/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/BinaryStudioAcademy/bsa-2016-forum/labels{/name}","releases_url":"https://api.github.com/repos/BinaryStudioAcademy/bsa-2016-forum/releases{/id}","deployments_url":"https://api.github.com/repos/BinaryStudioAcademy/bsa-2016-forum/deployments","created_at":"2016-08-08T11:07:57Z","updated_at":"2016-08-08T12:28:55Z","pushed_at":"2016-08-17T20:56:06Z","git_url":"git://github.com/BinaryStudioAcademy/bsa-2016-forum.git","ssh_url":"git@github.com:BinaryStudioAcademy/bsa-2016-forum.git","clone_url":"https://github.com/BinaryStudioAcademy/bsa-2016-forum.git","svn_url":"https://github.com/BinaryStudioAcademy/bsa-2016-forum","homepage":"","size":1557,"stargazers_count":0,"watchers_count":0,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"open_issues_count":2,"forks":3,"open_issues":2,"watchers":0,"default_branch":"next"}},"_links":{"self":{"href":"https://api.github.com/repos/BinaryStudioAcademy/bsa-2016-forum/pulls/119"},"html":{"href":"https://github.com/BinaryStudioAcademy/bsa-2016-forum/pull/119"},"issue":{"href":"https://api.github.com/repos/BinaryStudioAcademy/bsa-2016-forum/issues/119"},"comments":{"href":"https://api.github.com/repos/BinaryStudioAcademy/bsa-2016-forum/issues/119/comments"},"review_comments":{"href":"https://api.github.com/repos/BinaryStudioAcademy/bsa-2016-forum/pulls/119/comments"},"review_comment":{"href":"https://api.github.com/repos/BinaryStudioAcademy/bsa-2016-forum/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/BinaryStudioAcademy/bsa-2016-forum/pulls/119/commits"},"statuses":{"href":"https://api.github.com/repos/BinaryStudioAcademy/bsa-2016-forum/statuses/74141e65e313f499577d239aa8dc150415a59dc5"}}}}
{"actor":{"display_login":"TatsuUkraine"}}