{"action":"created","comment":{"url":"https://api.github.com/repos/fsr-itse/EvaP/pulls/comments/41708631","id":41708631,"diff_hunk":"@@ -2,48 +2,90 @@\n {% load evaluation_templatetags %}\n \n <script type=\"text/javascript\">\n-         function makeClickHandler(i, contributorCount) {\n-            return function () {\n-                // if the responsible checkbox is selected\n-                if($(\"#id_contributions-\" + i + \"-responsible\").is(\":checked\")) {\n-                    // uncheck and enable all\n-                    for(var j = 0; j < contributorCount; j++){\n-                        $(\"#id_contributions-\" + j + \"-responsible\").prop(\"checked\", false);\n-                        $(\"#id_contributions-\" + j + \"-can_edit\").prop(\"disabled\", false);\n-                    }\n+    function makeClickHandler(i, contributorCount, responsibility) {\n+        return function () {\n+            // don't do anything on disabled buttons\n+            if ($(this).hasClass(\"disabled\"))\n+                return false;\n \n-                    // check self\n-                    $(\"#id_contributions-\" + i + \"-responsible\").prop(\"checked\", true);\n+            // if the responsible button is selected\n+            if(responsibility == \"RESPONSIBLE\") {\n+                // uncheck all buttons\n+                uncheckButtons(\"input[name=contributions-\" + i + \"-comment_visibility]\");\n+                uncheckButtons(\"input[name=contributions-\" + i + \"-responsibility]\");\n \n-                    // check and disable can-edit\n-                    $(\"#id_contributions-\" + i + \"-can_edit\").prop(\"checked\", true);\n-                    $(\"#id_contributions-\" + i + \"-can_edit\").prop(\"disabled\", true);\n+                // check \"all comments\" and disable comment buttons\n+                checkButtons(\"input[name=contributions-\" + i + \"-comment_visibility][value=ALL]\");\n+                disableButtons(\"input[name=contributions-\" + i + \"-comment_visibility]\");\n+\n+                // disable all other responsible buttons\n+                for(var j = 0; j < contributorCount; j++){\n+                    if (j != i)\n+                        disableButtons(\"input[name=contributions-\" + j + \"-responsibility][value=RESPONSIBLE]\");\n                 }\n-                // if the responsible checkbox is deselected\n-                else {\n-                    // enable can-edit\n-                    $(\"#id_contributions-\" + i + \"-can_edit\").prop(\"disabled\", false);\n+            }\n+            // unchecked responsible right now","path":"evap/evaluation/templates/evap_course_edit_js.html","position":44,"original_position":44,"commit_id":"7bc0d11c145a659348fd7d4568ca7c343fd96314","original_commit_id":"7bc0d11c145a659348fd7d4568ca7c343fd96314","user":{"login":"karyon","id":1891915,"avatar_url":"https://avatars.githubusercontent.com/u/1891915?v=3","gravatar_id":"","url":"https://api.github.com/users/karyon","html_url":"https://github.com/karyon","followers_url":"https://api.github.com/users/karyon/followers","following_url":"https://api.github.com/users/karyon/following{/other_user}","gists_url":"https://api.github.com/users/karyon/gists{/gist_id}","starred_url":"https://api.github.com/users/karyon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/karyon/subscriptions","organizations_url":"https://api.github.com/users/karyon/orgs","repos_url":"https://api.github.com/users/karyon/repos","events_url":"https://api.github.com/users/karyon/events{/privacy}","received_events_url":"https://api.github.com/users/karyon/received_events","type":"User","site_admin":false},"body":"\"user unchecked responsible button\" or \"if the responsible button is deselected\" or \"user changed selection from responsible to something else\". at first i misunderstood this as a description of the state, which was confusing in between the if-elseif, but it should be more a description of the action that was performed.","created_at":"2015-10-11T10:34:57Z","updated_at":"2015-10-11T10:34:57Z","html_url":"https://github.com/fsr-itse/EvaP/pull/643#discussion_r41708631","pull_request_url":"https://api.github.com/repos/fsr-itse/EvaP/pulls/643","_links":{"self":{"href":"https://api.github.com/repos/fsr-itse/EvaP/pulls/comments/41708631"},"html":{"href":"https://github.com/fsr-itse/EvaP/pull/643#discussion_r41708631"},"pull_request":{"href":"https://api.github.com/repos/fsr-itse/EvaP/pulls/643"}}},"pull_request":{"url":"https://api.github.com/repos/fsr-itse/EvaP/pulls/643","id":46105223,"html_url":"https://github.com/fsr-itse/EvaP/pull/643","diff_url":"https://github.com/fsr-itse/EvaP/pull/643.diff","patch_url":"https://github.com/fsr-itse/EvaP/pull/643.patch","issue_url":"https://api.github.com/repos/fsr-itse/EvaP/issues/643","number":643,"state":"open","locked":false,"title":"Text results for contributors","user":{"login":"janno42","id":1781719,"avatar_url":"https://avatars.githubusercontent.com/u/1781719?v=3","gravatar_id":"","url":"https://api.github.com/users/janno42","html_url":"https://github.com/janno42","followers_url":"https://api.github.com/users/janno42/followers","following_url":"https://api.github.com/users/janno42/following{/other_user}","gists_url":"https://api.github.com/users/janno42/gists{/gist_id}","starred_url":"https://api.github.com/users/janno42/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/janno42/subscriptions","organizations_url":"https://api.github.com/users/janno42/orgs","repos_url":"https://api.github.com/users/janno42/repos","events_url":"https://api.github.com/users/janno42/events{/privacy}","received_events_url":"https://api.github.com/users/janno42/received_events","type":"User","site_admin":false},"body":"fix #551 \r\n\r\nThis allows staff users and editors to define on the course edit page, which contributors can see which comments after the course was published.","created_at":"2015-09-27T17:50:33Z","updated_at":"2015-10-11T10:34:57Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e14ced956cbe64cfb532e36f1c8773c3d562b5ac","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/fsr-itse/EvaP/pulls/643/commits","review_comments_url":"https://api.github.com/repos/fsr-itse/EvaP/pulls/643/comments","review_comment_url":"https://api.github.com/repos/fsr-itse/EvaP/pulls/comments{/number}","comments_url":"https://api.github.com/repos/fsr-itse/EvaP/issues/643/comments","statuses_url":"https://api.github.com/repos/fsr-itse/EvaP/statuses/7bc0d11c145a659348fd7d4568ca7c343fd96314","head":{"label":"janno42:publish_comments","ref":"publish_comments","sha":"7bc0d11c145a659348fd7d4568ca7c343fd96314","user":{"login":"janno42","id":1781719,"avatar_url":"https://avatars.githubusercontent.com/u/1781719?v=3","gravatar_id":"","url":"https://api.github.com/users/janno42","html_url":"https://github.com/janno42","followers_url":"https://api.github.com/users/janno42/followers","following_url":"https://api.github.com/users/janno42/following{/other_user}","gists_url":"https://api.github.com/users/janno42/gists{/gist_id}","starred_url":"https://api.github.com/users/janno42/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/janno42/subscriptions","organizations_url":"https://api.github.com/users/janno42/orgs","repos_url":"https://api.github.com/users/janno42/repos","events_url":"https://api.github.com/users/janno42/events{/privacy}","received_events_url":"https://api.github.com/users/janno42/received_events","type":"User","site_admin":false},"repo":{"id":20739629,"name":"EvaP","full_name":"janno42/EvaP","owner":{"login":"janno42","id":1781719,"avatar_url":"https://avatars.githubusercontent.com/u/1781719?v=3","gravatar_id":"","url":"https://api.github.com/users/janno42","html_url":"https://github.com/janno42","followers_url":"https://api.github.com/users/janno42/followers","following_url":"https://api.github.com/users/janno42/following{/other_user}","gists_url":"https://api.github.com/users/janno42/gists{/gist_id}","starred_url":"https://api.github.com/users/janno42/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/janno42/subscriptions","organizations_url":"https://api.github.com/users/janno42/orgs","repos_url":"https://api.github.com/users/janno42/repos","events_url":"https://api.github.com/users/janno42/events{/privacy}","received_events_url":"https://api.github.com/users/janno42/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/janno42/EvaP","description":"a university course evaluation system written in Python using Django","fork":true,"url":"https://api.github.com/repos/janno42/EvaP","forks_url":"https://api.github.com/repos/janno42/EvaP/forks","keys_url":"https://api.github.com/repos/janno42/EvaP/keys{/key_id}","collaborators_url":"https://api.github.com/repos/janno42/EvaP/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/janno42/EvaP/teams","hooks_url":"https://api.github.com/repos/janno42/EvaP/hooks","issue_events_url":"https://api.github.com/repos/janno42/EvaP/issues/events{/number}","events_url":"https://api.github.com/repos/janno42/EvaP/events","assignees_url":"https://api.github.com/repos/janno42/EvaP/assignees{/user}","branches_url":"https://api.github.com/repos/janno42/EvaP/branches{/branch}","tags_url":"https://api.github.com/repos/janno42/EvaP/tags","blobs_url":"https://api.github.com/repos/janno42/EvaP/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/janno42/EvaP/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/janno42/EvaP/git/refs{/sha}","trees_url":"https://api.github.com/repos/janno42/EvaP/git/trees{/sha}","statuses_url":"https://api.github.com/repos/janno42/EvaP/statuses/{sha}","languages_url":"https://api.github.com/repos/janno42/EvaP/languages","stargazers_url":"https://api.github.com/repos/janno42/EvaP/stargazers","contributors_url":"https://api.github.com/repos/janno42/EvaP/contributors","subscribers_url":"https://api.github.com/repos/janno42/EvaP/subscribers","subscription_url":"https://api.github.com/repos/janno42/EvaP/subscription","commits_url":"https://api.github.com/repos/janno42/EvaP/commits{/sha}","git_commits_url":"https://api.github.com/repos/janno42/EvaP/git/commits{/sha}","comments_url":"https://api.github.com/repos/janno42/EvaP/comments{/number}","issue_comment_url":"https://api.github.com/repos/janno42/EvaP/issues/comments{/number}","contents_url":"https://api.github.com/repos/janno42/EvaP/contents/{+path}","compare_url":"https://api.github.com/repos/janno42/EvaP/compare/{base}...{head}","merges_url":"https://api.github.com/repos/janno42/EvaP/merges","archive_url":"https://api.github.com/repos/janno42/EvaP/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/janno42/EvaP/downloads","issues_url":"https://api.github.com/repos/janno42/EvaP/issues{/number}","pulls_url":"https://api.github.com/repos/janno42/EvaP/pulls{/number}","milestones_url":"https://api.github.com/repos/janno42/EvaP/milestones{/number}","notifications_url":"https://api.github.com/repos/janno42/EvaP/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/janno42/EvaP/labels{/name}","releases_url":"https://api.github.com/repos/janno42/EvaP/releases{/id}","created_at":"2014-06-11T20:15:30Z","updated_at":"2015-01-06T21:08:30Z","pushed_at":"2015-09-28T18:20:28Z","git_url":"git://github.com/janno42/EvaP.git","ssh_url":"git@github.com:janno42/EvaP.git","clone_url":"https://github.com/janno42/EvaP.git","svn_url":"https://github.com/janno42/EvaP","homepage":"","size":10342,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"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":"fsr-itse:master","ref":"master","sha":"5b9dfc691ff76b5c01ced9137033037b537ad23c","user":{"login":"fsr-itse","id":1298457,"avatar_url":"https://avatars.githubusercontent.com/u/1298457?v=3","gravatar_id":"","url":"https://api.github.com/users/fsr-itse","html_url":"https://github.com/fsr-itse","followers_url":"https://api.github.com/users/fsr-itse/followers","following_url":"https://api.github.com/users/fsr-itse/following{/other_user}","gists_url":"https://api.github.com/users/fsr-itse/gists{/gist_id}","starred_url":"https://api.github.com/users/fsr-itse/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fsr-itse/subscriptions","organizations_url":"https://api.github.com/users/fsr-itse/orgs","repos_url":"https://api.github.com/users/fsr-itse/repos","events_url":"https://api.github.com/users/fsr-itse/events{/privacy}","received_events_url":"https://api.github.com/users/fsr-itse/received_events","type":"Organization","site_admin":false},"repo":{"id":3110378,"name":"EvaP","full_name":"fsr-itse/EvaP","owner":{"login":"fsr-itse","id":1298457,"avatar_url":"https://avatars.githubusercontent.com/u/1298457?v=3","gravatar_id":"","url":"https://api.github.com/users/fsr-itse","html_url":"https://github.com/fsr-itse","followers_url":"https://api.github.com/users/fsr-itse/followers","following_url":"https://api.github.com/users/fsr-itse/following{/other_user}","gists_url":"https://api.github.com/users/fsr-itse/gists{/gist_id}","starred_url":"https://api.github.com/users/fsr-itse/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fsr-itse/subscriptions","organizations_url":"https://api.github.com/users/fsr-itse/orgs","repos_url":"https://api.github.com/users/fsr-itse/repos","events_url":"https://api.github.com/users/fsr-itse/events{/privacy}","received_events_url":"https://api.github.com/users/fsr-itse/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/fsr-itse/EvaP","description":"a university course evaluation system written in Python using Django","fork":false,"url":"https://api.github.com/repos/fsr-itse/EvaP","forks_url":"https://api.github.com/repos/fsr-itse/EvaP/forks","keys_url":"https://api.github.com/repos/fsr-itse/EvaP/keys{/key_id}","collaborators_url":"https://api.github.com/repos/fsr-itse/EvaP/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/fsr-itse/EvaP/teams","hooks_url":"https://api.github.com/repos/fsr-itse/EvaP/hooks","issue_events_url":"https://api.github.com/repos/fsr-itse/EvaP/issues/events{/number}","events_url":"https://api.github.com/repos/fsr-itse/EvaP/events","assignees_url":"https://api.github.com/repos/fsr-itse/EvaP/assignees{/user}","branches_url":"https://api.github.com/repos/fsr-itse/EvaP/branches{/branch}","tags_url":"https://api.github.com/repos/fsr-itse/EvaP/tags","blobs_url":"https://api.github.com/repos/fsr-itse/EvaP/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/fsr-itse/EvaP/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/fsr-itse/EvaP/git/refs{/sha}","trees_url":"https://api.github.com/repos/fsr-itse/EvaP/git/trees{/sha}","statuses_url":"https://api.github.com/repos/fsr-itse/EvaP/statuses/{sha}","languages_url":"https://api.github.com/repos/fsr-itse/EvaP/languages","stargazers_url":"https://api.github.com/repos/fsr-itse/EvaP/stargazers","contributors_url":"https://api.github.com/repos/fsr-itse/EvaP/contributors","subscribers_url":"https://api.github.com/repos/fsr-itse/EvaP/subscribers","subscription_url":"https://api.github.com/repos/fsr-itse/EvaP/subscription","commits_url":"https://api.github.com/repos/fsr-itse/EvaP/commits{/sha}","git_commits_url":"https://api.github.com/repos/fsr-itse/EvaP/git/commits{/sha}","comments_url":"https://api.github.com/repos/fsr-itse/EvaP/comments{/number}","issue_comment_url":"https://api.github.com/repos/fsr-itse/EvaP/issues/comments{/number}","contents_url":"https://api.github.com/repos/fsr-itse/EvaP/contents/{+path}","compare_url":"https://api.github.com/repos/fsr-itse/EvaP/compare/{base}...{head}","merges_url":"https://api.github.com/repos/fsr-itse/EvaP/merges","archive_url":"https://api.github.com/repos/fsr-itse/EvaP/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/fsr-itse/EvaP/downloads","issues_url":"https://api.github.com/repos/fsr-itse/EvaP/issues{/number}","pulls_url":"https://api.github.com/repos/fsr-itse/EvaP/pulls{/number}","milestones_url":"https://api.github.com/repos/fsr-itse/EvaP/milestones{/number}","notifications_url":"https://api.github.com/repos/fsr-itse/EvaP/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/fsr-itse/EvaP/labels{/name}","releases_url":"https://api.github.com/repos/fsr-itse/EvaP/releases{/id}","created_at":"2012-01-05T13:56:45Z","updated_at":"2015-06-10T14:51:45Z","pushed_at":"2015-09-28T18:20:29Z","git_url":"git://github.com/fsr-itse/EvaP.git","ssh_url":"git@github.com:fsr-itse/EvaP.git","clone_url":"https://github.com/fsr-itse/EvaP.git","svn_url":"https://github.com/fsr-itse/EvaP","homepage":"","size":74915,"stargazers_count":22,"watchers_count":22,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":43,"mirror_url":null,"open_issues_count":57,"forks":43,"open_issues":57,"watchers":22,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/fsr-itse/EvaP/pulls/643"},"html":{"href":"https://github.com/fsr-itse/EvaP/pull/643"},"issue":{"href":"https://api.github.com/repos/fsr-itse/EvaP/issues/643"},"comments":{"href":"https://api.github.com/repos/fsr-itse/EvaP/issues/643/comments"},"review_comments":{"href":"https://api.github.com/repos/fsr-itse/EvaP/pulls/643/comments"},"review_comment":{"href":"https://api.github.com/repos/fsr-itse/EvaP/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/fsr-itse/EvaP/pulls/643/commits"},"statuses":{"href":"https://api.github.com/repos/fsr-itse/EvaP/statuses/7bc0d11c145a659348fd7d4568ca7c343fd96314"}}}}