452
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
|
452
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
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
|
+
+
+
+
+
+
+
+
+
+
+
+
-
+
+
+
+
+
+
+
+
+
-
+
+
-
+
+
+
-
+
+
+
|
** "closed leaf" is a leaf that has a "closed" tag. An "open leaf"
** 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 = "&";
}
if( !showAll ){
style_submenu_element("All", "leaves?all");
style_submenu_element("All", "leaves?all%s%s",
zParamSep, blob_str(&QueryParams));
}
if( !showClosed ){
style_submenu_element("Closed", "leaves?closed");
style_submenu_element("Closed", "leaves?closed%s%s",
zParamSep, blob_str(&QueryParams));
}
if( showClosed || showAll ){
if( zParamSep ) zParamSep = "?";
style_submenu_element("Open", "leaves");
style_submenu_element("Open", "leaves%s%s",
zParamSep, blob_str(&QueryParams));
}
blob_reset(&QueryParams);
style_header("Leaves");
login_anonymous_available();
timeline_ss_submenu();
cookie_render();
#if 0
style_sidebox_begin("Nomenclature:", "33%");
@ <ol>
|
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
|
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
|
+
+
+
+
-
+
-
|
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);
tmFlags = TIMELINE_LEAFONLY | TIMELINE_NOSCROLL;
if( fNg==0 ) tmFlags |= TIMELINE_GRAPH;
if( fBrBg ) tmFlags |= TIMELINE_BRCOLOR;
if( fUBg ) tmFlags |= TIMELINE_UCOLOR;
www_print_timeline(
www_print_timeline(&q, tmFlags, 0, 0, 0, 0);
&q, TIMELINE_LEAFONLY|TIMELINE_GRAPH|TIMELINE_NOSCROLL, 0, 0, 0, 0);
db_finalize(&q);
@ <br />
style_footer();
}
#if INTERFACE
/* Flag parameters to compute_uses_file() */
|