{"action":"created","comment":{"url":"https://api.github.com/repos/framgia/fitm/pulls/comments/156833977","pull_request_review_id":83371699,"id":156833977,"diff_hunk":"@@ -0,0 +1,124 @@\n+package com.framgia.fitm.util;\n+\n+import javax.servlet.jsp.JspException;\n+import javax.servlet.jsp.JspWriter;\n+import javax.servlet.jsp.tagext.SimpleTagSupport;\n+import java.io.Writer;\n+\n+public class PaginationTaglib extends SimpleTagSupport {\n+\tprivate String uri;\n+\tprivate int offset;\n+\tprivate int count;\n+\tprivate int max = 5;\n+\tprivate int steps = 5;\n+\tprivate String previous = \"Previous\";\n+\tprivate String next = \"Next\";\n+\n+\tprivate Writer getWriter() {\n+\t\tJspWriter out = getJspContext().getOut();\n+\t\treturn out;\n+\t}\n+\n+\t@Override\n+\tpublic void doTag() throws JspException {\n+\t\tWriter out = getWriter();\n+\n+\t\ttry {\n+\t\t\tout.write(\"<nav>\");\n+\t\t\tout.write(\"<ul class=\\\"pagination\\\">\");\n+\n+\t\t\tif (offset < steps)\n+\t\t\t\tout.write(constructLink(1, previous, \"disabled\", true));\n+\t\t\telse\n+\t\t\t\tout.write(constructLink(offset - steps, previous, null, false));\n+\n+\t\t\tfor (int itr = 0; itr < count; itr += steps) {\n+\t\t\t\tif (offset == itr)\n+\t\t\t\t\tout.write(constructLink((itr / 5 + 1) - 1 * steps, String.valueOf(itr / 5 + 1), \"active\", true));\n+\t\t\t\telse\n+\t\t\t\t\tout.write(constructLink(itr / 5 * steps, String.valueOf(itr / 5 + 1), null, false));\n+\t\t\t}\n+\n+\t\t\tif (offset + steps >= count)\n+\t\t\t\tout.write(constructLink(offset + steps, next, \"disabled\", true));\n+\t\t\telse\n+\t\t\t\tout.write(constructLink(offset + steps, next, null, false));\n+\n+\t\t\tout.write(\"</ul>\");\n+\t\t\tout.write(\"</nav>\");\n+\t\t} catch (java.io.IOException ex) {\n+\t\t\tthrow new JspException(\"Error in Paginator tag\", ex);\n+\t\t}\n+\t}\n+\n+\tprivate String constructLink(int page, String text, String className, boolean disabled) {\n+\t\tStringBuilder link = new StringBuilder(\"<li\");\n+\t\tif (className != null) {\n+\t\t\tlink.append(\" class=\\\"\");\n+\t\t\tlink.append(className);\n+\t\t\tlink.append(\"\\\"\");\n+\t\t}\n+\t\tif (disabled)\n+\t\t\tlink.append(\">\").append(\"<a href=\\\"#\\\">\" + text + \"</a></li>\");\n+\t\telse\n+\t\t\tlink.append(\">\").append(\"<a href=\\\"\" + uri + \"?offset=\" + page + \"\\\">\" + text + \"</a></li>\");\n+\t\treturn link.toString();","path":"src/main/java/com/framgia/fitm/util/PaginationTaglib.java","position":65,"original_position":65,"commit_id":"af74805855b4d4330d98d1dca31226778ad19cb9","original_commit_id":"af74805855b4d4330d98d1dca31226778ad19cb9","user":{"login":"VuThiTranVan","id":27009821,"avatar_url":"https://avatars3.githubusercontent.com/u/27009821?v=4","gravatar_id":"","url":"https://api.github.com/users/VuThiTranVan","html_url":"https://github.com/VuThiTranVan","followers_url":"https://api.github.com/users/VuThiTranVan/followers","following_url":"https://api.github.com/users/VuThiTranVan/following{/other_user}","gists_url":"https://api.github.com/users/VuThiTranVan/gists{/gist_id}","starred_url":"https://api.github.com/users/VuThiTranVan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/VuThiTranVan/subscriptions","organizations_url":"https://api.github.com/users/VuThiTranVan/orgs","repos_url":"https://api.github.com/users/VuThiTranVan/repos","events_url":"https://api.github.com/users/VuThiTranVan/events{/privacy}","received_events_url":"https://api.github.com/users/VuThiTranVan/received_events","type":"User","site_admin":false},"body":"I think that you shouldn't code HTML in Java file. I think it must coding in JSP.","created_at":"2017-12-14T01:36:36Z","updated_at":"2017-12-14T01:39:00Z","html_url":"https://github.com/framgia/fitm/pull/3#discussion_r156833977","pull_request_url":"https://api.github.com/repos/framgia/fitm/pulls/3","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/framgia/fitm/pulls/comments/156833977"},"html":{"href":"https://github.com/framgia/fitm/pull/3#discussion_r156833977"},"pull_request":{"href":"https://api.github.com/repos/framgia/fitm/pulls/3"}}},"pull_request":{"url":"https://api.github.com/repos/framgia/fitm/pulls/3","id":156195846,"html_url":"https://github.com/framgia/fitm/pull/3","diff_url":"https://github.com/framgia/fitm/pull/3.diff","patch_url":"https://github.com/framgia/fitm/pull/3.patch","issue_url":"https://api.github.com/repos/framgia/fitm/issues/3","number":3,"state":"open","locked":false,"title":"refs Task #148339 [admin] crud course","user":{"login":"tashdidjonayed","id":23231185,"avatar_url":"https://avatars1.githubusercontent.com/u/23231185?v=4","gravatar_id":"","url":"https://api.github.com/users/tashdidjonayed","html_url":"https://github.com/tashdidjonayed","followers_url":"https://api.github.com/users/tashdidjonayed/followers","following_url":"https://api.github.com/users/tashdidjonayed/following{/other_user}","gists_url":"https://api.github.com/users/tashdidjonayed/gists{/gist_id}","starred_url":"https://api.github.com/users/tashdidjonayed/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tashdidjonayed/subscriptions","organizations_url":"https://api.github.com/users/tashdidjonayed/orgs","repos_url":"https://api.github.com/users/tashdidjonayed/repos","events_url":"https://api.github.com/users/tashdidjonayed/events{/privacy}","received_events_url":"https://api.github.com/users/tashdidjonayed/received_events","type":"User","site_admin":false},"body":"","created_at":"2017-12-04T13:24:41Z","updated_at":"2017-12-14T01:39:00Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e267a6b2f02710c3ca3d79140c3be095a328ecef","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/framgia/fitm/pulls/3/commits","review_comments_url":"https://api.github.com/repos/framgia/fitm/pulls/3/comments","review_comment_url":"https://api.github.com/repos/framgia/fitm/pulls/comments{/number}","comments_url":"https://api.github.com/repos/framgia/fitm/issues/3/comments","statuses_url":"https://api.github.com/repos/framgia/fitm/statuses/af74805855b4d4330d98d1dca31226778ad19cb9","head":{"label":"tashdidjonayed:task/148339","ref":"task/148339","sha":"af74805855b4d4330d98d1dca31226778ad19cb9","user":{"login":"tashdidjonayed","id":23231185,"avatar_url":"https://avatars1.githubusercontent.com/u/23231185?v=4","gravatar_id":"","url":"https://api.github.com/users/tashdidjonayed","html_url":"https://github.com/tashdidjonayed","followers_url":"https://api.github.com/users/tashdidjonayed/followers","following_url":"https://api.github.com/users/tashdidjonayed/following{/other_user}","gists_url":"https://api.github.com/users/tashdidjonayed/gists{/gist_id}","starred_url":"https://api.github.com/users/tashdidjonayed/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tashdidjonayed/subscriptions","organizations_url":"https://api.github.com/users/tashdidjonayed/orgs","repos_url":"https://api.github.com/users/tashdidjonayed/repos","events_url":"https://api.github.com/users/tashdidjonayed/events{/privacy}","received_events_url":"https://api.github.com/users/tashdidjonayed/received_events","type":"User","site_admin":false},"repo":{"id":112313057,"name":"fitm","full_name":"tashdidjonayed/fitm","owner":{"login":"tashdidjonayed","id":23231185,"avatar_url":"https://avatars1.githubusercontent.com/u/23231185?v=4","gravatar_id":"","url":"https://api.github.com/users/tashdidjonayed","html_url":"https://github.com/tashdidjonayed","followers_url":"https://api.github.com/users/tashdidjonayed/followers","following_url":"https://api.github.com/users/tashdidjonayed/following{/other_user}","gists_url":"https://api.github.com/users/tashdidjonayed/gists{/gist_id}","starred_url":"https://api.github.com/users/tashdidjonayed/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tashdidjonayed/subscriptions","organizations_url":"https://api.github.com/users/tashdidjonayed/orgs","repos_url":"https://api.github.com/users/tashdidjonayed/repos","events_url":"https://api.github.com/users/tashdidjonayed/events{/privacy}","received_events_url":"https://api.github.com/users/tashdidjonayed/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/tashdidjonayed/fitm","description":"Framgia Internal Training Management","fork":true,"url":"https://api.github.com/repos/tashdidjonayed/fitm","forks_url":"https://api.github.com/repos/tashdidjonayed/fitm/forks","keys_url":"https://api.github.com/repos/tashdidjonayed/fitm/keys{/key_id}","collaborators_url":"https://api.github.com/repos/tashdidjonayed/fitm/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/tashdidjonayed/fitm/teams","hooks_url":"https://api.github.com/repos/tashdidjonayed/fitm/hooks","issue_events_url":"https://api.github.com/repos/tashdidjonayed/fitm/issues/events{/number}","events_url":"https://api.github.com/repos/tashdidjonayed/fitm/events","assignees_url":"https://api.github.com/repos/tashdidjonayed/fitm/assignees{/user}","branches_url":"https://api.github.com/repos/tashdidjonayed/fitm/branches{/branch}","tags_url":"https://api.github.com/repos/tashdidjonayed/fitm/tags","blobs_url":"https://api.github.com/repos/tashdidjonayed/fitm/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/tashdidjonayed/fitm/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/tashdidjonayed/fitm/git/refs{/sha}","trees_url":"https://api.github.com/repos/tashdidjonayed/fitm/git/trees{/sha}","statuses_url":"https://api.github.com/repos/tashdidjonayed/fitm/statuses/{sha}","languages_url":"https://api.github.com/repos/tashdidjonayed/fitm/languages","stargazers_url":"https://api.github.com/repos/tashdidjonayed/fitm/stargazers","contributors_url":"https://api.github.com/repos/tashdidjonayed/fitm/contributors","subscribers_url":"https://api.github.com/repos/tashdidjonayed/fitm/subscribers","subscription_url":"https://api.github.com/repos/tashdidjonayed/fitm/subscription","commits_url":"https://api.github.com/repos/tashdidjonayed/fitm/commits{/sha}","git_commits_url":"https://api.github.com/repos/tashdidjonayed/fitm/git/commits{/sha}","comments_url":"https://api.github.com/repos/tashdidjonayed/fitm/comments{/number}","issue_comment_url":"https://api.github.com/repos/tashdidjonayed/fitm/issues/comments{/number}","contents_url":"https://api.github.com/repos/tashdidjonayed/fitm/contents/{+path}","compare_url":"https://api.github.com/repos/tashdidjonayed/fitm/compare/{base}...{head}","merges_url":"https://api.github.com/repos/tashdidjonayed/fitm/merges","archive_url":"https://api.github.com/repos/tashdidjonayed/fitm/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/tashdidjonayed/fitm/downloads","issues_url":"https://api.github.com/repos/tashdidjonayed/fitm/issues{/number}","pulls_url":"https://api.github.com/repos/tashdidjonayed/fitm/pulls{/number}","milestones_url":"https://api.github.com/repos/tashdidjonayed/fitm/milestones{/number}","notifications_url":"https://api.github.com/repos/tashdidjonayed/fitm/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/tashdidjonayed/fitm/labels{/name}","releases_url":"https://api.github.com/repos/tashdidjonayed/fitm/releases{/id}","deployments_url":"https://api.github.com/repos/tashdidjonayed/fitm/deployments","created_at":"2017-11-28T09:15:51Z","updated_at":"2017-11-22T09:38:29Z","pushed_at":"2017-12-13T19:49:57Z","git_url":"git://github.com/tashdidjonayed/fitm.git","ssh_url":"git@github.com:tashdidjonayed/fitm.git","clone_url":"https://github.com/tashdidjonayed/fitm.git","svn_url":"https://github.com/tashdidjonayed/fitm","homepage":null,"size":299,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":null,"forks":0,"open_issues":0,"watchers":0,"default_branch":"develop"}},"base":{"label":"framgia:develop","ref":"develop","sha":"beab25e9ad0e04035d99c42746546aab0a14c82a","user":{"login":"framgia","id":2322183,"avatar_url":"https://avatars3.githubusercontent.com/u/2322183?v=4","gravatar_id":"","url":"https://api.github.com/users/framgia","html_url":"https://github.com/framgia","followers_url":"https://api.github.com/users/framgia/followers","following_url":"https://api.github.com/users/framgia/following{/other_user}","gists_url":"https://api.github.com/users/framgia/gists{/gist_id}","starred_url":"https://api.github.com/users/framgia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/framgia/subscriptions","organizations_url":"https://api.github.com/users/framgia/orgs","repos_url":"https://api.github.com/users/framgia/repos","events_url":"https://api.github.com/users/framgia/events{/privacy}","received_events_url":"https://api.github.com/users/framgia/received_events","type":"Organization","site_admin":false},"repo":{"id":111664497,"name":"fitm","full_name":"framgia/fitm","owner":{"login":"framgia","id":2322183,"avatar_url":"https://avatars3.githubusercontent.com/u/2322183?v=4","gravatar_id":"","url":"https://api.github.com/users/framgia","html_url":"https://github.com/framgia","followers_url":"https://api.github.com/users/framgia/followers","following_url":"https://api.github.com/users/framgia/following{/other_user}","gists_url":"https://api.github.com/users/framgia/gists{/gist_id}","starred_url":"https://api.github.com/users/framgia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/framgia/subscriptions","organizations_url":"https://api.github.com/users/framgia/orgs","repos_url":"https://api.github.com/users/framgia/repos","events_url":"https://api.github.com/users/framgia/events{/privacy}","received_events_url":"https://api.github.com/users/framgia/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/framgia/fitm","description":"Framgia Internal Training Management","fork":false,"url":"https://api.github.com/repos/framgia/fitm","forks_url":"https://api.github.com/repos/framgia/fitm/forks","keys_url":"https://api.github.com/repos/framgia/fitm/keys{/key_id}","collaborators_url":"https://api.github.com/repos/framgia/fitm/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/framgia/fitm/teams","hooks_url":"https://api.github.com/repos/framgia/fitm/hooks","issue_events_url":"https://api.github.com/repos/framgia/fitm/issues/events{/number}","events_url":"https://api.github.com/repos/framgia/fitm/events","assignees_url":"https://api.github.com/repos/framgia/fitm/assignees{/user}","branches_url":"https://api.github.com/repos/framgia/fitm/branches{/branch}","tags_url":"https://api.github.com/repos/framgia/fitm/tags","blobs_url":"https://api.github.com/repos/framgia/fitm/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/framgia/fitm/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/framgia/fitm/git/refs{/sha}","trees_url":"https://api.github.com/repos/framgia/fitm/git/trees{/sha}","statuses_url":"https://api.github.com/repos/framgia/fitm/statuses/{sha}","languages_url":"https://api.github.com/repos/framgia/fitm/languages","stargazers_url":"https://api.github.com/repos/framgia/fitm/stargazers","contributors_url":"https://api.github.com/repos/framgia/fitm/contributors","subscribers_url":"https://api.github.com/repos/framgia/fitm/subscribers","subscription_url":"https://api.github.com/repos/framgia/fitm/subscription","commits_url":"https://api.github.com/repos/framgia/fitm/commits{/sha}","git_commits_url":"https://api.github.com/repos/framgia/fitm/git/commits{/sha}","comments_url":"https://api.github.com/repos/framgia/fitm/comments{/number}","issue_comment_url":"https://api.github.com/repos/framgia/fitm/issues/comments{/number}","contents_url":"https://api.github.com/repos/framgia/fitm/contents/{+path}","compare_url":"https://api.github.com/repos/framgia/fitm/compare/{base}...{head}","merges_url":"https://api.github.com/repos/framgia/fitm/merges","archive_url":"https://api.github.com/repos/framgia/fitm/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/framgia/fitm/downloads","issues_url":"https://api.github.com/repos/framgia/fitm/issues{/number}","pulls_url":"https://api.github.com/repos/framgia/fitm/pulls{/number}","milestones_url":"https://api.github.com/repos/framgia/fitm/milestones{/number}","notifications_url":"https://api.github.com/repos/framgia/fitm/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/framgia/fitm/labels{/name}","releases_url":"https://api.github.com/repos/framgia/fitm/releases{/id}","deployments_url":"https://api.github.com/repos/framgia/fitm/deployments","created_at":"2017-11-22T09:38:29Z","updated_at":"2017-12-11T08:23:29Z","pushed_at":"2017-12-13T19:49:58Z","git_url":"git://github.com/framgia/fitm.git","ssh_url":"git@github.com:framgia/fitm.git","clone_url":"https://github.com/framgia/fitm.git","svn_url":"https://github.com/framgia/fitm","homepage":null,"size":184,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"archived":false,"open_issues_count":1,"license":null,"forks":1,"open_issues":1,"watchers":0,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/framgia/fitm/pulls/3"},"html":{"href":"https://github.com/framgia/fitm/pull/3"},"issue":{"href":"https://api.github.com/repos/framgia/fitm/issues/3"},"comments":{"href":"https://api.github.com/repos/framgia/fitm/issues/3/comments"},"review_comments":{"href":"https://api.github.com/repos/framgia/fitm/pulls/3/comments"},"review_comment":{"href":"https://api.github.com/repos/framgia/fitm/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/framgia/fitm/pulls/3/commits"},"statuses":{"href":"https://api.github.com/repos/framgia/fitm/statuses/af74805855b4d4330d98d1dca31226778ad19cb9"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"VuThiTranVan"}}