{"action":"created","comment":{"url":"https://api.github.com/repos/htmlacademy-javascript/174755-candyshop/pulls/comments/219845861","pull_request_review_id":158116186,"id":219845861,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIxOTg0NTg2MQ==","diff_hunk":"@@ -199,45 +202,98 @@ var renderGood = function (good) {\n   goodCardComposition.textContent = good.nutritionFacts.contents;\n   goodCardPicture.setAttribute('src', good.picture);\n \n+  goodCartButton.setAttribute('data-id', currentNumber);\n+\n   return goodCard;\n };\n \n+// Создание карточки мороженого в корзине\n var renderOrderedGood = function (orderedGood) {\n   var orderedGoodTemplate = document.querySelector('#card-order').content.querySelector('.goods_card');\n   var orderedGoodCard = orderedGoodTemplate.cloneNode(true);\n   var orderedGoodTitle = orderedGoodCard.querySelector('.card-order__title');\n   var orderedGoodPrice = orderedGoodCard.querySelector('.card-order__price');\n   var orderedGoodPicture = orderedGoodCard.querySelector('.card-order__img');\n+  var orderedGoodCount = orderedGoodCard.querySelector('.card-order__count');\n \n+  orderedGoodCard.setAttribute('data-id', orderedGood.id);\n   orderedGoodTitle.textContent = orderedGood.name;\n   orderedGoodPrice.textContent = orderedGood.price + ' ₽';\n   orderedGoodPicture.setAttribute('src', orderedGood.picture);\n+  orderedGoodCount.value = orderedGood.orderedAmount;\n \n   return orderedGoodCard;\n };\n \n+// Обновление текста в ссылке на корзину в хедере\n+var setHeaderCartText = function () {\n+  var headerCart = document.querySelector('.main-header__basket');\n+  var cartTotal = 0;\n+\n+  for (var k = 0; k < cart.length; k++) {\n+    cartTotal = cartTotal + cart[k].orderedAmount;\n+  }\n+\n+  if (!cartTotal) {","path":"js/goods.js","position":78,"original_position":78,"commit_id":"45913e09a9d66662d1c81e0b60544cdc54b4862d","original_commit_id":"45913e09a9d66662d1c81e0b60544cdc54b4862d","user":{"login":"cy6erskunk","id":754849,"node_id":"MDQ6VXNlcjc1NDg0OQ==","avatar_url":"https://avatars3.githubusercontent.com/u/754849?v=4","gravatar_id":"","url":"https://api.github.com/users/cy6erskunk","html_url":"https://github.com/cy6erskunk","followers_url":"https://api.github.com/users/cy6erskunk/followers","following_url":"https://api.github.com/users/cy6erskunk/following{/other_user}","gists_url":"https://api.github.com/users/cy6erskunk/gists{/gist_id}","starred_url":"https://api.github.com/users/cy6erskunk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cy6erskunk/subscriptions","organizations_url":"https://api.github.com/users/cy6erskunk/orgs","repos_url":"https://api.github.com/users/cy6erskunk/repos","events_url":"https://api.github.com/users/cy6erskunk/events{/privacy}","received_events_url":"https://api.github.com/users/cy6erskunk/received_events","type":"User","site_admin":false},"body":"Легко можно тспользовать тернарный оператор","created_at":"2018-09-24T13:59:52Z","updated_at":"2018-09-24T13:59:52Z","html_url":"https://github.com/htmlacademy-javascript/174755-candyshop/pull/3#discussion_r219845861","pull_request_url":"https://api.github.com/repos/htmlacademy-javascript/174755-candyshop/pulls/3","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/htmlacademy-javascript/174755-candyshop/pulls/comments/219845861"},"html":{"href":"https://github.com/htmlacademy-javascript/174755-candyshop/pull/3#discussion_r219845861"},"pull_request":{"href":"https://api.github.com/repos/htmlacademy-javascript/174755-candyshop/pulls/3"}}},"pull_request":{"url":"https://api.github.com/repos/htmlacademy-javascript/174755-candyshop/pulls/3","id":217044582,"node_id":"MDExOlB1bGxSZXF1ZXN0MjE3MDQ0NTgy","html_url":"https://github.com/htmlacademy-javascript/174755-candyshop/pull/3","diff_url":"https://github.com/htmlacademy-javascript/174755-candyshop/pull/3.diff","patch_url":"https://github.com/htmlacademy-javascript/174755-candyshop/pull/3.patch","issue_url":"https://api.github.com/repos/htmlacademy-javascript/174755-candyshop/issues/3","number":3,"state":"open","locked":false,"title":"Личный проект: подробности","user":{"login":"JackieHide","id":20701048,"node_id":"MDQ6VXNlcjIwNzAxMDQ4","avatar_url":"https://avatars3.githubusercontent.com/u/20701048?v=4","gravatar_id":"","url":"https://api.github.com/users/JackieHide","html_url":"https://github.com/JackieHide","followers_url":"https://api.github.com/users/JackieHide/followers","following_url":"https://api.github.com/users/JackieHide/following{/other_user}","gists_url":"https://api.github.com/users/JackieHide/gists{/gist_id}","starred_url":"https://api.github.com/users/JackieHide/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JackieHide/subscriptions","organizations_url":"https://api.github.com/users/JackieHide/orgs","repos_url":"https://api.github.com/users/JackieHide/repos","events_url":"https://api.github.com/users/JackieHide/events{/privacy}","received_events_url":"https://api.github.com/users/JackieHide/received_events","type":"User","site_admin":false},"body":"\n\n---\n:mortar_board: [Личный проект: подробности](https://up.htmlacademy.ru/javascript/15/user/174755/tasks/16)\n\n:boom: https://htmlacademy-javascript.github.io/174755-candyshop/3/","created_at":"2018-09-20T17:07:39Z","updated_at":"2018-09-24T13:59:52Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c38bbe443c8ec2ab4f24a5a2c3b986b6fe9d0772","assignee":{"login":"cy6erskunk","id":754849,"node_id":"MDQ6VXNlcjc1NDg0OQ==","avatar_url":"https://avatars3.githubusercontent.com/u/754849?v=4","gravatar_id":"","url":"https://api.github.com/users/cy6erskunk","html_url":"https://github.com/cy6erskunk","followers_url":"https://api.github.com/users/cy6erskunk/followers","following_url":"https://api.github.com/users/cy6erskunk/following{/other_user}","gists_url":"https://api.github.com/users/cy6erskunk/gists{/gist_id}","starred_url":"https://api.github.com/users/cy6erskunk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cy6erskunk/subscriptions","organizations_url":"https://api.github.com/users/cy6erskunk/orgs","repos_url":"https://api.github.com/users/cy6erskunk/repos","events_url":"https://api.github.com/users/cy6erskunk/events{/privacy}","received_events_url":"https://api.github.com/users/cy6erskunk/received_events","type":"User","site_admin":false},"assignees":[{"login":"cy6erskunk","id":754849,"node_id":"MDQ6VXNlcjc1NDg0OQ==","avatar_url":"https://avatars3.githubusercontent.com/u/754849?v=4","gravatar_id":"","url":"https://api.github.com/users/cy6erskunk","html_url":"https://github.com/cy6erskunk","followers_url":"https://api.github.com/users/cy6erskunk/followers","following_url":"https://api.github.com/users/cy6erskunk/following{/other_user}","gists_url":"https://api.github.com/users/cy6erskunk/gists{/gist_id}","starred_url":"https://api.github.com/users/cy6erskunk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cy6erskunk/subscriptions","organizations_url":"https://api.github.com/users/cy6erskunk/orgs","repos_url":"https://api.github.com/users/cy6erskunk/repos","events_url":"https://api.github.com/users/cy6erskunk/events{/privacy}","received_events_url":"https://api.github.com/users/cy6erskunk/received_events","type":"User","site_admin":false}],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/htmlacademy-javascript/174755-candyshop/pulls/3/commits","review_comments_url":"https://api.github.com/repos/htmlacademy-javascript/174755-candyshop/pulls/3/comments","review_comment_url":"https://api.github.com/repos/htmlacademy-javascript/174755-candyshop/pulls/comments{/number}","comments_url":"https://api.github.com/repos/htmlacademy-javascript/174755-candyshop/issues/3/comments","statuses_url":"https://api.github.com/repos/htmlacademy-javascript/174755-candyshop/statuses/45913e09a9d66662d1c81e0b60544cdc54b4862d","head":{"label":"JackieHide:module4-task1","ref":"module4-task1","sha":"45913e09a9d66662d1c81e0b60544cdc54b4862d","user":{"login":"JackieHide","id":20701048,"node_id":"MDQ6VXNlcjIwNzAxMDQ4","avatar_url":"https://avatars3.githubusercontent.com/u/20701048?v=4","gravatar_id":"","url":"https://api.github.com/users/JackieHide","html_url":"https://github.com/JackieHide","followers_url":"https://api.github.com/users/JackieHide/followers","following_url":"https://api.github.com/users/JackieHide/following{/other_user}","gists_url":"https://api.github.com/users/JackieHide/gists{/gist_id}","starred_url":"https://api.github.com/users/JackieHide/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JackieHide/subscriptions","organizations_url":"https://api.github.com/users/JackieHide/orgs","repos_url":"https://api.github.com/users/JackieHide/repos","events_url":"https://api.github.com/users/JackieHide/events{/privacy}","received_events_url":"https://api.github.com/users/JackieHide/received_events","type":"User","site_admin":false},"repo":{"id":146717907,"node_id":"MDEwOlJlcG9zaXRvcnkxNDY3MTc5MDc=","name":"174755-candyshop","full_name":"JackieHide/174755-candyshop","private":false,"owner":{"login":"JackieHide","id":20701048,"node_id":"MDQ6VXNlcjIwNzAxMDQ4","avatar_url":"https://avatars3.githubusercontent.com/u/20701048?v=4","gravatar_id":"","url":"https://api.github.com/users/JackieHide","html_url":"https://github.com/JackieHide","followers_url":"https://api.github.com/users/JackieHide/followers","following_url":"https://api.github.com/users/JackieHide/following{/other_user}","gists_url":"https://api.github.com/users/JackieHide/gists{/gist_id}","starred_url":"https://api.github.com/users/JackieHide/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JackieHide/subscriptions","organizations_url":"https://api.github.com/users/JackieHide/orgs","repos_url":"https://api.github.com/users/JackieHide/repos","events_url":"https://api.github.com/users/JackieHide/events{/privacy}","received_events_url":"https://api.github.com/users/JackieHide/received_events","type":"User","site_admin":false},"html_url":"https://github.com/JackieHide/174755-candyshop","description":"Женя Макарова","fork":true,"url":"https://api.github.com/repos/JackieHide/174755-candyshop","forks_url":"https://api.github.com/repos/JackieHide/174755-candyshop/forks","keys_url":"https://api.github.com/repos/JackieHide/174755-candyshop/keys{/key_id}","collaborators_url":"https://api.github.com/repos/JackieHide/174755-candyshop/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/JackieHide/174755-candyshop/teams","hooks_url":"https://api.github.com/repos/JackieHide/174755-candyshop/hooks","issue_events_url":"https://api.github.com/repos/JackieHide/174755-candyshop/issues/events{/number}","events_url":"https://api.github.com/repos/JackieHide/174755-candyshop/events","assignees_url":"https://api.github.com/repos/JackieHide/174755-candyshop/assignees{/user}","branches_url":"https://api.github.com/repos/JackieHide/174755-candyshop/branches{/branch}","tags_url":"https://api.github.com/repos/JackieHide/174755-candyshop/tags","blobs_url":"https://api.github.com/repos/JackieHide/174755-candyshop/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/JackieHide/174755-candyshop/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/JackieHide/174755-candyshop/git/refs{/sha}","trees_url":"https://api.github.com/repos/JackieHide/174755-candyshop/git/trees{/sha}","statuses_url":"https://api.github.com/repos/JackieHide/174755-candyshop/statuses/{sha}","languages_url":"https://api.github.com/repos/JackieHide/174755-candyshop/languages","stargazers_url":"https://api.github.com/repos/JackieHide/174755-candyshop/stargazers","contributors_url":"https://api.github.com/repos/JackieHide/174755-candyshop/contributors","subscribers_url":"https://api.github.com/repos/JackieHide/174755-candyshop/subscribers","subscription_url":"https://api.github.com/repos/JackieHide/174755-candyshop/subscription","commits_url":"https://api.github.com/repos/JackieHide/174755-candyshop/commits{/sha}","git_commits_url":"https://api.github.com/repos/JackieHide/174755-candyshop/git/commits{/sha}","comments_url":"https://api.github.com/repos/JackieHide/174755-candyshop/comments{/number}","issue_comment_url":"https://api.github.com/repos/JackieHide/174755-candyshop/issues/comments{/number}","contents_url":"https://api.github.com/repos/JackieHide/174755-candyshop/contents/{+path}","compare_url":"https://api.github.com/repos/JackieHide/174755-candyshop/compare/{base}...{head}","merges_url":"https://api.github.com/repos/JackieHide/174755-candyshop/merges","archive_url":"https://api.github.com/repos/JackieHide/174755-candyshop/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/JackieHide/174755-candyshop/downloads","issues_url":"https://api.github.com/repos/JackieHide/174755-candyshop/issues{/number}","pulls_url":"https://api.github.com/repos/JackieHide/174755-candyshop/pulls{/number}","milestones_url":"https://api.github.com/repos/JackieHide/174755-candyshop/milestones{/number}","notifications_url":"https://api.github.com/repos/JackieHide/174755-candyshop/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/JackieHide/174755-candyshop/labels{/name}","releases_url":"https://api.github.com/repos/JackieHide/174755-candyshop/releases{/id}","deployments_url":"https://api.github.com/repos/JackieHide/174755-candyshop/deployments","created_at":"2018-08-30T08:14:02Z","updated_at":"2018-09-14T18:07:56Z","pushed_at":"2018-09-21T13:54:49Z","git_url":"git://github.com/JackieHide/174755-candyshop.git","ssh_url":"git@github.com:JackieHide/174755-candyshop.git","clone_url":"https://github.com/JackieHide/174755-candyshop.git","svn_url":"https://github.com/JackieHide/174755-candyshop","homepage":null,"size":1613,"stargazers_count":0,"watchers_count":0,"language":"HTML","has_issues":false,"has_projects":true,"has_downloads":false,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":null,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"htmlacademy-javascript:master","ref":"master","sha":"c7d09fea8a03641da5e41864a6c3119d902bf739","user":{"login":"htmlacademy-javascript","id":14179712,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE0MTc5NzEy","avatar_url":"https://avatars2.githubusercontent.com/u/14179712?v=4","gravatar_id":"","url":"https://api.github.com/users/htmlacademy-javascript","html_url":"https://github.com/htmlacademy-javascript","followers_url":"https://api.github.com/users/htmlacademy-javascript/followers","following_url":"https://api.github.com/users/htmlacademy-javascript/following{/other_user}","gists_url":"https://api.github.com/users/htmlacademy-javascript/gists{/gist_id}","starred_url":"https://api.github.com/users/htmlacademy-javascript/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/htmlacademy-javascript/subscriptions","organizations_url":"https://api.github.com/users/htmlacademy-javascript/orgs","repos_url":"https://api.github.com/users/htmlacademy-javascript/repos","events_url":"https://api.github.com/users/htmlacademy-javascript/events{/privacy}","received_events_url":"https://api.github.com/users/htmlacademy-javascript/received_events","type":"Organization","site_admin":false},"repo":{"id":146492800,"node_id":"MDEwOlJlcG9zaXRvcnkxNDY0OTI4MDA=","name":"174755-candyshop","full_name":"htmlacademy-javascript/174755-candyshop","private":false,"owner":{"login":"htmlacademy-javascript","id":14179712,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE0MTc5NzEy","avatar_url":"https://avatars2.githubusercontent.com/u/14179712?v=4","gravatar_id":"","url":"https://api.github.com/users/htmlacademy-javascript","html_url":"https://github.com/htmlacademy-javascript","followers_url":"https://api.github.com/users/htmlacademy-javascript/followers","following_url":"https://api.github.com/users/htmlacademy-javascript/following{/other_user}","gists_url":"https://api.github.com/users/htmlacademy-javascript/gists{/gist_id}","starred_url":"https://api.github.com/users/htmlacademy-javascript/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/htmlacademy-javascript/subscriptions","organizations_url":"https://api.github.com/users/htmlacademy-javascript/orgs","repos_url":"https://api.github.com/users/htmlacademy-javascript/repos","events_url":"https://api.github.com/users/htmlacademy-javascript/events{/privacy}","received_events_url":"https://api.github.com/users/htmlacademy-javascript/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/htmlacademy-javascript/174755-candyshop","description":"Женя Макарова","fork":false,"url":"https://api.github.com/repos/htmlacademy-javascript/174755-candyshop","forks_url":"https://api.github.com/repos/htmlacademy-javascript/174755-candyshop/forks","keys_url":"https://api.github.com/repos/htmlacademy-javascript/174755-candyshop/keys{/key_id}","collaborators_url":"https://api.github.com/repos/htmlacademy-javascript/174755-candyshop/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/htmlacademy-javascript/174755-candyshop/teams","hooks_url":"https://api.github.com/repos/htmlacademy-javascript/174755-candyshop/hooks","issue_events_url":"https://api.github.com/repos/htmlacademy-javascript/174755-candyshop/issues/events{/number}","events_url":"https://api.github.com/repos/htmlacademy-javascript/174755-candyshop/events","assignees_url":"https://api.github.com/repos/htmlacademy-javascript/174755-candyshop/assignees{/user}","branches_url":"https://api.github.com/repos/htmlacademy-javascript/174755-candyshop/branches{/branch}","tags_url":"https://api.github.com/repos/htmlacademy-javascript/174755-candyshop/tags","blobs_url":"https://api.github.com/repos/htmlacademy-javascript/174755-candyshop/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/htmlacademy-javascript/174755-candyshop/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/htmlacademy-javascript/174755-candyshop/git/refs{/sha}","trees_url":"https://api.github.com/repos/htmlacademy-javascript/174755-candyshop/git/trees{/sha}","statuses_url":"https://api.github.com/repos/htmlacademy-javascript/174755-candyshop/statuses/{sha}","languages_url":"https://api.github.com/repos/htmlacademy-javascript/174755-candyshop/languages","stargazers_url":"https://api.github.com/repos/htmlacademy-javascript/174755-candyshop/stargazers","contributors_url":"https://api.github.com/repos/htmlacademy-javascript/174755-candyshop/contributors","subscribers_url":"https://api.github.com/repos/htmlacademy-javascript/174755-candyshop/subscribers","subscription_url":"https://api.github.com/repos/htmlacademy-javascript/174755-candyshop/subscription","commits_url":"https://api.github.com/repos/htmlacademy-javascript/174755-candyshop/commits{/sha}","git_commits_url":"https://api.github.com/repos/htmlacademy-javascript/174755-candyshop/git/commits{/sha}","comments_url":"https://api.github.com/repos/htmlacademy-javascript/174755-candyshop/comments{/number}","issue_comment_url":"https://api.github.com/repos/htmlacademy-javascript/174755-candyshop/issues/comments{/number}","contents_url":"https://api.github.com/repos/htmlacademy-javascript/174755-candyshop/contents/{+path}","compare_url":"https://api.github.com/repos/htmlacademy-javascript/174755-candyshop/compare/{base}...{head}","merges_url":"https://api.github.com/repos/htmlacademy-javascript/174755-candyshop/merges","archive_url":"https://api.github.com/repos/htmlacademy-javascript/174755-candyshop/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/htmlacademy-javascript/174755-candyshop/downloads","issues_url":"https://api.github.com/repos/htmlacademy-javascript/174755-candyshop/issues{/number}","pulls_url":"https://api.github.com/repos/htmlacademy-javascript/174755-candyshop/pulls{/number}","milestones_url":"https://api.github.com/repos/htmlacademy-javascript/174755-candyshop/milestones{/number}","notifications_url":"https://api.github.com/repos/htmlacademy-javascript/174755-candyshop/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/htmlacademy-javascript/174755-candyshop/labels{/name}","releases_url":"https://api.github.com/repos/htmlacademy-javascript/174755-candyshop/releases{/id}","deployments_url":"https://api.github.com/repos/htmlacademy-javascript/174755-candyshop/deployments","created_at":"2018-08-28T18:53:51Z","updated_at":"2018-09-14T18:06:32Z","pushed_at":"2018-09-24T13:48:43Z","git_url":"git://github.com/htmlacademy-javascript/174755-candyshop.git","ssh_url":"git@github.com:htmlacademy-javascript/174755-candyshop.git","clone_url":"https://github.com/htmlacademy-javascript/174755-candyshop.git","svn_url":"https://github.com/htmlacademy-javascript/174755-candyshop","homepage":"https://github.com/JackieHide/174755-candyshop","size":1629,"stargazers_count":0,"watchers_count":0,"language":"HTML","has_issues":false,"has_projects":false,"has_downloads":false,"has_wiki":false,"has_pages":true,"forks_count":1,"mirror_url":null,"archived":false,"open_issues_count":1,"license":null,"forks":1,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/htmlacademy-javascript/174755-candyshop/pulls/3"},"html":{"href":"https://github.com/htmlacademy-javascript/174755-candyshop/pull/3"},"issue":{"href":"https://api.github.com/repos/htmlacademy-javascript/174755-candyshop/issues/3"},"comments":{"href":"https://api.github.com/repos/htmlacademy-javascript/174755-candyshop/issues/3/comments"},"review_comments":{"href":"https://api.github.com/repos/htmlacademy-javascript/174755-candyshop/pulls/3/comments"},"review_comment":{"href":"https://api.github.com/repos/htmlacademy-javascript/174755-candyshop/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/htmlacademy-javascript/174755-candyshop/pulls/3/commits"},"statuses":{"href":"https://api.github.com/repos/htmlacademy-javascript/174755-candyshop/statuses/45913e09a9d66662d1c81e0b60544cdc54b4862d"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"cy6erskunk"}}