Fossil SCM

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.)

florian 2018-12-24 21:33 UTC fix-timeline-view
Commit 92fa3664621423e994df7eb13b99c749cb1e2806ce28cba8163d66eeb94678f4
+13 -6
--- src/branch.c
+++ src/branch.c
@@ -617,14 +617,16 @@
617617
** Show a timeline of all branches
618618
**
619619
** Query parameters:
620620
**
621621
** ng No graph
622
+** hide Hide check-ins with "hidden" tag
622623
** brbg Background color by branch name
623624
** ubg Background color by user name
624625
*/
625626
void brtimeline_page(void){
627
+ Blob sql = empty_blob;
626628
Stmt q;
627629
int tmFlags; /* Timeline display flags */
628630
629631
login_check_credentials();
630632
if( !g.perm.Read ){ login_needed(g.anon.Read); return; }
@@ -633,16 +635,21 @@
633635
style_submenu_element("List", "brlist");
634636
login_anonymous_available();
635637
timeline_ss_submenu();
636638
cookie_render();
637639
@ <h2>The initial check-in for each branch:</h2>
638
- db_prepare(&q,
639
- "%s AND blob.rid IN (SELECT rid FROM tagxref"
640
- " WHERE tagtype>0 AND tagid=%d AND srcid!=0)"
641
- " ORDER BY event.mtime DESC",
642
- timeline_query_for_www(), TAG_BRANCH
643
- );
640
+ blob_append(&sql, timeline_query_for_www(), -1);
641
+ blob_append_sql(&sql,
642
+ "AND blob.rid IN (SELECT rid FROM tagxref"
643
+ " WHERE tagtype>0 AND tagid=%d AND srcid!=0)", TAG_BRANCH);
644
+ if( P("hide") ){
645
+ blob_append_sql(&sql,
646
+ " AND NOT EXISTS(SELECT 1 FROM tagxref"
647
+ " WHERE tagid=%d AND tagtype>0 AND rid=blob.rid)\n", TAG_HIDDEN);
648
+ }
649
+ db_prepare(&q, "%s ORDER BY event.mtime DESC", blob_sql_text(&sql));
650
+ blob_reset(&sql);
644651
/* Always specify TIMELINE_DISJOINT, or graph_finish() may fail because of too
645652
** many descenders to (off-screen) parents. */
646653
tmFlags = TIMELINE_DISJOINT | TIMELINE_NOSCROLL;
647654
if( P("ng")==0 ) tmFlags |= TIMELINE_GRAPH;
648655
if( P("brbg")!=0 ) tmFlags |= TIMELINE_BRCOLOR;
649656
--- src/branch.c
+++ src/branch.c
@@ -617,14 +617,16 @@
617 ** Show a timeline of all branches
618 **
619 ** Query parameters:
620 **
621 ** ng No graph
 
622 ** brbg Background color by branch name
623 ** ubg Background color by user name
624 */
625 void brtimeline_page(void){
 
626 Stmt q;
627 int tmFlags; /* Timeline display flags */
628
629 login_check_credentials();
630 if( !g.perm.Read ){ login_needed(g.anon.Read); return; }
@@ -633,16 +635,21 @@
633 style_submenu_element("List", "brlist");
634 login_anonymous_available();
635 timeline_ss_submenu();
636 cookie_render();
637 @ <h2>The initial check-in for each branch:</h2>
638 db_prepare(&q,
639 "%s AND blob.rid IN (SELECT rid FROM tagxref"
640 " WHERE tagtype>0 AND tagid=%d AND srcid!=0)"
641 " ORDER BY event.mtime DESC",
642 timeline_query_for_www(), TAG_BRANCH
643 );
 
 
 
 
 
644 /* Always specify TIMELINE_DISJOINT, or graph_finish() may fail because of too
645 ** many descenders to (off-screen) parents. */
646 tmFlags = TIMELINE_DISJOINT | TIMELINE_NOSCROLL;
647 if( P("ng")==0 ) tmFlags |= TIMELINE_GRAPH;
648 if( P("brbg")!=0 ) tmFlags |= TIMELINE_BRCOLOR;
649
--- src/branch.c
+++ src/branch.c
@@ -617,14 +617,16 @@
617 ** Show a timeline of all branches
618 **
619 ** Query parameters:
620 **
621 ** ng No graph
622 ** hide Hide check-ins with "hidden" tag
623 ** brbg Background color by branch name
624 ** ubg Background color by user name
625 */
626 void brtimeline_page(void){
627 Blob sql = empty_blob;
628 Stmt q;
629 int tmFlags; /* Timeline display flags */
630
631 login_check_credentials();
632 if( !g.perm.Read ){ login_needed(g.anon.Read); return; }
@@ -633,16 +635,21 @@
635 style_submenu_element("List", "brlist");
636 login_anonymous_available();
637 timeline_ss_submenu();
638 cookie_render();
639 @ <h2>The initial check-in for each branch:</h2>
640 blob_append(&sql, timeline_query_for_www(), -1);
641 blob_append_sql(&sql,
642 "AND blob.rid IN (SELECT rid FROM tagxref"
643 " WHERE tagtype>0 AND tagid=%d AND srcid!=0)", TAG_BRANCH);
644 if( P("hide") ){
645 blob_append_sql(&sql,
646 " AND NOT EXISTS(SELECT 1 FROM tagxref"
647 " WHERE tagid=%d AND tagtype>0 AND rid=blob.rid)\n", TAG_HIDDEN);
648 }
649 db_prepare(&q, "%s ORDER BY event.mtime DESC", blob_sql_text(&sql));
650 blob_reset(&sql);
651 /* Always specify TIMELINE_DISJOINT, or graph_finish() may fail because of too
652 ** many descenders to (off-screen) parents. */
653 tmFlags = TIMELINE_DISJOINT | TIMELINE_NOSCROLL;
654 if( P("ng")==0 ) tmFlags |= TIMELINE_GRAPH;
655 if( P("brbg")!=0 ) tmFlags |= TIMELINE_BRCOLOR;
656
--- src/descendants.c
+++ src/descendants.c
@@ -455,19 +455,21 @@
455455
** Query parameters:
456456
**
457457
** all Show all leaves
458458
** closed Show only closed leaves
459459
** ng No graph
460
+** hide Hide check-ins with "hidden" tag
460461
** brbg Background color by branch name
461462
** ubg Background color by user name
462463
*/
463464
void leaves_page(void){
464465
Blob sql;
465466
Stmt q;
466467
int showAll = P("all")!=0;
467468
int showClosed = P("closed")!=0;
468469
int fNg = P("ng")!=0; /* Flag for the "ng" query parameter */
470
+ int fHide = P("hide")!=0; /* Flag for the "hide" query parameter */
469471
int fBrBg = P("brbg")!=0; /* Flag for the "brbg" query parameter */
470472
int fUBg = P("ubg")!=0; /* Flag for the "ubg" query parameter */
471473
Blob QueryParams = empty_blob; /* Concatenated query parameters */
472474
char *zParamSep = 0; /* Query parameter separator */
473475
int tmFlags; /* Timeline display flags */
@@ -476,10 +478,14 @@
476478
if( !g.perm.Read ){ login_needed(g.anon.Read); return; }
477479
if( fNg ){
478480
blob_appendf(&QueryParams, "%s%s", zParamSep, "ng");
479481
zParamSep = "&";
480482
}
483
+ if( fHide ){
484
+ blob_appendf(&QueryParams, "%s%s", zParamSep, "hide");
485
+ zParamSep = "&";
486
+ }
481487
if( fBrBg ){
482488
blob_appendf(&QueryParams, "%s%s", zParamSep, "brbg");
483489
zParamSep = "&";
484490
}
485491
if( fUBg ){
@@ -532,10 +538,15 @@
532538
if( showClosed ){
533539
blob_append_sql(&sql," AND %z", leaf_is_closed_sql("blob.rid"));
534540
}else if( !showAll ){
535541
blob_append_sql(&sql," AND NOT %z", leaf_is_closed_sql("blob.rid"));
536542
}
543
+ if( fHide ){
544
+ blob_append_sql(&sql,
545
+ " AND NOT EXISTS(SELECT 1 FROM tagxref"
546
+ " WHERE tagid=%d AND tagtype>0 AND rid=blob.rid)\n", TAG_HIDDEN);
547
+ }
537548
db_prepare(&q, "%s ORDER BY event.mtime DESC", blob_sql_text(&sql));
538549
blob_reset(&sql);
539550
/* Always specify TIMELINE_DISJOINT, or graph_finish() may fail because of too
540551
** many descenders to (off-screen) parents. */
541552
tmFlags = TIMELINE_LEAFONLY | TIMELINE_DISJOINT | TIMELINE_NOSCROLL;
542553
--- src/descendants.c
+++ src/descendants.c
@@ -455,19 +455,21 @@
455 ** Query parameters:
456 **
457 ** all Show all leaves
458 ** closed Show only closed leaves
459 ** ng No graph
 
460 ** brbg Background color by branch name
461 ** ubg Background color by user name
462 */
463 void leaves_page(void){
464 Blob sql;
465 Stmt q;
466 int showAll = P("all")!=0;
467 int showClosed = P("closed")!=0;
468 int fNg = P("ng")!=0; /* Flag for the "ng" query parameter */
 
469 int fBrBg = P("brbg")!=0; /* Flag for the "brbg" query parameter */
470 int fUBg = P("ubg")!=0; /* Flag for the "ubg" query parameter */
471 Blob QueryParams = empty_blob; /* Concatenated query parameters */
472 char *zParamSep = 0; /* Query parameter separator */
473 int tmFlags; /* Timeline display flags */
@@ -476,10 +478,14 @@
476 if( !g.perm.Read ){ login_needed(g.anon.Read); return; }
477 if( fNg ){
478 blob_appendf(&QueryParams, "%s%s", zParamSep, "ng");
479 zParamSep = "&";
480 }
 
 
 
 
481 if( fBrBg ){
482 blob_appendf(&QueryParams, "%s%s", zParamSep, "brbg");
483 zParamSep = "&";
484 }
485 if( fUBg ){
@@ -532,10 +538,15 @@
532 if( showClosed ){
533 blob_append_sql(&sql," AND %z", leaf_is_closed_sql("blob.rid"));
534 }else if( !showAll ){
535 blob_append_sql(&sql," AND NOT %z", leaf_is_closed_sql("blob.rid"));
536 }
 
 
 
 
 
537 db_prepare(&q, "%s ORDER BY event.mtime DESC", blob_sql_text(&sql));
538 blob_reset(&sql);
539 /* Always specify TIMELINE_DISJOINT, or graph_finish() may fail because of too
540 ** many descenders to (off-screen) parents. */
541 tmFlags = TIMELINE_LEAFONLY | TIMELINE_DISJOINT | TIMELINE_NOSCROLL;
542
--- src/descendants.c
+++ src/descendants.c
@@ -455,19 +455,21 @@
455 ** Query parameters:
456 **
457 ** all Show all leaves
458 ** closed Show only closed leaves
459 ** ng No graph
460 ** hide Hide check-ins with "hidden" tag
461 ** brbg Background color by branch name
462 ** ubg Background color by user name
463 */
464 void leaves_page(void){
465 Blob sql;
466 Stmt q;
467 int showAll = P("all")!=0;
468 int showClosed = P("closed")!=0;
469 int fNg = P("ng")!=0; /* Flag for the "ng" query parameter */
470 int fHide = P("hide")!=0; /* Flag for the "hide" query parameter */
471 int fBrBg = P("brbg")!=0; /* Flag for the "brbg" query parameter */
472 int fUBg = P("ubg")!=0; /* Flag for the "ubg" query parameter */
473 Blob QueryParams = empty_blob; /* Concatenated query parameters */
474 char *zParamSep = 0; /* Query parameter separator */
475 int tmFlags; /* Timeline display flags */
@@ -476,10 +478,14 @@
478 if( !g.perm.Read ){ login_needed(g.anon.Read); return; }
479 if( fNg ){
480 blob_appendf(&QueryParams, "%s%s", zParamSep, "ng");
481 zParamSep = "&";
482 }
483 if( fHide ){
484 blob_appendf(&QueryParams, "%s%s", zParamSep, "hide");
485 zParamSep = "&";
486 }
487 if( fBrBg ){
488 blob_appendf(&QueryParams, "%s%s", zParamSep, "brbg");
489 zParamSep = "&";
490 }
491 if( fUBg ){
@@ -532,10 +538,15 @@
538 if( showClosed ){
539 blob_append_sql(&sql," AND %z", leaf_is_closed_sql("blob.rid"));
540 }else if( !showAll ){
541 blob_append_sql(&sql," AND NOT %z", leaf_is_closed_sql("blob.rid"));
542 }
543 if( fHide ){
544 blob_append_sql(&sql,
545 " AND NOT EXISTS(SELECT 1 FROM tagxref"
546 " WHERE tagid=%d AND tagtype>0 AND rid=blob.rid)\n", TAG_HIDDEN);
547 }
548 db_prepare(&q, "%s ORDER BY event.mtime DESC", blob_sql_text(&sql));
549 blob_reset(&sql);
550 /* Always specify TIMELINE_DISJOINT, or graph_finish() may fail because of too
551 ** many descenders to (off-screen) parents. */
552 tmFlags = TIMELINE_LEAFONLY | TIMELINE_DISJOINT | TIMELINE_NOSCROLL;
553
+15 -8
--- src/tag.c
+++ src/tag.c
@@ -689,14 +689,16 @@
689689
** symbolic tags.
690690
**
691691
** Query parameters:
692692
**
693693
** ng No graph
694
+** hide Hide check-ins with "hidden" tag
694695
** brbg Background color by branch name
695696
** ubg Background color by user name
696697
*/
697698
void tagtimeline_page(void){
699
+ Blob sql = empty_blob;
698700
Stmt q;
699701
int tmFlags; /* Timeline display flags */
700702
701703
login_check_credentials();
702704
if( !g.perm.Read ){ login_needed(g.anon.Read); return; }
@@ -705,18 +707,23 @@
705707
style_submenu_element("List", "taglist");
706708
login_anonymous_available();
707709
timeline_ss_submenu();
708710
cookie_render();
709711
@ <h2>Check-ins with non-propagating tags:</h2>
710
- db_prepare(&q,
711
- "%s AND blob.rid IN (SELECT rid FROM tagxref"
712
- " WHERE tagtype=1 AND srcid>0"
713
- " AND tagid IN (SELECT tagid FROM tag "
714
- " WHERE tagname GLOB 'sym-*'))"
715
- " ORDER BY event.mtime DESC /*sort*/",
716
- timeline_query_for_www()
717
- );
712
+ blob_append(&sql, timeline_query_for_www(), -1);
713
+ blob_append_sql(&sql,
714
+ "AND blob.rid IN (SELECT rid FROM tagxref"
715
+ " WHERE tagtype=1 AND srcid>0"
716
+ " AND tagid IN (SELECT tagid FROM tag "
717
+ " WHERE tagname GLOB 'sym-*'))");
718
+ if( P("hide") ){
719
+ blob_append_sql(&sql,
720
+ " AND NOT EXISTS(SELECT 1 FROM tagxref"
721
+ " WHERE tagid=%d AND tagtype>0 AND rid=blob.rid)\n", TAG_HIDDEN);
722
+ }
723
+ db_prepare(&q, "%s ORDER BY event.mtime DESC /*sort*/", blob_sql_text(&sql));
724
+ blob_reset(&sql);
718725
/* Always specify TIMELINE_DISJOINT, or graph_finish() may fail because of too
719726
** many descenders to (off-screen) parents. */
720727
tmFlags = TIMELINE_DISJOINT | TIMELINE_NOSCROLL;
721728
if( P("ng")==0 ) tmFlags |= TIMELINE_GRAPH;
722729
if( P("brbg")!=0 ) tmFlags |= TIMELINE_BRCOLOR;
723730
--- src/tag.c
+++ src/tag.c
@@ -689,14 +689,16 @@
689 ** symbolic tags.
690 **
691 ** Query parameters:
692 **
693 ** ng No graph
 
694 ** brbg Background color by branch name
695 ** ubg Background color by user name
696 */
697 void tagtimeline_page(void){
 
698 Stmt q;
699 int tmFlags; /* Timeline display flags */
700
701 login_check_credentials();
702 if( !g.perm.Read ){ login_needed(g.anon.Read); return; }
@@ -705,18 +707,23 @@
705 style_submenu_element("List", "taglist");
706 login_anonymous_available();
707 timeline_ss_submenu();
708 cookie_render();
709 @ <h2>Check-ins with non-propagating tags:</h2>
710 db_prepare(&q,
711 "%s AND blob.rid IN (SELECT rid FROM tagxref"
712 " WHERE tagtype=1 AND srcid>0"
713 " AND tagid IN (SELECT tagid FROM tag "
714 " WHERE tagname GLOB 'sym-*'))"
715 " ORDER BY event.mtime DESC /*sort*/",
716 timeline_query_for_www()
717 );
 
 
 
 
 
718 /* Always specify TIMELINE_DISJOINT, or graph_finish() may fail because of too
719 ** many descenders to (off-screen) parents. */
720 tmFlags = TIMELINE_DISJOINT | TIMELINE_NOSCROLL;
721 if( P("ng")==0 ) tmFlags |= TIMELINE_GRAPH;
722 if( P("brbg")!=0 ) tmFlags |= TIMELINE_BRCOLOR;
723
--- src/tag.c
+++ src/tag.c
@@ -689,14 +689,16 @@
689 ** symbolic tags.
690 **
691 ** Query parameters:
692 **
693 ** ng No graph
694 ** hide Hide check-ins with "hidden" tag
695 ** brbg Background color by branch name
696 ** ubg Background color by user name
697 */
698 void tagtimeline_page(void){
699 Blob sql = empty_blob;
700 Stmt q;
701 int tmFlags; /* Timeline display flags */
702
703 login_check_credentials();
704 if( !g.perm.Read ){ login_needed(g.anon.Read); return; }
@@ -705,18 +707,23 @@
707 style_submenu_element("List", "taglist");
708 login_anonymous_available();
709 timeline_ss_submenu();
710 cookie_render();
711 @ <h2>Check-ins with non-propagating tags:</h2>
712 blob_append(&sql, timeline_query_for_www(), -1);
713 blob_append_sql(&sql,
714 "AND blob.rid IN (SELECT rid FROM tagxref"
715 " WHERE tagtype=1 AND srcid>0"
716 " AND tagid IN (SELECT tagid FROM tag "
717 " WHERE tagname GLOB 'sym-*'))");
718 if( P("hide") ){
719 blob_append_sql(&sql,
720 " AND NOT EXISTS(SELECT 1 FROM tagxref"
721 " WHERE tagid=%d AND tagtype>0 AND rid=blob.rid)\n", TAG_HIDDEN);
722 }
723 db_prepare(&q, "%s ORDER BY event.mtime DESC /*sort*/", blob_sql_text(&sql));
724 blob_reset(&sql);
725 /* Always specify TIMELINE_DISJOINT, or graph_finish() may fail because of too
726 ** many descenders to (off-screen) parents. */
727 tmFlags = TIMELINE_DISJOINT | TIMELINE_NOSCROLL;
728 if( P("ng")==0 ) tmFlags |= TIMELINE_GRAPH;
729 if( P("brbg")!=0 ) tmFlags |= TIMELINE_BRCOLOR;
730

Keyboard Shortcuts

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