{"action":"created","comment":{"url":"https://api.github.com/repos/znick/anytask/pulls/comments/60393883","id":60393883,"diff_hunk":"@@ -3,53 +3,54 @@\n {# <script src=\"http://ajax.aspnetcdn.com/ajax/jquery.validate/1.11.1/additional-methods.min.js\"></script> #}\n <script src=\"http://malsup.github.io/jquery.form.js\"></script>\n <script type=\"text/javascript\">\n-\n-\n-$(document).ready(function() {\n-  $(\"#id_comment\").keydown(function (e) {\n-    if (e.ctrlKey && e.keyCode == 13) {\n-      $(\"form#comment\").submit();\n+    $(document).ready(function () {\n+        $(\"#id_comment\").keydown(function (e) {\n+            if (e.ctrlKey && e.keyCode == 13) {\n+                $(\"form#comment\").submit();\n+            }\n+        });\n+\n+        jQuery.validator.addMethod(\"lt_max\", function(value, element) {\n+            var value = parseFloat(value);\n+            var max = parseFloat($('#max_mark').val());\n+            return isNaN(value) || value <= max;\n+        });\n+\n+        $(\"#mark_form\").validate({\n+            rules: {\n+                mark: {\n+                    number: true,\n+                    min: 0,\n+                    lt_max: true","path":"anytask/issues/templates/issues/issue_js.html","position":28,"original_position":28,"commit_id":"1f5e2253234693b4d6bc796f1f314607caffd508","original_commit_id":"1f5e2253234693b4d6bc796f1f314607caffd508","user":{"login":"gebetix","id":4972649,"avatar_url":"https://avatars.githubusercontent.com/u/4972649?v=3","gravatar_id":"","url":"https://api.github.com/users/gebetix","html_url":"https://github.com/gebetix","followers_url":"https://api.github.com/users/gebetix/followers","following_url":"https://api.github.com/users/gebetix/following{/other_user}","gists_url":"https://api.github.com/users/gebetix/gists{/gist_id}","starred_url":"https://api.github.com/users/gebetix/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gebetix/subscriptions","organizations_url":"https://api.github.com/users/gebetix/orgs","repos_url":"https://api.github.com/users/gebetix/repos","events_url":"https://api.github.com/users/gebetix/events{/privacy}","received_events_url":"https://api.github.com/users/gebetix/received_events","type":"User","site_admin":false},"body":"Раз уже делаем валидацию, давай сделаем полноценную - сейчас если ничего не ввести и нажать отправить/зачтено балл смениться на 0. Это конечно надо ловить - требовать чтобы поле было заполнено.","created_at":"2016-04-20T11:54:44Z","updated_at":"2016-04-20T11:54:44Z","html_url":"https://github.com/znick/anytask/pull/26#discussion_r60393883","pull_request_url":"https://api.github.com/repos/znick/anytask/pulls/26","_links":{"self":{"href":"https://api.github.com/repos/znick/anytask/pulls/comments/60393883"},"html":{"href":"https://github.com/znick/anytask/pull/26#discussion_r60393883"},"pull_request":{"href":"https://api.github.com/repos/znick/anytask/pulls/26"}}},"pull_request":{"url":"https://api.github.com/repos/znick/anytask/pulls/26","id":67159598,"html_url":"https://github.com/znick/anytask/pull/26","diff_url":"https://github.com/znick/anytask/pull/26.diff","patch_url":"https://github.com/znick/anytask/pull/26.patch","issue_url":"https://api.github.com/repos/znick/anytask/issues/26","number":26,"state":"open","locked":false,"title":"fix max mark in issue","user":{"login":"kobolok","id":2647652,"avatar_url":"https://avatars.githubusercontent.com/u/2647652?v=3","gravatar_id":"","url":"https://api.github.com/users/kobolok","html_url":"https://github.com/kobolok","followers_url":"https://api.github.com/users/kobolok/followers","following_url":"https://api.github.com/users/kobolok/following{/other_user}","gists_url":"https://api.github.com/users/kobolok/gists{/gist_id}","starred_url":"https://api.github.com/users/kobolok/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kobolok/subscriptions","organizations_url":"https://api.github.com/users/kobolok/orgs","repos_url":"https://api.github.com/users/kobolok/repos","events_url":"https://api.github.com/users/kobolok/events{/privacy}","received_events_url":"https://api.github.com/users/kobolok/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-04-20T10:04:03Z","updated_at":"2016-04-20T11:54:44Z","closed_at":null,"merged_at":null,"merge_commit_sha":"4c978e8cb4d16fc16f704c29bf326463b39b2afb","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/znick/anytask/pulls/26/commits","review_comments_url":"https://api.github.com/repos/znick/anytask/pulls/26/comments","review_comment_url":"https://api.github.com/repos/znick/anytask/pulls/comments{/number}","comments_url":"https://api.github.com/repos/znick/anytask/issues/26/comments","statuses_url":"https://api.github.com/repos/znick/anytask/statuses/1f5e2253234693b4d6bc796f1f314607caffd508","head":{"label":"znick:anytask-240","ref":"anytask-240","sha":"1f5e2253234693b4d6bc796f1f314607caffd508","user":{"login":"znick","id":105183,"avatar_url":"https://avatars.githubusercontent.com/u/105183?v=3","gravatar_id":"","url":"https://api.github.com/users/znick","html_url":"https://github.com/znick","followers_url":"https://api.github.com/users/znick/followers","following_url":"https://api.github.com/users/znick/following{/other_user}","gists_url":"https://api.github.com/users/znick/gists{/gist_id}","starred_url":"https://api.github.com/users/znick/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/znick/subscriptions","organizations_url":"https://api.github.com/users/znick/orgs","repos_url":"https://api.github.com/users/znick/repos","events_url":"https://api.github.com/users/znick/events{/privacy}","received_events_url":"https://api.github.com/users/znick/received_events","type":"User","site_admin":false},"repo":{"id":27121963,"name":"anytask","full_name":"znick/anytask","owner":{"login":"znick","id":105183,"avatar_url":"https://avatars.githubusercontent.com/u/105183?v=3","gravatar_id":"","url":"https://api.github.com/users/znick","html_url":"https://github.com/znick","followers_url":"https://api.github.com/users/znick/followers","following_url":"https://api.github.com/users/znick/following{/other_user}","gists_url":"https://api.github.com/users/znick/gists{/gist_id}","starred_url":"https://api.github.com/users/znick/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/znick/subscriptions","organizations_url":"https://api.github.com/users/znick/orgs","repos_url":"https://api.github.com/users/znick/repos","events_url":"https://api.github.com/users/znick/events{/privacy}","received_events_url":"https://api.github.com/users/znick/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/znick/anytask","description":"","fork":false,"url":"https://api.github.com/repos/znick/anytask","forks_url":"https://api.github.com/repos/znick/anytask/forks","keys_url":"https://api.github.com/repos/znick/anytask/keys{/key_id}","collaborators_url":"https://api.github.com/repos/znick/anytask/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/znick/anytask/teams","hooks_url":"https://api.github.com/repos/znick/anytask/hooks","issue_events_url":"https://api.github.com/repos/znick/anytask/issues/events{/number}","events_url":"https://api.github.com/repos/znick/anytask/events","assignees_url":"https://api.github.com/repos/znick/anytask/assignees{/user}","branches_url":"https://api.github.com/repos/znick/anytask/branches{/branch}","tags_url":"https://api.github.com/repos/znick/anytask/tags","blobs_url":"https://api.github.com/repos/znick/anytask/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/znick/anytask/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/znick/anytask/git/refs{/sha}","trees_url":"https://api.github.com/repos/znick/anytask/git/trees{/sha}","statuses_url":"https://api.github.com/repos/znick/anytask/statuses/{sha}","languages_url":"https://api.github.com/repos/znick/anytask/languages","stargazers_url":"https://api.github.com/repos/znick/anytask/stargazers","contributors_url":"https://api.github.com/repos/znick/anytask/contributors","subscribers_url":"https://api.github.com/repos/znick/anytask/subscribers","subscription_url":"https://api.github.com/repos/znick/anytask/subscription","commits_url":"https://api.github.com/repos/znick/anytask/commits{/sha}","git_commits_url":"https://api.github.com/repos/znick/anytask/git/commits{/sha}","comments_url":"https://api.github.com/repos/znick/anytask/comments{/number}","issue_comment_url":"https://api.github.com/repos/znick/anytask/issues/comments{/number}","contents_url":"https://api.github.com/repos/znick/anytask/contents/{+path}","compare_url":"https://api.github.com/repos/znick/anytask/compare/{base}...{head}","merges_url":"https://api.github.com/repos/znick/anytask/merges","archive_url":"https://api.github.com/repos/znick/anytask/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/znick/anytask/downloads","issues_url":"https://api.github.com/repos/znick/anytask/issues{/number}","pulls_url":"https://api.github.com/repos/znick/anytask/pulls{/number}","milestones_url":"https://api.github.com/repos/znick/anytask/milestones{/number}","notifications_url":"https://api.github.com/repos/znick/anytask/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/znick/anytask/labels{/name}","releases_url":"https://api.github.com/repos/znick/anytask/releases{/id}","deployments_url":"https://api.github.com/repos/znick/anytask/deployments","created_at":"2014-11-25T11:07:10Z","updated_at":"2016-01-11T08:50:48Z","pushed_at":"2016-04-20T11:32:08Z","git_url":"git://github.com/znick/anytask.git","ssh_url":"git@github.com:znick/anytask.git","clone_url":"https://github.com/znick/anytask.git","svn_url":"https://github.com/znick/anytask","homepage":null,"size":2773,"stargazers_count":8,"watchers_count":8,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":9,"mirror_url":null,"open_issues_count":2,"forks":9,"open_issues":2,"watchers":8,"default_branch":"master"}},"base":{"label":"znick:master","ref":"master","sha":"53af8eedafe5c7e89b3fb6ed9b501d5a434de55b","user":{"login":"znick","id":105183,"avatar_url":"https://avatars.githubusercontent.com/u/105183?v=3","gravatar_id":"","url":"https://api.github.com/users/znick","html_url":"https://github.com/znick","followers_url":"https://api.github.com/users/znick/followers","following_url":"https://api.github.com/users/znick/following{/other_user}","gists_url":"https://api.github.com/users/znick/gists{/gist_id}","starred_url":"https://api.github.com/users/znick/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/znick/subscriptions","organizations_url":"https://api.github.com/users/znick/orgs","repos_url":"https://api.github.com/users/znick/repos","events_url":"https://api.github.com/users/znick/events{/privacy}","received_events_url":"https://api.github.com/users/znick/received_events","type":"User","site_admin":false},"repo":{"id":27121963,"name":"anytask","full_name":"znick/anytask","owner":{"login":"znick","id":105183,"avatar_url":"https://avatars.githubusercontent.com/u/105183?v=3","gravatar_id":"","url":"https://api.github.com/users/znick","html_url":"https://github.com/znick","followers_url":"https://api.github.com/users/znick/followers","following_url":"https://api.github.com/users/znick/following{/other_user}","gists_url":"https://api.github.com/users/znick/gists{/gist_id}","starred_url":"https://api.github.com/users/znick/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/znick/subscriptions","organizations_url":"https://api.github.com/users/znick/orgs","repos_url":"https://api.github.com/users/znick/repos","events_url":"https://api.github.com/users/znick/events{/privacy}","received_events_url":"https://api.github.com/users/znick/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/znick/anytask","description":"","fork":false,"url":"https://api.github.com/repos/znick/anytask","forks_url":"https://api.github.com/repos/znick/anytask/forks","keys_url":"https://api.github.com/repos/znick/anytask/keys{/key_id}","collaborators_url":"https://api.github.com/repos/znick/anytask/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/znick/anytask/teams","hooks_url":"https://api.github.com/repos/znick/anytask/hooks","issue_events_url":"https://api.github.com/repos/znick/anytask/issues/events{/number}","events_url":"https://api.github.com/repos/znick/anytask/events","assignees_url":"https://api.github.com/repos/znick/anytask/assignees{/user}","branches_url":"https://api.github.com/repos/znick/anytask/branches{/branch}","tags_url":"https://api.github.com/repos/znick/anytask/tags","blobs_url":"https://api.github.com/repos/znick/anytask/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/znick/anytask/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/znick/anytask/git/refs{/sha}","trees_url":"https://api.github.com/repos/znick/anytask/git/trees{/sha}","statuses_url":"https://api.github.com/repos/znick/anytask/statuses/{sha}","languages_url":"https://api.github.com/repos/znick/anytask/languages","stargazers_url":"https://api.github.com/repos/znick/anytask/stargazers","contributors_url":"https://api.github.com/repos/znick/anytask/contributors","subscribers_url":"https://api.github.com/repos/znick/anytask/subscribers","subscription_url":"https://api.github.com/repos/znick/anytask/subscription","commits_url":"https://api.github.com/repos/znick/anytask/commits{/sha}","git_commits_url":"https://api.github.com/repos/znick/anytask/git/commits{/sha}","comments_url":"https://api.github.com/repos/znick/anytask/comments{/number}","issue_comment_url":"https://api.github.com/repos/znick/anytask/issues/comments{/number}","contents_url":"https://api.github.com/repos/znick/anytask/contents/{+path}","compare_url":"https://api.github.com/repos/znick/anytask/compare/{base}...{head}","merges_url":"https://api.github.com/repos/znick/anytask/merges","archive_url":"https://api.github.com/repos/znick/anytask/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/znick/anytask/downloads","issues_url":"https://api.github.com/repos/znick/anytask/issues{/number}","pulls_url":"https://api.github.com/repos/znick/anytask/pulls{/number}","milestones_url":"https://api.github.com/repos/znick/anytask/milestones{/number}","notifications_url":"https://api.github.com/repos/znick/anytask/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/znick/anytask/labels{/name}","releases_url":"https://api.github.com/repos/znick/anytask/releases{/id}","deployments_url":"https://api.github.com/repos/znick/anytask/deployments","created_at":"2014-11-25T11:07:10Z","updated_at":"2016-01-11T08:50:48Z","pushed_at":"2016-04-20T11:32:08Z","git_url":"git://github.com/znick/anytask.git","ssh_url":"git@github.com:znick/anytask.git","clone_url":"https://github.com/znick/anytask.git","svn_url":"https://github.com/znick/anytask","homepage":null,"size":2773,"stargazers_count":8,"watchers_count":8,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":9,"mirror_url":null,"open_issues_count":2,"forks":9,"open_issues":2,"watchers":8,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/znick/anytask/pulls/26"},"html":{"href":"https://github.com/znick/anytask/pull/26"},"issue":{"href":"https://api.github.com/repos/znick/anytask/issues/26"},"comments":{"href":"https://api.github.com/repos/znick/anytask/issues/26/comments"},"review_comments":{"href":"https://api.github.com/repos/znick/anytask/pulls/26/comments"},"review_comment":{"href":"https://api.github.com/repos/znick/anytask/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/znick/anytask/pulls/26/commits"},"statuses":{"href":"https://api.github.com/repos/znick/anytask/statuses/1f5e2253234693b4d6bc796f1f314607caffd508"}}}}