{"action":"created","comment":{"url":"https://api.github.com/repos/WISVCH/events/pulls/comments/54561559","id":54561559,"diff_hunk":"@@ -39,12 +40,51 @@ public String createEvent(Model model) {\n         return \"events/create\";\n     }\n \n-    @RequestMapping(value = \"/create\", method = RequestMethod.POST)\n+    @RequestMapping(value = \"/save\", method = RequestMethod.POST)\n     @PreAuthorize(\"hasRole('ADMIN')\")\n-    public String createEvent(@ModelAttribute Event event, RedirectAttributes redirectAttributes) {\n+    public String saveEvent(@ModelAttribute Event event, RedirectAttributes redirectAttributes) {\n         event = eventRepository.save(event);\n \n-        redirectAttributes.addFlashAttribute(\"message\", \"Event '\" + event.getTitle() + \"' created!\");\n+        redirectAttributes.addFlashAttribute(\"message\", \"Event '\" + event.getTitle() + \"' saved!\");\n         return \"redirect:/events/\";\n     }\n+\n+    @RequestMapping(value = \"/{id}\", method = RequestMethod.GET)\n+    public String getEvent(Model model, @PathVariable(\"id\") long id, RedirectAttributes redirectAttributes) {\n+        Event event = eventRepository.findOne(id);\n+        if (event != null) {\n+            model.addAttribute(\"event\", event);\n+            return \"events/detail\";\n+        } else {\n+            redirectAttributes.addFlashAttribute(\"message\", \"That event does not exist.\");\n+            return \"redirect:/events/\";\n+        }\n+    }\n+\n+    @RequestMapping(value = \"/delete/{id}\", method = RequestMethod.GET)\n+    @PreAuthorize(\"hasRole('ADMIN')\")\n+    public String removeEvent(@PathVariable(\"id\") long id, RedirectAttributes redirectAttributes) {\n+        Event event = eventRepository.findOne(id);\n+        if (event != null) {\n+            eventRepository.delete(event);\n+            redirectAttributes.addFlashAttribute(\"message\", \"Event '\" + event.getTitle() + \"' deleted!\");\n+        } else {\n+            redirectAttributes.addFlashAttribute(\"message\", \"That event does not exist.\");","path":"src/main/java/ch/wisv/events/EventsController.java","position":44,"original_position":44,"commit_id":"181be2b5b54db8821cd766b79824600164ede071","original_commit_id":"181be2b5b54db8821cd766b79824600164ede071","user":{"login":"praseodym","id":20283,"avatar_url":"https://avatars.githubusercontent.com/u/20283?v=3","gravatar_id":"","url":"https://api.github.com/users/praseodym","html_url":"https://github.com/praseodym","followers_url":"https://api.github.com/users/praseodym/followers","following_url":"https://api.github.com/users/praseodym/following{/other_user}","gists_url":"https://api.github.com/users/praseodym/gists{/gist_id}","starred_url":"https://api.github.com/users/praseodym/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/praseodym/subscriptions","organizations_url":"https://api.github.com/users/praseodym/orgs","repos_url":"https://api.github.com/users/praseodym/repos","events_url":"https://api.github.com/users/praseodym/events{/privacy}","received_events_url":"https://api.github.com/users/praseodym/received_events","type":"User","site_admin":false},"body":"This should throw an error instead.","created_at":"2016-03-01T12:46:32Z","updated_at":"2016-03-01T12:46:32Z","html_url":"https://github.com/WISVCH/events/pull/22#discussion_r54561559","pull_request_url":"https://api.github.com/repos/WISVCH/events/pulls/22","_links":{"self":{"href":"https://api.github.com/repos/WISVCH/events/pulls/comments/54561559"},"html":{"href":"https://github.com/WISVCH/events/pull/22#discussion_r54561559"},"pull_request":{"href":"https://api.github.com/repos/WISVCH/events/pulls/22"}}},"pull_request":{"url":"https://api.github.com/repos/WISVCH/events/pulls/22","id":57590529,"html_url":"https://github.com/WISVCH/events/pull/22","diff_url":"https://github.com/WISVCH/events/pull/22.diff","patch_url":"https://github.com/WISVCH/events/pull/22.patch","issue_url":"https://api.github.com/repos/WISVCH/events/issues/22","number":22,"state":"open","locked":false,"title":"Basic detail view for events, plus delete functionality","user":{"login":"sanderploegsma","id":1564254,"avatar_url":"https://avatars.githubusercontent.com/u/1564254?v=3","gravatar_id":"","url":"https://api.github.com/users/sanderploegsma","html_url":"https://github.com/sanderploegsma","followers_url":"https://api.github.com/users/sanderploegsma/followers","following_url":"https://api.github.com/users/sanderploegsma/following{/other_user}","gists_url":"https://api.github.com/users/sanderploegsma/gists{/gist_id}","starred_url":"https://api.github.com/users/sanderploegsma/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sanderploegsma/subscriptions","organizations_url":"https://api.github.com/users/sanderploegsma/orgs","repos_url":"https://api.github.com/users/sanderploegsma/repos","events_url":"https://api.github.com/users/sanderploegsma/events{/privacy}","received_events_url":"https://api.github.com/users/sanderploegsma/received_events","type":"User","site_admin":false},"body":"See #4. Not entirely complete yet, but a good start. Edit view should probably re-use the create form in some way.\r\n\r\nAlso, the view could use a 'register' button.\r\n\r\nOh, forgot to mention: WIP!","created_at":"2016-01-29T00:44:27Z","updated_at":"2016-03-01T12:46:32Z","closed_at":null,"merged_at":null,"merge_commit_sha":"ece3661feff6f628f6c9a7bd5ae559a0a1991cb8","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/WISVCH/events/pulls/22/commits","review_comments_url":"https://api.github.com/repos/WISVCH/events/pulls/22/comments","review_comment_url":"https://api.github.com/repos/WISVCH/events/pulls/comments{/number}","comments_url":"https://api.github.com/repos/WISVCH/events/issues/22/comments","statuses_url":"https://api.github.com/repos/WISVCH/events/statuses/181be2b5b54db8821cd766b79824600164ede071","head":{"label":"WISVCH:feature/event-detail","ref":"feature/event-detail","sha":"181be2b5b54db8821cd766b79824600164ede071","user":{"login":"WISVCH","id":1391433,"avatar_url":"https://avatars.githubusercontent.com/u/1391433?v=3","gravatar_id":"","url":"https://api.github.com/users/WISVCH","html_url":"https://github.com/WISVCH","followers_url":"https://api.github.com/users/WISVCH/followers","following_url":"https://api.github.com/users/WISVCH/following{/other_user}","gists_url":"https://api.github.com/users/WISVCH/gists{/gist_id}","starred_url":"https://api.github.com/users/WISVCH/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/WISVCH/subscriptions","organizations_url":"https://api.github.com/users/WISVCH/orgs","repos_url":"https://api.github.com/users/WISVCH/repos","events_url":"https://api.github.com/users/WISVCH/events{/privacy}","received_events_url":"https://api.github.com/users/WISVCH/received_events","type":"Organization","site_admin":false},"repo":{"id":42854261,"name":"events","full_name":"WISVCH/events","owner":{"login":"WISVCH","id":1391433,"avatar_url":"https://avatars.githubusercontent.com/u/1391433?v=3","gravatar_id":"","url":"https://api.github.com/users/WISVCH","html_url":"https://github.com/WISVCH","followers_url":"https://api.github.com/users/WISVCH/followers","following_url":"https://api.github.com/users/WISVCH/following{/other_user}","gists_url":"https://api.github.com/users/WISVCH/gists{/gist_id}","starred_url":"https://api.github.com/users/WISVCH/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/WISVCH/subscriptions","organizations_url":"https://api.github.com/users/WISVCH/orgs","repos_url":"https://api.github.com/users/WISVCH/repos","events_url":"https://api.github.com/users/WISVCH/events{/privacy}","received_events_url":"https://api.github.com/users/WISVCH/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/WISVCH/events","description":"Registration for CH events (lectures, workshops, excursions, ...)","fork":false,"url":"https://api.github.com/repos/WISVCH/events","forks_url":"https://api.github.com/repos/WISVCH/events/forks","keys_url":"https://api.github.com/repos/WISVCH/events/keys{/key_id}","collaborators_url":"https://api.github.com/repos/WISVCH/events/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/WISVCH/events/teams","hooks_url":"https://api.github.com/repos/WISVCH/events/hooks","issue_events_url":"https://api.github.com/repos/WISVCH/events/issues/events{/number}","events_url":"https://api.github.com/repos/WISVCH/events/events","assignees_url":"https://api.github.com/repos/WISVCH/events/assignees{/user}","branches_url":"https://api.github.com/repos/WISVCH/events/branches{/branch}","tags_url":"https://api.github.com/repos/WISVCH/events/tags","blobs_url":"https://api.github.com/repos/WISVCH/events/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/WISVCH/events/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/WISVCH/events/git/refs{/sha}","trees_url":"https://api.github.com/repos/WISVCH/events/git/trees{/sha}","statuses_url":"https://api.github.com/repos/WISVCH/events/statuses/{sha}","languages_url":"https://api.github.com/repos/WISVCH/events/languages","stargazers_url":"https://api.github.com/repos/WISVCH/events/stargazers","contributors_url":"https://api.github.com/repos/WISVCH/events/contributors","subscribers_url":"https://api.github.com/repos/WISVCH/events/subscribers","subscription_url":"https://api.github.com/repos/WISVCH/events/subscription","commits_url":"https://api.github.com/repos/WISVCH/events/commits{/sha}","git_commits_url":"https://api.github.com/repos/WISVCH/events/git/commits{/sha}","comments_url":"https://api.github.com/repos/WISVCH/events/comments{/number}","issue_comment_url":"https://api.github.com/repos/WISVCH/events/issues/comments{/number}","contents_url":"https://api.github.com/repos/WISVCH/events/contents/{+path}","compare_url":"https://api.github.com/repos/WISVCH/events/compare/{base}...{head}","merges_url":"https://api.github.com/repos/WISVCH/events/merges","archive_url":"https://api.github.com/repos/WISVCH/events/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/WISVCH/events/downloads","issues_url":"https://api.github.com/repos/WISVCH/events/issues{/number}","pulls_url":"https://api.github.com/repos/WISVCH/events/pulls{/number}","milestones_url":"https://api.github.com/repos/WISVCH/events/milestones{/number}","notifications_url":"https://api.github.com/repos/WISVCH/events/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/WISVCH/events/labels{/name}","releases_url":"https://api.github.com/repos/WISVCH/events/releases{/id}","deployments_url":"https://api.github.com/repos/WISVCH/events/deployments","created_at":"2015-09-21T08:41:22Z","updated_at":"2016-01-22T16:32:28Z","pushed_at":"2016-03-01T12:35:33Z","git_url":"git://github.com/WISVCH/events.git","ssh_url":"git@github.com:WISVCH/events.git","clone_url":"https://github.com/WISVCH/events.git","svn_url":"https://github.com/WISVCH/events","homepage":"","size":117,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":9,"forks":0,"open_issues":9,"watchers":0,"default_branch":"master"}},"base":{"label":"WISVCH:master","ref":"master","sha":"3ab1612d77ee391f5c6deea1fbc9d57d77379171","user":{"login":"WISVCH","id":1391433,"avatar_url":"https://avatars.githubusercontent.com/u/1391433?v=3","gravatar_id":"","url":"https://api.github.com/users/WISVCH","html_url":"https://github.com/WISVCH","followers_url":"https://api.github.com/users/WISVCH/followers","following_url":"https://api.github.com/users/WISVCH/following{/other_user}","gists_url":"https://api.github.com/users/WISVCH/gists{/gist_id}","starred_url":"https://api.github.com/users/WISVCH/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/WISVCH/subscriptions","organizations_url":"https://api.github.com/users/WISVCH/orgs","repos_url":"https://api.github.com/users/WISVCH/repos","events_url":"https://api.github.com/users/WISVCH/events{/privacy}","received_events_url":"https://api.github.com/users/WISVCH/received_events","type":"Organization","site_admin":false},"repo":{"id":42854261,"name":"events","full_name":"WISVCH/events","owner":{"login":"WISVCH","id":1391433,"avatar_url":"https://avatars.githubusercontent.com/u/1391433?v=3","gravatar_id":"","url":"https://api.github.com/users/WISVCH","html_url":"https://github.com/WISVCH","followers_url":"https://api.github.com/users/WISVCH/followers","following_url":"https://api.github.com/users/WISVCH/following{/other_user}","gists_url":"https://api.github.com/users/WISVCH/gists{/gist_id}","starred_url":"https://api.github.com/users/WISVCH/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/WISVCH/subscriptions","organizations_url":"https://api.github.com/users/WISVCH/orgs","repos_url":"https://api.github.com/users/WISVCH/repos","events_url":"https://api.github.com/users/WISVCH/events{/privacy}","received_events_url":"https://api.github.com/users/WISVCH/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/WISVCH/events","description":"Registration for CH events (lectures, workshops, excursions, ...)","fork":false,"url":"https://api.github.com/repos/WISVCH/events","forks_url":"https://api.github.com/repos/WISVCH/events/forks","keys_url":"https://api.github.com/repos/WISVCH/events/keys{/key_id}","collaborators_url":"https://api.github.com/repos/WISVCH/events/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/WISVCH/events/teams","hooks_url":"https://api.github.com/repos/WISVCH/events/hooks","issue_events_url":"https://api.github.com/repos/WISVCH/events/issues/events{/number}","events_url":"https://api.github.com/repos/WISVCH/events/events","assignees_url":"https://api.github.com/repos/WISVCH/events/assignees{/user}","branches_url":"https://api.github.com/repos/WISVCH/events/branches{/branch}","tags_url":"https://api.github.com/repos/WISVCH/events/tags","blobs_url":"https://api.github.com/repos/WISVCH/events/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/WISVCH/events/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/WISVCH/events/git/refs{/sha}","trees_url":"https://api.github.com/repos/WISVCH/events/git/trees{/sha}","statuses_url":"https://api.github.com/repos/WISVCH/events/statuses/{sha}","languages_url":"https://api.github.com/repos/WISVCH/events/languages","stargazers_url":"https://api.github.com/repos/WISVCH/events/stargazers","contributors_url":"https://api.github.com/repos/WISVCH/events/contributors","subscribers_url":"https://api.github.com/repos/WISVCH/events/subscribers","subscription_url":"https://api.github.com/repos/WISVCH/events/subscription","commits_url":"https://api.github.com/repos/WISVCH/events/commits{/sha}","git_commits_url":"https://api.github.com/repos/WISVCH/events/git/commits{/sha}","comments_url":"https://api.github.com/repos/WISVCH/events/comments{/number}","issue_comment_url":"https://api.github.com/repos/WISVCH/events/issues/comments{/number}","contents_url":"https://api.github.com/repos/WISVCH/events/contents/{+path}","compare_url":"https://api.github.com/repos/WISVCH/events/compare/{base}...{head}","merges_url":"https://api.github.com/repos/WISVCH/events/merges","archive_url":"https://api.github.com/repos/WISVCH/events/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/WISVCH/events/downloads","issues_url":"https://api.github.com/repos/WISVCH/events/issues{/number}","pulls_url":"https://api.github.com/repos/WISVCH/events/pulls{/number}","milestones_url":"https://api.github.com/repos/WISVCH/events/milestones{/number}","notifications_url":"https://api.github.com/repos/WISVCH/events/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/WISVCH/events/labels{/name}","releases_url":"https://api.github.com/repos/WISVCH/events/releases{/id}","deployments_url":"https://api.github.com/repos/WISVCH/events/deployments","created_at":"2015-09-21T08:41:22Z","updated_at":"2016-01-22T16:32:28Z","pushed_at":"2016-03-01T12:35:33Z","git_url":"git://github.com/WISVCH/events.git","ssh_url":"git@github.com:WISVCH/events.git","clone_url":"https://github.com/WISVCH/events.git","svn_url":"https://github.com/WISVCH/events","homepage":"","size":117,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":9,"forks":0,"open_issues":9,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/WISVCH/events/pulls/22"},"html":{"href":"https://github.com/WISVCH/events/pull/22"},"issue":{"href":"https://api.github.com/repos/WISVCH/events/issues/22"},"comments":{"href":"https://api.github.com/repos/WISVCH/events/issues/22/comments"},"review_comments":{"href":"https://api.github.com/repos/WISVCH/events/pulls/22/comments"},"review_comment":{"href":"https://api.github.com/repos/WISVCH/events/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/WISVCH/events/pulls/22/commits"},"statuses":{"href":"https://api.github.com/repos/WISVCH/events/statuses/181be2b5b54db8821cd766b79824600164ede071"}}}}