Fossil SCM

Provide new classes "tktTlOpen" or "tktTlClosed" for the timeline display of tickets, depending on whether or not the ticket is open or closed. The default style changes the foreground color slightly. Probably the style needs to be adjusted.

drh 2019-12-23 14:31 trunk
Commit d80adfe0297d109dd124860e242bf347694a60e9e6b6e586cd3f744696e66a15
--- src/default_css.txt
+++ src/default_css.txt
@@ -455,10 +455,16 @@
455455
}
456456
td.tktDspValue {
457457
text-align: left;
458458
vertical-align: top;
459459
background-color: #d0d0d0;
460
+}
461
+td.tktTlOpen {
462
+ color: #800;
463
+}
464
+td.tktTlClosed {
465
+ color: #888;
460466
}
461467
span.tktError {
462468
color: red;
463469
font-weight: bold;
464470
}
465471
--- src/default_css.txt
+++ src/default_css.txt
@@ -455,10 +455,16 @@
455 }
456 td.tktDspValue {
457 text-align: left;
458 vertical-align: top;
459 background-color: #d0d0d0;
 
 
 
 
 
 
460 }
461 span.tktError {
462 color: red;
463 font-weight: bold;
464 }
465
--- src/default_css.txt
+++ src/default_css.txt
@@ -455,10 +455,16 @@
455 }
456 td.tktDspValue {
457 text-align: left;
458 vertical-align: top;
459 background-color: #d0d0d0;
460 }
461 td.tktTlOpen {
462 color: #800;
463 }
464 td.tktTlClosed {
465 color: #888;
466 }
467 span.tktError {
468 color: red;
469 font-weight: bold;
470 }
471
+26 -7
--- src/timeline.c
+++ src/timeline.c
@@ -114,10 +114,11 @@
114114
#define TIMELINE_NOSCROLL 0x0100000 /* Don't scroll to the selection */
115115
#define TIMELINE_FILEDIFF 0x0200000 /* Show File differences, not ckin diffs */
116116
#define TIMELINE_CHPICK 0x0400000 /* Show cherrypick merges */
117117
#define TIMELINE_FILLGAPS 0x0800000 /* Dotted lines for missing nodes */
118118
#define TIMELINE_XMERGE 0x1000000 /* Omit merges from off-graph nodes */
119
+#define TIMELINE_NOTKT 0x2000000 /* Omit extra ticket classes */
119120
#endif
120121
121122
/*
122123
** Hash a string and use the hash to determine a background color.
123124
*/
@@ -324,10 +325,11 @@
324325
int modPending; /* Pending moderation */
325326
char *zDateLink; /* URL for the link on the timestamp */
326327
int drawDetailEllipsis; /* True to show ellipsis in place of detail */
327328
int gidx = 0; /* Graph row identifier */
328329
int isSelectedOrCurrent = 0; /* True if current row is selected */
330
+ const char *zExtraClass = "";
329331
char zTime[20];
330332
331333
if( zDate==0 ){
332334
zDate = "YYYY-MM-DD HH:MM:SS"; /* Something wrong with the repo */
333335
}
@@ -404,10 +406,23 @@
404406
}else if( rid==vid ){
405407
@ <tr class="timelineCurrent">
406408
isSelectedOrCurrent = 1;
407409
}else {
408410
@ <tr>
411
+ }
412
+ if( zType[0]=='t' && tagid && (tmFlags & TIMELINE_NOTKT)==0 ){
413
+ char *zTktid = db_text(0, "SELECT substr(tagname,5) FROM tag"
414
+ " WHERE tagid=%d", tagid);
415
+ if( zTktid ){
416
+ int isClosed = 0;
417
+ if( is_ticket(zTktid, &isClosed) && isClosed ){
418
+ zExtraClass = " tktTlClosed";
419
+ }else{
420
+ zExtraClass = " tktTlOpen";
421
+ }
422
+ fossil_free(zTktid);
423
+ }
409424
}
410425
if( zType[0]=='e' && tagid ){
411426
if( bTimestampLinksToInfo ){
412427
char *zId;
413428
zId = db_text(0, "SELECT substr(tagname, 7) FROM tag WHERE tagid=%d",
@@ -486,13 +501,13 @@
486501
gidx = graph_add_row(pGraph, rid, -1, 0, 0, zBr, zBgClr, zUuid, 0);
487502
@ <div id="m%d(gidx)" class="tl-nodemark"></div>
488503
}
489504
@</td>
490505
if( !isSelectedOrCurrent ){
491
- @ <td class="timeline%s(zStyle)Cell" id='mc%d(gidx)'>
506
+ @ <td class="timeline%s(zStyle)Cell%s(zExtraClass)" id='mc%d(gidx)'>
492507
}else{
493
- @ <td class="timeline%s(zStyle)Cell">
508
+ @ <td class="timeline%s(zStyle)Cell%s(zExtraClass)">
494509
}
495510
if( pGraph && zType[0]!='c' ){
496511
@ &bull;
497512
}
498513
if( modPending ){
@@ -543,13 +558,17 @@
543558
}
544559
}
545560
if( zType[0]!='c' ){
546561
/* Comments for anything other than a check-in are generated by
547562
** "fossil rebuild" and expect to be rendered as text/x-fossil-wiki */
548
- if( zType[0]=='w' ) wiki_hyperlink_override(zUuid);
549
- wiki_convert(&comment, 0, WIKI_INLINE);
550
- wiki_hyperlink_override(0);
563
+ if( zType[0]=='w' ){
564
+ wiki_hyperlink_override(zUuid);
565
+ wiki_convert(&comment, 0, WIKI_INLINE);
566
+ wiki_hyperlink_override(0);
567
+ }else{
568
+ wiki_convert(&comment, 0, WIKI_INLINE);
569
+ }
551570
}else{
552571
if( bCommentGitStyle ){
553572
/* Truncate comment at first blank line */
554573
int ii, jj;
555574
int n = blob_size(&comment);
@@ -584,13 +603,13 @@
584603
@ <span class='timelineEllipsis' id='ellipsis-%d(rid)' \
585604
@ data-id='%d(rid)'>...</span>
586605
}
587606
if( tmFlags & TIMELINE_COLUMNAR ){
588607
if( !isSelectedOrCurrent ){
589
- @ <td class="timelineDetailCell" id='md%d(gidx)'>
608
+ @ <td class="timelineDetailCell%s(zExtraClass)" id='md%d(gidx)'>
590609
}else{
591
- @ <td class="timelineDetailCell">
610
+ @ <td class="timelineDetailCell%s(zExtraClass)">
592611
}
593612
}
594613
if( tmFlags & TIMELINE_COMPACT ){
595614
cgi_printf("<span class='clutter' id='detail-%d'>",rid);
596615
}
597616
--- src/timeline.c
+++ src/timeline.c
@@ -114,10 +114,11 @@
114 #define TIMELINE_NOSCROLL 0x0100000 /* Don't scroll to the selection */
115 #define TIMELINE_FILEDIFF 0x0200000 /* Show File differences, not ckin diffs */
116 #define TIMELINE_CHPICK 0x0400000 /* Show cherrypick merges */
117 #define TIMELINE_FILLGAPS 0x0800000 /* Dotted lines for missing nodes */
118 #define TIMELINE_XMERGE 0x1000000 /* Omit merges from off-graph nodes */
 
119 #endif
120
121 /*
122 ** Hash a string and use the hash to determine a background color.
123 */
@@ -324,10 +325,11 @@
324 int modPending; /* Pending moderation */
325 char *zDateLink; /* URL for the link on the timestamp */
326 int drawDetailEllipsis; /* True to show ellipsis in place of detail */
327 int gidx = 0; /* Graph row identifier */
328 int isSelectedOrCurrent = 0; /* True if current row is selected */
 
329 char zTime[20];
330
331 if( zDate==0 ){
332 zDate = "YYYY-MM-DD HH:MM:SS"; /* Something wrong with the repo */
333 }
@@ -404,10 +406,23 @@
404 }else if( rid==vid ){
405 @ <tr class="timelineCurrent">
406 isSelectedOrCurrent = 1;
407 }else {
408 @ <tr>
 
 
 
 
 
 
 
 
 
 
 
 
 
409 }
410 if( zType[0]=='e' && tagid ){
411 if( bTimestampLinksToInfo ){
412 char *zId;
413 zId = db_text(0, "SELECT substr(tagname, 7) FROM tag WHERE tagid=%d",
@@ -486,13 +501,13 @@
486 gidx = graph_add_row(pGraph, rid, -1, 0, 0, zBr, zBgClr, zUuid, 0);
487 @ <div id="m%d(gidx)" class="tl-nodemark"></div>
488 }
489 @</td>
490 if( !isSelectedOrCurrent ){
491 @ <td class="timeline%s(zStyle)Cell" id='mc%d(gidx)'>
492 }else{
493 @ <td class="timeline%s(zStyle)Cell">
494 }
495 if( pGraph && zType[0]!='c' ){
496 @ &bull;
497 }
498 if( modPending ){
@@ -543,13 +558,17 @@
543 }
544 }
545 if( zType[0]!='c' ){
546 /* Comments for anything other than a check-in are generated by
547 ** "fossil rebuild" and expect to be rendered as text/x-fossil-wiki */
548 if( zType[0]=='w' ) wiki_hyperlink_override(zUuid);
549 wiki_convert(&comment, 0, WIKI_INLINE);
550 wiki_hyperlink_override(0);
 
 
 
 
551 }else{
552 if( bCommentGitStyle ){
553 /* Truncate comment at first blank line */
554 int ii, jj;
555 int n = blob_size(&comment);
@@ -584,13 +603,13 @@
584 @ <span class='timelineEllipsis' id='ellipsis-%d(rid)' \
585 @ data-id='%d(rid)'>...</span>
586 }
587 if( tmFlags & TIMELINE_COLUMNAR ){
588 if( !isSelectedOrCurrent ){
589 @ <td class="timelineDetailCell" id='md%d(gidx)'>
590 }else{
591 @ <td class="timelineDetailCell">
592 }
593 }
594 if( tmFlags & TIMELINE_COMPACT ){
595 cgi_printf("<span class='clutter' id='detail-%d'>",rid);
596 }
597
--- src/timeline.c
+++ src/timeline.c
@@ -114,10 +114,11 @@
114 #define TIMELINE_NOSCROLL 0x0100000 /* Don't scroll to the selection */
115 #define TIMELINE_FILEDIFF 0x0200000 /* Show File differences, not ckin diffs */
116 #define TIMELINE_CHPICK 0x0400000 /* Show cherrypick merges */
117 #define TIMELINE_FILLGAPS 0x0800000 /* Dotted lines for missing nodes */
118 #define TIMELINE_XMERGE 0x1000000 /* Omit merges from off-graph nodes */
119 #define TIMELINE_NOTKT 0x2000000 /* Omit extra ticket classes */
120 #endif
121
122 /*
123 ** Hash a string and use the hash to determine a background color.
124 */
@@ -324,10 +325,11 @@
325 int modPending; /* Pending moderation */
326 char *zDateLink; /* URL for the link on the timestamp */
327 int drawDetailEllipsis; /* True to show ellipsis in place of detail */
328 int gidx = 0; /* Graph row identifier */
329 int isSelectedOrCurrent = 0; /* True if current row is selected */
330 const char *zExtraClass = "";
331 char zTime[20];
332
333 if( zDate==0 ){
334 zDate = "YYYY-MM-DD HH:MM:SS"; /* Something wrong with the repo */
335 }
@@ -404,10 +406,23 @@
406 }else if( rid==vid ){
407 @ <tr class="timelineCurrent">
408 isSelectedOrCurrent = 1;
409 }else {
410 @ <tr>
411 }
412 if( zType[0]=='t' && tagid && (tmFlags & TIMELINE_NOTKT)==0 ){
413 char *zTktid = db_text(0, "SELECT substr(tagname,5) FROM tag"
414 " WHERE tagid=%d", tagid);
415 if( zTktid ){
416 int isClosed = 0;
417 if( is_ticket(zTktid, &isClosed) && isClosed ){
418 zExtraClass = " tktTlClosed";
419 }else{
420 zExtraClass = " tktTlOpen";
421 }
422 fossil_free(zTktid);
423 }
424 }
425 if( zType[0]=='e' && tagid ){
426 if( bTimestampLinksToInfo ){
427 char *zId;
428 zId = db_text(0, "SELECT substr(tagname, 7) FROM tag WHERE tagid=%d",
@@ -486,13 +501,13 @@
501 gidx = graph_add_row(pGraph, rid, -1, 0, 0, zBr, zBgClr, zUuid, 0);
502 @ <div id="m%d(gidx)" class="tl-nodemark"></div>
503 }
504 @</td>
505 if( !isSelectedOrCurrent ){
506 @ <td class="timeline%s(zStyle)Cell%s(zExtraClass)" id='mc%d(gidx)'>
507 }else{
508 @ <td class="timeline%s(zStyle)Cell%s(zExtraClass)">
509 }
510 if( pGraph && zType[0]!='c' ){
511 @ &bull;
512 }
513 if( modPending ){
@@ -543,13 +558,17 @@
558 }
559 }
560 if( zType[0]!='c' ){
561 /* Comments for anything other than a check-in are generated by
562 ** "fossil rebuild" and expect to be rendered as text/x-fossil-wiki */
563 if( zType[0]=='w' ){
564 wiki_hyperlink_override(zUuid);
565 wiki_convert(&comment, 0, WIKI_INLINE);
566 wiki_hyperlink_override(0);
567 }else{
568 wiki_convert(&comment, 0, WIKI_INLINE);
569 }
570 }else{
571 if( bCommentGitStyle ){
572 /* Truncate comment at first blank line */
573 int ii, jj;
574 int n = blob_size(&comment);
@@ -584,13 +603,13 @@
603 @ <span class='timelineEllipsis' id='ellipsis-%d(rid)' \
604 @ data-id='%d(rid)'>...</span>
605 }
606 if( tmFlags & TIMELINE_COLUMNAR ){
607 if( !isSelectedOrCurrent ){
608 @ <td class="timelineDetailCell%s(zExtraClass)" id='md%d(gidx)'>
609 }else{
610 @ <td class="timelineDetailCell%s(zExtraClass)">
611 }
612 }
613 if( tmFlags & TIMELINE_COMPACT ){
614 cgi_printf("<span class='clutter' id='detail-%d'>",rid);
615 }
616
+3 -2
--- src/tkt.c
+++ src/tkt.c
@@ -874,12 +874,13 @@
874874
"ORDER BY mtime DESC",
875875
timeline_query_for_www(), tagid, zFullUuid, zFullUuid, zFullUuid
876876
);
877877
}
878878
db_prepare(&q, "%z", zSQL/*safe-for-%s*/);
879
- www_print_timeline(&q, TIMELINE_ARTID|TIMELINE_DISJOINT|TIMELINE_GRAPH,
880
- 0, 0, 0, 0, 0, 0);
879
+ www_print_timeline(&q,
880
+ TIMELINE_ARTID | TIMELINE_DISJOINT | TIMELINE_GRAPH | TIMELINE_NOTKT,
881
+ 0, 0, 0, 0, 0, 0);
881882
db_finalize(&q);
882883
fossil_free(zFullUuid);
883884
}
884885
885886
/*
886887
--- src/tkt.c
+++ src/tkt.c
@@ -874,12 +874,13 @@
874 "ORDER BY mtime DESC",
875 timeline_query_for_www(), tagid, zFullUuid, zFullUuid, zFullUuid
876 );
877 }
878 db_prepare(&q, "%z", zSQL/*safe-for-%s*/);
879 www_print_timeline(&q, TIMELINE_ARTID|TIMELINE_DISJOINT|TIMELINE_GRAPH,
880 0, 0, 0, 0, 0, 0);
 
881 db_finalize(&q);
882 fossil_free(zFullUuid);
883 }
884
885 /*
886
--- src/tkt.c
+++ src/tkt.c
@@ -874,12 +874,13 @@
874 "ORDER BY mtime DESC",
875 timeline_query_for_www(), tagid, zFullUuid, zFullUuid, zFullUuid
876 );
877 }
878 db_prepare(&q, "%z", zSQL/*safe-for-%s*/);
879 www_print_timeline(&q,
880 TIMELINE_ARTID | TIMELINE_DISJOINT | TIMELINE_GRAPH | TIMELINE_NOTKT,
881 0, 0, 0, 0, 0, 0);
882 db_finalize(&q);
883 fossil_free(zFullUuid);
884 }
885
886 /*
887
--- src/wikiformat.c
+++ src/wikiformat.c
@@ -1100,11 +1100,11 @@
11001100
** zTarget is guaranteed to be a UUID. It might be the UUID of a ticket.
11011101
** If it is, store in *pClosed a true or false depending on whether or not
11021102
** the ticket is closed and return true. If zTarget
11031103
** is not the UUID of a ticket, return false.
11041104
*/
1105
-static int is_ticket(
1105
+int is_ticket(
11061106
const char *zTarget, /* Ticket UUID */
11071107
int *pClosed /* True if the ticket is closed */
11081108
){
11091109
static Stmt q;
11101110
int n;
11111111
--- src/wikiformat.c
+++ src/wikiformat.c
@@ -1100,11 +1100,11 @@
1100 ** zTarget is guaranteed to be a UUID. It might be the UUID of a ticket.
1101 ** If it is, store in *pClosed a true or false depending on whether or not
1102 ** the ticket is closed and return true. If zTarget
1103 ** is not the UUID of a ticket, return false.
1104 */
1105 static int is_ticket(
1106 const char *zTarget, /* Ticket UUID */
1107 int *pClosed /* True if the ticket is closed */
1108 ){
1109 static Stmt q;
1110 int n;
1111
--- src/wikiformat.c
+++ src/wikiformat.c
@@ -1100,11 +1100,11 @@
1100 ** zTarget is guaranteed to be a UUID. It might be the UUID of a ticket.
1101 ** If it is, store in *pClosed a true or false depending on whether or not
1102 ** the ticket is closed and return true. If zTarget
1103 ** is not the UUID of a ticket, return false.
1104 */
1105 int is_ticket(
1106 const char *zTarget, /* Ticket UUID */
1107 int *pClosed /* True if the ticket is closed */
1108 ){
1109 static Stmt q;
1110 int n;
1111

Keyboard Shortcuts

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