diff --git a/web/pgadmin/misc/file_manager/__init__.py b/web/pgadmin/misc/file_manager/__init__.py index e262208a1..5c6a908c7 100644 --- a/web/pgadmin/misc/file_manager/__init__.py +++ b/web/pgadmin/misc/file_manager/__init__.py @@ -415,7 +415,7 @@ class Filemanager(object): except: drive_size = 0 protected = 1 if drive_size == 0 else 0 - files[drive] = { + files[file_name] = { "Filename": file_name, "Path": path, "file_type": 'drive', @@ -441,7 +441,12 @@ class Filemanager(object): orig_path = unquote(orig_path) try: - for f in sorted(os.listdir(orig_path)): + def custom_sort(x, y): + return y.lower() > x.lower() + + mylist = [x for x in sorted(os.listdir(orig_path), + cmp=custom_sort)] + for f in mylist: protected = 0 system_path = os.path.join(os.path.join(orig_path, f)) @@ -474,7 +479,7 @@ class Filemanager(object): continue # create a list of files and folders - files[user_path] = { + files[f] = { "Filename": f, "Path": user_path, "file_type": file_extension, diff --git a/web/pgadmin/misc/file_manager/templates/file_manager/js/utility.js b/web/pgadmin/misc/file_manager/templates/file_manager/js/utility.js index 1bf7cd68a..f1a5ef411 100755 --- a/web/pgadmin/misc/file_manager/templates/file_manager/js/utility.js +++ b/web/pgadmin/misc/file_manager/templates/file_manager/js/utility.js @@ -236,7 +236,7 @@ var setUploader = function(path) { // template for creating new folder folder_div = - "
  • " + + "
  • " + "
    " + "

    New_Folder

    " + "
  • "; @@ -686,7 +686,9 @@ var getFolderInfo = function(path, file_type) { if (!_.isEmpty(data)) { if ($('.fileinfo').data('view') == 'grid') { result += '