From da265616a750774a2305d996e4a15bee476fcaaa Mon Sep 17 00:00:00 2001 From: zhijie Date: Wed, 24 Jul 2013 17:04:14 +0800 Subject: [PATCH] rewrite project detail view --- .../RedmineMobile.xcodeproj/project.pbxproj | 30 +- .../OZLIssueCreateViewController.h | 7 + .../OZLProjectDetailViewController.h | 43 -- .../OZLProjectDetailViewController.m | 80 --- .../OZLProjectDetailViewController.xib | 583 ------------------ ...oller.h => OZLProjectInfoViewController.h} | 14 +- ...oller.m => OZLProjectInfoViewController.m} | 47 +- ...> OZLProjectInfoViewController.storyboard} | 22 +- .../OZLProjectListViewController.m | 9 +- .../OZLProjectViewController.m | 8 +- 10 files changed, 80 insertions(+), 763 deletions(-) delete mode 100644 RedmineMobile/RedmineMobile/ViewControllers/OZLProjectDetailViewController.h delete mode 100644 RedmineMobile/RedmineMobile/ViewControllers/OZLProjectDetailViewController.m delete mode 100644 RedmineMobile/RedmineMobile/ViewControllers/OZLProjectDetailViewController.xib rename RedmineMobile/RedmineMobile/ViewControllers/{OZLProjectCreateViewController.h => OZLProjectInfoViewController.h} (84%) rename RedmineMobile/RedmineMobile/ViewControllers/{OZLProjectCreateViewController.m => OZLProjectInfoViewController.m} (85%) rename RedmineMobile/RedmineMobile/ViewControllers/{OZLProjectCreateViewController.storyboard => OZLProjectInfoViewController.storyboard} (92%) diff --git a/RedmineMobile/RedmineMobile.xcodeproj/project.pbxproj b/RedmineMobile/RedmineMobile.xcodeproj/project.pbxproj index dd6ade0..812e107 100644 --- a/RedmineMobile/RedmineMobile.xcodeproj/project.pbxproj +++ b/RedmineMobile/RedmineMobile.xcodeproj/project.pbxproj @@ -9,7 +9,7 @@ /* Begin PBXBuildFile section */ 2B62D0DF1796498800AC3C19 /* OZLIssueCreateViewController.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 2B62D0DE1796498800AC3C19 /* OZLIssueCreateViewController.storyboard */; }; 2B62D0E1179649A800AC3C19 /* OZLIssueDetailViewController.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 2B62D0E0179649A800AC3C19 /* OZLIssueDetailViewController.storyboard */; }; - 2B62D0E31796A15C00AC3C19 /* OZLProjectCreateViewController.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 2B62D0E21796A15C00AC3C19 /* OZLProjectCreateViewController.storyboard */; }; + 2B62D0E31796A15C00AC3C19 /* OZLProjectInfoViewController.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 2B62D0E21796A15C00AC3C19 /* OZLProjectInfoViewController.storyboard */; }; 2B62D0E81796A8D800AC3C19 /* OZLIssueFilterViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 2B62D0E71796A8D800AC3C19 /* OZLIssueFilterViewController.m */; }; 2B6F382F1797A00A00D06F51 /* MLTableAlertBackground.png in Resources */ = {isa = PBXBuildFile; fileRef = 2B6F38251797A00A00D06F51 /* MLTableAlertBackground.png */; }; 2B6F38301797A00A00D06F51 /* MLTableAlertBackground@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 2B6F38261797A00A00D06F51 /* MLTableAlertBackground@2x.png */; }; @@ -23,7 +23,7 @@ 2B6F38391797BEBA00D06F51 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2B6F38381797BEBA00D06F51 /* QuartzCore.framework */; }; 2B8A11E217963CE500906D34 /* OZLIssueDetailViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 2B8A11E117963CE500906D34 /* OZLIssueDetailViewController.m */; }; 2B9968AB1794F71B0086F115 /* OZLModelIssueCategory.m in Sources */ = {isa = PBXBuildFile; fileRef = 2B9968AA1794F71B0086F115 /* OZLModelIssueCategory.m */; }; - 2B9968AF1794FC0A0086F115 /* OZLProjectCreateViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 2B9968AD1794FC0A0086F115 /* OZLProjectCreateViewController.m */; }; + 2B9968AF1794FC0A0086F115 /* OZLProjectInfoViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 2B9968AD1794FC0A0086F115 /* OZLProjectInfoViewController.m */; }; 2B9968B417951A5C0086F115 /* OZLIssueCreateViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 2B9968B217951A5C0086F115 /* OZLIssueCreateViewController.m */; }; 2BBE440F179E500E00FD9E20 /* OZLIssueLogtimeViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 2BBE440E179E500E00FD9E20 /* OZLIssueLogtimeViewController.m */; }; 2BBE4411179E503100FD9E20 /* OZLIssueLogtimeViewController.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 2BBE4410179E503100FD9E20 /* OZLIssueLogtimeViewController.storyboard */; }; @@ -42,8 +42,6 @@ 2BCF88101793ABA0006FC859 /* Reachability.m in Sources */ = {isa = PBXBuildFile; fileRef = 2BCF880F1793ABA0006FC859 /* Reachability.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; }; 2BCF88121793CB4F006FC859 /* CFNetwork.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2BCF88111793CB4F006FC859 /* CFNetwork.framework */; }; 2BCF88141793CB94006FC859 /* SystemConfiguration.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2BCF88131793CB94006FC859 /* SystemConfiguration.framework */; }; - 2BCF88181793E353006FC859 /* OZLProjectDetailViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 2BCF88161793E353006FC859 /* OZLProjectDetailViewController.m */; }; - 2BCF88191793E353006FC859 /* OZLProjectDetailViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 2BCF88171793E353006FC859 /* OZLProjectDetailViewController.xib */; }; 2BCF881E1793F3C8006FC859 /* OZLModelIssue.m in Sources */ = {isa = PBXBuildFile; fileRef = 2BCF881D1793F3C8006FC859 /* OZLModelIssue.m */; }; 2BCF88211793F478006FC859 /* OZLModelTracker.m in Sources */ = {isa = PBXBuildFile; fileRef = 2BCF88201793F478006FC859 /* OZLModelTracker.m */; }; 2BCF88271793F4AA006FC859 /* OZLModelIssueStatus.m in Sources */ = {isa = PBXBuildFile; fileRef = 2BCF88261793F4AA006FC859 /* OZLModelIssueStatus.m */; }; @@ -96,7 +94,7 @@ /* Begin PBXFileReference section */ 2B62D0DE1796498800AC3C19 /* OZLIssueCreateViewController.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; name = OZLIssueCreateViewController.storyboard; path = ViewControllers/OZLIssueCreateViewController.storyboard; sourceTree = ""; }; 2B62D0E0179649A800AC3C19 /* OZLIssueDetailViewController.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; name = OZLIssueDetailViewController.storyboard; path = ViewControllers/OZLIssueDetailViewController.storyboard; sourceTree = ""; }; - 2B62D0E21796A15C00AC3C19 /* OZLProjectCreateViewController.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; name = OZLProjectCreateViewController.storyboard; path = ViewControllers/OZLProjectCreateViewController.storyboard; sourceTree = ""; }; + 2B62D0E21796A15C00AC3C19 /* OZLProjectInfoViewController.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; name = OZLProjectInfoViewController.storyboard; path = ViewControllers/OZLProjectInfoViewController.storyboard; sourceTree = ""; }; 2B62D0E61796A8D800AC3C19 /* OZLIssueFilterViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OZLIssueFilterViewController.h; path = ViewControllers/OZLIssueFilterViewController.h; sourceTree = ""; }; 2B62D0E71796A8D800AC3C19 /* OZLIssueFilterViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = OZLIssueFilterViewController.m; path = ViewControllers/OZLIssueFilterViewController.m; sourceTree = ""; }; 2B6F38251797A00A00D06F51 /* MLTableAlertBackground.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = MLTableAlertBackground.png; sourceTree = ""; }; @@ -114,8 +112,8 @@ 2B8A11E117963CE500906D34 /* OZLIssueDetailViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = OZLIssueDetailViewController.m; path = ViewControllers/OZLIssueDetailViewController.m; sourceTree = ""; }; 2B9968A91794F71B0086F115 /* OZLModelIssueCategory.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OZLModelIssueCategory.h; path = Models/OZLModelIssueCategory.h; sourceTree = ""; }; 2B9968AA1794F71B0086F115 /* OZLModelIssueCategory.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = OZLModelIssueCategory.m; path = Models/OZLModelIssueCategory.m; sourceTree = ""; }; - 2B9968AC1794FC0A0086F115 /* OZLProjectCreateViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OZLProjectCreateViewController.h; path = ViewControllers/OZLProjectCreateViewController.h; sourceTree = ""; }; - 2B9968AD1794FC0A0086F115 /* OZLProjectCreateViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = OZLProjectCreateViewController.m; path = ViewControllers/OZLProjectCreateViewController.m; sourceTree = ""; }; + 2B9968AC1794FC0A0086F115 /* OZLProjectInfoViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OZLProjectInfoViewController.h; path = ViewControllers/OZLProjectInfoViewController.h; sourceTree = ""; }; + 2B9968AD1794FC0A0086F115 /* OZLProjectInfoViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = OZLProjectInfoViewController.m; path = ViewControllers/OZLProjectInfoViewController.m; sourceTree = ""; }; 2B9968B117951A5C0086F115 /* OZLIssueCreateViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OZLIssueCreateViewController.h; path = ViewControllers/OZLIssueCreateViewController.h; sourceTree = ""; }; 2B9968B217951A5C0086F115 /* OZLIssueCreateViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = OZLIssueCreateViewController.m; path = ViewControllers/OZLIssueCreateViewController.m; sourceTree = ""; }; 2BBE440D179E500E00FD9E20 /* OZLIssueLogtimeViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OZLIssueLogtimeViewController.h; path = ViewControllers/OZLIssueLogtimeViewController.h; sourceTree = ""; }; @@ -146,9 +144,6 @@ 2BCF880F1793ABA0006FC859 /* Reachability.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Reachability.m; sourceTree = ""; }; 2BCF88111793CB4F006FC859 /* CFNetwork.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CFNetwork.framework; path = System/Library/Frameworks/CFNetwork.framework; sourceTree = SDKROOT; }; 2BCF88131793CB94006FC859 /* SystemConfiguration.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SystemConfiguration.framework; path = System/Library/Frameworks/SystemConfiguration.framework; sourceTree = SDKROOT; }; - 2BCF88151793E352006FC859 /* OZLProjectDetailViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OZLProjectDetailViewController.h; path = ViewControllers/OZLProjectDetailViewController.h; sourceTree = ""; }; - 2BCF88161793E353006FC859 /* OZLProjectDetailViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = OZLProjectDetailViewController.m; path = ViewControllers/OZLProjectDetailViewController.m; sourceTree = ""; }; - 2BCF88171793E353006FC859 /* OZLProjectDetailViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; name = OZLProjectDetailViewController.xib; path = ViewControllers/OZLProjectDetailViewController.xib; sourceTree = ""; }; 2BCF881C1793F3C8006FC859 /* OZLModelIssue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OZLModelIssue.h; path = Models/OZLModelIssue.h; sourceTree = ""; }; 2BCF881D1793F3C8006FC859 /* OZLModelIssue.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = OZLModelIssue.m; path = Models/OZLModelIssue.m; sourceTree = ""; }; 2BCF881F1793F478006FC859 /* OZLModelTracker.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OZLModelTracker.h; path = Models/OZLModelTracker.h; sourceTree = ""; }; @@ -321,12 +316,9 @@ D5DB80A31792F4DE0081662A /* OZLProjectListViewController.h */, D5DB80A41792F4DE0081662A /* OZLProjectListViewController.m */, D5DB80A51792F4DE0081662A /* OZLProjectListViewController.xib */, - 2BCF88151793E352006FC859 /* OZLProjectDetailViewController.h */, - 2BCF88161793E353006FC859 /* OZLProjectDetailViewController.m */, - 2BCF88171793E353006FC859 /* OZLProjectDetailViewController.xib */, - 2B9968AC1794FC0A0086F115 /* OZLProjectCreateViewController.h */, - 2B9968AD1794FC0A0086F115 /* OZLProjectCreateViewController.m */, - 2B62D0E21796A15C00AC3C19 /* OZLProjectCreateViewController.storyboard */, + 2B9968AC1794FC0A0086F115 /* OZLProjectInfoViewController.h */, + 2B9968AD1794FC0A0086F115 /* OZLProjectInfoViewController.m */, + 2B62D0E21796A15C00AC3C19 /* OZLProjectInfoViewController.storyboard */, ); name = Project; sourceTree = ""; @@ -628,10 +620,9 @@ D5DB80A71792F4DE0081662A /* OZLProjectListViewController.xib in Resources */, D5DB80AD1792F6980081662A /* OZLProjectViewController.xib in Resources */, D5DB80B61793016B0081662A /* OZLAccountViewController.xib in Resources */, - 2BCF88191793E353006FC859 /* OZLProjectDetailViewController.xib in Resources */, 2B62D0DF1796498800AC3C19 /* OZLIssueCreateViewController.storyboard in Resources */, 2B62D0E1179649A800AC3C19 /* OZLIssueDetailViewController.storyboard in Resources */, - 2B62D0E31796A15C00AC3C19 /* OZLProjectCreateViewController.storyboard in Resources */, + 2B62D0E31796A15C00AC3C19 /* OZLProjectInfoViewController.storyboard in Resources */, 2B6F382F1797A00A00D06F51 /* MLTableAlertBackground.png in Resources */, 2B6F38301797A00A00D06F51 /* MLTableAlertBackground@2x.png in Resources */, 2B6F38311797A00A00D06F51 /* MLTableAlertButton.png in Resources */, @@ -699,14 +690,13 @@ D5DB80C217931C8B0081662A /* OZLModelProject.m in Sources */, 2BCF880C1793A26A006FC859 /* MBProgressHUD.m in Sources */, 2BCF88101793ABA0006FC859 /* Reachability.m in Sources */, - 2BCF88181793E353006FC859 /* OZLProjectDetailViewController.m in Sources */, 2BCF881E1793F3C8006FC859 /* OZLModelIssue.m in Sources */, 2BCF88211793F478006FC859 /* OZLModelTracker.m in Sources */, 2BCF88271793F4AA006FC859 /* OZLModelIssueStatus.m in Sources */, 2BCF882A1793F4C9006FC859 /* OZLModelIssuePriority.m in Sources */, 2BCF88301793F5CE006FC859 /* OZLModelUser.m in Sources */, 2B9968AB1794F71B0086F115 /* OZLModelIssueCategory.m in Sources */, - 2B9968AF1794FC0A0086F115 /* OZLProjectCreateViewController.m in Sources */, + 2B9968AF1794FC0A0086F115 /* OZLProjectInfoViewController.m in Sources */, 2B9968B417951A5C0086F115 /* OZLIssueCreateViewController.m in Sources */, 2BCCA0541795312E00FA8B1A /* OZLConstants.m in Sources */, 2B8A11E217963CE500906D34 /* OZLIssueDetailViewController.m in Sources */, diff --git a/RedmineMobile/RedmineMobile/ViewControllers/OZLIssueCreateViewController.h b/RedmineMobile/RedmineMobile/ViewControllers/OZLIssueCreateViewController.h index a16a228..0b4d3ed 100644 --- a/RedmineMobile/RedmineMobile/ViewControllers/OZLIssueCreateViewController.h +++ b/RedmineMobile/RedmineMobile/ViewControllers/OZLIssueCreateViewController.h @@ -30,6 +30,13 @@ #import "OZLModelIssue.h" #import "OZLModelProject.h" +typedef enum { + OZLIssueInfoViewModeCreate, + OZLIssueInfoViewModeDisplay, + OZLIssueInfoViewModeEdit +} OZLIssueInfoViewMode; + + @interface OZLIssueCreateViewController : UITableViewController - (IBAction)onCancel:(id)sender; - (IBAction)onSave:(id)sender; diff --git a/RedmineMobile/RedmineMobile/ViewControllers/OZLProjectDetailViewController.h b/RedmineMobile/RedmineMobile/ViewControllers/OZLProjectDetailViewController.h deleted file mode 100644 index 83bbf2c..0000000 --- a/RedmineMobile/RedmineMobile/ViewControllers/OZLProjectDetailViewController.h +++ /dev/null @@ -1,43 +0,0 @@ -// -// OZLProjectDetailViewController.h -// RedmineMobile -// -// Created by lizhijie on 7/15/13. - -// This code is distributed under the terms and conditions of the MIT license. - -// Copyright (c) 2013 Zhijie Lee(onezeros.lee@gmail.com) -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -#import -#import "OZLModelProject.h" - -@interface OZLProjectDetailViewController : UIViewController - -@property(nonatomic, strong) OZLModelProject* projectData; - -@property (weak, nonatomic) IBOutlet UILabel *IDLabel; -@property (weak, nonatomic) IBOutlet UILabel *nameLabel; -@property (weak, nonatomic) IBOutlet UILabel *parentIDlabel; -@property (weak, nonatomic) IBOutlet UILabel *createTimeLabel; -@property (weak, nonatomic) IBOutlet UILabel *updateTimeLabel; -@property (weak, nonatomic) IBOutlet UITextView *descriptionTextview; - -@end diff --git a/RedmineMobile/RedmineMobile/ViewControllers/OZLProjectDetailViewController.m b/RedmineMobile/RedmineMobile/ViewControllers/OZLProjectDetailViewController.m deleted file mode 100644 index cbfdd7a..0000000 --- a/RedmineMobile/RedmineMobile/ViewControllers/OZLProjectDetailViewController.m +++ /dev/null @@ -1,80 +0,0 @@ -// -// OZLProjectDetailViewController.m -// RedmineMobile -// -// Created by lizhijie on 7/15/13. - -// This code is distributed under the terms and conditions of the MIT license. - -// Copyright (c) 2013 Zhijie Lee(onezeros.lee@gmail.com) -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -#import "OZLProjectDetailViewController.h" - -@interface OZLProjectDetailViewController () { - -} - -@end - -@implementation OZLProjectDetailViewController - -- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil -{ - self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]; - if (self) { - // Custom initialization - } - return self; -} - -- (void)viewDidLoad -{ - [super viewDidLoad]; - [_IDLabel setText:[NSString stringWithFormat:@"%d",_projectData.index]]; - [_nameLabel setText:_projectData.name]; - if (_projectData.parentId < 0) { - [_parentIDlabel setText:@"--"]; - }else { - [_parentIDlabel setText:[NSString stringWithFormat:@"%d",_projectData.parentId]]; - } - [_createTimeLabel setText:_projectData.createdOn]; - [_updateTimeLabel setText:_projectData.updatedOn]; - - [_descriptionTextview setEditable:NO]; - [_descriptionTextview setText:_projectData.description]; -} - -- (void)didReceiveMemoryWarning -{ - [super didReceiveMemoryWarning]; - // Dispose of any resources that can be recreated. -} - -- (void)viewDidUnload { - [self setIDLabel:nil]; - [self setNameLabel:nil]; - [self setParentIDlabel:nil]; - [self setCreateTimeLabel:nil]; - [self setUpdateTimeLabel:nil]; - [self setDescriptionTextview:nil]; - [super viewDidUnload]; -} -@end diff --git a/RedmineMobile/RedmineMobile/ViewControllers/OZLProjectDetailViewController.xib b/RedmineMobile/RedmineMobile/ViewControllers/OZLProjectDetailViewController.xib deleted file mode 100644 index e6aa4d7..0000000 --- a/RedmineMobile/RedmineMobile/ViewControllers/OZLProjectDetailViewController.xib +++ /dev/null @@ -1,583 +0,0 @@ - - - - 1552 - 11G63 - 3084 - 1138.51 - 569.00 - - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - 2083 - - - IBProxyObject - IBUILabel - IBUITextView - IBUIView - - - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - - - PluginDependencyRecalculationVersion - - - - - IBFilesOwner - IBCocoaTouchFramework - - - IBFirstResponder - IBCocoaTouchFramework - - - - 274 - - - - 292 - {{20, 20}, {106, 21}} - - - - _NS:9 - NO - YES - 7 - NO - IBCocoaTouchFramework - ID: - - 1 - MCAwIDAAA - darkTextColor - - - 0 - - 1 - 17 - - - Helvetica - 17 - 16 - - NO - - - - 292 - {{20, 49}, {106, 21}} - - - - _NS:9 - NO - YES - 7 - NO - IBCocoaTouchFramework - Name: - - - 0 - - - NO - - - - 292 - {{20, 107}, {106, 21}} - - - - _NS:9 - NO - YES - 7 - NO - IBCocoaTouchFramework - Created On: - - - 0 - - - NO - - - - 292 - {{20, 136}, {106, 21}} - - - - _NS:9 - NO - YES - 7 - NO - IBCocoaTouchFramework - Updated On: - - - 0 - - - NO - - - - 292 - {{20, 165}, {106, 21}} - - - - _NS:9 - NO - YES - 7 - NO - IBCocoaTouchFramework - Description: - - - 0 - - - NO - - - - 292 - {{20, 78}, {106, 21}} - - - - _NS:9 - NO - YES - 7 - NO - IBCocoaTouchFramework - Parent ID: - - - 0 - - - NO - - - - 306 - {{20, 194}, {280, 290}} - - - - _NS:9 - - 1 - MSAxIDEAA - - YES - YES - IBCocoaTouchFramework - Lorem ipsum dolor sit er elit lamet, consectetaur cillium adipisicing pecu, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Nam liber te conscient to factor tum poen legum odioque civiuda. - - 2 - IBCocoaTouchFramework - - - 1 - 14 - - - Helvetica - 14 - 16 - - - - - 292 - {{134, 20}, {166, 21}} - - - - _NS:9 - NO - YES - 7 - NO - IBCocoaTouchFramework - ID: - - - 0 - - - NO - - - - 292 - {{134, 49}, {166, 21}} - - - - _NS:9 - NO - YES - 7 - NO - IBCocoaTouchFramework - ID: - - - 0 - - - NO - - - - 292 - {{134, 78}, {166, 21}} - - - - _NS:9 - NO - YES - 7 - NO - IBCocoaTouchFramework - ID: - - - 0 - - - NO - - - - 292 - {{134, 107}, {166, 21}} - - - - _NS:9 - NO - YES - 7 - NO - IBCocoaTouchFramework - ID: - - - 0 - - - NO - - - - 292 - {{134, 136}, {166, 21}} - - - - _NS:9 - NO - YES - 7 - NO - IBCocoaTouchFramework - ID: - - - 0 - - - NO - - - {{0, 64}, {320, 504}} - - - - - 3 - MQA - - 2 - - - - - NO - - - IBUIScreenMetrics - - YES - - - - - - {320, 568} - {568, 320} - - - IBCocoaTouchFramework - Retina 4 Full Screen - 2 - - IBCocoaTouchFramework - - - - - - - view - - - - 3 - - - - IDLabel - - - - 18 - - - - nameLabel - - - - 19 - - - - parentIDlabel - - - - 20 - - - - createTimeLabel - - - - 21 - - - - updateTimeLabel - - - - 22 - - - - descriptionTextview - - - - 23 - - - - - - 0 - - - - - - 1 - - - - - - - - - - - - - - - - - - - -1 - - - File's Owner - - - -2 - - - - - 6 - - - - - 7 - - - - - 8 - - - - - 9 - - - - - 10 - - - - - 11 - - - - - 12 - - - - - 13 - - - - - 14 - - - - - 15 - - - - - 16 - - - - - 17 - - - - - - - OZLProjectDetailViewController - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - UIResponder - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - - - - - - 23 - - - - - OZLProjectDetailViewController - UIViewController - - UILabel - UILabel - UITextView - UILabel - UILabel - UILabel - - - - IDLabel - UILabel - - - createTimeLabel - UILabel - - - descriptionTextview - UITextView - - - nameLabel - UILabel - - - parentIDlabel - UILabel - - - updateTimeLabel - UILabel - - - - IBProjectSource - ./Classes/OZLProjectDetailViewController.h - - - - - 0 - IBCocoaTouchFramework - YES - 3 - 2083 - - diff --git a/RedmineMobile/RedmineMobile/ViewControllers/OZLProjectCreateViewController.h b/RedmineMobile/RedmineMobile/ViewControllers/OZLProjectInfoViewController.h similarity index 84% rename from RedmineMobile/RedmineMobile/ViewControllers/OZLProjectCreateViewController.h rename to RedmineMobile/RedmineMobile/ViewControllers/OZLProjectInfoViewController.h index 39e8b14..4a46332 100644 --- a/RedmineMobile/RedmineMobile/ViewControllers/OZLProjectCreateViewController.h +++ b/RedmineMobile/RedmineMobile/ViewControllers/OZLProjectInfoViewController.h @@ -1,5 +1,5 @@ // -// OZLProjectCreateViewController.h +// OZLProjectInfoViewController.h // RedmineMobile // // Created by lizhijie on 7/16/13. @@ -29,7 +29,14 @@ #import #import "OZLModelProject.h" -@interface OZLProjectCreateViewController : UITableViewController +typedef enum { + OZLProjectInfoViewModeCreate, + OZLProjectInfoViewModeDisplay, + OZLProjectInfoViewModeEdit +} OZLProjectInfoViewMode; + + +@interface OZLProjectInfoViewController : UITableViewController - (IBAction)onCancel:(id)sender; - (IBAction)onSave:(id)sender; @property (weak, nonatomic) IBOutlet UITextField *name; @@ -40,4 +47,7 @@ @property (nonatomic,strong) OZLModelProject* parentProject; @property (nonatomic,strong) NSArray* projectList; +@property (nonatomic, strong) OZLModelProject* projectData; +@property (nonatomic) int viewMode; + @end diff --git a/RedmineMobile/RedmineMobile/ViewControllers/OZLProjectCreateViewController.m b/RedmineMobile/RedmineMobile/ViewControllers/OZLProjectInfoViewController.m similarity index 85% rename from RedmineMobile/RedmineMobile/ViewControllers/OZLProjectCreateViewController.m rename to RedmineMobile/RedmineMobile/ViewControllers/OZLProjectInfoViewController.m index cda5122..c4b2a72 100644 --- a/RedmineMobile/RedmineMobile/ViewControllers/OZLProjectCreateViewController.m +++ b/RedmineMobile/RedmineMobile/ViewControllers/OZLProjectInfoViewController.m @@ -1,5 +1,5 @@ // -// OZLProjectCreateViewController.m +// OZLProjectInfoViewController.m // RedmineMobile // // Created by lizhijie on 7/16/13. @@ -26,19 +26,19 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. -#import "OZLProjectCreateViewController.h" +#import "OZLProjectInfoViewController.h" #import "MBProgressHUD.h" #import "OZLNetwork.h" #import "MLTableAlert.h" -@interface OZLProjectCreateViewController () { +@interface OZLProjectInfoViewController () { MBProgressHUD * _HUD; } @end -@implementation OZLProjectCreateViewController +@implementation OZLProjectInfoViewController - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil { @@ -53,15 +53,45 @@ { [super viewDidLoad]; + + _HUD = [[MBProgressHUD alloc] initWithView:self.view]; + [self.view addSubview:_HUD]; + _HUD.labelText = @"Loading..."; + + if (_viewMode == OZLProjectInfoViewModeCreate) { + [self prepareViewForCreate]; + }else if(_viewMode == OZLProjectInfoViewModeDisplay) { + [self prepareViewForDisplay]; + }else if(_viewMode == OZLProjectInfoViewModeEdit) { + + } +} + +-(void)prepareViewForDisplay +{ + self.navigationItem.title = @"Project Details"; + + _name.userInteractionEnabled = NO; + _identifier.userInteractionEnabled = NO; + _homepageUrl.userInteractionEnabled = NO; + _description.userInteractionEnabled = NO; + + _name.text = _projectData.name; + _identifier.text = _projectData.identifier; + _homepageUrl.text = _projectData.homepage; + _description.text = _projectData.description; +} + +-(void)prepareViewForCreate +{ + UIBarButtonItem* cancelBtn = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemCancel target:self action:@selector(onCancel:)]; [self.navigationItem setLeftBarButtonItem:cancelBtn]; UIBarButtonItem* saveBtn = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemSave target:self action:@selector(onSave:)]; [self.navigationItem setRightBarButtonItem:saveBtn]; + self.navigationItem.title = @"New Project"; - _HUD = [[MBProgressHUD alloc] initWithView:self.view]; - [self.view addSubview:_HUD]; - _HUD.labelText = @"Loading..."; } - (void)didReceiveMemoryWarning @@ -126,6 +156,9 @@ [super viewDidUnload]; } +#pragma mark tableview datasource + +#pragma mark tableview delegate -(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { if (indexPath.section ==0 && indexPath.row == 4) {//parent project diff --git a/RedmineMobile/RedmineMobile/ViewControllers/OZLProjectCreateViewController.storyboard b/RedmineMobile/RedmineMobile/ViewControllers/OZLProjectInfoViewController.storyboard similarity index 92% rename from RedmineMobile/RedmineMobile/ViewControllers/OZLProjectCreateViewController.storyboard rename to RedmineMobile/RedmineMobile/ViewControllers/OZLProjectInfoViewController.storyboard index cdfb4ff..3749179 100644 --- a/RedmineMobile/RedmineMobile/ViewControllers/OZLProjectCreateViewController.storyboard +++ b/RedmineMobile/RedmineMobile/ViewControllers/OZLProjectInfoViewController.storyboard @@ -4,11 +4,11 @@ - + - - + + @@ -170,22 +170,6 @@ - - - - - - - - - - - - - - - - diff --git a/RedmineMobile/RedmineMobile/ViewControllers/OZLProjectListViewController.m b/RedmineMobile/RedmineMobile/ViewControllers/OZLProjectListViewController.m index 5710843..faf0a37 100644 --- a/RedmineMobile/RedmineMobile/ViewControllers/OZLProjectListViewController.m +++ b/RedmineMobile/RedmineMobile/ViewControllers/OZLProjectListViewController.m @@ -30,7 +30,7 @@ #import "PPRevealSideViewController.h" #import "OZLProjectViewController.h" #import "OZLAccountViewController.h" -#import "OZLProjectCreateViewController.h" +#import "OZLProjectInfoViewController.h" #import "OZLNetwork.h" #import "OZLModelProject.h" #import "MBProgressHUD.h" @@ -137,11 +137,10 @@ } - (IBAction)createProject:(id)sender { - //OZLProjectCreateViewController* creator = [[OZLProjectCreateViewController alloc] initWithNibName:@"OZLProjectCreateViewController" bundle:nil]; - //[self.navigationController presentModalViewController:creator animated:YES]; - UIStoryboard *tableViewStoryboard = [UIStoryboard storyboardWithName:@"OZLProjectCreateViewController" bundle:nil]; - OZLProjectCreateViewController* creator = [tableViewStoryboard instantiateViewControllerWithIdentifier:@"OZLProjectCreateViewController"]; + UIStoryboard *tableViewStoryboard = [UIStoryboard storyboardWithName:@"OZLProjectInfoViewController" bundle:nil]; + OZLProjectInfoViewController* creator = [tableViewStoryboard instantiateViewControllerWithIdentifier:@"OZLProjectInfoViewController"]; [creator setProjectList:_projectList]; + [creator setViewMode:OZLProjectInfoViewModeCreate]; [self.navigationController pushViewController:creator animated:YES]; } diff --git a/RedmineMobile/RedmineMobile/ViewControllers/OZLProjectViewController.m b/RedmineMobile/RedmineMobile/ViewControllers/OZLProjectViewController.m index afef5c5..b259fce 100644 --- a/RedmineMobile/RedmineMobile/ViewControllers/OZLProjectViewController.m +++ b/RedmineMobile/RedmineMobile/ViewControllers/OZLProjectViewController.m @@ -31,7 +31,7 @@ #import "OZLProjectListViewController.h" #import "OZLNetwork.h" #import "MBProgressHUD.h" -#import "OZLProjectDetailViewController.h" +#import "OZLProjectInfoViewController.h" #import "OZLIssueDetailViewController.h" #import "OZLIssueCreateViewController.h" #import "OZLIssueFilterViewController.h" @@ -371,10 +371,10 @@ } - (IBAction)onShowInfo:(id)sender { -// UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"OZLProjectDetailViewController" bundle:nil]; -// OZLProjectDetailViewController* detail = [storyboard instantiateViewControllerWithIdentifier:@"OZLProjectDetailViewController"]; - OZLProjectDetailViewController* detail = [[OZLProjectDetailViewController alloc] initWithNibName:@"OZLProjectDetailViewController" bundle:nil]; + UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"OZLProjectInfoViewController" bundle:nil]; + OZLProjectInfoViewController* detail = [storyboard instantiateViewControllerWithIdentifier:@"OZLProjectInfoViewController"]; [detail setProjectData:_projectData]; + [detail setViewMode:OZLProjectInfoViewModeDisplay]; [self.navigationController pushViewController:detail animated:YES]; }