{"action":"created","comment":{"url":"https://api.github.com/repos/framgia/fels_137/pulls/comments/66899609","id":66899609,"diff_hunk":"@@ -7,18 +7,270 @@\n //\n \n #import \"WordsListViewController.h\"\n+#import \"WordItem.h\"\n+#import \"DBUtil.h\"\n+#import \"CategoriesViewController.h\"\n+#import \"WordListManager.h\"\n+//#import \"CategoryManager.h\"\n+#import \"WordListTableViewCell.h\"\n+#import \"LoadingView.h\"\n \n-@interface WordsListViewController ()\n+NSString *const USER_TOKEN = @\"-Kx03yy94NhYc81Shz63_g\"; //TODO:\n+NSString *const TITLE_REMINDER = @\"Reminder\";\n+NSString *const TITLE_FILTER = @\"Filter\";\n+NSString *const CANCEL_ACTION = @\"Cancel\";\n+NSString *const QUIT_ACTION = @\"Quit\";\n+NSString *const RELOAD_ACTION = @\"Reload\";\n+NSString *const MESSAGE_REMINDER_CHECK_INTERNET = @\"Check internet network,please\";\n+NSString *const MESSAGE_FITLER = @\"Select type filter\";\n+NSString *const ALL_ACTION = @\"All\";\n+NSString *const NOT_LEARN_ACTION = @\"Not learn\";\n+NSString *const LEARNED_ACTION = @\"Learned\";\n+\n+@interface WordsListViewController ()<NSURLConnectionDataDelegate,UITableViewDataSource,UITableViewDelegate,NSURLConnectionDelegate,WordListManagerDelegate>\n+// TODO: CategoryManagerDelegate\n+\n+@property (weak, nonatomic) IBOutlet UITableView *tableView;\n+@property (strong, nonatomic) NSMutableArray *wordsList;\n+@property (strong, nonatomic) NSMutableArray *arrCategories;\n+@property (weak, nonatomic) IBOutlet UIButton *btnAll1;\n+@property (weak, nonatomic) IBOutlet UIButton *btnAll2;\n+@property (strong, nonatomic) LoadingView *loadingView;\n \n @end\n \n @implementation WordsListViewController\n \n+{\n+    NSString *_categoryID;\n+    NSString *option;\n+    NSInteger totalPage;\n+    NSInteger currentPage;\n+}\n+\n+NSString *const NAME_WORDLIST_TABLEVIEWCELL = @\"WordListTableViewCell\";\n+NSInteger const PER_PAGE_DATA = 10;\n+\n - (void)viewDidLoad {\n     [super viewDidLoad];\n-    // Do any additional setup after loading the view.\n-    \n+    self.tableView.delegate = self;\n+    self.tableView.dataSource = self;\n+    currentPage = 1;\n+    self.wordsList = [[NSMutableArray alloc] init];\n+}\n+- (void)viewWillAppear: (BOOL)animated {\n+    [super viewWillAppear:animated];\n     self.title = @\"Words List\";\n+    [self setupLoadingView];\n+    option = @\"all_word\";\n+    self.wordsList = [[NSMutableArray alloc] init];\n+    [self getWordListWithCategoryId:_categoryID\n+                               page:currentPage\n+                             option:option];\n+    [self getCategoriesListWithAuthToken:USER_TOKEN\n+                                    page:currentPage\n+                             perPageData:PER_PAGE_DATA];\n+}\n+\n+#pragma mark - LoadingView\n+\n+- (void)setupLoadingView {\n+    self.loadingView = [[LoadingView alloc] initWithFrame:[UIScreen mainScreen].bounds];\n+    [self.view addSubview:self.loadingView];\n+}\n+- (void)animateDismissLoadingView {\n+    [UIView animateWithDuration:0.25f animations:^{\n+        self.loadingView.alpha = 0.0f;\n+    } completion:^(BOOL finished) {\n+        [self.loadingView removeFromSuperview];\n+    }];\n+}\n+\n+#pragma mark - CategoryManagerDelegate\n+\n+- (void)getCategoriesListWithAuthToken:(NSString *)authoToken\n+                                  page:(NSInteger)page\n+                           perPageData:(NSInteger)perPageData {\n+// TODO:\n+//    CategoryManager *catManager = [CategoryManager new];\n+//    catManager.delegate = self;\n+//    [catManager doGetCategoryWithAuthToken:authoToken\n+//                                      page:page\n+//                               perPageData:perPageData];\n+}\n+- (void)didReceiveCategoriesWithArray:(NSMutableArray *)arrCategories\n+                            withError:(NSError *)error {\n+    if (error) {\n+        [self turnOnAlertWhenDisconneted];\n+    } else {\n+        [self animateDismissLoadingView];\n+        self.arrCategories = arrCategories;\n+    }\n+}\n+\n+#pragma mark - WorldListManageDelegate\n+\n+- (void)getWordListWithCategoryId:(NSString *)categoriesID\n+                             page:(NSInteger)pageCurrents\n+                           option:(NSString *)optionWords {\n+    WordListManager *wlManager = [[WordListManager alloc] init];\n+    wlManager.delegate = self;\n+    [wlManager getWordListWithCategoryId:categoriesID\n+                                    option:optionWords\n+                                      page:pageCurrents\n+                               perPageData:PER_PAGE_DATA\n+                                 authToken:USER_TOKEN];\n+}\n+- (void)didReceiveWordListWithArray:(NSMutableArray *)arrWords\n+                          withError:(NSError *)error {\n+    if (!error) {\n+        [self animateDismissLoadingView];\n+        NSMutableArray *arr = arrWords[0];\n+        \n+        for (NSDictionary *item in arr) {\n+            WordItem *word = [DBUtil dbItemToWordItem:item ];","path":"Elearning/Elearning/ViewControllers/WordsListViewController/WordsListViewController.m","position":128,"original_position":128,"commit_id":"4bd5db5bab2daa350d70327711b9b913be2a9cb8","original_commit_id":"4bd5db5bab2daa350d70327711b9b913be2a9cb8","user":{"login":"quocnb","id":4478445,"avatar_url":"https://avatars.githubusercontent.com/u/4478445?v=3","gravatar_id":"","url":"https://api.github.com/users/quocnb","html_url":"https://github.com/quocnb","followers_url":"https://api.github.com/users/quocnb/followers","following_url":"https://api.github.com/users/quocnb/following{/other_user}","gists_url":"https://api.github.com/users/quocnb/gists{/gist_id}","starred_url":"https://api.github.com/users/quocnb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/quocnb/subscriptions","organizations_url":"https://api.github.com/users/quocnb/orgs","repos_url":"https://api.github.com/users/quocnb/repos","events_url":"https://api.github.com/users/quocnb/events{/privacy}","received_events_url":"https://api.github.com/users/quocnb/received_events","type":"User","site_admin":false},"body":"convention","created_at":"2016-06-14T02:08:58Z","updated_at":"2016-06-14T02:08:58Z","html_url":"https://github.com/framgia/fels_137/pull/22#discussion_r66899609","pull_request_url":"https://api.github.com/repos/framgia/fels_137/pulls/22","_links":{"self":{"href":"https://api.github.com/repos/framgia/fels_137/pulls/comments/66899609"},"html":{"href":"https://github.com/framgia/fels_137/pull/22#discussion_r66899609"},"pull_request":{"href":"https://api.github.com/repos/framgia/fels_137/pulls/22"}}},"pull_request":{"url":"https://api.github.com/repos/framgia/fels_137/pulls/22","id":73023645,"html_url":"https://github.com/framgia/fels_137/pull/22","diff_url":"https://github.com/framgia/fels_137/pull/22.diff","patch_url":"https://github.com/framgia/fels_137/pull/22.patch","issue_url":"https://api.github.com/repos/framgia/fels_137/issues/22","number":22,"state":"open","locked":false,"title":"Code word list","user":{"login":"vantientu1703","id":13485031,"avatar_url":"https://avatars.githubusercontent.com/u/13485031?v=3","gravatar_id":"","url":"https://api.github.com/users/vantientu1703","html_url":"https://github.com/vantientu1703","followers_url":"https://api.github.com/users/vantientu1703/followers","following_url":"https://api.github.com/users/vantientu1703/following{/other_user}","gists_url":"https://api.github.com/users/vantientu1703/gists{/gist_id}","starred_url":"https://api.github.com/users/vantientu1703/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vantientu1703/subscriptions","organizations_url":"https://api.github.com/users/vantientu1703/orgs","repos_url":"https://api.github.com/users/vantientu1703/repos","events_url":"https://api.github.com/users/vantientu1703/events{/privacy}","received_events_url":"https://api.github.com/users/vantientu1703/received_events","type":"User","site_admin":false},"body":"Code màn hình word list","created_at":"2016-06-08T10:39:06Z","updated_at":"2016-06-14T02:08:58Z","closed_at":null,"merged_at":null,"merge_commit_sha":"90367448a36bb400b977b9a0d036017d7bac9240","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/framgia/fels_137/pulls/22/commits","review_comments_url":"https://api.github.com/repos/framgia/fels_137/pulls/22/comments","review_comment_url":"https://api.github.com/repos/framgia/fels_137/pulls/comments{/number}","comments_url":"https://api.github.com/repos/framgia/fels_137/issues/22/comments","statuses_url":"https://api.github.com/repos/framgia/fels_137/statuses/4bd5db5bab2daa350d70327711b9b913be2a9cb8","head":{"label":"vantientu1703:64666-word-list","ref":"64666-word-list","sha":"4bd5db5bab2daa350d70327711b9b913be2a9cb8","user":{"login":"vantientu1703","id":13485031,"avatar_url":"https://avatars.githubusercontent.com/u/13485031?v=3","gravatar_id":"","url":"https://api.github.com/users/vantientu1703","html_url":"https://github.com/vantientu1703","followers_url":"https://api.github.com/users/vantientu1703/followers","following_url":"https://api.github.com/users/vantientu1703/following{/other_user}","gists_url":"https://api.github.com/users/vantientu1703/gists{/gist_id}","starred_url":"https://api.github.com/users/vantientu1703/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vantientu1703/subscriptions","organizations_url":"https://api.github.com/users/vantientu1703/orgs","repos_url":"https://api.github.com/users/vantientu1703/repos","events_url":"https://api.github.com/users/vantientu1703/events{/privacy}","received_events_url":"https://api.github.com/users/vantientu1703/received_events","type":"User","site_admin":false},"repo":{"id":59182394,"name":"fels_137","full_name":"vantientu1703/fels_137","owner":{"login":"vantientu1703","id":13485031,"avatar_url":"https://avatars.githubusercontent.com/u/13485031?v=3","gravatar_id":"","url":"https://api.github.com/users/vantientu1703","html_url":"https://github.com/vantientu1703","followers_url":"https://api.github.com/users/vantientu1703/followers","following_url":"https://api.github.com/users/vantientu1703/following{/other_user}","gists_url":"https://api.github.com/users/vantientu1703/gists{/gist_id}","starred_url":"https://api.github.com/users/vantientu1703/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vantientu1703/subscriptions","organizations_url":"https://api.github.com/users/vantientu1703/orgs","repos_url":"https://api.github.com/users/vantientu1703/repos","events_url":"https://api.github.com/users/vantientu1703/events{/privacy}","received_events_url":"https://api.github.com/users/vantientu1703/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/vantientu1703/fels_137","description":"Framgia E-Learning System (training)","fork":true,"url":"https://api.github.com/repos/vantientu1703/fels_137","forks_url":"https://api.github.com/repos/vantientu1703/fels_137/forks","keys_url":"https://api.github.com/repos/vantientu1703/fels_137/keys{/key_id}","collaborators_url":"https://api.github.com/repos/vantientu1703/fels_137/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/vantientu1703/fels_137/teams","hooks_url":"https://api.github.com/repos/vantientu1703/fels_137/hooks","issue_events_url":"https://api.github.com/repos/vantientu1703/fels_137/issues/events{/number}","events_url":"https://api.github.com/repos/vantientu1703/fels_137/events","assignees_url":"https://api.github.com/repos/vantientu1703/fels_137/assignees{/user}","branches_url":"https://api.github.com/repos/vantientu1703/fels_137/branches{/branch}","tags_url":"https://api.github.com/repos/vantientu1703/fels_137/tags","blobs_url":"https://api.github.com/repos/vantientu1703/fels_137/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/vantientu1703/fels_137/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/vantientu1703/fels_137/git/refs{/sha}","trees_url":"https://api.github.com/repos/vantientu1703/fels_137/git/trees{/sha}","statuses_url":"https://api.github.com/repos/vantientu1703/fels_137/statuses/{sha}","languages_url":"https://api.github.com/repos/vantientu1703/fels_137/languages","stargazers_url":"https://api.github.com/repos/vantientu1703/fels_137/stargazers","contributors_url":"https://api.github.com/repos/vantientu1703/fels_137/contributors","subscribers_url":"https://api.github.com/repos/vantientu1703/fels_137/subscribers","subscription_url":"https://api.github.com/repos/vantientu1703/fels_137/subscription","commits_url":"https://api.github.com/repos/vantientu1703/fels_137/commits{/sha}","git_commits_url":"https://api.github.com/repos/vantientu1703/fels_137/git/commits{/sha}","comments_url":"https://api.github.com/repos/vantientu1703/fels_137/comments{/number}","issue_comment_url":"https://api.github.com/repos/vantientu1703/fels_137/issues/comments{/number}","contents_url":"https://api.github.com/repos/vantientu1703/fels_137/contents/{+path}","compare_url":"https://api.github.com/repos/vantientu1703/fels_137/compare/{base}...{head}","merges_url":"https://api.github.com/repos/vantientu1703/fels_137/merges","archive_url":"https://api.github.com/repos/vantientu1703/fels_137/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/vantientu1703/fels_137/downloads","issues_url":"https://api.github.com/repos/vantientu1703/fels_137/issues{/number}","pulls_url":"https://api.github.com/repos/vantientu1703/fels_137/pulls{/number}","milestones_url":"https://api.github.com/repos/vantientu1703/fels_137/milestones{/number}","notifications_url":"https://api.github.com/repos/vantientu1703/fels_137/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/vantientu1703/fels_137/labels{/name}","releases_url":"https://api.github.com/repos/vantientu1703/fels_137/releases{/id}","deployments_url":"https://api.github.com/repos/vantientu1703/fels_137/deployments","created_at":"2016-05-19T07:06:25Z","updated_at":"2016-05-18T07:44:05Z","pushed_at":"2016-06-14T01:43:23Z","git_url":"git://github.com/vantientu1703/fels_137.git","ssh_url":"git@github.com:vantientu1703/fels_137.git","clone_url":"https://github.com/vantientu1703/fels_137.git","svn_url":"https://github.com/vantientu1703/fels_137","homepage":null,"size":240,"stargazers_count":0,"watchers_count":0,"language":null,"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":"framgia:develop","ref":"develop","sha":"c15cc7b3569a616be52363bee41e15072a2807bb","user":{"login":"framgia","id":2322183,"avatar_url":"https://avatars.githubusercontent.com/u/2322183?v=3","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":59093360,"name":"fels_137","full_name":"framgia/fels_137","owner":{"login":"framgia","id":2322183,"avatar_url":"https://avatars.githubusercontent.com/u/2322183?v=3","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/fels_137","description":"Framgia E-Learning System (training)","fork":false,"url":"https://api.github.com/repos/framgia/fels_137","forks_url":"https://api.github.com/repos/framgia/fels_137/forks","keys_url":"https://api.github.com/repos/framgia/fels_137/keys{/key_id}","collaborators_url":"https://api.github.com/repos/framgia/fels_137/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/framgia/fels_137/teams","hooks_url":"https://api.github.com/repos/framgia/fels_137/hooks","issue_events_url":"https://api.github.com/repos/framgia/fels_137/issues/events{/number}","events_url":"https://api.github.com/repos/framgia/fels_137/events","assignees_url":"https://api.github.com/repos/framgia/fels_137/assignees{/user}","branches_url":"https://api.github.com/repos/framgia/fels_137/branches{/branch}","tags_url":"https://api.github.com/repos/framgia/fels_137/tags","blobs_url":"https://api.github.com/repos/framgia/fels_137/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/framgia/fels_137/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/framgia/fels_137/git/refs{/sha}","trees_url":"https://api.github.com/repos/framgia/fels_137/git/trees{/sha}","statuses_url":"https://api.github.com/repos/framgia/fels_137/statuses/{sha}","languages_url":"https://api.github.com/repos/framgia/fels_137/languages","stargazers_url":"https://api.github.com/repos/framgia/fels_137/stargazers","contributors_url":"https://api.github.com/repos/framgia/fels_137/contributors","subscribers_url":"https://api.github.com/repos/framgia/fels_137/subscribers","subscription_url":"https://api.github.com/repos/framgia/fels_137/subscription","commits_url":"https://api.github.com/repos/framgia/fels_137/commits{/sha}","git_commits_url":"https://api.github.com/repos/framgia/fels_137/git/commits{/sha}","comments_url":"https://api.github.com/repos/framgia/fels_137/comments{/number}","issue_comment_url":"https://api.github.com/repos/framgia/fels_137/issues/comments{/number}","contents_url":"https://api.github.com/repos/framgia/fels_137/contents/{+path}","compare_url":"https://api.github.com/repos/framgia/fels_137/compare/{base}...{head}","merges_url":"https://api.github.com/repos/framgia/fels_137/merges","archive_url":"https://api.github.com/repos/framgia/fels_137/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/framgia/fels_137/downloads","issues_url":"https://api.github.com/repos/framgia/fels_137/issues{/number}","pulls_url":"https://api.github.com/repos/framgia/fels_137/pulls{/number}","milestones_url":"https://api.github.com/repos/framgia/fels_137/milestones{/number}","notifications_url":"https://api.github.com/repos/framgia/fels_137/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/framgia/fels_137/labels{/name}","releases_url":"https://api.github.com/repos/framgia/fels_137/releases{/id}","deployments_url":"https://api.github.com/repos/framgia/fels_137/deployments","created_at":"2016-05-18T07:44:05Z","updated_at":"2016-05-18T07:44:05Z","pushed_at":"2016-06-14T01:57:44Z","git_url":"git://github.com/framgia/fels_137.git","ssh_url":"git@github.com:framgia/fels_137.git","clone_url":"https://github.com/framgia/fels_137.git","svn_url":"https://github.com/framgia/fels_137","homepage":null,"size":240,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":5,"forks":2,"open_issues":5,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/framgia/fels_137/pulls/22"},"html":{"href":"https://github.com/framgia/fels_137/pull/22"},"issue":{"href":"https://api.github.com/repos/framgia/fels_137/issues/22"},"comments":{"href":"https://api.github.com/repos/framgia/fels_137/issues/22/comments"},"review_comments":{"href":"https://api.github.com/repos/framgia/fels_137/pulls/22/comments"},"review_comment":{"href":"https://api.github.com/repos/framgia/fels_137/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/framgia/fels_137/pulls/22/commits"},"statuses":{"href":"https://api.github.com/repos/framgia/fels_137/statuses/4bd5db5bab2daa350d70327711b9b913be2a9cb8"}}}}
{"actor":{"display_login":"quocnb"}}