Fossil SCM
Add #define to enable the new formatting of the "extra" tail on timeline entries. Currently set for legacy.
Commit
4da636fe350cda95f245b3b9ba1a7b4993b2b2d348773cbe75c2dc9909ed42a2
Parent
f181c88a71b1200…
1 file changed
+8
-3
+8
-3
| --- src/timeline.c | ||
| +++ src/timeline.c | ||
| @@ -168,10 +168,11 @@ | ||
| 168 | 168 | if( pPost ){ |
| 169 | 169 | sqlite3_result_text(context, pPost->zWiki, -1, SQLITE_TRANSIENT); |
| 170 | 170 | manifest_destroy(pPost); |
| 171 | 171 | } |
| 172 | 172 | } |
| 173 | + | |
| 173 | 174 | |
| 174 | 175 | /* |
| 175 | 176 | ** This routine generates the default "extra" text after the description |
| 176 | 177 | ** in a timeline. |
| 177 | 178 | ** |
| @@ -186,11 +187,10 @@ | ||
| 186 | 187 | const char *zThisUser, /* Suppress links to this user */ |
| 187 | 188 | const char *zThisTag /* Suppress links to this tag */ |
| 188 | 189 | ){ |
| 189 | 190 | int rid = db_column_int(pQuery, 0); |
| 190 | 191 | const char *zUuid = db_column_text(pQuery, 1); |
| 191 | - /* int isLeaf = db_column_int(pQuery, 5); // not used */ | |
| 192 | 192 | const char *zDate = db_column_text(pQuery, 2); |
| 193 | 193 | const char *zType = db_column_text(pQuery, 7); |
| 194 | 194 | const char *zUser = db_column_text(pQuery, 4); |
| 195 | 195 | const char *zTagList = db_column_text(pQuery, 8); |
| 196 | 196 | int tagid = db_column_int(pQuery, 9); |
| @@ -198,13 +198,16 @@ | ||
| 198 | 198 | |
| 199 | 199 | if( (tmFlags & (TIMELINE_CLASSIC|TIMELINE_VERBOSE|TIMELINE_COMPACT))!=0 ){ |
| 200 | 200 | cgi_printf("("); |
| 201 | 201 | } |
| 202 | 202 | |
| 203 | -#if 0 | |
| 203 | +/* Set to 1 for historical appearance. Set to 0 for new experimental look */ | |
| 204 | +#define OLD_STYLE 1 | |
| 205 | +#if OLD_STYLE | |
| 204 | 206 | if( (tmFlags & TIMELINE_CLASSIC)==0 ){ |
| 205 | 207 | if( zType[0]=='c' ){ |
| 208 | + int isLeaf = db_column_int(pQuery, 5); | |
| 206 | 209 | if( isLeaf ){ |
| 207 | 210 | if( has_closed_tag(rid) ){ |
| 208 | 211 | @ <span class='timelineLeaf'>Closed-Leaf</span> |
| 209 | 212 | }else{ |
| 210 | 213 | @ <span class='timelineLeaf'>Leaf</span> |
| @@ -221,11 +224,11 @@ | ||
| 221 | 224 | } |
| 222 | 225 | }else if( zType[0]=='g' || zType[0]=='w' || zType[0]=='t' |
| 223 | 226 | || zType[0]=='n' || zType[0]=='f'){ |
| 224 | 227 | cgi_printf("artifact: %z%S</a> ",href("%R/info/%!S",zUuid),zUuid); |
| 225 | 228 | } |
| 226 | -#endif | |
| 229 | +#endif /* OLD_STYLE */ | |
| 227 | 230 | |
| 228 | 231 | if( g.perm.Hyperlink && fossil_strcmp(zDispUser, zThisUser)!=0 ){ |
| 229 | 232 | char *zLink; |
| 230 | 233 | if( zType[0]!='f' || (tmFlags & TIMELINE_FORUMTXT)==0 ){ |
| 231 | 234 | zLink = mprintf("%R/timeline?u=%h&c=%t&y=a", zDispUser, zDate); |
| @@ -277,10 +280,11 @@ | ||
| 277 | 280 | href("%R/deltachain/%d",rid), rid); |
| 278 | 281 | } |
| 279 | 282 | } |
| 280 | 283 | tag_private_status(rid); |
| 281 | 284 | |
| 285 | +#if !OLD_STYLE | |
| 282 | 286 | if( (tmFlags & TIMELINE_CLASSIC)==0 ){ |
| 283 | 287 | if( zType[0]=='e' && tagid ){ |
| 284 | 288 | char *zId = db_text(0, |
| 285 | 289 | "SELECT substr(tagname,7) FROM tag WHERE tagid=abs(%d)", tagid); |
| 286 | 290 | cgi_printf(" technote: %z%S</a>", |
| @@ -287,10 +291,11 @@ | ||
| 287 | 291 | href("%R/technote/%t",zId), zId); |
| 288 | 292 | }else{ |
| 289 | 293 | cgi_printf(" hash: %z%S</a>", href("%R/info/%!S", zUuid), zUuid); |
| 290 | 294 | } |
| 291 | 295 | } |
| 296 | +#endif /* !OLD_STYLE */ | |
| 292 | 297 | |
| 293 | 298 | /* End timelineDetail */ |
| 294 | 299 | if( (tmFlags & (TIMELINE_CLASSIC|TIMELINE_VERBOSE|TIMELINE_COMPACT))!=0 ){ |
| 295 | 300 | cgi_printf(")"); |
| 296 | 301 | } |
| 297 | 302 |
| --- src/timeline.c | |
| +++ src/timeline.c | |
| @@ -168,10 +168,11 @@ | |
| 168 | if( pPost ){ |
| 169 | sqlite3_result_text(context, pPost->zWiki, -1, SQLITE_TRANSIENT); |
| 170 | manifest_destroy(pPost); |
| 171 | } |
| 172 | } |
| 173 | |
| 174 | /* |
| 175 | ** This routine generates the default "extra" text after the description |
| 176 | ** in a timeline. |
| 177 | ** |
| @@ -186,11 +187,10 @@ | |
| 186 | const char *zThisUser, /* Suppress links to this user */ |
| 187 | const char *zThisTag /* Suppress links to this tag */ |
| 188 | ){ |
| 189 | int rid = db_column_int(pQuery, 0); |
| 190 | const char *zUuid = db_column_text(pQuery, 1); |
| 191 | /* int isLeaf = db_column_int(pQuery, 5); // not used */ |
| 192 | const char *zDate = db_column_text(pQuery, 2); |
| 193 | const char *zType = db_column_text(pQuery, 7); |
| 194 | const char *zUser = db_column_text(pQuery, 4); |
| 195 | const char *zTagList = db_column_text(pQuery, 8); |
| 196 | int tagid = db_column_int(pQuery, 9); |
| @@ -198,13 +198,16 @@ | |
| 198 | |
| 199 | if( (tmFlags & (TIMELINE_CLASSIC|TIMELINE_VERBOSE|TIMELINE_COMPACT))!=0 ){ |
| 200 | cgi_printf("("); |
| 201 | } |
| 202 | |
| 203 | #if 0 |
| 204 | if( (tmFlags & TIMELINE_CLASSIC)==0 ){ |
| 205 | if( zType[0]=='c' ){ |
| 206 | if( isLeaf ){ |
| 207 | if( has_closed_tag(rid) ){ |
| 208 | @ <span class='timelineLeaf'>Closed-Leaf</span> |
| 209 | }else{ |
| 210 | @ <span class='timelineLeaf'>Leaf</span> |
| @@ -221,11 +224,11 @@ | |
| 221 | } |
| 222 | }else if( zType[0]=='g' || zType[0]=='w' || zType[0]=='t' |
| 223 | || zType[0]=='n' || zType[0]=='f'){ |
| 224 | cgi_printf("artifact: %z%S</a> ",href("%R/info/%!S",zUuid),zUuid); |
| 225 | } |
| 226 | #endif |
| 227 | |
| 228 | if( g.perm.Hyperlink && fossil_strcmp(zDispUser, zThisUser)!=0 ){ |
| 229 | char *zLink; |
| 230 | if( zType[0]!='f' || (tmFlags & TIMELINE_FORUMTXT)==0 ){ |
| 231 | zLink = mprintf("%R/timeline?u=%h&c=%t&y=a", zDispUser, zDate); |
| @@ -277,10 +280,11 @@ | |
| 277 | href("%R/deltachain/%d",rid), rid); |
| 278 | } |
| 279 | } |
| 280 | tag_private_status(rid); |
| 281 | |
| 282 | if( (tmFlags & TIMELINE_CLASSIC)==0 ){ |
| 283 | if( zType[0]=='e' && tagid ){ |
| 284 | char *zId = db_text(0, |
| 285 | "SELECT substr(tagname,7) FROM tag WHERE tagid=abs(%d)", tagid); |
| 286 | cgi_printf(" technote: %z%S</a>", |
| @@ -287,10 +291,11 @@ | |
| 287 | href("%R/technote/%t",zId), zId); |
| 288 | }else{ |
| 289 | cgi_printf(" hash: %z%S</a>", href("%R/info/%!S", zUuid), zUuid); |
| 290 | } |
| 291 | } |
| 292 | |
| 293 | /* End timelineDetail */ |
| 294 | if( (tmFlags & (TIMELINE_CLASSIC|TIMELINE_VERBOSE|TIMELINE_COMPACT))!=0 ){ |
| 295 | cgi_printf(")"); |
| 296 | } |
| 297 |
| --- src/timeline.c | |
| +++ src/timeline.c | |
| @@ -168,10 +168,11 @@ | |
| 168 | if( pPost ){ |
| 169 | sqlite3_result_text(context, pPost->zWiki, -1, SQLITE_TRANSIENT); |
| 170 | manifest_destroy(pPost); |
| 171 | } |
| 172 | } |
| 173 | |
| 174 | |
| 175 | /* |
| 176 | ** This routine generates the default "extra" text after the description |
| 177 | ** in a timeline. |
| 178 | ** |
| @@ -186,11 +187,10 @@ | |
| 187 | const char *zThisUser, /* Suppress links to this user */ |
| 188 | const char *zThisTag /* Suppress links to this tag */ |
| 189 | ){ |
| 190 | int rid = db_column_int(pQuery, 0); |
| 191 | const char *zUuid = db_column_text(pQuery, 1); |
| 192 | const char *zDate = db_column_text(pQuery, 2); |
| 193 | const char *zType = db_column_text(pQuery, 7); |
| 194 | const char *zUser = db_column_text(pQuery, 4); |
| 195 | const char *zTagList = db_column_text(pQuery, 8); |
| 196 | int tagid = db_column_int(pQuery, 9); |
| @@ -198,13 +198,16 @@ | |
| 198 | |
| 199 | if( (tmFlags & (TIMELINE_CLASSIC|TIMELINE_VERBOSE|TIMELINE_COMPACT))!=0 ){ |
| 200 | cgi_printf("("); |
| 201 | } |
| 202 | |
| 203 | /* Set to 1 for historical appearance. Set to 0 for new experimental look */ |
| 204 | #define OLD_STYLE 1 |
| 205 | #if OLD_STYLE |
| 206 | if( (tmFlags & TIMELINE_CLASSIC)==0 ){ |
| 207 | if( zType[0]=='c' ){ |
| 208 | int isLeaf = db_column_int(pQuery, 5); |
| 209 | if( isLeaf ){ |
| 210 | if( has_closed_tag(rid) ){ |
| 211 | @ <span class='timelineLeaf'>Closed-Leaf</span> |
| 212 | }else{ |
| 213 | @ <span class='timelineLeaf'>Leaf</span> |
| @@ -221,11 +224,11 @@ | |
| 224 | } |
| 225 | }else if( zType[0]=='g' || zType[0]=='w' || zType[0]=='t' |
| 226 | || zType[0]=='n' || zType[0]=='f'){ |
| 227 | cgi_printf("artifact: %z%S</a> ",href("%R/info/%!S",zUuid),zUuid); |
| 228 | } |
| 229 | #endif /* OLD_STYLE */ |
| 230 | |
| 231 | if( g.perm.Hyperlink && fossil_strcmp(zDispUser, zThisUser)!=0 ){ |
| 232 | char *zLink; |
| 233 | if( zType[0]!='f' || (tmFlags & TIMELINE_FORUMTXT)==0 ){ |
| 234 | zLink = mprintf("%R/timeline?u=%h&c=%t&y=a", zDispUser, zDate); |
| @@ -277,10 +280,11 @@ | |
| 280 | href("%R/deltachain/%d",rid), rid); |
| 281 | } |
| 282 | } |
| 283 | tag_private_status(rid); |
| 284 | |
| 285 | #if !OLD_STYLE |
| 286 | if( (tmFlags & TIMELINE_CLASSIC)==0 ){ |
| 287 | if( zType[0]=='e' && tagid ){ |
| 288 | char *zId = db_text(0, |
| 289 | "SELECT substr(tagname,7) FROM tag WHERE tagid=abs(%d)", tagid); |
| 290 | cgi_printf(" technote: %z%S</a>", |
| @@ -287,10 +291,11 @@ | |
| 291 | href("%R/technote/%t",zId), zId); |
| 292 | }else{ |
| 293 | cgi_printf(" hash: %z%S</a>", href("%R/info/%!S", zUuid), zUuid); |
| 294 | } |
| 295 | } |
| 296 | #endif /* !OLD_STYLE */ |
| 297 | |
| 298 | /* End timelineDetail */ |
| 299 | if( (tmFlags & (TIMELINE_CLASSIC|TIMELINE_VERBOSE|TIMELINE_COMPACT))!=0 ){ |
| 300 | cgi_printf(")"); |
| 301 | } |
| 302 |