Fossil

Check-in [8bf8b378]
Login

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

Overview
Comment:Simplify URL building 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: 8bf8b37828e6ab8f46890e1cc6157856622522deaf3081b3fd61c80bcbce5c46
User & Date: florian 2018-12-26 10:43:00
Context
2018-12-26
11:12
Rename the 'hide' query parameter to 'nohidden' for the /leaves, /brtimeline, and /tagtimeline web pages. Closed-Leaf check-in: 5359e3db user: florian tags: fix-timeline-view
10:43
Simplify URL building for the /leaves web page. check-in: 8bf8b378 user: florian tags: fix-timeline-view
10:16
Add the 'onlyhidden' query parameter to show only check-ins tagged as "hidden" for the /leaves, /brtimeline, and /tagtimeline web pages. check-in: 82b9140f user: florian tags: fix-timeline-view
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/descendants.c.

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
510
511
512
513
514
515
516
517
518
519
520
521
  int showAll = P("all")!=0;
  int showClosed = P("closed")!=0;
  int fNg = PB("ng")!=0;           /* Flag for the "ng" query parameter */
  int fHide = PB("hide")!=0;       /* Flag for the "hide" query parameter */
  int fOnlyHidden = PB("onlyhidden")!=0;  /* "onlyhidden" query parameter */
  int fBrBg = PB("brbg")!=0;       /* Flag for the "brbg" query parameter */
  int fUBg = PB("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( fOnlyHidden ){
    blob_appendf(&QueryParams, "%s%s", zParamSep, "onlyhidden");
    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>







|
<




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

|
<


|
<


<
|
<

|







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
  int showAll = P("all")!=0;
  int showClosed = P("closed")!=0;
  int fNg = PB("ng")!=0;           /* Flag for the "ng" query parameter */
  int fHide = PB("hide")!=0;       /* Flag for the "hide" query parameter */
  int fOnlyHidden = PB("onlyhidden")!=0;  /* "onlyhidden" query parameter */
  int fBrBg = PB("brbg")!=0;       /* Flag for the "brbg" query parameter */
  int fUBg = PB("ubg")!=0;         /* Flag for the "ubg" query parameter */
  HQuery url;                      /* URL to /leaves plus query parameters */

  int tmFlags;                     /* Timeline display flags */

  login_check_credentials();
  if( !g.perm.Read ){ login_needed(g.anon.Read); return; }
  url_initialize(&url, "leaves");
  if( fNg ) url_add_parameter(&url, "ng", "");


  if( fHide ) url_add_parameter(&url, "hide", "");



  if( fOnlyHidden ) url_add_parameter(&url, "onlyhidden", "");



  if( fBrBg ) url_add_parameter(&url, "brbg", "");







  if( fUBg ) url_add_parameter(&url, "ubg", "");
  if( !showAll ){
    style_submenu_element("All", "%s", url_render(&url, "all", "", 0, 0));

  }
  if( !showClosed ){
    style_submenu_element("Closed", "%s", url_render(&url, "closed", "", 0, 0));

  }
  if( showClosed || showAll ){

    style_submenu_element("Open", "%s", url_render(&url, 0, 0, 0, 0));

  }
  url_reset(&url);
  style_header("Leaves");
  login_anonymous_available();
  timeline_ss_submenu();
  cookie_render();
#if 0
  style_sidebox_begin("Nomenclature:", "33%");
  @ <ol>