Fossil

Check-in [92fa3664]
Login

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

Overview
Comment:Add the 'hide' query parameter to remove check-ins tagged as "hidden" (which are shown by default) for the /leaves, /brtimeline, and /tagtimeline web pages. (Rationale: listings of open leaves not tagged as "hidden" can make handy TODO lists.)
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | fix-timeline-view
Files: files | file ages | folders
SHA3-256: 92fa3664621423e994df7eb13b99c749cb1e2806ce28cba8163d66eeb94678f4
User & Date: florian 2018-12-24 21:33:00.000
Context
2018-12-24
21:48
Cosmetic change to insert a space between two hyperlinks. ... (check-in: eb882e27 user: florian tags: fix-timeline-view)
21:33
Add the 'hide' query parameter to remove check-ins tagged as "hidden" (which are shown by default) for the /leaves, /brtimeline, and /tagtimeline web pages. (Rationale: listings of open leaves not tagged as "hidden" can make handy TODO lists.) ... (check-in: 92fa3664 user: florian tags: fix-timeline-view)
20:54
Revise and partially revert [d28f9e99a0] and [f174bfa157]: no need to remove the parents, TIMELINE_DISJOINT already does the magic. Related nodes now again have connecting rails for the /leaves, /brtimeline, and /tagtimeline web pages. ... (check-in: 8f4b7e1f user: florian tags: fix-timeline-view)
Changes
Unified Diff Ignore Whitespace Patch
Changes to src/branch.c.
615
616
617
618
619
620
621

622
623
624
625

626
627
628
629
630
631
632
633
634
635
636
637

638
639
640





641
642
643
644
645
646
647
648
649
650
** WEBPAGE: brtimeline
**
** Show a timeline of all branches
**
** Query parameters:
**
**     ng            No graph

**     brbg          Background color by branch name
**     ubg           Background color by user name
*/
void brtimeline_page(void){

  Stmt q;
  int tmFlags; /* Timeline display flags */

  login_check_credentials();
  if( !g.perm.Read ){ login_needed(g.anon.Read); return; }

  style_header("Branches");
  style_submenu_element("List", "brlist");
  login_anonymous_available();
  timeline_ss_submenu();
  cookie_render();
  @ <h2>The initial check-in for each branch:</h2>

  db_prepare(&q,
    "%s AND blob.rid IN (SELECT rid FROM tagxref"
    "                     WHERE tagtype>0 AND tagid=%d AND srcid!=0)"





    " ORDER BY event.mtime DESC",
    timeline_query_for_www(), TAG_BRANCH
  );
  /* Always specify TIMELINE_DISJOINT, or graph_finish() may fail because of too
  ** many descenders to (off-screen) parents. */
  tmFlags = TIMELINE_DISJOINT | TIMELINE_NOSCROLL;
  if( P("ng")==0 ) tmFlags |= TIMELINE_GRAPH;
  if( P("brbg")!=0 ) tmFlags |= TIMELINE_BRCOLOR;
  if( P("ubg")!=0 ) tmFlags |= TIMELINE_UCOLOR;
  www_print_timeline(&q, tmFlags, 0, 0, 0, brtimeline_extra);







>




>












>
|
|
|
>
>
>
>
>
|
<
|







615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
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
** WEBPAGE: brtimeline
**
** Show a timeline of all branches
**
** Query parameters:
**
**     ng            No graph
**     hide          Hide check-ins with "hidden" tag
**     brbg          Background color by branch name
**     ubg           Background color by user name
*/
void brtimeline_page(void){
  Blob sql = empty_blob;
  Stmt q;
  int tmFlags; /* Timeline display flags */

  login_check_credentials();
  if( !g.perm.Read ){ login_needed(g.anon.Read); return; }

  style_header("Branches");
  style_submenu_element("List", "brlist");
  login_anonymous_available();
  timeline_ss_submenu();
  cookie_render();
  @ <h2>The initial check-in for each branch:</h2>
  blob_append(&sql, timeline_query_for_www(), -1);
  blob_append_sql(&sql,
    "AND blob.rid IN (SELECT rid FROM tagxref"
    "                  WHERE tagtype>0 AND tagid=%d AND srcid!=0)", TAG_BRANCH);
  if( P("hide") ){
    blob_append_sql(&sql,
      " AND NOT EXISTS(SELECT 1 FROM tagxref"
      " WHERE tagid=%d AND tagtype>0 AND rid=blob.rid)\n", TAG_HIDDEN);
  }
  db_prepare(&q, "%s ORDER BY event.mtime DESC", blob_sql_text(&sql));

  blob_reset(&sql);
  /* Always specify TIMELINE_DISJOINT, or graph_finish() may fail because of too
  ** many descenders to (off-screen) parents. */
  tmFlags = TIMELINE_DISJOINT | TIMELINE_NOSCROLL;
  if( P("ng")==0 ) tmFlags |= TIMELINE_GRAPH;
  if( P("brbg")!=0 ) tmFlags |= TIMELINE_BRCOLOR;
  if( P("ubg")!=0 ) tmFlags |= TIMELINE_UCOLOR;
  www_print_timeline(&q, tmFlags, 0, 0, 0, brtimeline_extra);
Changes to src/descendants.c.
453
454
455
456
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
** is a leaf without a "closed" tag.
**
** Query parameters:
**
**     all           Show all leaves
**     closed        Show only closed leaves
**     ng            No graph

**     brbg          Background color by branch name
**     ubg           Background color by user name
*/
void leaves_page(void){
  Blob sql;
  Stmt q;
  int showAll = P("all")!=0;
  int showClosed = P("closed")!=0;
  int fNg = P("ng")!=0;           /* Flag for the "ng" query parameter */

  int fBrBg = P("brbg")!=0;       /* Flag for the "brbg" query parameter */
  int fUBg = P("ubg")!=0;         /* Flag for the "ubg" query parameter */
  Blob QueryParams = empty_blob;  /* Concatenated query parameters */
  char *zParamSep = 0;            /* Query parameter separator */
  int tmFlags;                    /* Timeline display flags */

  login_check_credentials();
  if( !g.perm.Read ){ login_needed(g.anon.Read); return; }
  if( fNg ){
    blob_appendf(&QueryParams, "%s%s", zParamSep, "ng");
    zParamSep = "&";
  }




  if( fBrBg ){
    blob_appendf(&QueryParams, "%s%s", zParamSep, "brbg");
    zParamSep = "&";
  }
  if( fUBg ){
    blob_appendf(&QueryParams, "%s%s", zParamSep, "ubg");
    zParamSep = "&";







>









>












>
>
>
>







453
454
455
456
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
** is a leaf without a "closed" tag.
**
** Query parameters:
**
**     all           Show all leaves
**     closed        Show only closed leaves
**     ng            No graph
**     hide          Hide check-ins with "hidden" tag
**     brbg          Background color by branch name
**     ubg           Background color by user name
*/
void leaves_page(void){
  Blob sql;
  Stmt q;
  int showAll = P("all")!=0;
  int showClosed = P("closed")!=0;
  int fNg = P("ng")!=0;           /* Flag for the "ng" query parameter */
  int fHide = P("hide")!=0;       /* Flag for the "hide" query parameter */
  int fBrBg = P("brbg")!=0;       /* Flag for the "brbg" query parameter */
  int fUBg = P("ubg")!=0;         /* Flag for the "ubg" query parameter */
  Blob QueryParams = empty_blob;  /* Concatenated query parameters */
  char *zParamSep = 0;            /* Query parameter separator */
  int tmFlags;                    /* Timeline display flags */

  login_check_credentials();
  if( !g.perm.Read ){ login_needed(g.anon.Read); return; }
  if( fNg ){
    blob_appendf(&QueryParams, "%s%s", zParamSep, "ng");
    zParamSep = "&";
  }
  if( fHide ){
    blob_appendf(&QueryParams, "%s%s", zParamSep, "hide");
    zParamSep = "&";
  }
  if( fBrBg ){
    blob_appendf(&QueryParams, "%s%s", zParamSep, "brbg");
    zParamSep = "&";
  }
  if( fUBg ){
    blob_appendf(&QueryParams, "%s%s", zParamSep, "ubg");
    zParamSep = "&";
530
531
532
533
534
535
536





537
538
539
540
541
542
543
  blob_append(&sql, timeline_query_for_www(), -1);
  blob_append_sql(&sql, " AND blob.rid IN leaf");
  if( showClosed ){
    blob_append_sql(&sql," AND %z", leaf_is_closed_sql("blob.rid"));
  }else if( !showAll ){
    blob_append_sql(&sql," AND NOT %z", leaf_is_closed_sql("blob.rid"));
  }





  db_prepare(&q, "%s ORDER BY event.mtime DESC", blob_sql_text(&sql));
  blob_reset(&sql);
  /* Always specify TIMELINE_DISJOINT, or graph_finish() may fail because of too
  ** many descenders to (off-screen) parents. */
  tmFlags = TIMELINE_LEAFONLY | TIMELINE_DISJOINT | TIMELINE_NOSCROLL;
  if( fNg==0 ) tmFlags |= TIMELINE_GRAPH;
  if( fBrBg ) tmFlags |= TIMELINE_BRCOLOR;







>
>
>
>
>







536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
  blob_append(&sql, timeline_query_for_www(), -1);
  blob_append_sql(&sql, " AND blob.rid IN leaf");
  if( showClosed ){
    blob_append_sql(&sql," AND %z", leaf_is_closed_sql("blob.rid"));
  }else if( !showAll ){
    blob_append_sql(&sql," AND NOT %z", leaf_is_closed_sql("blob.rid"));
  }
  if( fHide ){
    blob_append_sql(&sql,
      " AND NOT EXISTS(SELECT 1 FROM tagxref"
      " WHERE tagid=%d AND tagtype>0 AND rid=blob.rid)\n", TAG_HIDDEN);
  }
  db_prepare(&q, "%s ORDER BY event.mtime DESC", blob_sql_text(&sql));
  blob_reset(&sql);
  /* Always specify TIMELINE_DISJOINT, or graph_finish() may fail because of too
  ** many descenders to (off-screen) parents. */
  tmFlags = TIMELINE_LEAFONLY | TIMELINE_DISJOINT | TIMELINE_NOSCROLL;
  if( fNg==0 ) tmFlags |= TIMELINE_GRAPH;
  if( fBrBg ) tmFlags |= TIMELINE_BRCOLOR;
Changes to src/tag.c.
687
688
689
690
691
692
693

694
695
696
697

698
699
700
701
702
703
704
705
706
707
708
709

710
711
712
713
714





715
716
717
718
719
720
721
722
723
724
**
** Render a timeline with all check-ins that contain non-propagating
** symbolic tags.
**
** Query parameters:
**
**     ng            No graph

**     brbg          Background color by branch name
**     ubg           Background color by user name
*/
void tagtimeline_page(void){

  Stmt q;
  int tmFlags; /* Timeline display flags */

  login_check_credentials();
  if( !g.perm.Read ){ login_needed(g.anon.Read); return; }

  style_header("Tagged Check-ins");
  style_submenu_element("List", "taglist");
  login_anonymous_available();
  timeline_ss_submenu();
  cookie_render();
  @ <h2>Check-ins with non-propagating tags:</h2>

  db_prepare(&q,
    "%s AND blob.rid IN (SELECT rid FROM tagxref"
    "                     WHERE tagtype=1 AND srcid>0"
    "                       AND tagid IN (SELECT tagid FROM tag "
    "                                      WHERE tagname GLOB 'sym-*'))"





    " ORDER BY event.mtime DESC /*sort*/",
    timeline_query_for_www()
  );
  /* Always specify TIMELINE_DISJOINT, or graph_finish() may fail because of too
  ** many descenders to (off-screen) parents. */
  tmFlags = TIMELINE_DISJOINT | TIMELINE_NOSCROLL;
  if( P("ng")==0 ) tmFlags |= TIMELINE_GRAPH;
  if( P("brbg")!=0 ) tmFlags |= TIMELINE_BRCOLOR;
  if( P("ubg")!=0 ) tmFlags |= TIMELINE_UCOLOR;
  www_print_timeline(&q, tmFlags, 0, 0, 0, 0);







>




>












>
|
|
|
|
|
>
>
>
>
>
|
<
|







687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723

724
725
726
727
728
729
730
731
**
** Render a timeline with all check-ins that contain non-propagating
** symbolic tags.
**
** Query parameters:
**
**     ng            No graph
**     hide          Hide check-ins with "hidden" tag
**     brbg          Background color by branch name
**     ubg           Background color by user name
*/
void tagtimeline_page(void){
  Blob sql = empty_blob;
  Stmt q;
  int tmFlags; /* Timeline display flags */

  login_check_credentials();
  if( !g.perm.Read ){ login_needed(g.anon.Read); return; }

  style_header("Tagged Check-ins");
  style_submenu_element("List", "taglist");
  login_anonymous_available();
  timeline_ss_submenu();
  cookie_render();
  @ <h2>Check-ins with non-propagating tags:</h2>
  blob_append(&sql, timeline_query_for_www(), -1);
  blob_append_sql(&sql,
    "AND blob.rid IN (SELECT rid FROM tagxref"
    "                  WHERE tagtype=1 AND srcid>0"
    "                    AND tagid IN (SELECT tagid FROM tag "
    "                                   WHERE tagname GLOB 'sym-*'))");
  if( P("hide") ){
    blob_append_sql(&sql,
      " AND NOT EXISTS(SELECT 1 FROM tagxref"
      " WHERE tagid=%d AND tagtype>0 AND rid=blob.rid)\n", TAG_HIDDEN);
  }
  db_prepare(&q, "%s ORDER BY event.mtime DESC /*sort*/", blob_sql_text(&sql));

  blob_reset(&sql);
  /* Always specify TIMELINE_DISJOINT, or graph_finish() may fail because of too
  ** many descenders to (off-screen) parents. */
  tmFlags = TIMELINE_DISJOINT | TIMELINE_NOSCROLL;
  if( P("ng")==0 ) tmFlags |= TIMELINE_GRAPH;
  if( P("brbg")!=0 ) tmFlags |= TIMELINE_BRCOLOR;
  if( P("ubg")!=0 ) tmFlags |= TIMELINE_UCOLOR;
  www_print_timeline(&q, tmFlags, 0, 0, 0, 0);