Fossil

Check-in [417d1808]
Login

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

Overview
Comment:Fix incorrect insertion of closing UL tags.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | csstree
Files: files | file ages | folders
SHA1:417d18082bde5bdda79b65484f61314986ef0f60
User & Date: joel 2014-01-02 18:50:19
Original Comment: Fix incorrect insertion of tags.
Context
2014-01-03
08:42
Minor CSS changes check-in: 331185fa user: joel tags: csstree
2014-01-02
18:50
Fix incorrect insertion of closing UL tags. check-in: 417d1808 user: joel tags: csstree
12:47
Propose tree-view enhancement. check-in: 377a4f2d user: joel tags: csstree
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/browse.c.

411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
...
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580


581
582
583
584
585
586
587


588
589
590
591
592
593
594
  int linkTip = 1;         /* include link to "tip" */
  const char *zRE;         /* the value for the re=REGEXP query parameter */
  char *zREx = "";         /* Extra parameters for path hyperlinks */
  ReCompiled *pRE = 0;     /* Compiled regular expression */
  FileTreeNode *p;         /* One line of the tree */
  FileTree sTree;          /* The complete tree of files */
  HQuery sURI;             /* Hyperlink */
  int iDepth = 0;          /* <ul> depth */
  char *zProjectName = db_get("project-name", 0);

  if( strcmp(PD("type",""),"flat")==0 ){ page_dir(); return; }
  memset(&sTree, 0, sizeof(sTree));
  login_check_credentials();
  if( !g.perm.Read ){ login_needed(); return; }
  while( nD>1 && zD[nD-2]=='/' ){ zD[(--nD)-1] = 0; }
................................................................................
  if( nD ){
    char *zLink = href("%s", url_render(&sURI, "name", 0, 0, 0));
    @ %z(zLink)%h(zProjectName)</a>
  }else{
    @ <a>%h(zProjectName)</a>
  }
  @ <ul class="filetree">
  iDepth = 2;
  for(p=sTree.pFirst; p; p=p->pNext){
    if( p->isDir ){
      @ <li class="dir">
      if( fossil_strcmp(p->zFullName, zD)==0 ){
        @ <a>%h(p->zName)</a>
      }else{
        char *zLink = href("%s", url_render(&sURI, "name", p->zFullName, 0, 0));
        @ %z(zLink)%h(p->zName)</a>
      }
      @ <ul class="filetree">
      iDepth++;
    }else{
      char *zLink;
      if( zCI ){
        zLink = href("%R/artifact/%s",p->zUuid);
      }else{
        zLink = href("%R/finfo?name=%T",p->zFullName);
      }
      @ <li class="file">%z(zLink)%h(p->zName)</a>
    }
    if( p->isLast && !p->isDir ){


      @ </ul>
      iDepth--;
    }
  }
  while( iDepth-- > 0 ) {
    @ </ul>
  }


  style_footer();

  /* We could free memory used by sTree here if we needed to.  But
  ** the process is about to exit, so doing so would not really accomplish
  ** anything useful. */
}








<







 







<










<









|
>
>
|
<
|
|
<
<

>
>







411
412
413
414
415
416
417

418
419
420
421
422
423
424
...
551
552
553
554
555
556
557

558
559
560
561
562
563
564
565
566
567

568
569
570
571
572
573
574
575
576
577
578
579
580

581
582


583
584
585
586
587
588
589
590
591
592
  int linkTip = 1;         /* include link to "tip" */
  const char *zRE;         /* the value for the re=REGEXP query parameter */
  char *zREx = "";         /* Extra parameters for path hyperlinks */
  ReCompiled *pRE = 0;     /* Compiled regular expression */
  FileTreeNode *p;         /* One line of the tree */
  FileTree sTree;          /* The complete tree of files */
  HQuery sURI;             /* Hyperlink */

  char *zProjectName = db_get("project-name", 0);

  if( strcmp(PD("type",""),"flat")==0 ){ page_dir(); return; }
  memset(&sTree, 0, sizeof(sTree));
  login_check_credentials();
  if( !g.perm.Read ){ login_needed(); return; }
  while( nD>1 && zD[nD-2]=='/' ){ zD[(--nD)-1] = 0; }
................................................................................
  if( nD ){
    char *zLink = href("%s", url_render(&sURI, "name", 0, 0, 0));
    @ %z(zLink)%h(zProjectName)</a>
  }else{
    @ <a>%h(zProjectName)</a>
  }
  @ <ul class="filetree">

  for(p=sTree.pFirst; p; p=p->pNext){
    if( p->isDir ){
      @ <li class="dir">
      if( fossil_strcmp(p->zFullName, zD)==0 ){
        @ <a>%h(p->zName)</a>
      }else{
        char *zLink = href("%s", url_render(&sURI, "name", p->zFullName, 0, 0));
        @ %z(zLink)%h(p->zName)</a>
      }
      @ <ul class="filetree">

    }else{
      char *zLink;
      if( zCI ){
        zLink = href("%R/artifact/%s",p->zUuid);
      }else{
        zLink = href("%R/finfo?name=%T",p->zFullName);
      }
      @ <li class="file">%z(zLink)%h(p->zName)</a>
    }
    if( p->isLast ){
      int nClose = p->iLevel - (p->pNext ? p->pNext->iLevel : 0);
      while( nClose-- > 0 ){
        @ </ul>

      }
    }


  }
  @ </ul>
  @ </ul>
  style_footer();

  /* We could free memory used by sTree here if we needed to.  But
  ** the process is about to exit, so doing so would not really accomplish
  ** anything useful. */
}