Fossil SCM

Change the style selector query parameter on /timeline to "ss". Other code cleanup. The new style selector is working, but needs default CSS.

drh 2017-11-28 21:43 UTC sticky-timeline-style
Commit f64fa4f1ae38fe97fe47cada2c1b8aeaae43cfdbc5e41af889160c70b862b0fb
1 file changed +42 -103
+42 -103
--- src/timeline.c
+++ src/timeline.c
@@ -106,10 +106,11 @@
106106
#define TIMELINE_SHOWRID 0x0400 /* Show RID values in addition to UUIDs */
107107
#define TIMELINE_BISECT 0x0800 /* Show supplimental bisect information */
108108
#define TIMELINE_COMPACT 0x1000 /* Use the "compact" view style */
109109
#define TIMELINE_DETAILED 0x2000 /* Use the "detailed" view style */
110110
#define TIMELINE_NORMAL 0x4000 /* Use the "normal" view style */
111
+#define TIMELINE_COLUMNAR 0x8000 /* Use the "columns view style */
111112
#endif
112113
113114
/*
114115
** Hash a string and use the hash to determine a background color.
115116
*/
@@ -252,16 +253,10 @@
252253
int pendingEndTr = 0; /* True if a </td></tr> is needed */
253254
int vid = 0; /* Current checkout version */
254255
int dateFormat = 0; /* 0: HH:MM (default) */
255256
int bCommentGitStyle = 0; /* Only show comments through first blank line */
256257
const char *zTdClass;
257
- int bHashBeforeComment = 0; /* Show hash before the comment */
258
- int bHashAfterComment = 0; /* Show hash after the comment */
259
- int bHashInDetail = 0; /* Show the hash inside the detail section */
260
- int bShowDetail; /* Show the detail section */
261
- int bSeparateDetail; /* Detail in a separate column */
262
- int eCommentFormat; /* value for timeline-comment-format */
263258
const char *zDateFmt;
264259
int iTableId = timeline_tableid();
265260
266261
if( fossil_strcmp(g.zIpAddr, "127.0.0.1")==0 && db_open_local(0) ){
267262
vid = db_lget_int("checkout", 0);
@@ -439,11 +434,12 @@
439434
db_reset(&qbranch);
440435
@ <div id="m%d(gidx)" class="tl-nodemark"></div>
441436
}
442437
@</td>
443438
if( zBgClr && zBgClr[0] && rid!=selectedRid ){
444
- @ <td class="timelineTableCell %s(zTdClass)" style="background-color: %h(zBgClr);">
439
+ @ <td class="timelineTableCell %s(zTdClass)" \
440
+ @ style="background-color: %h(zBgClr);">
445441
}else{
446442
@ <td class="timelineTableCell %s(zTdClass)">
447443
}
448444
if( pGraph && zType[0]!='c' ){
449445
@ &bull;
@@ -459,38 +455,10 @@
459455
@ <b>%s(db_column_text(&bisectQuery,1))</b>
460456
@ (%d(db_column_int(&bisectQuery,0)))
461457
}
462458
db_reset(&bisectQuery);
463459
}
464
-#if 0
465
- if( bHashBeforeComment ){
466
- if( zType[0]=='c' ){
467
- hyperlink_to_uuid(zUuid);
468
- if( isLeaf ){
469
- if( db_exists("SELECT 1 FROM tagxref"
470
- " WHERE rid=%d AND tagid=%d AND tagtype>0",
471
- rid, TAG_CLOSED) ){
472
- @ <span class="timelineLeaf">Closed-Leaf:</span>
473
- }else{
474
- @ <span class="timelineLeaf">Leaf:</span>
475
- }
476
- }
477
- }else if( zType[0]=='e' && tagid ){
478
- hyperlink_to_event_tagid(tagid<0?-tagid:tagid);
479
- }else if( (tmFlags & TIMELINE_ARTID)!=0 ){
480
- hyperlink_to_uuid(zUuid);
481
- }
482
- if( tmFlags & TIMELINE_SHOWRID ){
483
- int srcId = delta_source_rid(rid);
484
- if( srcId ){
485
- @ (%d(rid)&larr;%d(srcId))
486
- }else{
487
- @ (%d(rid))
488
- }
489
- }
490
- }
491
-#endif
492460
drawDetailEllipsis = (tmFlags & TIMELINE_COMPACT)!=0;
493461
db_column_blob(pQuery, commentColumn, &comment);
494462
if( zType[0]!='c' ){
495463
/* Comments for anything other than a check-in are generated by
496464
** "fossil rebuild" and expect to be rendered as text/x-fossil-wiki */
@@ -526,93 +494,61 @@
526494
}
527495
@ </span>
528496
}
529497
blob_reset(&comment);
530498
531
-#if 0
532
- if( bHashAfterComment ){
533
- if( zType[0]=='c' ){
534
- hyperlink_to_uuid(zUuid);
535
- if( isLeaf ){
536
- if( db_exists("SELECT 1 FROM tagxref"
537
- " WHERE rid=%d AND tagid=%d AND tagtype>0",
538
- rid, TAG_CLOSED) ){
539
- @ <span class="timelineLeaf">Closed-Leaf</span>
540
- }else{
541
- @ <span class="timelineLeaf">Leaf</span>
542
- }
543
- }
544
- }else if( zType[0]=='e' && tagid ){
545
- hyperlink_to_event_tagid(tagid<0?-tagid:tagid);
546
- }else if( (tmFlags & TIMELINE_ARTID)!=0 ){
547
- hyperlink_to_uuid(zUuid);
548
- }
549
- if( tmFlags & TIMELINE_SHOWRID ){
550
- int srcId = delta_source_rid(rid);
551
- if( srcId ){
552
- @ (%d(rid)&larr;%d(srcId))
553
- }else{
554
- @ (%d(rid))
555
- }
556
- }
557
- drawDetailEllipsis = 1;
558
- }
559
-#endif
560
-
561499
/* Generate extra information and hyperlinks to follow the comment.
562500
** Example: "(check-in: [abcdefg], user: drh, tags: trunk)"
563501
*/
564502
if( drawDetailEllipsis ){
565503
@ <span class='timelineEllipsis anticlutter' id='ellipsis-%d(rid)' \
566504
@ onclick='toggleDetail(%d(rid))'>...</span>
567505
}
568
- if( bSeparateDetail ){
506
+ if( tmFlags & TIMELINE_COLUMNAR ){
569507
if( zBgClr && zBgClr[0] && rid!=selectedRid ){
570508
@ <td class="timelineTableCell timelineDetailCell"
571509
@ style="background-color: %h(zBgClr);">
572510
}else{
573511
@ <td class="timelineTableCell timelineDetailCell">
574512
}
575513
}
576514
if( tmFlags & TIMELINE_COMPACT ){
577
- cgi_printf("<span class='timelineDetailWrapper clutter' id='detail-%d'>", rid);
515
+ cgi_printf("<span class='timelineDetailWrapper clutter' id='detail-%d'>",rid);
578516
}else{
579517
cgi_printf("<span class='timelineDetailWrapper'>");
580518
}
581519
if( zType[0]=='c' ){
582520
cgi_printf("<span class='timelineDetail timelineCheckinDetail'>");
583521
}else{
584522
cgi_printf("<span class='timelineDetail'>");
585523
}
586524
587
- if( bHashInDetail ){
588
- if( zType[0]=='c' ){
589
- if( isLeaf ){
590
- if( db_exists("SELECT 1 FROM tagxref"
591
- " WHERE rid=%d AND tagid=%d AND tagtype>0",
592
- rid, TAG_CLOSED) ){
593
- @ <span class='timelineLeaf'>Closed-Leaf</span>
594
- }else{
595
- @ <span class='timelineLeaf'>Leaf</span>
596
- }
597
- }
598
- cgi_printf("check-in: ");
599
- hyperlink_to_uuid(zUuid);
600
- }else if( zType[0]=='e' && tagid ){
601
- cgi_printf("technote: ");
602
- hyperlink_to_event_tagid(tagid<0?-tagid:tagid);
603
- }else{
604
- cgi_printf("artifact: ");
605
- hyperlink_to_uuid(zUuid);
606
- }
525
+ if( zType[0]=='c' ){
526
+ if( isLeaf ){
527
+ if( db_exists("SELECT 1 FROM tagxref"
528
+ " WHERE rid=%d AND tagid=%d AND tagtype>0",
529
+ rid, TAG_CLOSED) ){
530
+ @ <span class='timelineLeaf'>Closed-Leaf</span>
531
+ }else{
532
+ @ <span class='timelineLeaf'>Leaf</span>
533
+ }
534
+ }
535
+ cgi_printf("check-in:&nbsp;");
536
+ hyperlink_to_uuid(zUuid);
537
+ }else if( zType[0]=='e' && tagid ){
538
+ cgi_printf("technote:&nbsp;");
539
+ hyperlink_to_event_tagid(tagid<0?-tagid:tagid);
540
+ }else{
541
+ cgi_printf("artifact:&nbsp;");
542
+ hyperlink_to_uuid(zUuid);
607543
}
608544
609545
if( g.perm.Hyperlink && fossil_strcmp(zDispUser, zThisUser)!=0 ){
610546
char *zLink = mprintf("%R/timeline?u=%h&c=%t&nd&n=200", zDispUser, zDate);
611
- cgi_printf("user: %z%h</a>", href("%z",zLink), zDispUser);
547
+ cgi_printf("user:&nbsp;%z%h</a>", href("%z",zLink), zDispUser);
612548
}else{
613
- cgi_printf("user: %h", zDispUser);
549
+ cgi_printf("user:&nbsp;%h", zDispUser);
614550
}
615551
616552
/* Generate the "tags: TAGLIST" at the end of the comment, together
617553
** with hyperlinks to the tag list.
618554
*/
@@ -634,30 +570,31 @@
634570
blob_appendf(&links, "%#h", i+2, z);
635571
}
636572
if( z[i]==0 ) break;
637573
z += i+2;
638574
}
639
- cgi_printf(" tags: %s", blob_str(&links));
575
+ cgi_printf(" tags:&nbsp;%s", blob_str(&links));
640576
blob_reset(&links);
641577
}else{
642
- cgi_printf(" tags: %h", zTagList);
578
+ cgi_printf(" tags:&nbsp;%h", zTagList);
643579
}
644580
}
645581
646582
if( tmFlags & TIMELINE_SHOWRID ){
647583
int srcId = delta_source_rid(rid);
648584
if( srcId ){
649
- cgi_printf(" id: %d&larr;%d", rid, srcId);
585
+ cgi_printf(" id:&nbsp;%d&larr;%d", rid, srcId);
650586
}else{
651
- cgi_printf(" id: %d", rid);
587
+ cgi_printf(" id:&nbsp;%d", rid);
652588
}
653589
}
654590
tag_private_status(rid);
655591
if( xExtra ){
656592
xExtra(rid);
657593
}
658
- cgi_printf("</span></span>\n"); /* End timelineDetail and timelineDetailWrapper */
594
+ /* End timelineDetail and timelineDetailWrapper */
595
+ cgi_printf("</span></span>\n");
659596
660597
/* Generate the file-change list if requested */
661598
if( (tmFlags & (TIMELINE_FCHANGES|TIMELINE_FRENAMES))!=0
662599
&& zType[0]=='c' && g.perm.Hyperlink
663600
){
@@ -1622,11 +1559,11 @@
16221559
** rel Show related check-ins as well as those matching t=TAG
16231560
** mionly Limit rel to show ancestors but not descendants
16241561
** ms=MATCHSTYLE Set tag match style to EXACT, GLOB, LIKE, REGEXP
16251562
** u=USER Only show items associated with USER
16261563
** y=TYPE 'ci', 'w', 't', 'e', or 'all'.
1627
-** vs=VIEWSTYLE c: "compact" d: "detail" n: "normal"
1564
+** ss=VIEWSTYLE c: "compact" d: "detail" n: "normal" j: "columnar"
16281565
** ng No Graph.
16291566
** nd Do not highlight the focus check-in
16301567
** v Show details of files changed
16311568
** f=CHECKIN Show family (immediate parents and children) of CHECKIN
16321569
** from=CHECKIN Path from...
@@ -1706,15 +1643,16 @@
17061643
char cViewStyle; /* Overall style of the page */
17071644
static const char *azViewStyles[] = {
17081645
"n", "Normal",
17091646
"c", "Compact",
17101647
"d", "Detailed",
1648
+ "j", "Columnar",
17111649
};
17121650
17131651
/* Set number of rows to display */
17141652
cookie_parse("fossil_display_settings");
1715
- cookie_link_parameter("n","tln");
1653
+ cookie_link_parameter("n","n");
17161654
z = P("n");
17171655
if( z==0 ) z = db_get("timeline-default-length",0);
17181656
if( z ){
17191657
if( fossil_strcmp(z,"all")==0 ){
17201658
nEntry = 0;
@@ -1727,13 +1665,13 @@
17271665
}
17281666
}else{
17291667
cgi_replace_query_parameter("n","50");
17301668
nEntry = 50;
17311669
}
1732
- cookie_link_parameter("vs","tlvs");
1733
- cViewStyle = PD("vs","n")[0];
1734
- style_submenu_multichoice("vs", 3, azViewStyles, 0);
1670
+ cookie_link_parameter("ss","ss");
1671
+ cViewStyle = PD("ss","n")[0];
1672
+ style_submenu_multichoice("ss", 4, azViewStyles, 0);
17351673
17361674
17371675
/* To view the timeline, must have permission to read project data.
17381676
*/
17391677
pd_rid = name_to_typed_rid(P("dp"),"ci");
@@ -1745,18 +1683,18 @@
17451683
|| (bisectOnly && !g.perm.Setup)
17461684
){
17471685
login_needed(g.anon.Read && g.anon.RdTkt && g.anon.RdWiki);
17481686
return;
17491687
}
1750
- cookie_read_parameter("y","tly");
1688
+ cookie_read_parameter("y","y");
17511689
zType = P("y");
17521690
if( zType==0 ){
17531691
zType = g.perm.Read ? "ci" : "all";
17541692
cgi_set_parameter("y", zType);
17551693
}
17561694
if( zType[0]=='a' || zType[0]=='c' ){
1757
- cookie_write_parameter("y","tly");
1695
+ cookie_write_parameter("y","y");
17581696
}
17591697
cookie_render();
17601698
url_initialize(&url, "timeline");
17611699
cgi_query_parameters_to_url(&url);
17621700
@@ -1805,13 +1743,14 @@
18051743
){
18061744
nEntry = -1;
18071745
zCirca = 0;
18081746
}
18091747
switch( cViewStyle ){
1810
- case 'n': tmFlags |= TIMELINE_NORMAL; break;
1748
+ case 'n': tmFlags |= TIMELINE_NORMAL; break;
18111749
case 'c': tmFlags |= TIMELINE_COMPACT; break;
1812
- case 'd': tmFlags |= TIMELINE_DETAILED; break;
1750
+ case 'd': tmFlags |= TIMELINE_DETAILED; break;
1751
+ case 'j': tmFlags |= TIMELINE_COLUMNAR; break;
18131752
}
18141753
if( zType[0]=='a' ){
18151754
tmFlags |= TIMELINE_BRIEF | TIMELINE_GRAPH;
18161755
}else{
18171756
tmFlags |= TIMELINE_GRAPH;
18181757
--- src/timeline.c
+++ src/timeline.c
@@ -106,10 +106,11 @@
106 #define TIMELINE_SHOWRID 0x0400 /* Show RID values in addition to UUIDs */
107 #define TIMELINE_BISECT 0x0800 /* Show supplimental bisect information */
108 #define TIMELINE_COMPACT 0x1000 /* Use the "compact" view style */
109 #define TIMELINE_DETAILED 0x2000 /* Use the "detailed" view style */
110 #define TIMELINE_NORMAL 0x4000 /* Use the "normal" view style */
 
111 #endif
112
113 /*
114 ** Hash a string and use the hash to determine a background color.
115 */
@@ -252,16 +253,10 @@
252 int pendingEndTr = 0; /* True if a </td></tr> is needed */
253 int vid = 0; /* Current checkout version */
254 int dateFormat = 0; /* 0: HH:MM (default) */
255 int bCommentGitStyle = 0; /* Only show comments through first blank line */
256 const char *zTdClass;
257 int bHashBeforeComment = 0; /* Show hash before the comment */
258 int bHashAfterComment = 0; /* Show hash after the comment */
259 int bHashInDetail = 0; /* Show the hash inside the detail section */
260 int bShowDetail; /* Show the detail section */
261 int bSeparateDetail; /* Detail in a separate column */
262 int eCommentFormat; /* value for timeline-comment-format */
263 const char *zDateFmt;
264 int iTableId = timeline_tableid();
265
266 if( fossil_strcmp(g.zIpAddr, "127.0.0.1")==0 && db_open_local(0) ){
267 vid = db_lget_int("checkout", 0);
@@ -439,11 +434,12 @@
439 db_reset(&qbranch);
440 @ <div id="m%d(gidx)" class="tl-nodemark"></div>
441 }
442 @</td>
443 if( zBgClr && zBgClr[0] && rid!=selectedRid ){
444 @ <td class="timelineTableCell %s(zTdClass)" style="background-color: %h(zBgClr);">
 
445 }else{
446 @ <td class="timelineTableCell %s(zTdClass)">
447 }
448 if( pGraph && zType[0]!='c' ){
449 @ &bull;
@@ -459,38 +455,10 @@
459 @ <b>%s(db_column_text(&bisectQuery,1))</b>
460 @ (%d(db_column_int(&bisectQuery,0)))
461 }
462 db_reset(&bisectQuery);
463 }
464 #if 0
465 if( bHashBeforeComment ){
466 if( zType[0]=='c' ){
467 hyperlink_to_uuid(zUuid);
468 if( isLeaf ){
469 if( db_exists("SELECT 1 FROM tagxref"
470 " WHERE rid=%d AND tagid=%d AND tagtype>0",
471 rid, TAG_CLOSED) ){
472 @ <span class="timelineLeaf">Closed-Leaf:</span>
473 }else{
474 @ <span class="timelineLeaf">Leaf:</span>
475 }
476 }
477 }else if( zType[0]=='e' && tagid ){
478 hyperlink_to_event_tagid(tagid<0?-tagid:tagid);
479 }else if( (tmFlags & TIMELINE_ARTID)!=0 ){
480 hyperlink_to_uuid(zUuid);
481 }
482 if( tmFlags & TIMELINE_SHOWRID ){
483 int srcId = delta_source_rid(rid);
484 if( srcId ){
485 @ (%d(rid)&larr;%d(srcId))
486 }else{
487 @ (%d(rid))
488 }
489 }
490 }
491 #endif
492 drawDetailEllipsis = (tmFlags & TIMELINE_COMPACT)!=0;
493 db_column_blob(pQuery, commentColumn, &comment);
494 if( zType[0]!='c' ){
495 /* Comments for anything other than a check-in are generated by
496 ** "fossil rebuild" and expect to be rendered as text/x-fossil-wiki */
@@ -526,93 +494,61 @@
526 }
527 @ </span>
528 }
529 blob_reset(&comment);
530
531 #if 0
532 if( bHashAfterComment ){
533 if( zType[0]=='c' ){
534 hyperlink_to_uuid(zUuid);
535 if( isLeaf ){
536 if( db_exists("SELECT 1 FROM tagxref"
537 " WHERE rid=%d AND tagid=%d AND tagtype>0",
538 rid, TAG_CLOSED) ){
539 @ <span class="timelineLeaf">Closed-Leaf</span>
540 }else{
541 @ <span class="timelineLeaf">Leaf</span>
542 }
543 }
544 }else if( zType[0]=='e' && tagid ){
545 hyperlink_to_event_tagid(tagid<0?-tagid:tagid);
546 }else if( (tmFlags & TIMELINE_ARTID)!=0 ){
547 hyperlink_to_uuid(zUuid);
548 }
549 if( tmFlags & TIMELINE_SHOWRID ){
550 int srcId = delta_source_rid(rid);
551 if( srcId ){
552 @ (%d(rid)&larr;%d(srcId))
553 }else{
554 @ (%d(rid))
555 }
556 }
557 drawDetailEllipsis = 1;
558 }
559 #endif
560
561 /* Generate extra information and hyperlinks to follow the comment.
562 ** Example: "(check-in: [abcdefg], user: drh, tags: trunk)"
563 */
564 if( drawDetailEllipsis ){
565 @ <span class='timelineEllipsis anticlutter' id='ellipsis-%d(rid)' \
566 @ onclick='toggleDetail(%d(rid))'>...</span>
567 }
568 if( bSeparateDetail ){
569 if( zBgClr && zBgClr[0] && rid!=selectedRid ){
570 @ <td class="timelineTableCell timelineDetailCell"
571 @ style="background-color: %h(zBgClr);">
572 }else{
573 @ <td class="timelineTableCell timelineDetailCell">
574 }
575 }
576 if( tmFlags & TIMELINE_COMPACT ){
577 cgi_printf("<span class='timelineDetailWrapper clutter' id='detail-%d'>", rid);
578 }else{
579 cgi_printf("<span class='timelineDetailWrapper'>");
580 }
581 if( zType[0]=='c' ){
582 cgi_printf("<span class='timelineDetail timelineCheckinDetail'>");
583 }else{
584 cgi_printf("<span class='timelineDetail'>");
585 }
586
587 if( bHashInDetail ){
588 if( zType[0]=='c' ){
589 if( isLeaf ){
590 if( db_exists("SELECT 1 FROM tagxref"
591 " WHERE rid=%d AND tagid=%d AND tagtype>0",
592 rid, TAG_CLOSED) ){
593 @ <span class='timelineLeaf'>Closed-Leaf</span>
594 }else{
595 @ <span class='timelineLeaf'>Leaf</span>
596 }
597 }
598 cgi_printf("check-in: ");
599 hyperlink_to_uuid(zUuid);
600 }else if( zType[0]=='e' && tagid ){
601 cgi_printf("technote: ");
602 hyperlink_to_event_tagid(tagid<0?-tagid:tagid);
603 }else{
604 cgi_printf("artifact: ");
605 hyperlink_to_uuid(zUuid);
606 }
607 }
608
609 if( g.perm.Hyperlink && fossil_strcmp(zDispUser, zThisUser)!=0 ){
610 char *zLink = mprintf("%R/timeline?u=%h&c=%t&nd&n=200", zDispUser, zDate);
611 cgi_printf("user: %z%h</a>", href("%z",zLink), zDispUser);
612 }else{
613 cgi_printf("user: %h", zDispUser);
614 }
615
616 /* Generate the "tags: TAGLIST" at the end of the comment, together
617 ** with hyperlinks to the tag list.
618 */
@@ -634,30 +570,31 @@
634 blob_appendf(&links, "%#h", i+2, z);
635 }
636 if( z[i]==0 ) break;
637 z += i+2;
638 }
639 cgi_printf(" tags: %s", blob_str(&links));
640 blob_reset(&links);
641 }else{
642 cgi_printf(" tags: %h", zTagList);
643 }
644 }
645
646 if( tmFlags & TIMELINE_SHOWRID ){
647 int srcId = delta_source_rid(rid);
648 if( srcId ){
649 cgi_printf(" id: %d&larr;%d", rid, srcId);
650 }else{
651 cgi_printf(" id: %d", rid);
652 }
653 }
654 tag_private_status(rid);
655 if( xExtra ){
656 xExtra(rid);
657 }
658 cgi_printf("</span></span>\n"); /* End timelineDetail and timelineDetailWrapper */
 
659
660 /* Generate the file-change list if requested */
661 if( (tmFlags & (TIMELINE_FCHANGES|TIMELINE_FRENAMES))!=0
662 && zType[0]=='c' && g.perm.Hyperlink
663 ){
@@ -1622,11 +1559,11 @@
1622 ** rel Show related check-ins as well as those matching t=TAG
1623 ** mionly Limit rel to show ancestors but not descendants
1624 ** ms=MATCHSTYLE Set tag match style to EXACT, GLOB, LIKE, REGEXP
1625 ** u=USER Only show items associated with USER
1626 ** y=TYPE 'ci', 'w', 't', 'e', or 'all'.
1627 ** vs=VIEWSTYLE c: "compact" d: "detail" n: "normal"
1628 ** ng No Graph.
1629 ** nd Do not highlight the focus check-in
1630 ** v Show details of files changed
1631 ** f=CHECKIN Show family (immediate parents and children) of CHECKIN
1632 ** from=CHECKIN Path from...
@@ -1706,15 +1643,16 @@
1706 char cViewStyle; /* Overall style of the page */
1707 static const char *azViewStyles[] = {
1708 "n", "Normal",
1709 "c", "Compact",
1710 "d", "Detailed",
 
1711 };
1712
1713 /* Set number of rows to display */
1714 cookie_parse("fossil_display_settings");
1715 cookie_link_parameter("n","tln");
1716 z = P("n");
1717 if( z==0 ) z = db_get("timeline-default-length",0);
1718 if( z ){
1719 if( fossil_strcmp(z,"all")==0 ){
1720 nEntry = 0;
@@ -1727,13 +1665,13 @@
1727 }
1728 }else{
1729 cgi_replace_query_parameter("n","50");
1730 nEntry = 50;
1731 }
1732 cookie_link_parameter("vs","tlvs");
1733 cViewStyle = PD("vs","n")[0];
1734 style_submenu_multichoice("vs", 3, azViewStyles, 0);
1735
1736
1737 /* To view the timeline, must have permission to read project data.
1738 */
1739 pd_rid = name_to_typed_rid(P("dp"),"ci");
@@ -1745,18 +1683,18 @@
1745 || (bisectOnly && !g.perm.Setup)
1746 ){
1747 login_needed(g.anon.Read && g.anon.RdTkt && g.anon.RdWiki);
1748 return;
1749 }
1750 cookie_read_parameter("y","tly");
1751 zType = P("y");
1752 if( zType==0 ){
1753 zType = g.perm.Read ? "ci" : "all";
1754 cgi_set_parameter("y", zType);
1755 }
1756 if( zType[0]=='a' || zType[0]=='c' ){
1757 cookie_write_parameter("y","tly");
1758 }
1759 cookie_render();
1760 url_initialize(&url, "timeline");
1761 cgi_query_parameters_to_url(&url);
1762
@@ -1805,13 +1743,14 @@
1805 ){
1806 nEntry = -1;
1807 zCirca = 0;
1808 }
1809 switch( cViewStyle ){
1810 case 'n': tmFlags |= TIMELINE_NORMAL; break;
1811 case 'c': tmFlags |= TIMELINE_COMPACT; break;
1812 case 'd': tmFlags |= TIMELINE_DETAILED; break;
 
1813 }
1814 if( zType[0]=='a' ){
1815 tmFlags |= TIMELINE_BRIEF | TIMELINE_GRAPH;
1816 }else{
1817 tmFlags |= TIMELINE_GRAPH;
1818
--- src/timeline.c
+++ src/timeline.c
@@ -106,10 +106,11 @@
106 #define TIMELINE_SHOWRID 0x0400 /* Show RID values in addition to UUIDs */
107 #define TIMELINE_BISECT 0x0800 /* Show supplimental bisect information */
108 #define TIMELINE_COMPACT 0x1000 /* Use the "compact" view style */
109 #define TIMELINE_DETAILED 0x2000 /* Use the "detailed" view style */
110 #define TIMELINE_NORMAL 0x4000 /* Use the "normal" view style */
111 #define TIMELINE_COLUMNAR 0x8000 /* Use the "columns view style */
112 #endif
113
114 /*
115 ** Hash a string and use the hash to determine a background color.
116 */
@@ -252,16 +253,10 @@
253 int pendingEndTr = 0; /* True if a </td></tr> is needed */
254 int vid = 0; /* Current checkout version */
255 int dateFormat = 0; /* 0: HH:MM (default) */
256 int bCommentGitStyle = 0; /* Only show comments through first blank line */
257 const char *zTdClass;
 
 
 
 
 
 
258 const char *zDateFmt;
259 int iTableId = timeline_tableid();
260
261 if( fossil_strcmp(g.zIpAddr, "127.0.0.1")==0 && db_open_local(0) ){
262 vid = db_lget_int("checkout", 0);
@@ -439,11 +434,12 @@
434 db_reset(&qbranch);
435 @ <div id="m%d(gidx)" class="tl-nodemark"></div>
436 }
437 @</td>
438 if( zBgClr && zBgClr[0] && rid!=selectedRid ){
439 @ <td class="timelineTableCell %s(zTdClass)" \
440 @ style="background-color: %h(zBgClr);">
441 }else{
442 @ <td class="timelineTableCell %s(zTdClass)">
443 }
444 if( pGraph && zType[0]!='c' ){
445 @ &bull;
@@ -459,38 +455,10 @@
455 @ <b>%s(db_column_text(&bisectQuery,1))</b>
456 @ (%d(db_column_int(&bisectQuery,0)))
457 }
458 db_reset(&bisectQuery);
459 }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
460 drawDetailEllipsis = (tmFlags & TIMELINE_COMPACT)!=0;
461 db_column_blob(pQuery, commentColumn, &comment);
462 if( zType[0]!='c' ){
463 /* Comments for anything other than a check-in are generated by
464 ** "fossil rebuild" and expect to be rendered as text/x-fossil-wiki */
@@ -526,93 +494,61 @@
494 }
495 @ </span>
496 }
497 blob_reset(&comment);
498
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
499 /* Generate extra information and hyperlinks to follow the comment.
500 ** Example: "(check-in: [abcdefg], user: drh, tags: trunk)"
501 */
502 if( drawDetailEllipsis ){
503 @ <span class='timelineEllipsis anticlutter' id='ellipsis-%d(rid)' \
504 @ onclick='toggleDetail(%d(rid))'>...</span>
505 }
506 if( tmFlags & TIMELINE_COLUMNAR ){
507 if( zBgClr && zBgClr[0] && rid!=selectedRid ){
508 @ <td class="timelineTableCell timelineDetailCell"
509 @ style="background-color: %h(zBgClr);">
510 }else{
511 @ <td class="timelineTableCell timelineDetailCell">
512 }
513 }
514 if( tmFlags & TIMELINE_COMPACT ){
515 cgi_printf("<span class='timelineDetailWrapper clutter' id='detail-%d'>",rid);
516 }else{
517 cgi_printf("<span class='timelineDetailWrapper'>");
518 }
519 if( zType[0]=='c' ){
520 cgi_printf("<span class='timelineDetail timelineCheckinDetail'>");
521 }else{
522 cgi_printf("<span class='timelineDetail'>");
523 }
524
525 if( zType[0]=='c' ){
526 if( isLeaf ){
527 if( db_exists("SELECT 1 FROM tagxref"
528 " WHERE rid=%d AND tagid=%d AND tagtype>0",
529 rid, TAG_CLOSED) ){
530 @ <span class='timelineLeaf'>Closed-Leaf</span>
531 }else{
532 @ <span class='timelineLeaf'>Leaf</span>
533 }
534 }
535 cgi_printf("check-in:&nbsp;");
536 hyperlink_to_uuid(zUuid);
537 }else if( zType[0]=='e' && tagid ){
538 cgi_printf("technote:&nbsp;");
539 hyperlink_to_event_tagid(tagid<0?-tagid:tagid);
540 }else{
541 cgi_printf("artifact:&nbsp;");
542 hyperlink_to_uuid(zUuid);
 
 
543 }
544
545 if( g.perm.Hyperlink && fossil_strcmp(zDispUser, zThisUser)!=0 ){
546 char *zLink = mprintf("%R/timeline?u=%h&c=%t&nd&n=200", zDispUser, zDate);
547 cgi_printf("user:&nbsp;%z%h</a>", href("%z",zLink), zDispUser);
548 }else{
549 cgi_printf("user:&nbsp;%h", zDispUser);
550 }
551
552 /* Generate the "tags: TAGLIST" at the end of the comment, together
553 ** with hyperlinks to the tag list.
554 */
@@ -634,30 +570,31 @@
570 blob_appendf(&links, "%#h", i+2, z);
571 }
572 if( z[i]==0 ) break;
573 z += i+2;
574 }
575 cgi_printf(" tags:&nbsp;%s", blob_str(&links));
576 blob_reset(&links);
577 }else{
578 cgi_printf(" tags:&nbsp;%h", zTagList);
579 }
580 }
581
582 if( tmFlags & TIMELINE_SHOWRID ){
583 int srcId = delta_source_rid(rid);
584 if( srcId ){
585 cgi_printf(" id:&nbsp;%d&larr;%d", rid, srcId);
586 }else{
587 cgi_printf(" id:&nbsp;%d", rid);
588 }
589 }
590 tag_private_status(rid);
591 if( xExtra ){
592 xExtra(rid);
593 }
594 /* End timelineDetail and timelineDetailWrapper */
595 cgi_printf("</span></span>\n");
596
597 /* Generate the file-change list if requested */
598 if( (tmFlags & (TIMELINE_FCHANGES|TIMELINE_FRENAMES))!=0
599 && zType[0]=='c' && g.perm.Hyperlink
600 ){
@@ -1622,11 +1559,11 @@
1559 ** rel Show related check-ins as well as those matching t=TAG
1560 ** mionly Limit rel to show ancestors but not descendants
1561 ** ms=MATCHSTYLE Set tag match style to EXACT, GLOB, LIKE, REGEXP
1562 ** u=USER Only show items associated with USER
1563 ** y=TYPE 'ci', 'w', 't', 'e', or 'all'.
1564 ** ss=VIEWSTYLE c: "compact" d: "detail" n: "normal" j: "columnar"
1565 ** ng No Graph.
1566 ** nd Do not highlight the focus check-in
1567 ** v Show details of files changed
1568 ** f=CHECKIN Show family (immediate parents and children) of CHECKIN
1569 ** from=CHECKIN Path from...
@@ -1706,15 +1643,16 @@
1643 char cViewStyle; /* Overall style of the page */
1644 static const char *azViewStyles[] = {
1645 "n", "Normal",
1646 "c", "Compact",
1647 "d", "Detailed",
1648 "j", "Columnar",
1649 };
1650
1651 /* Set number of rows to display */
1652 cookie_parse("fossil_display_settings");
1653 cookie_link_parameter("n","n");
1654 z = P("n");
1655 if( z==0 ) z = db_get("timeline-default-length",0);
1656 if( z ){
1657 if( fossil_strcmp(z,"all")==0 ){
1658 nEntry = 0;
@@ -1727,13 +1665,13 @@
1665 }
1666 }else{
1667 cgi_replace_query_parameter("n","50");
1668 nEntry = 50;
1669 }
1670 cookie_link_parameter("ss","ss");
1671 cViewStyle = PD("ss","n")[0];
1672 style_submenu_multichoice("ss", 4, azViewStyles, 0);
1673
1674
1675 /* To view the timeline, must have permission to read project data.
1676 */
1677 pd_rid = name_to_typed_rid(P("dp"),"ci");
@@ -1745,18 +1683,18 @@
1683 || (bisectOnly && !g.perm.Setup)
1684 ){
1685 login_needed(g.anon.Read && g.anon.RdTkt && g.anon.RdWiki);
1686 return;
1687 }
1688 cookie_read_parameter("y","y");
1689 zType = P("y");
1690 if( zType==0 ){
1691 zType = g.perm.Read ? "ci" : "all";
1692 cgi_set_parameter("y", zType);
1693 }
1694 if( zType[0]=='a' || zType[0]=='c' ){
1695 cookie_write_parameter("y","y");
1696 }
1697 cookie_render();
1698 url_initialize(&url, "timeline");
1699 cgi_query_parameters_to_url(&url);
1700
@@ -1805,13 +1743,14 @@
1743 ){
1744 nEntry = -1;
1745 zCirca = 0;
1746 }
1747 switch( cViewStyle ){
1748 case 'n': tmFlags |= TIMELINE_NORMAL; break;
1749 case 'c': tmFlags |= TIMELINE_COMPACT; break;
1750 case 'd': tmFlags |= TIMELINE_DETAILED; break;
1751 case 'j': tmFlags |= TIMELINE_COLUMNAR; break;
1752 }
1753 if( zType[0]=='a' ){
1754 tmFlags |= TIMELINE_BRIEF | TIMELINE_GRAPH;
1755 }else{
1756 tmFlags |= TIMELINE_GRAPH;
1757

Keyboard Shortcuts

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