Fossil

Check-in [2ac6b507]
Login

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

Overview
Comment:Add timeline query parameters 'ng', 'brbg' and 'ubg' for the Leaves web page.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | fix-timeline-view
Files: files | file ages | folders
SHA3-256: 2ac6b5077656c35ffbaaf98f86064d720a78c3184957630688357d89395b519c
User & Date: florian 2018-12-24 12:11:00
Context
2018-12-24
12:44
Also add background colors, clickable nodes, the option box to select the viewing mode, and timeline query parameters 'ng', 'brbg' and 'ubg' for the /brtimeline and /tagtimeline web pages. check-in: f174bfa1 user: florian tags: fix-timeline-view
12:11
Add timeline query parameters 'ng', 'brbg' and 'ubg' for the Leaves web page. check-in: 2ac6b507 user: florian tags: fix-timeline-view
07:11
Show the option box to select the viewing mode for the Leaves web page. check-in: e03610b1 user: florian tags: fix-timeline-view
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/descendants.c.

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
...
507
508
509
510
511
512
513




514
515
516
517
518
519
520
521
522
** "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



*/
void leaves_page(void){
  Blob sql;
  Stmt q;
  int showAll = P("all")!=0;
  int showClosed = P("closed")!=0;







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












  if( !showAll ){
    style_submenu_element("All", "leaves?all");

  }
  if( !showClosed ){
    style_submenu_element("Closed", "leaves?closed");

  }
  if( showClosed || showAll ){

    style_submenu_element("Open", "leaves");

  }

  style_header("Leaves");
  login_anonymous_available();
  timeline_ss_submenu();
  cookie_render();
#if 0
  style_sidebox_begin("Nomenclature:", "33%");
  @ <ol>
................................................................................
  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);




  www_print_timeline(
    &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() */







>
>
>






>
>
>
>
>
>



>
>
>
|
>
>
>
>
>
>
>
>

|
>


|
>


>
|
>

>







 







>
>
>
>
|
<







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
...
532
533
534
535
536
537
538
539
540
541
542
543

544
545
546
547
548
549
550
** "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%s%s",
                          zParamSep, blob_str(&QueryParams));
  }
  if( !showClosed ){
    style_submenu_element("Closed", "leaves?closed%s%s",
                          zParamSep, blob_str(&QueryParams));
  }
  if( showClosed || showAll ){
    if( zParamSep ) zParamSep = "?";
    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>
................................................................................
  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(&q, tmFlags, 0, 0, 0, 0);

  db_finalize(&q);
  @ <br />
  style_footer();
}

#if INTERFACE
/* Flag parameters to compute_uses_file() */