Fossil

Check-in [f64fa4f1]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Change the style selector query parameter on /timeline to "ss". Other code cleanup. The new style selector is working, but needs default CSS.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | sticky-timeline-style
Files: files | file ages | folders
SHA3-256:f64fa4f1ae38fe97fe47cada2c1b8aeaae43cfdbc5e41af889160c70b862b0fb
User & Date: drh 2017-11-28 21:43:59
Context
2017-11-28
22:16
Improvements to handling of the cookie for "sticky" display settings. check-in: 3ec84397 user: drh tags: sticky-timeline-style
21:43
Change the style selector query parameter on /timeline to "ss". Other code cleanup. The new style selector is working, but needs default CSS. check-in: f64fa4f1 user: drh tags: sticky-timeline-style
19:41
Work toward getting the mode selector to work on /timeline. This check-in is incomplete and is intended only to transfer code between machines. check-in: fdf071e1 user: drh tags: sticky-timeline-style
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/timeline.c.

104
105
106
107
108
109
110

111
112
113
114
115
116
117
...
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
...
437
438
439
440
441
442
443
444

445
446
447
448
449
450
451
...
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
...
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
...
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658

659
660
661
662
663
664
665
....
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
....
1704
1705
1706
1707
1708
1709
1710

1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
....
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
....
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
....
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812

1813
1814
1815
1816
1817
1818
1819
#define TIMELINE_FRENAMES 0x0100  /* Detail only file name changes */
#define TIMELINE_UNHIDE   0x0200  /* Unhide check-ins with "hidden" tag */
#define TIMELINE_SHOWRID  0x0400  /* Show RID values in addition to UUIDs */
#define TIMELINE_BISECT   0x0800  /* Show supplimental bisect information */
#define TIMELINE_COMPACT  0x1000  /* Use the "compact" view style */
#define TIMELINE_DETAILED 0x2000  /* Use the "detailed" view style */
#define TIMELINE_NORMAL   0x4000  /* Use the "normal" view style */

#endif

/*
** Hash a string and use the hash to determine a background color.
*/
char *hash_color(const char *z){
  int i;                       /* Loop counter */
................................................................................
  Stmt fchngQuery;            /* Query for file changes on check-ins */
  static Stmt qbranch;
  int pendingEndTr = 0;       /* True if a </td></tr> is needed */
  int vid = 0;                /* Current checkout version */
  int dateFormat = 0;         /* 0: HH:MM (default) */
  int bCommentGitStyle = 0;   /* Only show comments through first blank line */
  const char *zTdClass;
  int bHashBeforeComment = 0; /* Show hash before the comment */
  int bHashAfterComment = 0;  /* Show hash after the comment */
  int bHashInDetail = 0;      /* Show the hash inside the detail section */
  int bShowDetail;            /* Show the detail section */
  int bSeparateDetail;        /* Detail in a separate column */
  int eCommentFormat;         /* value for timeline-comment-format */
  const char *zDateFmt;
  int iTableId = timeline_tableid();

  if( fossil_strcmp(g.zIpAddr, "127.0.0.1")==0 && db_open_local(0) ){
    vid = db_lget_int("checkout", 0);
  }
  zPrevDate[0] = 0;
................................................................................
      gidx = graph_add_row(pGraph, rid, nParent, aParent, zBr, zBgClr,
                           zUuid, isLeaf);
      db_reset(&qbranch);
      @ <div id="m%d(gidx)" class="tl-nodemark"></div>
    }
    @</td>
    if( zBgClr && zBgClr[0] && rid!=selectedRid ){
      @ <td class="timelineTableCell %s(zTdClass)" style="background-color: %h(zBgClr);">

    }else{
      @ <td class="timelineTableCell %s(zTdClass)">
    }
    if( pGraph && zType[0]!='c' ){
      @ &bull;
    }
    if( modPending ){
................................................................................
      db_bind_int(&bisectQuery, ":rid", rid);
      if( db_step(&bisectQuery)==SQLITE_ROW ){
        @ <b>%s(db_column_text(&bisectQuery,1))</b>
        @ (%d(db_column_int(&bisectQuery,0)))
      }
      db_reset(&bisectQuery);
    }
#if 0
    if( bHashBeforeComment ){
      if( zType[0]=='c' ){
        hyperlink_to_uuid(zUuid);
        if( isLeaf ){
          if( db_exists("SELECT 1 FROM tagxref"
                        " WHERE rid=%d AND tagid=%d AND tagtype>0",
                        rid, TAG_CLOSED) ){
            @ <span class="timelineLeaf">Closed-Leaf:</span>
          }else{
            @ <span class="timelineLeaf">Leaf:</span>
          }
        }
      }else if( zType[0]=='e' && tagid ){
        hyperlink_to_event_tagid(tagid<0?-tagid:tagid);
      }else if( (tmFlags & TIMELINE_ARTID)!=0 ){
        hyperlink_to_uuid(zUuid);
      }
      if( tmFlags & TIMELINE_SHOWRID ){
        int srcId = delta_source_rid(rid);
        if( srcId ){
          @ (%d(rid)&larr;%d(srcId))
        }else{
          @ (%d(rid))
        }
      }
    }
#endif
    drawDetailEllipsis = (tmFlags & TIMELINE_COMPACT)!=0;
    db_column_blob(pQuery, commentColumn, &comment);
    if( zType[0]!='c' ){
      /* Comments for anything other than a check-in are generated by
      ** "fossil rebuild" and expect to be rendered as text/x-fossil-wiki */
      @ <span class='timelineComment' onclick='toggleDetail(%d(rid))'>
      wiki_convert(&comment, 0, WIKI_INLINE);
................................................................................
      }else{
        cgi_printf("%W",blob_str(&comment));
      }
      @ </span>
    }
    blob_reset(&comment);

#if 0
    if( bHashAfterComment ){
      if( zType[0]=='c' ){
        hyperlink_to_uuid(zUuid);
        if( isLeaf ){
          if( db_exists("SELECT 1 FROM tagxref"
                        " WHERE rid=%d AND tagid=%d AND tagtype>0",
                        rid, TAG_CLOSED) ){
            @ <span class="timelineLeaf">Closed-Leaf</span>
          }else{
            @ <span class="timelineLeaf">Leaf</span>
          }
        }
      }else if( zType[0]=='e' && tagid ){
        hyperlink_to_event_tagid(tagid<0?-tagid:tagid);
      }else if( (tmFlags & TIMELINE_ARTID)!=0 ){
        hyperlink_to_uuid(zUuid);
      }
      if( tmFlags & TIMELINE_SHOWRID ){
        int srcId = delta_source_rid(rid);
        if( srcId ){
          @ (%d(rid)&larr;%d(srcId))
        }else{
          @ (%d(rid))
        }
      }
      drawDetailEllipsis = 1;
    }
#endif

    /* Generate extra information and hyperlinks to follow the comment.
    ** Example:  "(check-in: [abcdefg], user: drh, tags: trunk)"
    */
    if( drawDetailEllipsis ){
      @ <span class='timelineEllipsis anticlutter' id='ellipsis-%d(rid)' \
      @  onclick='toggleDetail(%d(rid))'>...</span>
    }
    if( bSeparateDetail ){
      if( zBgClr && zBgClr[0] && rid!=selectedRid ){
        @ <td class="timelineTableCell timelineDetailCell"
        @  style="background-color: %h(zBgClr);">
      }else{
        @ <td class="timelineTableCell timelineDetailCell">
      }
    }
    if( tmFlags & TIMELINE_COMPACT ){
      cgi_printf("<span class='timelineDetailWrapper clutter' id='detail-%d'>", rid);
    }else{
      cgi_printf("<span class='timelineDetailWrapper'>");
    }
    if( zType[0]=='c' ){
      cgi_printf("<span class='timelineDetail timelineCheckinDetail'>");
    }else{
      cgi_printf("<span class='timelineDetail'>");
    }

    if( bHashInDetail ){
      if( zType[0]=='c' ){
        if( isLeaf ){
          if( db_exists("SELECT 1 FROM tagxref"
                        " WHERE rid=%d AND tagid=%d AND tagtype>0",
                        rid, TAG_CLOSED) ){
            @ <span class='timelineLeaf'>Closed-Leaf</span>
          }else{
            @ <span class='timelineLeaf'>Leaf</span>
          }
        }
        cgi_printf("check-in: ");
        hyperlink_to_uuid(zUuid);
      }else if( zType[0]=='e' && tagid ){
        cgi_printf("technote: ");
        hyperlink_to_event_tagid(tagid<0?-tagid:tagid);
      }else{
        cgi_printf("artifact: ");
        hyperlink_to_uuid(zUuid);
      }
    }

    if( g.perm.Hyperlink && fossil_strcmp(zDispUser, zThisUser)!=0 ){
      char *zLink = mprintf("%R/timeline?u=%h&c=%t&nd&n=200", zDispUser, zDate);
      cgi_printf("user: %z%h</a>", href("%z",zLink), zDispUser);
    }else{
      cgi_printf("user: %h", zDispUser);
    }

    /* Generate the "tags: TAGLIST" at the end of the comment, together
    ** with hyperlinks to the tag list.
    */
    if( zTagList && zTagList[0]==0 ) zTagList = 0;
    if( zTagList ){
................................................................................
            );
          }else{
            blob_appendf(&links, "%#h", i+2, z);
          }
          if( z[i]==0 ) break;
          z += i+2;
        }
        cgi_printf(" tags: %s", blob_str(&links));
        blob_reset(&links);
      }else{
        cgi_printf(" tags: %h", zTagList);
      }
    }

    if( tmFlags & TIMELINE_SHOWRID ){
      int srcId = delta_source_rid(rid);
      if( srcId ){
        cgi_printf(" id: %d&larr;%d", rid, srcId);
      }else{
        cgi_printf(" id: %d", rid);
      }
    }
    tag_private_status(rid);
    if( xExtra ){
      xExtra(rid);
    }
    cgi_printf("</span></span>\n");   /* End timelineDetail and timelineDetailWrapper */


    /* Generate the file-change list if requested */
    if( (tmFlags & (TIMELINE_FCHANGES|TIMELINE_FRENAMES))!=0
     && zType[0]=='c' && g.perm.Hyperlink
    ){
      int inUl = 0;
      if( !fchngQueryInit ){
................................................................................
**    t=TAG           Show only check-ins with the given TAG
**    r=TAG           Show check-ins related to TAG, equivalent to t=TAG&rel
**    rel             Show related check-ins as well as those matching t=TAG
**    mionly          Limit rel to show ancestors but not descendants
**    ms=MATCHSTYLE   Set tag match style to EXACT, GLOB, LIKE, REGEXP
**    u=USER          Only show items associated with USER
**    y=TYPE          'ci', 'w', 't', 'e', or 'all'.
**    vs=VIEWSTYLE    c: "compact"  d: "detail"   n: "normal"
**    ng              No Graph.
**    nd              Do not highlight the focus check-in
**    v               Show details of files changed
**    f=CHECKIN       Show family (immediate parents and children) of CHECKIN
**    from=CHECKIN    Path from...
**    to=CHECKIN        ... to this
**    shortest          ... show only the shortest path
................................................................................
  int selectedRid = -9999999;         /* Show a highlight on this RID */
  int disableY = 0;                   /* Disable type selector on submenu */
  char cViewStyle;                    /* Overall style of the page */
  static const char *azViewStyles[] = {
     "n", "Normal",
     "c", "Compact",
     "d", "Detailed",

  };

  /* Set number of rows to display */
  cookie_parse("fossil_display_settings");
  cookie_link_parameter("n","tln");
  z = P("n");
  if( z==0 ) z = db_get("timeline-default-length",0);
  if( z ){
    if( fossil_strcmp(z,"all")==0 ){
      nEntry = 0;
    }else{
      nEntry = atoi(z);
................................................................................
        nEntry = 10;
      }
    }
  }else{
    cgi_replace_query_parameter("n","50");
    nEntry = 50;
  }
  cookie_link_parameter("vs","tlvs");
  cViewStyle = PD("vs","n")[0];
  style_submenu_multichoice("vs", 3, azViewStyles, 0);
  

  /* To view the timeline, must have permission to read project data.
  */
  pd_rid = name_to_typed_rid(P("dp"),"ci");
  if( pd_rid ){
    p_rid = d_rid = pd_rid;
................................................................................
  login_check_credentials();
  if( (!g.perm.Read && !g.perm.RdTkt && !g.perm.RdWiki)
   || (bisectOnly && !g.perm.Setup)
  ){
    login_needed(g.anon.Read && g.anon.RdTkt && g.anon.RdWiki);
    return;
  }
  cookie_read_parameter("y","tly");
  zType = P("y");
  if( zType==0 ){
    zType = g.perm.Read ? "ci" : "all";
    cgi_set_parameter("y", zType);
  }
  if( zType[0]=='a' || zType[0]=='c' ){
    cookie_write_parameter("y","tly");
  }
  cookie_render();
  url_initialize(&url, "timeline");
  cgi_query_parameters_to_url(&url);

  /* Convert r=TAG to t=TAG&rel. */
  if( zBrName && !related ){
................................................................................
  if( (zTagSql && db_int(0,"SELECT count(*) "
      "FROM tagxref NATURAL JOIN tag WHERE %s",zTagSql/*safe-for-%s*/)<=nEntry)
  ){
    nEntry = -1;
    zCirca = 0;
  }
  switch( cViewStyle ){
    case 'n':  tmFlags |= TIMELINE_NORMAL;  break;
    case 'c':  tmFlags |= TIMELINE_COMPACT;  break;
    case 'd':  tmFlags |= TIMELINE_DETAILED;  break;

  }    
  if( zType[0]=='a' ){
    tmFlags |= TIMELINE_BRIEF | TIMELINE_GRAPH;
  }else{
    tmFlags |= TIMELINE_GRAPH;
  }
  if( PB("ng") || zSearch!=0 ){







>







 







<
<
<
<
<
<







 







|
>







 







<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<







 







<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<







|








|









<
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<




|

|







 







|


|






|

|






|
>







 







|







 







>




|







 







|
|
|







 







|






|







 







|

|
>







104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
...
251
252
253
254
255
256
257






258
259
260
261
262
263
264
...
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
...
453
454
455
456
457
458
459




























460
461
462
463
464
465
466
...
492
493
494
495
496
497
498






























499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524

525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542

543
544
545
546
547
548
549
550
551
552
553
554
555
556
...
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
....
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
....
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
....
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
....
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
....
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
#define TIMELINE_FRENAMES 0x0100  /* Detail only file name changes */
#define TIMELINE_UNHIDE   0x0200  /* Unhide check-ins with "hidden" tag */
#define TIMELINE_SHOWRID  0x0400  /* Show RID values in addition to UUIDs */
#define TIMELINE_BISECT   0x0800  /* Show supplimental bisect information */
#define TIMELINE_COMPACT  0x1000  /* Use the "compact" view style */
#define TIMELINE_DETAILED 0x2000  /* Use the "detailed" view style */
#define TIMELINE_NORMAL   0x4000  /* Use the "normal" view style */
#define TIMELINE_COLUMNAR 0x8000  /* Use the "columns view style */
#endif

/*
** Hash a string and use the hash to determine a background color.
*/
char *hash_color(const char *z){
  int i;                       /* Loop counter */
................................................................................
  Stmt fchngQuery;            /* Query for file changes on check-ins */
  static Stmt qbranch;
  int pendingEndTr = 0;       /* True if a </td></tr> is needed */
  int vid = 0;                /* Current checkout version */
  int dateFormat = 0;         /* 0: HH:MM (default) */
  int bCommentGitStyle = 0;   /* Only show comments through first blank line */
  const char *zTdClass;






  const char *zDateFmt;
  int iTableId = timeline_tableid();

  if( fossil_strcmp(g.zIpAddr, "127.0.0.1")==0 && db_open_local(0) ){
    vid = db_lget_int("checkout", 0);
  }
  zPrevDate[0] = 0;
................................................................................
      gidx = graph_add_row(pGraph, rid, nParent, aParent, zBr, zBgClr,
                           zUuid, isLeaf);
      db_reset(&qbranch);
      @ <div id="m%d(gidx)" class="tl-nodemark"></div>
    }
    @</td>
    if( zBgClr && zBgClr[0] && rid!=selectedRid ){
      @ <td class="timelineTableCell %s(zTdClass)" \
      @  style="background-color: %h(zBgClr);">
    }else{
      @ <td class="timelineTableCell %s(zTdClass)">
    }
    if( pGraph && zType[0]!='c' ){
      @ &bull;
    }
    if( modPending ){
................................................................................
      db_bind_int(&bisectQuery, ":rid", rid);
      if( db_step(&bisectQuery)==SQLITE_ROW ){
        @ <b>%s(db_column_text(&bisectQuery,1))</b>
        @ (%d(db_column_int(&bisectQuery,0)))
      }
      db_reset(&bisectQuery);
    }




























    drawDetailEllipsis = (tmFlags & TIMELINE_COMPACT)!=0;
    db_column_blob(pQuery, commentColumn, &comment);
    if( zType[0]!='c' ){
      /* Comments for anything other than a check-in are generated by
      ** "fossil rebuild" and expect to be rendered as text/x-fossil-wiki */
      @ <span class='timelineComment' onclick='toggleDetail(%d(rid))'>
      wiki_convert(&comment, 0, WIKI_INLINE);
................................................................................
      }else{
        cgi_printf("%W",blob_str(&comment));
      }
      @ </span>
    }
    blob_reset(&comment);































    /* Generate extra information and hyperlinks to follow the comment.
    ** Example:  "(check-in: [abcdefg], user: drh, tags: trunk)"
    */
    if( drawDetailEllipsis ){
      @ <span class='timelineEllipsis anticlutter' id='ellipsis-%d(rid)' \
      @  onclick='toggleDetail(%d(rid))'>...</span>
    }
    if( tmFlags & TIMELINE_COLUMNAR ){
      if( zBgClr && zBgClr[0] && rid!=selectedRid ){
        @ <td class="timelineTableCell timelineDetailCell"
        @  style="background-color: %h(zBgClr);">
      }else{
        @ <td class="timelineTableCell timelineDetailCell">
      }
    }
    if( tmFlags & TIMELINE_COMPACT ){
      cgi_printf("<span class='timelineDetailWrapper clutter' id='detail-%d'>",rid);
    }else{
      cgi_printf("<span class='timelineDetailWrapper'>");
    }
    if( zType[0]=='c' ){
      cgi_printf("<span class='timelineDetail timelineCheckinDetail'>");
    }else{
      cgi_printf("<span class='timelineDetail'>");
    }


    if( zType[0]=='c' ){
      if( isLeaf ){
        if( db_exists("SELECT 1 FROM tagxref"
                      " WHERE rid=%d AND tagid=%d AND tagtype>0",
                      rid, TAG_CLOSED) ){
          @ <span class='timelineLeaf'>Closed-Leaf</span>
        }else{
          @ <span class='timelineLeaf'>Leaf</span>
        }
      }
      cgi_printf("check-in:&nbsp;");
      hyperlink_to_uuid(zUuid);
    }else if( zType[0]=='e' && tagid ){
      cgi_printf("technote:&nbsp;");
      hyperlink_to_event_tagid(tagid<0?-tagid:tagid);
    }else{
      cgi_printf("artifact:&nbsp;");
      hyperlink_to_uuid(zUuid);

    }

    if( g.perm.Hyperlink && fossil_strcmp(zDispUser, zThisUser)!=0 ){
      char *zLink = mprintf("%R/timeline?u=%h&c=%t&nd&n=200", zDispUser, zDate);
      cgi_printf("user:&nbsp;%z%h</a>", href("%z",zLink), zDispUser);
    }else{
      cgi_printf("user:&nbsp;%h", zDispUser);
    }

    /* Generate the "tags: TAGLIST" at the end of the comment, together
    ** with hyperlinks to the tag list.
    */
    if( zTagList && zTagList[0]==0 ) zTagList = 0;
    if( zTagList ){
................................................................................
            );
          }else{
            blob_appendf(&links, "%#h", i+2, z);
          }
          if( z[i]==0 ) break;
          z += i+2;
        }
        cgi_printf(" tags:&nbsp;%s", blob_str(&links));
        blob_reset(&links);
      }else{
        cgi_printf(" tags:&nbsp;%h", zTagList);
      }
    }

    if( tmFlags & TIMELINE_SHOWRID ){
      int srcId = delta_source_rid(rid);
      if( srcId ){
        cgi_printf(" id:&nbsp;%d&larr;%d", rid, srcId);
      }else{
        cgi_printf(" id:&nbsp;%d", rid);
      }
    }
    tag_private_status(rid);
    if( xExtra ){
      xExtra(rid);
    }
    /* End timelineDetail and timelineDetailWrapper */
    cgi_printf("</span></span>\n");

    /* Generate the file-change list if requested */
    if( (tmFlags & (TIMELINE_FCHANGES|TIMELINE_FRENAMES))!=0
     && zType[0]=='c' && g.perm.Hyperlink
    ){
      int inUl = 0;
      if( !fchngQueryInit ){
................................................................................
**    t=TAG           Show only check-ins with the given TAG
**    r=TAG           Show check-ins related to TAG, equivalent to t=TAG&rel
**    rel             Show related check-ins as well as those matching t=TAG
**    mionly          Limit rel to show ancestors but not descendants
**    ms=MATCHSTYLE   Set tag match style to EXACT, GLOB, LIKE, REGEXP
**    u=USER          Only show items associated with USER
**    y=TYPE          'ci', 'w', 't', 'e', or 'all'.
**    ss=VIEWSTYLE    c: "compact"  d: "detail"   n: "normal"  j: "columnar"
**    ng              No Graph.
**    nd              Do not highlight the focus check-in
**    v               Show details of files changed
**    f=CHECKIN       Show family (immediate parents and children) of CHECKIN
**    from=CHECKIN    Path from...
**    to=CHECKIN        ... to this
**    shortest          ... show only the shortest path
................................................................................
  int selectedRid = -9999999;         /* Show a highlight on this RID */
  int disableY = 0;                   /* Disable type selector on submenu */
  char cViewStyle;                    /* Overall style of the page */
  static const char *azViewStyles[] = {
     "n", "Normal",
     "c", "Compact",
     "d", "Detailed",
     "j", "Columnar",
  };

  /* Set number of rows to display */
  cookie_parse("fossil_display_settings");
  cookie_link_parameter("n","n");
  z = P("n");
  if( z==0 ) z = db_get("timeline-default-length",0);
  if( z ){
    if( fossil_strcmp(z,"all")==0 ){
      nEntry = 0;
    }else{
      nEntry = atoi(z);
................................................................................
        nEntry = 10;
      }
    }
  }else{
    cgi_replace_query_parameter("n","50");
    nEntry = 50;
  }
  cookie_link_parameter("ss","ss");
  cViewStyle = PD("ss","n")[0];
  style_submenu_multichoice("ss", 4, azViewStyles, 0);
  

  /* To view the timeline, must have permission to read project data.
  */
  pd_rid = name_to_typed_rid(P("dp"),"ci");
  if( pd_rid ){
    p_rid = d_rid = pd_rid;
................................................................................
  login_check_credentials();
  if( (!g.perm.Read && !g.perm.RdTkt && !g.perm.RdWiki)
   || (bisectOnly && !g.perm.Setup)
  ){
    login_needed(g.anon.Read && g.anon.RdTkt && g.anon.RdWiki);
    return;
  }
  cookie_read_parameter("y","y");
  zType = P("y");
  if( zType==0 ){
    zType = g.perm.Read ? "ci" : "all";
    cgi_set_parameter("y", zType);
  }
  if( zType[0]=='a' || zType[0]=='c' ){
    cookie_write_parameter("y","y");
  }
  cookie_render();
  url_initialize(&url, "timeline");
  cgi_query_parameters_to_url(&url);

  /* Convert r=TAG to t=TAG&rel. */
  if( zBrName && !related ){
................................................................................
  if( (zTagSql && db_int(0,"SELECT count(*) "
      "FROM tagxref NATURAL JOIN tag WHERE %s",zTagSql/*safe-for-%s*/)<=nEntry)
  ){
    nEntry = -1;
    zCirca = 0;
  }
  switch( cViewStyle ){
    case 'n':  tmFlags |= TIMELINE_NORMAL;   break;
    case 'c':  tmFlags |= TIMELINE_COMPACT;  break;
    case 'd':  tmFlags |= TIMELINE_DETAILED; break;
    case 'j':  tmFlags |= TIMELINE_COLUMNAR; break;
  }    
  if( zType[0]=='a' ){
    tmFlags |= TIMELINE_BRIEF | TIMELINE_GRAPH;
  }else{
    tmFlags |= TIMELINE_GRAPH;
  }
  if( PB("ng") || zSearch!=0 ){