{"action":"created","comment":{"url":"https://api.github.com/repos/htmlacademy-ecmascript/125911-guess-melody/pulls/comments/120276338","pull_request_review_id":42221836,"id":120276338,"diff_hunk":"@@ -0,0 +1,75 @@\n+import getElementFromTemplate from '../get-element-from-template';\n+import mainResultSuccess from './main--result-success';\n+import mainResultUnfortunate from './main--result-unfortunate';\n+import renderPage from '../render-page';\n+\n+const template = getElementFromTemplate(`<section class=\"main main--level main--level-genre\">\n+    <h2 class=\"title\">Выберите инди-рок треки</h2>\n+    <form class=\"genre\">\n+      <div class=\"genre-answer\">\n+        <div class=\"player-wrapper\"></div>\n+        <input type=\"checkbox\" name=\"answer\" value=\"answer-1\" id=\"a-1\">\n+        <label class=\"genre-answer-check\" for=\"a-1\"></label>\n+      </div>\n+\n+      <div class=\"genre-answer\">\n+        <div class=\"player-wrapper\"></div>\n+        <input type=\"checkbox\" name=\"answer\" value=\"answer-1\" id=\"a-2\">\n+        <label class=\"genre-answer-check\" for=\"a-2\"></label>\n+      </div>\n+\n+      <div class=\"genre-answer\">\n+        <div class=\"player-wrapper\"></div>\n+        <input type=\"checkbox\" name=\"answer\" value=\"answer-1\" id=\"a-3\">\n+        <label class=\"genre-answer-check\" for=\"a-3\"></label>\n+      </div>\n+\n+      <div class=\"genre-answer\">\n+        <div class=\"player-wrapper\"></div>\n+        <input type=\"checkbox\" name=\"answer\" value=\"answer-1\" id=\"a-4\">\n+        <label class=\"genre-answer-check\" for=\"a-4\"></label>\n+      </div>\n+\n+      <button class=\"genre-answer-send\" type=\"submit\">Ответить</button>\n+    </form>\n+  </section>`);\n+\n+const btnSend = template.querySelector(`.genre-answer-send`);\n+const answers = [...template.querySelectorAll(`[name=answer]`)];\n+let checkedAnswers = [];\n+\n+const setButtonState = () => {\n+  btnSend.disabled = checkedAnswers.length === 0;\n+};\n+\n+const answerChangeHandler = (evt) => {\n+  const answer = evt.target;\n+  if (answer.checked) {\n+    checkedAnswers.push(answer);\n+  } else if (checkedAnswers.indexOf(answer) > -1) {\n+    checkedAnswers.splice(checkedAnswers.indexOf((answer)), 1);","path":"js/modules/templates/main--level-genre.js","position":50,"original_position":50,"commit_id":"e1b9d8b15a898f48efdc81236a676433bebca878","original_commit_id":"e1b9d8b15a898f48efdc81236a676433bebca878","user":{"login":"aalexeev239","id":6787602,"avatar_url":"https://avatars1.githubusercontent.com/u/6787602?v=3","gravatar_id":"","url":"https://api.github.com/users/aalexeev239","html_url":"https://github.com/aalexeev239","followers_url":"https://api.github.com/users/aalexeev239/followers","following_url":"https://api.github.com/users/aalexeev239/following{/other_user}","gists_url":"https://api.github.com/users/aalexeev239/gists{/gist_id}","starred_url":"https://api.github.com/users/aalexeev239/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aalexeev239/subscriptions","organizations_url":"https://api.github.com/users/aalexeev239/orgs","repos_url":"https://api.github.com/users/aalexeev239/repos","events_url":"https://api.github.com/users/aalexeev239/events{/privacy}","received_events_url":"https://api.github.com/users/aalexeev239/received_events","type":"User","site_admin":false},"body":"манипуляции с массивом кажутся избыточными — сначала искать элемент, потом дробить массив – несколько ненужных проходок.\r\nГораздо проще проверить `answers.some(...)`","created_at":"2017-06-06T06:46:45Z","updated_at":"2017-06-06T06:53:55Z","html_url":"https://github.com/htmlacademy-ecmascript/125911-guess-melody/pull/3#discussion_r120276338","pull_request_url":"https://api.github.com/repos/htmlacademy-ecmascript/125911-guess-melody/pulls/3","_links":{"self":{"href":"https://api.github.com/repos/htmlacademy-ecmascript/125911-guess-melody/pulls/comments/120276338"},"html":{"href":"https://github.com/htmlacademy-ecmascript/125911-guess-melody/pull/3#discussion_r120276338"},"pull_request":{"href":"https://api.github.com/repos/htmlacademy-ecmascript/125911-guess-melody/pulls/3"}}},"pull_request":{"url":"https://api.github.com/repos/htmlacademy-ecmascript/125911-guess-melody/pulls/3","id":123894912,"html_url":"https://github.com/htmlacademy-ecmascript/125911-guess-melody/pull/3","diff_url":"https://github.com/htmlacademy-ecmascript/125911-guess-melody/pull/3.diff","patch_url":"https://github.com/htmlacademy-ecmascript/125911-guess-melody/pull/3.patch","issue_url":"https://api.github.com/repos/htmlacademy-ecmascript/125911-guess-melody/issues/3","number":3,"state":"open","locked":false,"title":"Тесные связи","user":{"login":"mozolev","id":15260025,"avatar_url":"https://avatars2.githubusercontent.com/u/15260025?v=3","gravatar_id":"","url":"https://api.github.com/users/mozolev","html_url":"https://github.com/mozolev","followers_url":"https://api.github.com/users/mozolev/followers","following_url":"https://api.github.com/users/mozolev/following{/other_user}","gists_url":"https://api.github.com/users/mozolev/gists{/gist_id}","starred_url":"https://api.github.com/users/mozolev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mozolev/subscriptions","organizations_url":"https://api.github.com/users/mozolev/orgs","repos_url":"https://api.github.com/users/mozolev/repos","events_url":"https://api.github.com/users/mozolev/events{/privacy}","received_events_url":"https://api.github.com/users/mozolev/received_events","type":"User","site_admin":false},"body":"\n\n---\n:mortar_board: [Тесные связи](https://up.htmlacademy.ru/ecmascript/2/user/125911/tasks/4)","created_at":"2017-06-04T22:37:18Z","updated_at":"2017-06-06T06:53:55Z","closed_at":null,"merged_at":null,"merge_commit_sha":"4375aa91a05f1f276921cc59068f4fec6b0f3df9","assignee":{"login":"aalexeev239","id":6787602,"avatar_url":"https://avatars1.githubusercontent.com/u/6787602?v=3","gravatar_id":"","url":"https://api.github.com/users/aalexeev239","html_url":"https://github.com/aalexeev239","followers_url":"https://api.github.com/users/aalexeev239/followers","following_url":"https://api.github.com/users/aalexeev239/following{/other_user}","gists_url":"https://api.github.com/users/aalexeev239/gists{/gist_id}","starred_url":"https://api.github.com/users/aalexeev239/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aalexeev239/subscriptions","organizations_url":"https://api.github.com/users/aalexeev239/orgs","repos_url":"https://api.github.com/users/aalexeev239/repos","events_url":"https://api.github.com/users/aalexeev239/events{/privacy}","received_events_url":"https://api.github.com/users/aalexeev239/received_events","type":"User","site_admin":false},"assignees":[{"login":"aalexeev239","id":6787602,"avatar_url":"https://avatars1.githubusercontent.com/u/6787602?v=3","gravatar_id":"","url":"https://api.github.com/users/aalexeev239","html_url":"https://github.com/aalexeev239","followers_url":"https://api.github.com/users/aalexeev239/followers","following_url":"https://api.github.com/users/aalexeev239/following{/other_user}","gists_url":"https://api.github.com/users/aalexeev239/gists{/gist_id}","starred_url":"https://api.github.com/users/aalexeev239/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aalexeev239/subscriptions","organizations_url":"https://api.github.com/users/aalexeev239/orgs","repos_url":"https://api.github.com/users/aalexeev239/repos","events_url":"https://api.github.com/users/aalexeev239/events{/privacy}","received_events_url":"https://api.github.com/users/aalexeev239/received_events","type":"User","site_admin":false}],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/htmlacademy-ecmascript/125911-guess-melody/pulls/3/commits","review_comments_url":"https://api.github.com/repos/htmlacademy-ecmascript/125911-guess-melody/pulls/3/comments","review_comment_url":"https://api.github.com/repos/htmlacademy-ecmascript/125911-guess-melody/pulls/comments{/number}","comments_url":"https://api.github.com/repos/htmlacademy-ecmascript/125911-guess-melody/issues/3/comments","statuses_url":"https://api.github.com/repos/htmlacademy-ecmascript/125911-guess-melody/statuses/e1b9d8b15a898f48efdc81236a676433bebca878","head":{"label":"mozolev:module2-task1","ref":"module2-task1","sha":"e1b9d8b15a898f48efdc81236a676433bebca878","user":{"login":"mozolev","id":15260025,"avatar_url":"https://avatars2.githubusercontent.com/u/15260025?v=3","gravatar_id":"","url":"https://api.github.com/users/mozolev","html_url":"https://github.com/mozolev","followers_url":"https://api.github.com/users/mozolev/followers","following_url":"https://api.github.com/users/mozolev/following{/other_user}","gists_url":"https://api.github.com/users/mozolev/gists{/gist_id}","starred_url":"https://api.github.com/users/mozolev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mozolev/subscriptions","organizations_url":"https://api.github.com/users/mozolev/orgs","repos_url":"https://api.github.com/users/mozolev/repos","events_url":"https://api.github.com/users/mozolev/events{/privacy}","received_events_url":"https://api.github.com/users/mozolev/received_events","type":"User","site_admin":false},"repo":{"id":92212034,"name":"125911-guess-melody","full_name":"mozolev/125911-guess-melody","owner":{"login":"mozolev","id":15260025,"avatar_url":"https://avatars2.githubusercontent.com/u/15260025?v=3","gravatar_id":"","url":"https://api.github.com/users/mozolev","html_url":"https://github.com/mozolev","followers_url":"https://api.github.com/users/mozolev/followers","following_url":"https://api.github.com/users/mozolev/following{/other_user}","gists_url":"https://api.github.com/users/mozolev/gists{/gist_id}","starred_url":"https://api.github.com/users/mozolev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mozolev/subscriptions","organizations_url":"https://api.github.com/users/mozolev/orgs","repos_url":"https://api.github.com/users/mozolev/repos","events_url":"https://api.github.com/users/mozolev/events{/privacy}","received_events_url":"https://api.github.com/users/mozolev/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/mozolev/125911-guess-melody","description":"Andrey Mozolev","fork":true,"url":"https://api.github.com/repos/mozolev/125911-guess-melody","forks_url":"https://api.github.com/repos/mozolev/125911-guess-melody/forks","keys_url":"https://api.github.com/repos/mozolev/125911-guess-melody/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mozolev/125911-guess-melody/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mozolev/125911-guess-melody/teams","hooks_url":"https://api.github.com/repos/mozolev/125911-guess-melody/hooks","issue_events_url":"https://api.github.com/repos/mozolev/125911-guess-melody/issues/events{/number}","events_url":"https://api.github.com/repos/mozolev/125911-guess-melody/events","assignees_url":"https://api.github.com/repos/mozolev/125911-guess-melody/assignees{/user}","branches_url":"https://api.github.com/repos/mozolev/125911-guess-melody/branches{/branch}","tags_url":"https://api.github.com/repos/mozolev/125911-guess-melody/tags","blobs_url":"https://api.github.com/repos/mozolev/125911-guess-melody/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mozolev/125911-guess-melody/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mozolev/125911-guess-melody/git/refs{/sha}","trees_url":"https://api.github.com/repos/mozolev/125911-guess-melody/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mozolev/125911-guess-melody/statuses/{sha}","languages_url":"https://api.github.com/repos/mozolev/125911-guess-melody/languages","stargazers_url":"https://api.github.com/repos/mozolev/125911-guess-melody/stargazers","contributors_url":"https://api.github.com/repos/mozolev/125911-guess-melody/contributors","subscribers_url":"https://api.github.com/repos/mozolev/125911-guess-melody/subscribers","subscription_url":"https://api.github.com/repos/mozolev/125911-guess-melody/subscription","commits_url":"https://api.github.com/repos/mozolev/125911-guess-melody/commits{/sha}","git_commits_url":"https://api.github.com/repos/mozolev/125911-guess-melody/git/commits{/sha}","comments_url":"https://api.github.com/repos/mozolev/125911-guess-melody/comments{/number}","issue_comment_url":"https://api.github.com/repos/mozolev/125911-guess-melody/issues/comments{/number}","contents_url":"https://api.github.com/repos/mozolev/125911-guess-melody/contents/{+path}","compare_url":"https://api.github.com/repos/mozolev/125911-guess-melody/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mozolev/125911-guess-melody/merges","archive_url":"https://api.github.com/repos/mozolev/125911-guess-melody/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mozolev/125911-guess-melody/downloads","issues_url":"https://api.github.com/repos/mozolev/125911-guess-melody/issues{/number}","pulls_url":"https://api.github.com/repos/mozolev/125911-guess-melody/pulls{/number}","milestones_url":"https://api.github.com/repos/mozolev/125911-guess-melody/milestones{/number}","notifications_url":"https://api.github.com/repos/mozolev/125911-guess-melody/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mozolev/125911-guess-melody/labels{/name}","releases_url":"https://api.github.com/repos/mozolev/125911-guess-melody/releases{/id}","deployments_url":"https://api.github.com/repos/mozolev/125911-guess-melody/deployments","created_at":"2017-05-23T19:33:51Z","updated_at":"2017-05-23T19:33:53Z","pushed_at":"2017-06-05T20:49:38Z","git_url":"git://github.com/mozolev/125911-guess-melody.git","ssh_url":"git@github.com:mozolev/125911-guess-melody.git","clone_url":"https://github.com/mozolev/125911-guess-melody.git","svn_url":"https://github.com/mozolev/125911-guess-melody","homepage":null,"size":199,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_projects":true,"has_downloads":false,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"htmlacademy-ecmascript:master","ref":"master","sha":"058f3ebf3496cd817291a60653aae32edf463055","user":{"login":"htmlacademy-ecmascript","id":22890904,"avatar_url":"https://avatars1.githubusercontent.com/u/22890904?v=3","gravatar_id":"","url":"https://api.github.com/users/htmlacademy-ecmascript","html_url":"https://github.com/htmlacademy-ecmascript","followers_url":"https://api.github.com/users/htmlacademy-ecmascript/followers","following_url":"https://api.github.com/users/htmlacademy-ecmascript/following{/other_user}","gists_url":"https://api.github.com/users/htmlacademy-ecmascript/gists{/gist_id}","starred_url":"https://api.github.com/users/htmlacademy-ecmascript/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/htmlacademy-ecmascript/subscriptions","organizations_url":"https://api.github.com/users/htmlacademy-ecmascript/orgs","repos_url":"https://api.github.com/users/htmlacademy-ecmascript/repos","events_url":"https://api.github.com/users/htmlacademy-ecmascript/events{/privacy}","received_events_url":"https://api.github.com/users/htmlacademy-ecmascript/received_events","type":"Organization","site_admin":false},"repo":{"id":92211637,"name":"125911-guess-melody","full_name":"htmlacademy-ecmascript/125911-guess-melody","owner":{"login":"htmlacademy-ecmascript","id":22890904,"avatar_url":"https://avatars1.githubusercontent.com/u/22890904?v=3","gravatar_id":"","url":"https://api.github.com/users/htmlacademy-ecmascript","html_url":"https://github.com/htmlacademy-ecmascript","followers_url":"https://api.github.com/users/htmlacademy-ecmascript/followers","following_url":"https://api.github.com/users/htmlacademy-ecmascript/following{/other_user}","gists_url":"https://api.github.com/users/htmlacademy-ecmascript/gists{/gist_id}","starred_url":"https://api.github.com/users/htmlacademy-ecmascript/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/htmlacademy-ecmascript/subscriptions","organizations_url":"https://api.github.com/users/htmlacademy-ecmascript/orgs","repos_url":"https://api.github.com/users/htmlacademy-ecmascript/repos","events_url":"https://api.github.com/users/htmlacademy-ecmascript/events{/privacy}","received_events_url":"https://api.github.com/users/htmlacademy-ecmascript/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/htmlacademy-ecmascript/125911-guess-melody","description":"Andrey Mozolev","fork":false,"url":"https://api.github.com/repos/htmlacademy-ecmascript/125911-guess-melody","forks_url":"https://api.github.com/repos/htmlacademy-ecmascript/125911-guess-melody/forks","keys_url":"https://api.github.com/repos/htmlacademy-ecmascript/125911-guess-melody/keys{/key_id}","collaborators_url":"https://api.github.com/repos/htmlacademy-ecmascript/125911-guess-melody/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/htmlacademy-ecmascript/125911-guess-melody/teams","hooks_url":"https://api.github.com/repos/htmlacademy-ecmascript/125911-guess-melody/hooks","issue_events_url":"https://api.github.com/repos/htmlacademy-ecmascript/125911-guess-melody/issues/events{/number}","events_url":"https://api.github.com/repos/htmlacademy-ecmascript/125911-guess-melody/events","assignees_url":"https://api.github.com/repos/htmlacademy-ecmascript/125911-guess-melody/assignees{/user}","branches_url":"https://api.github.com/repos/htmlacademy-ecmascript/125911-guess-melody/branches{/branch}","tags_url":"https://api.github.com/repos/htmlacademy-ecmascript/125911-guess-melody/tags","blobs_url":"https://api.github.com/repos/htmlacademy-ecmascript/125911-guess-melody/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/htmlacademy-ecmascript/125911-guess-melody/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/htmlacademy-ecmascript/125911-guess-melody/git/refs{/sha}","trees_url":"https://api.github.com/repos/htmlacademy-ecmascript/125911-guess-melody/git/trees{/sha}","statuses_url":"https://api.github.com/repos/htmlacademy-ecmascript/125911-guess-melody/statuses/{sha}","languages_url":"https://api.github.com/repos/htmlacademy-ecmascript/125911-guess-melody/languages","stargazers_url":"https://api.github.com/repos/htmlacademy-ecmascript/125911-guess-melody/stargazers","contributors_url":"https://api.github.com/repos/htmlacademy-ecmascript/125911-guess-melody/contributors","subscribers_url":"https://api.github.com/repos/htmlacademy-ecmascript/125911-guess-melody/subscribers","subscription_url":"https://api.github.com/repos/htmlacademy-ecmascript/125911-guess-melody/subscription","commits_url":"https://api.github.com/repos/htmlacademy-ecmascript/125911-guess-melody/commits{/sha}","git_commits_url":"https://api.github.com/repos/htmlacademy-ecmascript/125911-guess-melody/git/commits{/sha}","comments_url":"https://api.github.com/repos/htmlacademy-ecmascript/125911-guess-melody/comments{/number}","issue_comment_url":"https://api.github.com/repos/htmlacademy-ecmascript/125911-guess-melody/issues/comments{/number}","contents_url":"https://api.github.com/repos/htmlacademy-ecmascript/125911-guess-melody/contents/{+path}","compare_url":"https://api.github.com/repos/htmlacademy-ecmascript/125911-guess-melody/compare/{base}...{head}","merges_url":"https://api.github.com/repos/htmlacademy-ecmascript/125911-guess-melody/merges","archive_url":"https://api.github.com/repos/htmlacademy-ecmascript/125911-guess-melody/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/htmlacademy-ecmascript/125911-guess-melody/downloads","issues_url":"https://api.github.com/repos/htmlacademy-ecmascript/125911-guess-melody/issues{/number}","pulls_url":"https://api.github.com/repos/htmlacademy-ecmascript/125911-guess-melody/pulls{/number}","milestones_url":"https://api.github.com/repos/htmlacademy-ecmascript/125911-guess-melody/milestones{/number}","notifications_url":"https://api.github.com/repos/htmlacademy-ecmascript/125911-guess-melody/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/htmlacademy-ecmascript/125911-guess-melody/labels{/name}","releases_url":"https://api.github.com/repos/htmlacademy-ecmascript/125911-guess-melody/releases{/id}","deployments_url":"https://api.github.com/repos/htmlacademy-ecmascript/125911-guess-melody/deployments","created_at":"2017-05-23T19:29:30Z","updated_at":"2017-05-23T20:18:30Z","pushed_at":"2017-06-05T20:49:39Z","git_url":"git://github.com/htmlacademy-ecmascript/125911-guess-melody.git","ssh_url":"git@github.com:htmlacademy-ecmascript/125911-guess-melody.git","clone_url":"https://github.com/htmlacademy-ecmascript/125911-guess-melody.git","svn_url":"https://github.com/htmlacademy-ecmascript/125911-guess-melody","homepage":"https://github.com/mozolev/125911-guess-melody","size":192,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_projects":true,"has_downloads":false,"has_wiki":false,"has_pages":true,"forks_count":1,"mirror_url":null,"open_issues_count":1,"forks":1,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/htmlacademy-ecmascript/125911-guess-melody/pulls/3"},"html":{"href":"https://github.com/htmlacademy-ecmascript/125911-guess-melody/pull/3"},"issue":{"href":"https://api.github.com/repos/htmlacademy-ecmascript/125911-guess-melody/issues/3"},"comments":{"href":"https://api.github.com/repos/htmlacademy-ecmascript/125911-guess-melody/issues/3/comments"},"review_comments":{"href":"https://api.github.com/repos/htmlacademy-ecmascript/125911-guess-melody/pulls/3/comments"},"review_comment":{"href":"https://api.github.com/repos/htmlacademy-ecmascript/125911-guess-melody/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/htmlacademy-ecmascript/125911-guess-melody/pulls/3/commits"},"statuses":{"href":"https://api.github.com/repos/htmlacademy-ecmascript/125911-guess-melody/statuses/e1b9d8b15a898f48efdc81236a676433bebca878"}}}}
{"actor":{"display_login":"aalexeev239"}}