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;
|