{"action":"created","comment":{"url":"https://api.github.com/repos/4teamwork/opengever.core/pulls/comments/24417193","id":24417193,"diff_hunk":"@@ -67,32 +69,53 @@ def extract_title(self):\n         if self.request.method != 'POST':\n             return\n \n-        if 'submit' not in self.request:\n+        if 'schedule-paragraph' not in self.request \\\n+                and 'schedule-text' not in self.request:\n             return\n \n         return self.request.get('title')\n \n+    def extract_is_paragraph(self):\n+        return 'schedule-paragraph' in self.request\n+\n     def __call__(self):\n         title = self.extract_title()\n+        is_paragraph = self.extract_is_paragraph()\n         if title:\n-            self.meeting.schedule_text(title)\n+            self.meeting.schedule_text(title, is_paragraph=is_paragraph)\n \n         return self.request.response.redirect(self.nextURL())\n \n \n-class ScheduleParagraph(ScheduleText):\n+class UpdateAgendaItemOrder(BrowserView):\n+\n+    implements(IBrowserView, IPublishTraverse)\n \n     @classmethod\n     def url_for(cls, context, meeting):\n         return \"{}/{}\".format(MeetingList.url_for(context, meeting),\n-                              'schedule_paragraph')\n+                              'update_agenda_item_order')\n \n-    def __call__(self):\n-        title = self.extract_title()\n-        if title:\n-            self.meeting.schedule_paragraph(title)\n+    def __init__(self, context, request, model):\n+        super(UpdateAgendaItemOrder, self).__init__(context, request)\n+        self.model = model\n \n-        return self.request.response.redirect(self.nextURL())\n+    def __call__(self):\n+        data = json.loads(self.request.get('BODY'))\n+        new_order = [int(item_id) for item_id in data['sortOrder']]\n+        self.model.reorder_agenda_items(new_order)\n+\n+        numbers = dict((each.agenda_item_id, each.number) for each in\n+                       self.model.agenda_items)\n+\n+        self.request.response.setHeader(\"Content-type\", \"application/json\")\n+        return json.dumps(\n+            {'messages': [{'messageClass': 'info',\n+                           'messageTitle': 'Info',\n+                           'message': _('agenda_item_order_updated',\n+                                        default=u\"Agenda Item order updated.\"),","path":"opengever/meeting/browser/meetings/agendaitem.py","position":null,"original_position":80,"commit_id":"3177b0d9ec5ac1544e970581ef3fc8c4f5bab309","original_commit_id":"94a31285f031ff51a967c89e9a8d1e9a9cf9659f","user":{"login":"deiferni","id":736583,"avatar_url":"https://avatars.githubusercontent.com/u/736583?v=3","gravatar_id":"","url":"https://api.github.com/users/deiferni","html_url":"https://github.com/deiferni","followers_url":"https://api.github.com/users/deiferni/followers","following_url":"https://api.github.com/users/deiferni/following{/other_user}","gists_url":"https://api.github.com/users/deiferni/gists{/gist_id}","starred_url":"https://api.github.com/users/deiferni/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/deiferni/subscriptions","organizations_url":"https://api.github.com/users/deiferni/orgs","repos_url":"https://api.github.com/users/deiferni/repos","events_url":"https://api.github.com/users/deiferni/events{/privacy}","received_events_url":"https://api.github.com/users/deiferni/received_events","type":"User","site_admin":false},"body":"thx, updated.","created_at":"2015-02-10T14:57:48Z","updated_at":"2015-02-10T14:57:48Z","html_url":"https://github.com/4teamwork/opengever.core/pull/748#discussion_r24417193","pull_request_url":"https://api.github.com/repos/4teamwork/opengever.core/pulls/748","_links":{"self":{"href":"https://api.github.com/repos/4teamwork/opengever.core/pulls/comments/24417193"},"html":{"href":"https://github.com/4teamwork/opengever.core/pull/748#discussion_r24417193"},"pull_request":{"href":"https://api.github.com/repos/4teamwork/opengever.core/pulls/748"}}},"pull_request":{"url":"https://api.github.com/repos/4teamwork/opengever.core/pulls/748","id":28736032,"html_url":"https://github.com/4teamwork/opengever.core/pull/748","diff_url":"https://github.com/4teamwork/opengever.core/pull/748.diff","patch_url":"https://github.com/4teamwork/opengever.core/pull/748.patch","issue_url":"https://api.github.com/repos/4teamwork/opengever.core/issues/748","number":748,"state":"open","locked":false,"title":"Meeting form styles. Agendaitem sortable.","user":{"login":"bierik","id":1637820,"avatar_url":"https://avatars.githubusercontent.com/u/1637820?v=3","gravatar_id":"","url":"https://api.github.com/users/bierik","html_url":"https://github.com/bierik","followers_url":"https://api.github.com/users/bierik/followers","following_url":"https://api.github.com/users/bierik/following{/other_user}","gists_url":"https://api.github.com/users/bierik/gists{/gist_id}","starred_url":"https://api.github.com/users/bierik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bierik/subscriptions","organizations_url":"https://api.github.com/users/bierik/orgs","repos_url":"https://api.github.com/users/bierik/repos","events_url":"https://api.github.com/users/bierik/events{/privacy}","received_events_url":"https://api.github.com/users/bierik/received_events","type":"User","site_admin":false},"body":"Style meeting form.\r\nAdd agendaitem sorting implementation.","created_at":"2015-02-05T16:01:13Z","updated_at":"2015-02-10T14:57:49Z","closed_at":null,"merged_at":null,"merge_commit_sha":"483c20333c488d64011da4f1ae34cdb553690ff6","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/4teamwork/opengever.core/pulls/748/commits","review_comments_url":"https://api.github.com/repos/4teamwork/opengever.core/pulls/748/comments","review_comment_url":"https://api.github.com/repos/4teamwork/opengever.core/pulls/comments/{number}","comments_url":"https://api.github.com/repos/4teamwork/opengever.core/issues/748/comments","statuses_url":"https://api.github.com/repos/4teamwork/opengever.core/statuses/3177b0d9ec5ac1544e970581ef3fc8c4f5bab309","head":{"label":"4teamwork:kb-meeting-styles","ref":"kb-meeting-styles","sha":"3177b0d9ec5ac1544e970581ef3fc8c4f5bab309","user":{"login":"4teamwork","id":681821,"avatar_url":"https://avatars.githubusercontent.com/u/681821?v=3","gravatar_id":"","url":"https://api.github.com/users/4teamwork","html_url":"https://github.com/4teamwork","followers_url":"https://api.github.com/users/4teamwork/followers","following_url":"https://api.github.com/users/4teamwork/following{/other_user}","gists_url":"https://api.github.com/users/4teamwork/gists{/gist_id}","starred_url":"https://api.github.com/users/4teamwork/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/4teamwork/subscriptions","organizations_url":"https://api.github.com/users/4teamwork/orgs","repos_url":"https://api.github.com/users/4teamwork/repos","events_url":"https://api.github.com/users/4teamwork/events{/privacy}","received_events_url":"https://api.github.com/users/4teamwork/received_events","type":"Organization","site_admin":false},"repo":{"id":9788097,"name":"opengever.core","full_name":"4teamwork/opengever.core","owner":{"login":"4teamwork","id":681821,"avatar_url":"https://avatars.githubusercontent.com/u/681821?v=3","gravatar_id":"","url":"https://api.github.com/users/4teamwork","html_url":"https://github.com/4teamwork","followers_url":"https://api.github.com/users/4teamwork/followers","following_url":"https://api.github.com/users/4teamwork/following{/other_user}","gists_url":"https://api.github.com/users/4teamwork/gists{/gist_id}","starred_url":"https://api.github.com/users/4teamwork/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/4teamwork/subscriptions","organizations_url":"https://api.github.com/users/4teamwork/orgs","repos_url":"https://api.github.com/users/4teamwork/repos","events_url":"https://api.github.com/users/4teamwork/events{/privacy}","received_events_url":"https://api.github.com/users/4teamwork/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/4teamwork/opengever.core","description":"","fork":false,"url":"https://api.github.com/repos/4teamwork/opengever.core","forks_url":"https://api.github.com/repos/4teamwork/opengever.core/forks","keys_url":"https://api.github.com/repos/4teamwork/opengever.core/keys{/key_id}","collaborators_url":"https://api.github.com/repos/4teamwork/opengever.core/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/4teamwork/opengever.core/teams","hooks_url":"https://api.github.com/repos/4teamwork/opengever.core/hooks","issue_events_url":"https://api.github.com/repos/4teamwork/opengever.core/issues/events{/number}","events_url":"https://api.github.com/repos/4teamwork/opengever.core/events","assignees_url":"https://api.github.com/repos/4teamwork/opengever.core/assignees{/user}","branches_url":"https://api.github.com/repos/4teamwork/opengever.core/branches{/branch}","tags_url":"https://api.github.com/repos/4teamwork/opengever.core/tags","blobs_url":"https://api.github.com/repos/4teamwork/opengever.core/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/4teamwork/opengever.core/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/4teamwork/opengever.core/git/refs{/sha}","trees_url":"https://api.github.com/repos/4teamwork/opengever.core/git/trees{/sha}","statuses_url":"https://api.github.com/repos/4teamwork/opengever.core/statuses/{sha}","languages_url":"https://api.github.com/repos/4teamwork/opengever.core/languages","stargazers_url":"https://api.github.com/repos/4teamwork/opengever.core/stargazers","contributors_url":"https://api.github.com/repos/4teamwork/opengever.core/contributors","subscribers_url":"https://api.github.com/repos/4teamwork/opengever.core/subscribers","subscription_url":"https://api.github.com/repos/4teamwork/opengever.core/subscription","commits_url":"https://api.github.com/repos/4teamwork/opengever.core/commits{/sha}","git_commits_url":"https://api.github.com/repos/4teamwork/opengever.core/git/commits{/sha}","comments_url":"https://api.github.com/repos/4teamwork/opengever.core/comments{/number}","issue_comment_url":"https://api.github.com/repos/4teamwork/opengever.core/issues/comments/{number}","contents_url":"https://api.github.com/repos/4teamwork/opengever.core/contents/{+path}","compare_url":"https://api.github.com/repos/4teamwork/opengever.core/compare/{base}...{head}","merges_url":"https://api.github.com/repos/4teamwork/opengever.core/merges","archive_url":"https://api.github.com/repos/4teamwork/opengever.core/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/4teamwork/opengever.core/downloads","issues_url":"https://api.github.com/repos/4teamwork/opengever.core/issues{/number}","pulls_url":"https://api.github.com/repos/4teamwork/opengever.core/pulls{/number}","milestones_url":"https://api.github.com/repos/4teamwork/opengever.core/milestones{/number}","notifications_url":"https://api.github.com/repos/4teamwork/opengever.core/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/4teamwork/opengever.core/labels{/name}","releases_url":"https://api.github.com/repos/4teamwork/opengever.core/releases{/id}","created_at":"2013-05-01T08:28:16Z","updated_at":"2015-02-05T12:12:41Z","pushed_at":"2015-02-10T14:57:28Z","git_url":"git://github.com/4teamwork/opengever.core.git","ssh_url":"git@github.com:4teamwork/opengever.core.git","clone_url":"https://github.com/4teamwork/opengever.core.git","svn_url":"https://github.com/4teamwork/opengever.core","homepage":"","size":24339,"stargazers_count":5,"watchers_count":5,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"open_issues_count":74,"forks":3,"open_issues":74,"watchers":5,"default_branch":"master"}},"base":{"label":"4teamwork:master","ref":"master","sha":"8a0eedfd166c260c8e4db2d55455a7a026cecad0","user":{"login":"4teamwork","id":681821,"avatar_url":"https://avatars.githubusercontent.com/u/681821?v=3","gravatar_id":"","url":"https://api.github.com/users/4teamwork","html_url":"https://github.com/4teamwork","followers_url":"https://api.github.com/users/4teamwork/followers","following_url":"https://api.github.com/users/4teamwork/following{/other_user}","gists_url":"https://api.github.com/users/4teamwork/gists{/gist_id}","starred_url":"https://api.github.com/users/4teamwork/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/4teamwork/subscriptions","organizations_url":"https://api.github.com/users/4teamwork/orgs","repos_url":"https://api.github.com/users/4teamwork/repos","events_url":"https://api.github.com/users/4teamwork/events{/privacy}","received_events_url":"https://api.github.com/users/4teamwork/received_events","type":"Organization","site_admin":false},"repo":{"id":9788097,"name":"opengever.core","full_name":"4teamwork/opengever.core","owner":{"login":"4teamwork","id":681821,"avatar_url":"https://avatars.githubusercontent.com/u/681821?v=3","gravatar_id":"","url":"https://api.github.com/users/4teamwork","html_url":"https://github.com/4teamwork","followers_url":"https://api.github.com/users/4teamwork/followers","following_url":"https://api.github.com/users/4teamwork/following{/other_user}","gists_url":"https://api.github.com/users/4teamwork/gists{/gist_id}","starred_url":"https://api.github.com/users/4teamwork/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/4teamwork/subscriptions","organizations_url":"https://api.github.com/users/4teamwork/orgs","repos_url":"https://api.github.com/users/4teamwork/repos","events_url":"https://api.github.com/users/4teamwork/events{/privacy}","received_events_url":"https://api.github.com/users/4teamwork/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/4teamwork/opengever.core","description":"","fork":false,"url":"https://api.github.com/repos/4teamwork/opengever.core","forks_url":"https://api.github.com/repos/4teamwork/opengever.core/forks","keys_url":"https://api.github.com/repos/4teamwork/opengever.core/keys{/key_id}","collaborators_url":"https://api.github.com/repos/4teamwork/opengever.core/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/4teamwork/opengever.core/teams","hooks_url":"https://api.github.com/repos/4teamwork/opengever.core/hooks","issue_events_url":"https://api.github.com/repos/4teamwork/opengever.core/issues/events{/number}","events_url":"https://api.github.com/repos/4teamwork/opengever.core/events","assignees_url":"https://api.github.com/repos/4teamwork/opengever.core/assignees{/user}","branches_url":"https://api.github.com/repos/4teamwork/opengever.core/branches{/branch}","tags_url":"https://api.github.com/repos/4teamwork/opengever.core/tags","blobs_url":"https://api.github.com/repos/4teamwork/opengever.core/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/4teamwork/opengever.core/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/4teamwork/opengever.core/git/refs{/sha}","trees_url":"https://api.github.com/repos/4teamwork/opengever.core/git/trees{/sha}","statuses_url":"https://api.github.com/repos/4teamwork/opengever.core/statuses/{sha}","languages_url":"https://api.github.com/repos/4teamwork/opengever.core/languages","stargazers_url":"https://api.github.com/repos/4teamwork/opengever.core/stargazers","contributors_url":"https://api.github.com/repos/4teamwork/opengever.core/contributors","subscribers_url":"https://api.github.com/repos/4teamwork/opengever.core/subscribers","subscription_url":"https://api.github.com/repos/4teamwork/opengever.core/subscription","commits_url":"https://api.github.com/repos/4teamwork/opengever.core/commits{/sha}","git_commits_url":"https://api.github.com/repos/4teamwork/opengever.core/git/commits{/sha}","comments_url":"https://api.github.com/repos/4teamwork/opengever.core/comments{/number}","issue_comment_url":"https://api.github.com/repos/4teamwork/opengever.core/issues/comments/{number}","contents_url":"https://api.github.com/repos/4teamwork/opengever.core/contents/{+path}","compare_url":"https://api.github.com/repos/4teamwork/opengever.core/compare/{base}...{head}","merges_url":"https://api.github.com/repos/4teamwork/opengever.core/merges","archive_url":"https://api.github.com/repos/4teamwork/opengever.core/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/4teamwork/opengever.core/downloads","issues_url":"https://api.github.com/repos/4teamwork/opengever.core/issues{/number}","pulls_url":"https://api.github.com/repos/4teamwork/opengever.core/pulls{/number}","milestones_url":"https://api.github.com/repos/4teamwork/opengever.core/milestones{/number}","notifications_url":"https://api.github.com/repos/4teamwork/opengever.core/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/4teamwork/opengever.core/labels{/name}","releases_url":"https://api.github.com/repos/4teamwork/opengever.core/releases{/id}","created_at":"2013-05-01T08:28:16Z","updated_at":"2015-02-05T12:12:41Z","pushed_at":"2015-02-10T14:57:28Z","git_url":"git://github.com/4teamwork/opengever.core.git","ssh_url":"git@github.com:4teamwork/opengever.core.git","clone_url":"https://github.com/4teamwork/opengever.core.git","svn_url":"https://github.com/4teamwork/opengever.core","homepage":"","size":24339,"stargazers_count":5,"watchers_count":5,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"open_issues_count":74,"forks":3,"open_issues":74,"watchers":5,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/4teamwork/opengever.core/pulls/748"},"html":{"href":"https://github.com/4teamwork/opengever.core/pull/748"},"issue":{"href":"https://api.github.com/repos/4teamwork/opengever.core/issues/748"},"comments":{"href":"https://api.github.com/repos/4teamwork/opengever.core/issues/748/comments"},"review_comments":{"href":"https://api.github.com/repos/4teamwork/opengever.core/pulls/748/comments"},"review_comment":{"href":"https://api.github.com/repos/4teamwork/opengever.core/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/4teamwork/opengever.core/pulls/748/commits"},"statuses":{"href":"https://api.github.com/repos/4teamwork/opengever.core/statuses/3177b0d9ec5ac1544e970581ef3fc8c4f5bab309"}}}}