@@ -124,12 +124,12 @@ - (void)tweetsBtnClicked{
124124
125125#pragma mark Table M
126126- (NSInteger )numberOfSectionsInTableView : (UITableView *)tableView {
127- return 3 ;
127+ return 4 ;
128128}
129129
130130// header
131131- (CGFloat)tableView : (UITableView *)tableView heightForHeaderInSection : (NSInteger )section {
132- return section == 0 ? kLine_MinHeight : section == 1 ? 15.0 : _myProject.is_public .boolValue ? 15.0 : 50.0 ;
132+ return section == 0 ? kLine_MinHeight : ( section == 2 && ! _myProject.is_public .boolValue )? 50 : 15 ;
133133}
134134
135135- (UIView *)tableView : (UITableView *)tableView viewForHeaderInSection : (NSInteger )section {
@@ -160,7 +160,7 @@ - (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger
160160}
161161
162162- (CGFloat)tableView : (UITableView *)tableView heightForFooterInSection : (NSInteger )section {
163- return section == 2 ? 15 : kLine_MinHeight ;
163+ return section == 3 ? 44 : kLine_MinHeight ;
164164}
165165
166166// data
@@ -171,7 +171,9 @@ - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger
171171 }else if (section == 1 ){
172172 row = _myProject.is_public .boolValue ? _myProject.current_user_role_id .integerValue <= 70 ? 3 : 4 : 6 ;
173173 }else if (section == 2 ){
174- row = _myProject.is_public .boolValue ? 3 : 5 ;
174+ row = _myProject.is_public .boolValue ? 2 : 4 ;
175+ }else {
176+ row = 1 ;
175177 }
176178 return row;
177179}
@@ -236,8 +238,6 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N
236238 [cell setImageStr: @" project_item_readme" andTitle: @" README" ];
237239 }else if (indexPath.row == 1 ){
238240 [cell setImageStr: @" project_item_mr_pr" andTitle: @" Pull Request" ];
239- }else {
240- [cell setImageStr: @" project_item_code" andTitle: @" 本地阅读" ];
241241 }
242242 }else {
243243 if (indexPath.row == 0 ) {
@@ -248,10 +248,10 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N
248248 [cell setImageStr: @" project_item_tag" andTitle: @" 发布管理" ];
249249 }else if (indexPath.row == 3 ){
250250 [cell setImageStr: @" project_item_mr_pr" andTitle: @" 合并请求" ];
251- }else {
252- [cell setImageStr: @" project_item_code" andTitle: @" 本地阅读" ];
253251 }
254252 }
253+ }else if (indexPath.section == 3 ){
254+ [cell setImageStr: @" project_item_code" andTitle: @" 本地阅读" ];
255255 }
256256 FunctionTipsManager *ftm = [FunctionTipsManager shareManager ];
257257 NSString *tipStr = [self p_TipStrForIndexPath: indexPath];
@@ -301,8 +301,6 @@ - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath
301301 [self goToReadme ];
302302 }else if (indexPath.row == 1 ){
303303 [self goTo_MR_PR ];
304- }else {
305- [self goToLocalRepo ];
306304 }
307305 }else {
308306 if (indexPath.row == 0 ) {
@@ -317,10 +315,10 @@ - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath
317315 [self .navigationController pushViewController: vc animated: YES ];
318316 }else if (indexPath.row == 3 ){
319317 [self goTo_MR_PR ];
320- }else {
321- [self goToLocalRepo ];
322318 }
323319 }
320+ }else if (indexPath.section == 3 ){
321+ [self goToLocalRepo ];
324322 }
325323 FunctionTipsManager *ftm = [FunctionTipsManager shareManager ];
326324 NSString *tipStr = [self p_TipStrForIndexPath: indexPath];
0 commit comments