Fossil SCM

Add #define to enable the new formatting of the "extra" tail on timeline entries. Currently set for legacy.

drh 2025-10-17 11:05 timeline-enhance-2025
Commit 4da636fe350cda95f245b3b9ba1a7b4993b2b2d348773cbe75c2dc9909ed42a2
1 file changed +8 -3
+8 -3
--- src/timeline.c
+++ src/timeline.c
@@ -168,10 +168,11 @@
168168
if( pPost ){
169169
sqlite3_result_text(context, pPost->zWiki, -1, SQLITE_TRANSIENT);
170170
manifest_destroy(pPost);
171171
}
172172
}
173
+
173174
174175
/*
175176
** This routine generates the default "extra" text after the description
176177
** in a timeline.
177178
**
@@ -186,11 +187,10 @@
186187
const char *zThisUser, /* Suppress links to this user */
187188
const char *zThisTag /* Suppress links to this tag */
188189
){
189190
int rid = db_column_int(pQuery, 0);
190191
const char *zUuid = db_column_text(pQuery, 1);
191
- /* int isLeaf = db_column_int(pQuery, 5); // not used */
192192
const char *zDate = db_column_text(pQuery, 2);
193193
const char *zType = db_column_text(pQuery, 7);
194194
const char *zUser = db_column_text(pQuery, 4);
195195
const char *zTagList = db_column_text(pQuery, 8);
196196
int tagid = db_column_int(pQuery, 9);
@@ -198,13 +198,16 @@
198198
199199
if( (tmFlags & (TIMELINE_CLASSIC|TIMELINE_VERBOSE|TIMELINE_COMPACT))!=0 ){
200200
cgi_printf("(");
201201
}
202202
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
204206
if( (tmFlags & TIMELINE_CLASSIC)==0 ){
205207
if( zType[0]=='c' ){
208
+ int isLeaf = db_column_int(pQuery, 5);
206209
if( isLeaf ){
207210
if( has_closed_tag(rid) ){
208211
@ <span class='timelineLeaf'>Closed-Leaf</span>
209212
}else{
210213
@ <span class='timelineLeaf'>Leaf</span>
@@ -221,11 +224,11 @@
221224
}
222225
}else if( zType[0]=='g' || zType[0]=='w' || zType[0]=='t'
223226
|| zType[0]=='n' || zType[0]=='f'){
224227
cgi_printf("artifact:&nbsp;%z%S</a> ",href("%R/info/%!S",zUuid),zUuid);
225228
}
226
-#endif
229
+#endif /* OLD_STYLE */
227230
228231
if( g.perm.Hyperlink && fossil_strcmp(zDispUser, zThisUser)!=0 ){
229232
char *zLink;
230233
if( zType[0]!='f' || (tmFlags & TIMELINE_FORUMTXT)==0 ){
231234
zLink = mprintf("%R/timeline?u=%h&c=%t&y=a", zDispUser, zDate);
@@ -277,10 +280,11 @@
277280
href("%R/deltachain/%d",rid), rid);
278281
}
279282
}
280283
tag_private_status(rid);
281284
285
+#if !OLD_STYLE
282286
if( (tmFlags & TIMELINE_CLASSIC)==0 ){
283287
if( zType[0]=='e' && tagid ){
284288
char *zId = db_text(0,
285289
"SELECT substr(tagname,7) FROM tag WHERE tagid=abs(%d)", tagid);
286290
cgi_printf(" technote:&nbsp;%z%S</a>",
@@ -287,10 +291,11 @@
287291
href("%R/technote/%t",zId), zId);
288292
}else{
289293
cgi_printf(" hash:&nbsp;%z%S</a>", href("%R/info/%!S", zUuid), zUuid);
290294
}
291295
}
296
+#endif /* !OLD_STYLE */
292297
293298
/* End timelineDetail */
294299
if( (tmFlags & (TIMELINE_CLASSIC|TIMELINE_VERBOSE|TIMELINE_COMPACT))!=0 ){
295300
cgi_printf(")");
296301
}
297302
--- 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:&nbsp;%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:&nbsp;%z%S</a>",
@@ -287,10 +291,11 @@
287 href("%R/technote/%t",zId), zId);
288 }else{
289 cgi_printf(" hash:&nbsp;%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:&nbsp;%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:&nbsp;%z%S</a>",
@@ -287,10 +291,11 @@
291 href("%R/technote/%t",zId), zId);
292 }else{
293 cgi_printf(" hash:&nbsp;%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

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button