{"action":"created","comment":{"url":"https://api.github.com/repos/natxo-kodify/blog/pulls/comments/40121461","id":40121461,"diff_hunk":"@@ -1,13 +1,55 @@\n {% extends 'KodifyBlogBundle::base.html.twig' %}\n \n {% block content %}\n+\n+    {% for flashMessage in app.session.flashbag.get('success') %}\n+        <div class=\"bg-success\">\n+            {{ flashMessage }}\n+        </div>\n+    {% endfor %}\n+    {% for flashMessage in app.session.flashbag.get('danger') %}\n+        <div class=\"bg-danger\">\n+            {{ flashMessage }}\n+        </div>\n+    {% endfor %}\n+\n     <div class=\"panel panel-default\">\n         <div class=\"panel-heading\">\n             <a href=\"{{ path('view_post',{id: post.id}) }}\">{{ post.title }}</a>\n             <span class=\"pull-right\">by: {{ post.author.name }} on: {{ post.createdAt|date(\"m/d/Y\") }}</span>\n         </div>\n         <div class=\"panel-body\">\n-            {{ post.content }}\n+            <div class=\"row\">\n+                <div class=\"col-xs-12 col-sm-8\">\n+                    {{ post.content }}\n+                </div>\n+                <div class=\"col-xs-12 col-sm-4\">\n+                    {% if not post.rateClicks %}\n+                        there are no ratings\n+                    {% endif %}\n+                    <ul class=\"stars list-inline pull-right\" data-default-stars=\"{{ post.rate }}\">\n+                        {% for i in 1..5 %}\n+                            <li>\n+                                <a id=\"star{{ i }}\" href=\"{{ path('rate_post', {'id':post.id, 'star': i}) }}\"","path":"src/Kodify/BlogBundle/Resources/views/Post/view.html.twig","position":34,"original_position":34,"commit_id":"47c8cd624f6be6ec319142478ff125af3f26448c","original_commit_id":"47c8cd624f6be6ec319142478ff125af3f26448c","user":{"login":"warguns","id":3001004,"avatar_url":"https://avatars.githubusercontent.com/u/3001004?v=3","gravatar_id":"","url":"https://api.github.com/users/warguns","html_url":"https://github.com/warguns","followers_url":"https://api.github.com/users/warguns/followers","following_url":"https://api.github.com/users/warguns/following{/other_user}","gists_url":"https://api.github.com/users/warguns/gists{/gist_id}","starred_url":"https://api.github.com/users/warguns/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/warguns/subscriptions","organizations_url":"https://api.github.com/users/warguns/orgs","repos_url":"https://api.github.com/users/warguns/repos","events_url":"https://api.github.com/users/warguns/events{/privacy}","received_events_url":"https://api.github.com/users/warguns/received_events","type":"User","site_admin":false},"body":"Probably I would use jquery ajax, retrieving the url from the href, and using preventDefault's to avoid it. Next I would rewrite the rateAction function on PostsController to return a true or false on text or json format and removing the sessions flashbag object. Finally I would make appear and disappear the div's messages after success or failed.","created_at":"2015-09-22T18:06:25Z","updated_at":"2015-09-22T18:06:25Z","html_url":"https://github.com/natxo-kodify/blog/pull/8#discussion_r40121461","pull_request_url":"https://api.github.com/repos/natxo-kodify/blog/pulls/8","_links":{"self":{"href":"https://api.github.com/repos/natxo-kodify/blog/pulls/comments/40121461"},"html":{"href":"https://github.com/natxo-kodify/blog/pull/8#discussion_r40121461"},"pull_request":{"href":"https://api.github.com/repos/natxo-kodify/blog/pulls/8"}}},"pull_request":{"url":"https://api.github.com/repos/natxo-kodify/blog/pulls/8","id":45632378,"html_url":"https://github.com/natxo-kodify/blog/pull/8","diff_url":"https://github.com/natxo-kodify/blog/pull/8.diff","patch_url":"https://github.com/natxo-kodify/blog/pull/8.patch","issue_url":"https://api.github.com/repos/natxo-kodify/blog/issues/8","number":8,"state":"open","locked":false,"title":"There you go, please check it out!","user":{"login":"warguns","id":3001004,"avatar_url":"https://avatars.githubusercontent.com/u/3001004?v=3","gravatar_id":"","url":"https://api.github.com/users/warguns","html_url":"https://github.com/warguns","followers_url":"https://api.github.com/users/warguns/followers","following_url":"https://api.github.com/users/warguns/following{/other_user}","gists_url":"https://api.github.com/users/warguns/gists{/gist_id}","starred_url":"https://api.github.com/users/warguns/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/warguns/subscriptions","organizations_url":"https://api.github.com/users/warguns/orgs","repos_url":"https://api.github.com/users/warguns/repos","events_url":"https://api.github.com/users/warguns/events{/privacy}","received_events_url":"https://api.github.com/users/warguns/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-09-22T07:07:28Z","updated_at":"2015-09-22T18:06:25Z","closed_at":null,"merged_at":null,"merge_commit_sha":"48067616576f0b8a3f93b33d235b4aa480172b82","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/natxo-kodify/blog/pulls/8/commits","review_comments_url":"https://api.github.com/repos/natxo-kodify/blog/pulls/8/comments","review_comment_url":"https://api.github.com/repos/natxo-kodify/blog/pulls/comments{/number}","comments_url":"https://api.github.com/repos/natxo-kodify/blog/issues/8/comments","statuses_url":"https://api.github.com/repos/natxo-kodify/blog/statuses/47c8cd624f6be6ec319142478ff125af3f26448c","head":{"label":"warguns:master","ref":"master","sha":"47c8cd624f6be6ec319142478ff125af3f26448c","user":{"login":"warguns","id":3001004,"avatar_url":"https://avatars.githubusercontent.com/u/3001004?v=3","gravatar_id":"","url":"https://api.github.com/users/warguns","html_url":"https://github.com/warguns","followers_url":"https://api.github.com/users/warguns/followers","following_url":"https://api.github.com/users/warguns/following{/other_user}","gists_url":"https://api.github.com/users/warguns/gists{/gist_id}","starred_url":"https://api.github.com/users/warguns/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/warguns/subscriptions","organizations_url":"https://api.github.com/users/warguns/orgs","repos_url":"https://api.github.com/users/warguns/repos","events_url":"https://api.github.com/users/warguns/events{/privacy}","received_events_url":"https://api.github.com/users/warguns/received_events","type":"User","site_admin":false},"repo":{"id":42851320,"name":"blog","full_name":"warguns/blog","owner":{"login":"warguns","id":3001004,"avatar_url":"https://avatars.githubusercontent.com/u/3001004?v=3","gravatar_id":"","url":"https://api.github.com/users/warguns","html_url":"https://github.com/warguns","followers_url":"https://api.github.com/users/warguns/followers","following_url":"https://api.github.com/users/warguns/following{/other_user}","gists_url":"https://api.github.com/users/warguns/gists{/gist_id}","starred_url":"https://api.github.com/users/warguns/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/warguns/subscriptions","organizations_url":"https://api.github.com/users/warguns/orgs","repos_url":"https://api.github.com/users/warguns/repos","events_url":"https://api.github.com/users/warguns/events{/privacy}","received_events_url":"https://api.github.com/users/warguns/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/warguns/blog","description":"Blog test","fork":true,"url":"https://api.github.com/repos/warguns/blog","forks_url":"https://api.github.com/repos/warguns/blog/forks","keys_url":"https://api.github.com/repos/warguns/blog/keys{/key_id}","collaborators_url":"https://api.github.com/repos/warguns/blog/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/warguns/blog/teams","hooks_url":"https://api.github.com/repos/warguns/blog/hooks","issue_events_url":"https://api.github.com/repos/warguns/blog/issues/events{/number}","events_url":"https://api.github.com/repos/warguns/blog/events","assignees_url":"https://api.github.com/repos/warguns/blog/assignees{/user}","branches_url":"https://api.github.com/repos/warguns/blog/branches{/branch}","tags_url":"https://api.github.com/repos/warguns/blog/tags","blobs_url":"https://api.github.com/repos/warguns/blog/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/warguns/blog/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/warguns/blog/git/refs{/sha}","trees_url":"https://api.github.com/repos/warguns/blog/git/trees{/sha}","statuses_url":"https://api.github.com/repos/warguns/blog/statuses/{sha}","languages_url":"https://api.github.com/repos/warguns/blog/languages","stargazers_url":"https://api.github.com/repos/warguns/blog/stargazers","contributors_url":"https://api.github.com/repos/warguns/blog/contributors","subscribers_url":"https://api.github.com/repos/warguns/blog/subscribers","subscription_url":"https://api.github.com/repos/warguns/blog/subscription","commits_url":"https://api.github.com/repos/warguns/blog/commits{/sha}","git_commits_url":"https://api.github.com/repos/warguns/blog/git/commits{/sha}","comments_url":"https://api.github.com/repos/warguns/blog/comments{/number}","issue_comment_url":"https://api.github.com/repos/warguns/blog/issues/comments{/number}","contents_url":"https://api.github.com/repos/warguns/blog/contents/{+path}","compare_url":"https://api.github.com/repos/warguns/blog/compare/{base}...{head}","merges_url":"https://api.github.com/repos/warguns/blog/merges","archive_url":"https://api.github.com/repos/warguns/blog/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/warguns/blog/downloads","issues_url":"https://api.github.com/repos/warguns/blog/issues{/number}","pulls_url":"https://api.github.com/repos/warguns/blog/pulls{/number}","milestones_url":"https://api.github.com/repos/warguns/blog/milestones{/number}","notifications_url":"https://api.github.com/repos/warguns/blog/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/warguns/blog/labels{/name}","releases_url":"https://api.github.com/repos/warguns/blog/releases{/id}","created_at":"2015-09-21T07:38:33Z","updated_at":"2015-09-21T07:38:34Z","pushed_at":"2015-09-22T01:05:30Z","git_url":"git://github.com/warguns/blog.git","ssh_url":"git@github.com:warguns/blog.git","clone_url":"https://github.com/warguns/blog.git","svn_url":"https://github.com/warguns/blog","homepage":null,"size":364,"stargazers_count":0,"watchers_count":0,"language":"PHP","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":"natxo-kodify:master","ref":"master","sha":"04c4931fcfd9da9871e7888d37f9f39899953827","user":{"login":"natxo-kodify","id":3061986,"avatar_url":"https://avatars.githubusercontent.com/u/3061986?v=3","gravatar_id":"","url":"https://api.github.com/users/natxo-kodify","html_url":"https://github.com/natxo-kodify","followers_url":"https://api.github.com/users/natxo-kodify/followers","following_url":"https://api.github.com/users/natxo-kodify/following{/other_user}","gists_url":"https://api.github.com/users/natxo-kodify/gists{/gist_id}","starred_url":"https://api.github.com/users/natxo-kodify/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/natxo-kodify/subscriptions","organizations_url":"https://api.github.com/users/natxo-kodify/orgs","repos_url":"https://api.github.com/users/natxo-kodify/repos","events_url":"https://api.github.com/users/natxo-kodify/events{/privacy}","received_events_url":"https://api.github.com/users/natxo-kodify/received_events","type":"User","site_admin":false},"repo":{"id":28093369,"name":"blog","full_name":"natxo-kodify/blog","owner":{"login":"natxo-kodify","id":3061986,"avatar_url":"https://avatars.githubusercontent.com/u/3061986?v=3","gravatar_id":"","url":"https://api.github.com/users/natxo-kodify","html_url":"https://github.com/natxo-kodify","followers_url":"https://api.github.com/users/natxo-kodify/followers","following_url":"https://api.github.com/users/natxo-kodify/following{/other_user}","gists_url":"https://api.github.com/users/natxo-kodify/gists{/gist_id}","starred_url":"https://api.github.com/users/natxo-kodify/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/natxo-kodify/subscriptions","organizations_url":"https://api.github.com/users/natxo-kodify/orgs","repos_url":"https://api.github.com/users/natxo-kodify/repos","events_url":"https://api.github.com/users/natxo-kodify/events{/privacy}","received_events_url":"https://api.github.com/users/natxo-kodify/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/natxo-kodify/blog","description":"Blog test","fork":false,"url":"https://api.github.com/repos/natxo-kodify/blog","forks_url":"https://api.github.com/repos/natxo-kodify/blog/forks","keys_url":"https://api.github.com/repos/natxo-kodify/blog/keys{/key_id}","collaborators_url":"https://api.github.com/repos/natxo-kodify/blog/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/natxo-kodify/blog/teams","hooks_url":"https://api.github.com/repos/natxo-kodify/blog/hooks","issue_events_url":"https://api.github.com/repos/natxo-kodify/blog/issues/events{/number}","events_url":"https://api.github.com/repos/natxo-kodify/blog/events","assignees_url":"https://api.github.com/repos/natxo-kodify/blog/assignees{/user}","branches_url":"https://api.github.com/repos/natxo-kodify/blog/branches{/branch}","tags_url":"https://api.github.com/repos/natxo-kodify/blog/tags","blobs_url":"https://api.github.com/repos/natxo-kodify/blog/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/natxo-kodify/blog/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/natxo-kodify/blog/git/refs{/sha}","trees_url":"https://api.github.com/repos/natxo-kodify/blog/git/trees{/sha}","statuses_url":"https://api.github.com/repos/natxo-kodify/blog/statuses/{sha}","languages_url":"https://api.github.com/repos/natxo-kodify/blog/languages","stargazers_url":"https://api.github.com/repos/natxo-kodify/blog/stargazers","contributors_url":"https://api.github.com/repos/natxo-kodify/blog/contributors","subscribers_url":"https://api.github.com/repos/natxo-kodify/blog/subscribers","subscription_url":"https://api.github.com/repos/natxo-kodify/blog/subscription","commits_url":"https://api.github.com/repos/natxo-kodify/blog/commits{/sha}","git_commits_url":"https://api.github.com/repos/natxo-kodify/blog/git/commits{/sha}","comments_url":"https://api.github.com/repos/natxo-kodify/blog/comments{/number}","issue_comment_url":"https://api.github.com/repos/natxo-kodify/blog/issues/comments{/number}","contents_url":"https://api.github.com/repos/natxo-kodify/blog/contents/{+path}","compare_url":"https://api.github.com/repos/natxo-kodify/blog/compare/{base}...{head}","merges_url":"https://api.github.com/repos/natxo-kodify/blog/merges","archive_url":"https://api.github.com/repos/natxo-kodify/blog/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/natxo-kodify/blog/downloads","issues_url":"https://api.github.com/repos/natxo-kodify/blog/issues{/number}","pulls_url":"https://api.github.com/repos/natxo-kodify/blog/pulls{/number}","milestones_url":"https://api.github.com/repos/natxo-kodify/blog/milestones{/number}","notifications_url":"https://api.github.com/repos/natxo-kodify/blog/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/natxo-kodify/blog/labels{/name}","releases_url":"https://api.github.com/repos/natxo-kodify/blog/releases{/id}","created_at":"2014-12-16T15:35:21Z","updated_at":"2015-09-21T14:30:43Z","pushed_at":"2015-09-22T07:07:28Z","git_url":"git://github.com/natxo-kodify/blog.git","ssh_url":"git@github.com:natxo-kodify/blog.git","clone_url":"https://github.com/natxo-kodify/blog.git","svn_url":"https://github.com/natxo-kodify/blog","homepage":null,"size":662,"stargazers_count":2,"watchers_count":2,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":10,"mirror_url":null,"open_issues_count":1,"forks":10,"open_issues":1,"watchers":2,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/natxo-kodify/blog/pulls/8"},"html":{"href":"https://github.com/natxo-kodify/blog/pull/8"},"issue":{"href":"https://api.github.com/repos/natxo-kodify/blog/issues/8"},"comments":{"href":"https://api.github.com/repos/natxo-kodify/blog/issues/8/comments"},"review_comments":{"href":"https://api.github.com/repos/natxo-kodify/blog/pulls/8/comments"},"review_comment":{"href":"https://api.github.com/repos/natxo-kodify/blog/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/natxo-kodify/blog/pulls/8/commits"},"statuses":{"href":"https://api.github.com/repos/natxo-kodify/blog/statuses/47c8cd624f6be6ec319142478ff125af3f26448c"}}}}