Skip to content

Commit 9203177

Browse files
committed
Only show first line of commit message in header, show the rest in the main body.
1 parent ed2174d commit 9203177

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

PBWebCommitController.m

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -228,13 +228,19 @@ - (NSArray *)parseHeader:(NSString *)text
228228
- (NSString *)htmlForHeader:(NSArray *)header withRefs:(NSString *)badges
229229
{
230230
NSString *last_mail = @"";
231+
NSMutableString *subjectFirst = [NSMutableString string];
231232
NSMutableString *auths=[NSMutableString string];
232233
NSMutableString *refs=[NSMutableString string];
233234
NSMutableString *subject=[NSMutableString string];
234235

235236
for (NSDictionary *item in header) {
236237
if ([[item objectForKey:kHeaderKeyName] isEqualToString:@"subject"]) {
237-
[subject appendString:[NSString stringWithFormat:@"%@<br/>",[GLFileView escapeHTML:[item objectForKey:kHeaderKeyContent]]]];
238+
if ([subjectFirst isEqualToString:@""]) {
239+
[subjectFirst appendString:[NSString stringWithFormat:@"%@",[GLFileView escapeHTML:[item objectForKey:kHeaderKeyContent]]]];
240+
} else {
241+
[subject appendString:[NSString stringWithFormat:@"%@<br/>",[GLFileView escapeHTML:[item objectForKey:kHeaderKeyContent]]]];
242+
}
243+
238244
}else{
239245
if([[item objectForKey:kHeaderKeyContent] isKindOfClass:[NSString class]]){
240246
[refs appendString:[NSString stringWithFormat:@"<tr><td>%@</td><td><a href='' onclick='selectCommit(this.innerHTML); return false;'>%@</a></td></tr>",[item objectForKey:kHeaderKeyName],[item objectForKey:kHeaderKeyContent]]];
@@ -263,7 +269,7 @@ - (NSString *)htmlForHeader:(NSArray *)header withRefs:(NSString *)badges
263269
}
264270
}
265271

266-
return [NSString stringWithFormat:@"<div id='header' class='clearfix'><table class='references'>%@</table><p class='subject'>%@</p>%@<div id='badges'>%@</div></div>",refs,subject,auths,badges];
272+
return [NSString stringWithFormat:@"<div id='header' class='clearfix'><table class='references'>%@</table><p class='subject'>%@</p>%@<div id='badges'>%@</div></div><p>%@</p>",refs,subjectFirst,auths,badges,subject];
267273
}
268274

269275
- (NSString *) arbitraryHashForString:(NSString*)concat {

0 commit comments

Comments
 (0)