Fossil SCM

Add "Sort By Filename" and "Sort By Time" buttons to the /tree webpage.

drh 2014-12-16 23:49 UTC age-in-file-tree
Commit e99255f0a5bb12d3ba41c7988d04c36a9bd557b1
1 file changed +12 -4
+12 -4
--- src/browse.c
+++ src/browse.c
@@ -606,30 +606,38 @@
606606
}else{
607607
if( zRE ){
608608
blob_appendf(&dirname, "matching \"%s\"", zRE);
609609
}
610610
}
611
+ if( !showDirOnly ){
612
+ style_submenu_element("Flat-View", "Flat-View", "%s",
613
+ url_render(&sURI, "type", "flat", 0, 0));
614
+ }
611615
if( zCI ){
612616
style_submenu_element("All", "All", "%s",
613617
url_render(&sURI, "ci", 0, 0, 0));
614618
if( nD==0 && !showDirOnly ){
615619
style_submenu_element("File Ages", "File Ages", "%R/fileage?name=%s",
616620
zUuid);
617621
}
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
+ }
618630
}
619631
if( linkTrunk ){
620632
style_submenu_element("Trunk", "Trunk", "%s",
621633
url_render(&sURI, "ci", "trunk", 0, 0));
622634
}
623635
if( linkTip ){
624636
style_submenu_element("Tip", "Tip", "%s",
625637
url_render(&sURI, "ci", "tip", 0, 0));
626638
}
627
- if( !showDirOnly ){
628
- style_submenu_element("Flat-View", "Flat-View", "%s",
629
- url_render(&sURI, "type", "flat", 0, 0));
630
- }
631639
632640
/* Compute the file hierarchy.
633641
*/
634642
if( zCI ){
635643
Stmt q;
636644
--- 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

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button