Fossil SCM
Add "Sort By Filename" and "Sort By Time" buttons to the /tree webpage.
Commit
e99255f0a5bb12d3ba41c7988d04c36a9bd557b1
Parent
fd4e1b55d702de4…
1 file changed
+12
-4
+12
-4
| --- src/browse.c | ||
| +++ src/browse.c | ||
| @@ -606,30 +606,38 @@ | ||
| 606 | 606 | }else{ |
| 607 | 607 | if( zRE ){ |
| 608 | 608 | blob_appendf(&dirname, "matching \"%s\"", zRE); |
| 609 | 609 | } |
| 610 | 610 | } |
| 611 | + if( !showDirOnly ){ | |
| 612 | + style_submenu_element("Flat-View", "Flat-View", "%s", | |
| 613 | + url_render(&sURI, "type", "flat", 0, 0)); | |
| 614 | + } | |
| 611 | 615 | if( zCI ){ |
| 612 | 616 | style_submenu_element("All", "All", "%s", |
| 613 | 617 | url_render(&sURI, "ci", 0, 0, 0)); |
| 614 | 618 | if( nD==0 && !showDirOnly ){ |
| 615 | 619 | style_submenu_element("File Ages", "File Ages", "%R/fileage?name=%s", |
| 616 | 620 | zUuid); |
| 617 | 621 | } |
| 622 | + if( P("mtime")!=0 ){ | |
| 623 | + style_submenu_element("Sort By Filename","Sort By Filename", "%s", | |
| 624 | + url_render(&sURI, 0, 0, 0, 0)); | |
| 625 | + url_add_parameter(&sURI, "mtime", "1"); | |
| 626 | + }else{ | |
| 627 | + style_submenu_element("Sort By Time","Sort By Time", "%s", | |
| 628 | + url_render(&sURI, "mtime", "1", 0, 0)); | |
| 629 | + } | |
| 618 | 630 | } |
| 619 | 631 | if( linkTrunk ){ |
| 620 | 632 | style_submenu_element("Trunk", "Trunk", "%s", |
| 621 | 633 | url_render(&sURI, "ci", "trunk", 0, 0)); |
| 622 | 634 | } |
| 623 | 635 | if( linkTip ){ |
| 624 | 636 | style_submenu_element("Tip", "Tip", "%s", |
| 625 | 637 | url_render(&sURI, "ci", "tip", 0, 0)); |
| 626 | 638 | } |
| 627 | - if( !showDirOnly ){ | |
| 628 | - style_submenu_element("Flat-View", "Flat-View", "%s", | |
| 629 | - url_render(&sURI, "type", "flat", 0, 0)); | |
| 630 | - } | |
| 631 | 639 | |
| 632 | 640 | /* Compute the file hierarchy. |
| 633 | 641 | */ |
| 634 | 642 | if( zCI ){ |
| 635 | 643 | Stmt q; |
| 636 | 644 |
| --- src/browse.c | |
| +++ src/browse.c | |
| @@ -606,30 +606,38 @@ | |
| 606 | }else{ |
| 607 | if( zRE ){ |
| 608 | blob_appendf(&dirname, "matching \"%s\"", zRE); |
| 609 | } |
| 610 | } |
| 611 | if( zCI ){ |
| 612 | style_submenu_element("All", "All", "%s", |
| 613 | url_render(&sURI, "ci", 0, 0, 0)); |
| 614 | if( nD==0 && !showDirOnly ){ |
| 615 | style_submenu_element("File Ages", "File Ages", "%R/fileage?name=%s", |
| 616 | zUuid); |
| 617 | } |
| 618 | } |
| 619 | if( linkTrunk ){ |
| 620 | style_submenu_element("Trunk", "Trunk", "%s", |
| 621 | url_render(&sURI, "ci", "trunk", 0, 0)); |
| 622 | } |
| 623 | if( linkTip ){ |
| 624 | style_submenu_element("Tip", "Tip", "%s", |
| 625 | url_render(&sURI, "ci", "tip", 0, 0)); |
| 626 | } |
| 627 | if( !showDirOnly ){ |
| 628 | style_submenu_element("Flat-View", "Flat-View", "%s", |
| 629 | url_render(&sURI, "type", "flat", 0, 0)); |
| 630 | } |
| 631 | |
| 632 | /* Compute the file hierarchy. |
| 633 | */ |
| 634 | if( zCI ){ |
| 635 | Stmt q; |
| 636 |
| --- src/browse.c | |
| +++ src/browse.c | |
| @@ -606,30 +606,38 @@ | |
| 606 | }else{ |
| 607 | if( zRE ){ |
| 608 | blob_appendf(&dirname, "matching \"%s\"", zRE); |
| 609 | } |
| 610 | } |
| 611 | if( !showDirOnly ){ |
| 612 | style_submenu_element("Flat-View", "Flat-View", "%s", |
| 613 | url_render(&sURI, "type", "flat", 0, 0)); |
| 614 | } |
| 615 | if( zCI ){ |
| 616 | style_submenu_element("All", "All", "%s", |
| 617 | url_render(&sURI, "ci", 0, 0, 0)); |
| 618 | if( nD==0 && !showDirOnly ){ |
| 619 | style_submenu_element("File Ages", "File Ages", "%R/fileage?name=%s", |
| 620 | zUuid); |
| 621 | } |
| 622 | if( P("mtime")!=0 ){ |
| 623 | style_submenu_element("Sort By Filename","Sort By Filename", "%s", |
| 624 | url_render(&sURI, 0, 0, 0, 0)); |
| 625 | url_add_parameter(&sURI, "mtime", "1"); |
| 626 | }else{ |
| 627 | style_submenu_element("Sort By Time","Sort By Time", "%s", |
| 628 | url_render(&sURI, "mtime", "1", 0, 0)); |
| 629 | } |
| 630 | } |
| 631 | if( linkTrunk ){ |
| 632 | style_submenu_element("Trunk", "Trunk", "%s", |
| 633 | url_render(&sURI, "ci", "trunk", 0, 0)); |
| 634 | } |
| 635 | if( linkTip ){ |
| 636 | style_submenu_element("Tip", "Tip", "%s", |
| 637 | url_render(&sURI, "ci", "tip", 0, 0)); |
| 638 | } |
| 639 | |
| 640 | /* Compute the file hierarchy. |
| 641 | */ |
| 642 | if( zCI ){ |
| 643 | Stmt q; |
| 644 |