Hi
IMO in case of a directory with many entries it's more convenient to display all sub-directories on the top of the tree-page than to scroll down for them.
Bost
---
templates/tree.php | 8 +++++++-
1 files changed, 7 insertions(+), 1 deletions(-)
diff --git a/templates/tree.php b/templates/tree.php
index 37c86c5..6348e98 100644
--- a/templates/tree.php
+++ b/templates/tree.php
@@ -8,7 +8,13 @@
</thead>
<tbody>
<?php
-foreach ($page['entries'] as $e) {
+function cmp($a, $b) {
+ // '-1' means 'reverse order', i.e. directories first
+ return (strcmp($a['type'], $b['type']) * -1);
+}
+$sorted_entries = $page['entries'];
+usort($sorted_entries, "cmp");
+foreach ($sorted_entries as $e) {
$tr_class = $tr_class=="odd" ? "even" : "odd";
if (strlen($page['path']) > 0) {
--
1.6.5.1.1367.gcd48
Could you make this a config item, and use git format-patch to create the patch?
"Updated tree view to list directories first."
https://github.com/user996015/viewgit/commit/b413d2c15a725106a1f6f90f05203feee9637702