Skip to content

Commit 7418adc

Browse files
committed
项目动态添加下文件评论
1 parent 2a66913 commit 7418adc

7 files changed

Lines changed: 49 additions & 1 deletion

File tree

.DS_Store

0 Bytes
Binary file not shown.

Coding_iOS.xcodeproj/project.pbxproj

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -371,6 +371,7 @@
371371
4EAE068E1B78484D00179F4B /* [email protected] in Resources */ = {isa = PBXBuildFile; fileRef = 4EAE068D1B78484D00179F4B /* [email protected] */; };
372372
4EAE06901B784E9200179F4B /* [email protected] in Resources */ = {isa = PBXBuildFile; fileRef = 4EAE068F1B784E9200179F4B /* [email protected] */; };
373373
4EAE06921B7880BA00179F4B /* [email protected] in Resources */ = {isa = PBXBuildFile; fileRef = 4EAE06911B7880BA00179F4B /* [email protected] */; };
374+
4EAE06A41B7AE4EF00179F4B /* FileComment.m in Sources */ = {isa = PBXBuildFile; fileRef = 4EAE06A31B7AE4EF00179F4B /* FileComment.m */; };
374375
4EB0C2001A807ED00042FC4F /* NSURL+Common.m in Sources */ = {isa = PBXBuildFile; fileRef = 4EB0C1FF1A807ED00042FC4F /* NSURL+Common.m */; };
375376
4EB845331AB83C3B0030DC69 /* [email protected] in Resources */ = {isa = PBXBuildFile; fileRef = 4EB845301AB83C3B0030DC69 /* [email protected] */; };
376377
4EB845341AB83C3B0030DC69 /* [email protected] in Resources */ = {isa = PBXBuildFile; fileRef = 4EB845311AB83C3B0030DC69 /* [email protected] */; };
@@ -1401,6 +1402,8 @@
14011402
4EAE068D1B78484D00179F4B /* [email protected] */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "[email protected]"; sourceTree = "<group>"; };
14021403
4EAE068F1B784E9200179F4B /* [email protected] */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "[email protected]"; sourceTree = "<group>"; };
14031404
4EAE06911B7880BA00179F4B /* [email protected] */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "[email protected]"; sourceTree = "<group>"; };
1405+
4EAE06A21B7AE4EF00179F4B /* FileComment.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FileComment.h; sourceTree = "<group>"; };
1406+
4EAE06A31B7AE4EF00179F4B /* FileComment.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FileComment.m; sourceTree = "<group>"; };
14041407
4EB0C1FE1A807ED00042FC4F /* NSURL+Common.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSURL+Common.h"; sourceTree = "<group>"; };
14051408
4EB0C1FF1A807ED00042FC4F /* NSURL+Common.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSURL+Common.m"; sourceTree = "<group>"; };
14061409
4EB845301AB83C3B0030DC69 /* [email protected] */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "[email protected]"; sourceTree = "<group>"; };
@@ -3741,6 +3744,8 @@
37413744
8EA6CFEF19E240C40076D59C /* Task.m */,
37423745
8EABE3C619F10D2400A17784 /* TaskComment.h */,
37433746
8EABE3C719F10D2400A17784 /* TaskComment.m */,
3747+
4EAE06A21B7AE4EF00179F4B /* FileComment.h */,
3748+
4EAE06A31B7AE4EF00179F4B /* FileComment.m */,
37443749
8EA6CFF019E240C40076D59C /* Tasks.h */,
37453750
8EA6CFF119E240C40076D59C /* Tasks.m */,
37463751
8EA6CFF219E240C40076D59C /* Tweets.h */,
@@ -4970,6 +4975,7 @@
49704975
4E4D6A761B1C6C6100FD2E49 /* MRPRTopCell.m in Sources */,
49714976
4EE1A2301B5D02CA004284F1 /* ProjectTaskListView.m in Sources */,
49724977
3A38783A1AE2949E0078D5DE /* ResetLabelViewController.m in Sources */,
4978+
4EAE06A41B7AE4EF00179F4B /* FileComment.m in Sources */,
49734979
8EA6D13C19E240C40076D59C /* Tweet_RootViewController.m in Sources */,
49744980
B93D904B1ACBA3110057A6EE /* ProjectDeleteAlertControllerVisualStyle.m in Sources */,
49754981
4E1A22851AB172C400CFC14F /* ProjectItemsCell.m in Sources */,

Coding_iOS/Models/FileComment.h

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
//
2+
// FileComment.h
3+
// Coding_iOS
4+
//
5+
// Created by Ease on 15/8/12.
6+
// Copyright (c) 2015年 Coding. All rights reserved.
7+
//
8+
9+
#import <Foundation/Foundation.h>
10+
11+
@interface FileComment : NSObject
12+
@property (readwrite, nonatomic, strong) NSNumber *id;
13+
@property (readwrite, nonatomic, strong) NSString *content;
14+
@property (readwrite, nonatomic, strong) User *owner;
15+
@property (readwrite, nonatomic, strong) HtmlMedia *htmlMedia;
16+
@end

Coding_iOS/Models/FileComment.m

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
//
2+
// FileComment.m
3+
// Coding_iOS
4+
//
5+
// Created by Ease on 15/8/12.
6+
// Copyright (c) 2015年 Coding. All rights reserved.
7+
//
8+
9+
#import "FileComment.h"
10+
11+
@implementation FileComment
12+
- (void)setContent:(NSString *)content{
13+
if (_content != content) {
14+
_htmlMedia = [HtmlMedia htmlMediaWithString:content showType:MediaShowTypeCode];
15+
_content = _htmlMedia.contentDisplay;
16+
}
17+
}
18+
@end

Coding_iOS/Models/ProjectActivity.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
#import "ProjectLineNoteActivity.h"
1212

1313
#import "Projects.h"
14+
#import "FileComment.h"
15+
#import "ProjectFile.h"
1416

1517
@class Task;
1618
@class ProjectTopic;
@@ -31,6 +33,8 @@
3133
@property (readwrite, nonatomic, strong) NSDictionary *propertyArrayMap;
3234
@property (readwrite, nonatomic, strong) ProjectLineNoteActivity *line_note;
3335
@property (strong, nonatomic) Commit *commit;
36+
@property (strong, nonatomic) FileComment *projectFileComment;
37+
@property (strong, nonatomic) ProjectFile *projectFile;
3438

3539
@property (readonly, nonatomic, strong) NSMutableArray *actionMediaItems, *contentMediaItems;
3640
@property (readonly, nonatomic, strong) NSMutableString *actionStr, *contentStr;

Coding_iOS/Models/ProjectActivity.m

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,8 @@ - (NSMutableString *)actionStr{
110110
}
111111
}else if ([_target_type isEqualToString:@"ProjectFile"]){
112112
[_actionStr appendString:[_type isEqualToString:@"dir"]? @"文件夹": @"文件"];
113+
}else if ([_target_type isEqualToString:@"ProjectFileComment"]){
114+
[_actionStr appendFormat:@"文件「%@」的评论", _projectFile.title];
113115
}else if ([_target_type isEqualToString:@"Depot"]){
114116
if ([_action isEqualToString:@"push"]) {
115117
[_actionStr appendFormat:@"项目 %@%@", self.ref_type, _ref];
@@ -170,6 +172,8 @@ - (NSMutableString *)contentStr{
170172
}
171173
}else if ([_target_type isEqualToString:@"ProjectFile"]){
172174
[_contentStr saveAppendString:_file.name];
175+
}else if ([_target_type isEqualToString:@"ProjectFileComment"]){
176+
[_contentStr saveAppendString:_projectFileComment.content];
173177
}else if ([_target_type isEqualToString:@"Depot"]){
174178
if (_commits && [_commits count] > 0) {
175179
Commit *curCommit = _commits.firstObject;

Coding_iOS/Models/ProjectFile.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ typedef NS_ENUM(NSInteger, DownloadState){
2222
@interface ProjectFile : NSObject
2323
@property (readwrite, nonatomic, strong) NSDate *created_at, *updated_at;
2424
@property (readwrite, nonatomic, strong) NSNumber *file_id, *owner_id, *parent_id, *type, *current_user_role_id, *size, *project_id;
25-
@property (readwrite, nonatomic, strong) NSString *name, *fileType, *owner_preview, *preview, *storage_key, *storage_type;
25+
@property (readwrite, nonatomic, strong) NSString *name, *fileType, *owner_preview, *preview, *storage_key, *storage_type, *title;
2626
@property (readwrite, nonatomic, strong) User *owner;
2727
@property (readwrite, nonatomic, strong) NSString *diskFileName;
2828

0 commit comments

Comments
 (0)