Skip to content

Commit 7592d9e

Browse files
committed
line_note
1 parent a2f35cc commit 7592d9e

7 files changed

Lines changed: 303 additions & 229 deletions

File tree

Coding_iOS.xcodeproj/project.pbxproj

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,8 @@
134134
4E76D4E41A5A90CA0094A35E /* [email protected] in Resources */ = {isa = PBXBuildFile; fileRef = 4E76D4E01A5A90CA0094A35E /* [email protected] */; };
135135
4E76D4E51A5A90CA0094A35E /* [email protected] in Resources */ = {isa = PBXBuildFile; fileRef = 4E76D4E11A5A90CA0094A35E /* [email protected] */; };
136136
4E76D4E61A5A90CA0094A35E /* [email protected] in Resources */ = {isa = PBXBuildFile; fileRef = 4E76D4E21A5A90CA0094A35E /* [email protected] */; };
137+
4E787DE21B0329B300F06E83 /* ProjectLineNote.m in Sources */ = {isa = PBXBuildFile; fileRef = 4E787DE11B0329B300F06E83 /* ProjectLineNote.m */; };
138+
4E787DE51B03342000F06E83 /* ProjectActivity.m in Sources */ = {isa = PBXBuildFile; fileRef = 4E787DE41B03342000F06E83 /* ProjectActivity.m */; };
137139
4E8765651A22E5B40090CFB9 /* NSMutableArray+SWUtilityButtons.m in Sources */ = {isa = PBXBuildFile; fileRef = 4E87655A1A22E5B40090CFB9 /* NSMutableArray+SWUtilityButtons.m */; };
138140
4E8765661A22E5B40090CFB9 /* SWCellScrollView.m in Sources */ = {isa = PBXBuildFile; fileRef = 4E87655C1A22E5B40090CFB9 /* SWCellScrollView.m */; };
139141
4E8765671A22E5B40090CFB9 /* SWLongPressGestureRecognizer.m in Sources */ = {isa = PBXBuildFile; fileRef = 4E87655E1A22E5B40090CFB9 /* SWLongPressGestureRecognizer.m */; };
@@ -828,6 +830,10 @@
828830
4E76D4E01A5A90CA0094A35E /* [email protected] */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "[email protected]"; sourceTree = "<group>"; };
829831
4E76D4E11A5A90CA0094A35E /* [email protected] */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "[email protected]"; sourceTree = "<group>"; };
830832
4E76D4E21A5A90CA0094A35E /* [email protected] */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "[email protected]"; sourceTree = "<group>"; };
833+
4E787DE01B0329B300F06E83 /* ProjectLineNote.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ProjectLineNote.h; sourceTree = "<group>"; };
834+
4E787DE11B0329B300F06E83 /* ProjectLineNote.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ProjectLineNote.m; sourceTree = "<group>"; };
835+
4E787DE31B03342000F06E83 /* ProjectActivity.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ProjectActivity.h; sourceTree = "<group>"; };
836+
4E787DE41B03342000F06E83 /* ProjectActivity.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ProjectActivity.m; sourceTree = "<group>"; };
831837
4E8765591A22E5B40090CFB9 /* NSMutableArray+SWUtilityButtons.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSMutableArray+SWUtilityButtons.h"; sourceTree = "<group>"; };
832838
4E87655A1A22E5B40090CFB9 /* NSMutableArray+SWUtilityButtons.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSMutableArray+SWUtilityButtons.m"; sourceTree = "<group>"; };
833839
4E87655B1A22E5B40090CFB9 /* SWCellScrollView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SWCellScrollView.h; sourceTree = "<group>"; };
@@ -2799,6 +2805,10 @@
27992805
4EE548201AE8DB5600A92306 /* Project.m */,
28002806
4EACB4441A2C60110097ABB3 /* ProjectActivities.h */,
28012807
4EACB4451A2C60110097ABB3 /* ProjectActivities.m */,
2808+
4E787DE31B03342000F06E83 /* ProjectActivity.h */,
2809+
4E787DE41B03342000F06E83 /* ProjectActivity.m */,
2810+
4E787DE01B0329B300F06E83 /* ProjectLineNote.h */,
2811+
4E787DE11B0329B300F06E83 /* ProjectLineNote.m */,
28022812
8EA6CFE619E240C40076D59C /* ProjectTopic.h */,
28032813
8EA6CFE719E240C40076D59C /* ProjectTopic.m */,
28042814
8EA6CFE819E240C40076D59C /* ProjectTopics.h */,
@@ -3614,6 +3624,7 @@
36143624
8EA6D1B919E240C40076D59C /* ProjectMember.m in Sources */,
36153625
4E996BCD1ABA773800C704F1 /* UserInfoViewController.m in Sources */,
36163626
8EA6D13719E240C40076D59C /* Me_RootViewController.m in Sources */,
3627+
4E787DE51B03342000F06E83 /* ProjectActivity.m in Sources */,
36173628
4E8765691A22E5B40090CFB9 /* SWUtilityButtonTapGestureRecognizer.m in Sources */,
36183629
8E59F0EE1A00F34E009A905F /* ProjectCodeListView.m in Sources */,
36193630
4ECE8B041A3946C10021E29C /* UnReadManager.m in Sources */,
@@ -3860,6 +3871,7 @@
38603871
8EE72BE819E3F4A8002C11D9 /* MBProgressHUD+Add.m in Sources */,
38613872
8E59F10D1A02188D009A905F /* CodeViewController.m in Sources */,
38623873
8EA6D20B19E240C40076D59C /* RDVTabBarController.m in Sources */,
3874+
4E787DE21B0329B300F06E83 /* ProjectLineNote.m in Sources */,
38633875
8EA6D12E19E240C40076D59C /* EditTaskViewController.m in Sources */,
38643876
8EA6D1BC19E240C40076D59C /* ProjectTopics.m in Sources */,
38653877
8EA6D1C919E240C40076D59C /* UICustomCollectionView.m in Sources */,

Coding_iOS/Models/ProjectActivities.h

Lines changed: 3 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77
//
88

99
#import <Foundation/Foundation.h>
10-
#import "Projects.h"
10+
#import "ProjectActivity.h"
11+
1112

1213
typedef NS_ENUM(NSInteger, ProjectActivityType)
1314
{
@@ -19,8 +20,7 @@ typedef NS_ENUM(NSInteger, ProjectActivityType)
1920
ProjectActivityTypeOther
2021
};
2122

22-
@class Task;
23-
@class ProjectTopic;
23+
2424

2525
@interface ProjectActivities : NSObject
2626
@property (readwrite, nonatomic, strong) NSNumber *project_id, *last_id, *user_id;
@@ -39,23 +39,3 @@ typedef NS_ENUM(NSInteger, ProjectActivityType)
3939

4040
- (void)configWithProActList:(NSArray *)responseA;
4141
@end
42-
43-
@interface ProjectActivity : NSObject
44-
@property (readwrite, nonatomic, strong) NSNumber *id;
45-
@property (readwrite, nonatomic, strong) NSString *target_type, *action, *action_msg, *type, *ref, *ref_type, *ref_path, *pull_request_title, *merge_request_title, *comment_content;
46-
@property (readwrite, nonatomic, strong) User *user, *target_user;
47-
@property (readwrite, nonatomic, strong) NSDate *created_at;
48-
@property (readwrite, nonatomic, strong) Task *origin_task, *task;
49-
@property (readwrite, nonatomic, strong) TaskComment *taskComment, *origin_taskComment;
50-
@property (readwrite, nonatomic, strong) Project *project;
51-
@property (readwrite, nonatomic, strong) ProjectTopic *project_topic;
52-
@property (readwrite, nonatomic, strong) File *file;
53-
@property (readwrite, nonatomic, strong) QcTask *qc_task;
54-
@property (readwrite, nonatomic, strong) Depot *depot, *source_depot;
55-
@property (readwrite, nonatomic, strong) NSMutableArray *commits;
56-
@property (readwrite, nonatomic, strong) NSDictionary *propertyArrayMap;
57-
58-
@property (readonly, nonatomic, strong) NSMutableArray *actionMediaItems, *contentMediaItems;
59-
@property (readonly, nonatomic, strong) NSMutableString *actionStr, *contentStr;
60-
61-
@end

Coding_iOS/Models/ProjectActivities.m

Lines changed: 1 addition & 206 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
#import "ProjectActivities.h"
1010

11+
1112
@implementation ProjectActivities
1213

1314
- (instancetype)init
@@ -147,210 +148,4 @@ - (void)refreshListGroupWithArray:(NSArray *)responseA isAdd:(BOOL)isAdd{
147148
}
148149
}
149150
}
150-
@end
151-
@implementation ProjectActivity
152-
@synthesize actionStr = _actionStr, contentStr = _contentStr;
153-
- (instancetype)init
154-
{
155-
self = [super init];
156-
if (self) {
157-
_propertyArrayMap = [NSDictionary dictionaryWithObjectsAndKeys:
158-
@"Commit", @"commits", nil];
159-
_actionMediaItems = [[NSMutableArray alloc] init];
160-
_contentMediaItems = [[NSMutableArray alloc] init];
161-
}
162-
return self;
163-
}
164-
165-
- (void)setComment_content:(NSString *)comment_content{
166-
if (comment_content) {
167-
_comment_content = [comment_content stringByRemoveHtmlTag];
168-
}else{
169-
_comment_content = @"";
170-
}
171-
}
172-
173-
- (void)addActionUser:(User *)curUser{
174-
if (curUser) {
175-
[HtmlMedia addMediaItemUser:curUser toString:_actionStr andMediaItems:_actionMediaItems];
176-
}
177-
}
178-
179-
//- (void)addActionLinkStr:(NSString *)linkStr{
180-
// [HtmlMedia addLinkStr:linkStr type:HtmlMediaItemType_CustomLink toString:_actionStr andMediaItems:_actionMediaItems];
181-
//}
182-
183-
- (void)addContentLinkStr:(NSString *)linkStr{
184-
[HtmlMedia addLinkStr:linkStr type:HtmlMediaItemType_CustomLink toString:_contentStr andMediaItems:_contentMediaItems];
185-
}
186-
187-
- (NSMutableString *)actionStr{
188-
if (!_actionStr) {
189-
_actionStr = [[NSMutableString alloc] init];
190-
if ([_target_type isEqualToString:@"ProjectMember"]) {
191-
if ([_action isEqualToString:@"quit"]) {
192-
[self addActionUser:_target_user];
193-
[_actionStr appendString:_action_msg];
194-
[_actionStr appendString:@"项目"];
195-
}else{
196-
[self addActionUser:_user];
197-
[_actionStr appendString:_action_msg];
198-
[_actionStr appendString:@"项目成员"];
199-
}
200-
}else if ([_target_type isEqualToString:@"Task"]){
201-
[self addActionUser:_user];
202-
if ([_action isEqualToString:@"update_priority"]) {
203-
[_actionStr appendFormat:@"更新了任务<%@>的优先级", _task.title];
204-
}else if ([_action isEqualToString:@"update_deadline"]) {
205-
if (_task.deadline && _task.deadline.length > 0) {
206-
[_actionStr appendFormat:@"更新了任务<%@>的截止日期", _task.title];
207-
}else{
208-
[_actionStr appendFormat:@"移除了任务<%@>的截止日期", _task.title];
209-
}
210-
}else if ([_action isEqualToString:@"update_description"]) {
211-
[_actionStr appendFormat:@"更新了任务<%@>的描述", _task.title];
212-
}else{
213-
[_actionStr appendString:_action_msg];
214-
if (_origin_task.owner) {
215-
[self addActionUser:_origin_task.owner];
216-
[_actionStr appendString:@""];
217-
}
218-
[_actionStr appendString:@"任务"];
219-
220-
if ([_action isEqualToString:@"reassign"]) {
221-
[_actionStr appendString:@""];
222-
[self addActionUser:_task.owner];
223-
}
224-
}
225-
}else if ([_target_type isEqualToString:@"TaskComment"]){
226-
[self addActionUser:_user];
227-
[_actionStr appendFormat:@"%@任务<%@>的评论", _action_msg, _task.title];
228-
}else{
229-
[self addActionUser:_user];
230-
[_actionStr appendString:_action_msg];
231-
if ([_target_type isEqualToString:@"ProjectTopic"]){
232-
[_actionStr appendString:@"讨论"];
233-
if ([_action isEqualToString:@"comment"]) {
234-
[_actionStr appendString:@":"];
235-
[_actionStr appendString:_project_topic.parent.title];
236-
}
237-
}else if ([_target_type isEqualToString:@"ProjectFile"]){
238-
if ([_type isEqualToString:@"dir"]) {
239-
[_actionStr appendString:@"文件夹"];
240-
}else{
241-
[_actionStr appendString:@"文件"];
242-
}
243-
}else if ([_target_type isEqualToString:@"Depot"]){
244-
if (!_ref && _ref.length <= 0) {
245-
_ref = @"";
246-
}
247-
if ([_action isEqualToString:@"push"]) {
248-
[_actionStr appendString:@"项目分支:"];
249-
[_actionStr appendString:_ref];
250-
}else if ([_action isEqualToString:@"fork"]){
251-
[_actionStr appendString:@"项目"];
252-
[_actionStr appendString:_source_depot.name];
253-
[_actionStr appendString:@""];
254-
[_actionStr appendString:_depot.name];
255-
}
256-
}else{
257-
[_actionStr appendString:@"项目"];
258-
if ([_target_type isEqualToString:@"Project"]){
259-
}else if ([_target_type isEqualToString:@"QcTask"]){
260-
[_actionStr appendString:[NSString stringWithFormat:@"[%@]", _project.full_name]];
261-
[_actionStr appendString:@"的质量分析任务"];
262-
}else if ([_target_type isEqualToString:@"ProjectStar"]){
263-
[_actionStr appendString:[NSString stringWithFormat:@"[%@]", _project.full_name]];
264-
}else if ([_target_type isEqualToString:@"ProjectWatcher"]){
265-
[_actionStr appendString:[NSString stringWithFormat:@"[%@]", _project.full_name]];
266-
}else if ([_target_type isEqualToString:@"PullRequestBean"]){
267-
[_actionStr appendString:[NSString stringWithFormat:@"[%@]", _depot.name]];
268-
[_actionStr appendString:@"中的 Pull Request"];
269-
}else if ([_target_type isEqualToString:@"PullRequestComment"]){
270-
[_actionStr appendString:[NSString stringWithFormat:@"[%@]", _depot.name]];
271-
[_actionStr appendString:@"中的 Pull Request"];
272-
[_actionStr appendString:_pull_request_title];
273-
}else if ([_target_type isEqualToString:@"MergeRequestBean"]){
274-
[_actionStr appendString:[NSString stringWithFormat:@"[%@]", _depot.name]];
275-
[_actionStr appendString:@"中的 Merge Request"];
276-
}else if ([_target_type isEqualToString:@"MergeRequestComment"]){
277-
[_actionStr appendString:[NSString stringWithFormat:@"[%@]", _depot.name]];
278-
[_actionStr appendString:@"中的 Merge Request"];
279-
[_actionStr appendString:_merge_request_title];
280-
}
281-
}
282-
}
283-
}
284-
return _actionStr;
285-
}
286-
287-
- (NSMutableString *)contentStr{
288-
if (!_contentStr) {
289-
_contentStr = [[NSMutableString alloc] init];
290-
291-
if ([_target_type isEqualToString:@"Task"]) {
292-
NSString *linkStr;
293-
if ([_action isEqualToString:@"update_priority"]) {
294-
if (_task.priority && _task.priority.intValue < kTaskPrioritiesDisplay.count) {
295-
linkStr = [NSString stringWithFormat:@"[%@] %@", kTaskPrioritiesDisplay[_task.priority.intValue], _task.title];
296-
}
297-
}else if ([_action isEqualToString:@"update_deadline"] && _task.deadline && _task.deadline.length > 0) {
298-
linkStr = [NSString stringWithFormat:@"[%@] %@", [NSDate convertStr_yyyy_MM_ddToDisplay:_task.deadline], _task.title];
299-
}else if ([_action isEqualToString:@"update_description"]) {
300-
linkStr = _task.description_mine;
301-
}else{
302-
linkStr = _task.title;
303-
}
304-
[self addContentLinkStr:linkStr];
305-
}else if ([_target_type isEqualToString:@"TaskComment"]){
306-
if (_taskComment.content) {
307-
[self addContentLinkStr:_taskComment.content];
308-
}
309-
}else if ([_target_type isEqualToString:@"ProjectTopic"]){
310-
if ([_action isEqualToString:@"comment"]) {
311-
[self addContentLinkStr:_project_topic.content];
312-
}else{
313-
[self addContentLinkStr:_project_topic.title];
314-
}
315-
}else if ([_target_type isEqualToString:@"ProjectFile"]){
316-
[self addContentLinkStr:_file.name];
317-
}else if ([_target_type isEqualToString:@"Depot"]){
318-
if (_commits && [_commits count] > 0) {
319-
Commit *curCommit = _commits.firstObject;
320-
[_contentStr appendString:curCommit.contentStr];
321-
for (int i = 1; i<[_commits count]; i++) {
322-
curCommit = [_commits objectAtIndex:i];
323-
[_contentStr appendString:[NSString stringWithFormat:@"\n%@",curCommit.contentStr]];
324-
}
325-
}
326-
}else{
327-
if ([_target_type isEqualToString:@"ProjectMember"]) {
328-
if ([_action isEqualToString:@"quit"]) {
329-
[_contentStr appendString:_project.full_name];
330-
}else{
331-
[self addContentLinkStr:_target_user.name];
332-
}
333-
}else if ([_target_type isEqualToString:@"Project"]){
334-
[_contentStr appendString:_project.full_name];
335-
}else if ([_target_type isEqualToString:@"QcTask"]){
336-
[_contentStr appendString:_qc_task.link];
337-
}else if ([_target_type isEqualToString:@"ProjectStar"]){
338-
[_contentStr appendString:_project.full_name];
339-
}else if ([_target_type isEqualToString:@"ProjectWatcher"]){
340-
[_contentStr appendString:_project.full_name];
341-
}else if ([_target_type isEqualToString:@"PullRequestBean"]){
342-
[_contentStr appendString:_pull_request_title];
343-
}else if ([_target_type isEqualToString:@"PullRequestComment"]){
344-
[_contentStr appendString:_comment_content];
345-
}else if ([_target_type isEqualToString:@"MergeRequestBean"]){
346-
[_contentStr appendString:_merge_request_title];
347-
}else if ([_target_type isEqualToString:@"MergeRequestComment"]){
348-
[_contentStr appendString:_comment_content];
349-
}else{
350-
[_contentStr appendString:@"**未知**"];
351-
}
352-
}
353-
}
354-
return _contentStr;
355-
}
356151
@end
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
//
2+
// ProjectActivity.h
3+
// Coding_iOS
4+
//
5+
// Created by Ease on 15/5/13.
6+
// Copyright (c) 2015年 Coding. All rights reserved.
7+
//
8+
9+
#import <Foundation/Foundation.h>
10+
#import "Projects.h"
11+
#import "ProjectLineNote.h"
12+
13+
@class Task;
14+
@class ProjectTopic;
15+
16+
@interface ProjectActivity : NSObject
17+
@property (readwrite, nonatomic, strong) NSNumber *id;
18+
@property (readwrite, nonatomic, strong) NSString *target_type, *action, *action_msg, *type, *ref, *ref_type, *ref_path, *pull_request_title, *merge_request_title, *comment_content;
19+
@property (readwrite, nonatomic, strong) User *user, *target_user;
20+
@property (readwrite, nonatomic, strong) NSDate *created_at;
21+
@property (readwrite, nonatomic, strong) Task *origin_task, *task;
22+
@property (readwrite, nonatomic, strong) TaskComment *taskComment, *origin_taskComment;
23+
@property (readwrite, nonatomic, strong) Project *project;
24+
@property (readwrite, nonatomic, strong) ProjectTopic *project_topic;
25+
@property (readwrite, nonatomic, strong) File *file;
26+
@property (readwrite, nonatomic, strong) QcTask *qc_task;
27+
@property (readwrite, nonatomic, strong) Depot *depot, *source_depot;
28+
@property (readwrite, nonatomic, strong) NSMutableArray *commits;
29+
@property (readwrite, nonatomic, strong) NSDictionary *propertyArrayMap;
30+
@property (readwrite, nonatomic, strong) ProjectLineNote *line_note;
31+
32+
@property (readonly, nonatomic, strong) NSMutableArray *actionMediaItems, *contentMediaItems;
33+
@property (readonly, nonatomic, strong) NSMutableString *actionStr, *contentStr;
34+
@end

0 commit comments

Comments
 (0)