Hi,
Please find attached patch to set default layout of file listing as a list
in file manager.
Also replaced alertify with out custom alertifywrapper in file manager
utils.js
--
*Harshal Dhumal*
*Sr. Software Engineer*
EnterpriseDB India: http://www.enterprisedb.com
The Enterprise PostgreSQL Company
diff --git a/web/pgadmin/misc/file_manager/templates/file_manager/index.html b/web/pgadmin/misc/file_manager/templates/file_manager/index.html
index 1933895..80c85fb 100755
--- a/web/pgadmin/misc/file_manager/templates/file_manager/index.html
+++ b/web/pgadmin/misc/file_manager/templates/file_manager/index.html
@@ -26,8 +26,8 @@
<span></span></button>
<button name="newfolder" type="button" title="Create new folder" value="New Folder"
class="btn fa fa-folder-open create"><span></span></button>
- <button class="ON fa fa-th btn grid" type="button" title="View as grid"><span></span></button>
- <button type="button" class="btn fa fa-list list" title="View as Table"><span></span></button>
+ <button class="fa fa-th btn grid" type="button" title="View as grid"><span></span></button>
+ <button type="button" class="btn fa fa-list list ON" title="View as Table"><span></span></button>
</div>
</div>
<div class="fileinfo">
diff --git a/web/pgadmin/misc/file_manager/templates/file_manager/js/file_manager_config.json b/web/pgadmin/misc/file_manager/templates/file_manager/js/file_manager_config.json
index f74430d..fcc242d 100644
--- a/web/pgadmin/misc/file_manager/templates/file_manager/js/file_manager_config.json
+++ b/web/pgadmin/misc/file_manager/templates/file_manager/js/file_manager_config.json
@@ -2,7 +2,7 @@
"options": {
"culture": "en",
"lang": "py",
- "defaultViewMode": "grid",
+ "defaultViewMode": "list",
"autoload": true,
"showFullPath": false,
"dialog_type": "{{data.dialog_type}}",
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 fd8f25c..56be16a 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
@@ -1601,7 +1601,8 @@ pgAdmin.FileUtils = {
// create a new folder
var getFolderName = function(value) {
- var fname = value;
+ var fname = value,
+ alertifyWrapper = new AlertifyWrapper();
if (fname != '') {
foldername = fname;
@@ -1609,14 +1610,17 @@ pgAdmin.FileUtils = {
$.getJSON(pgAdmin.FileUtils.fileConnector + '?mode=addfolder&path=' + $('.currentpath').val() + '&name=' + foldername, function(resp) {
var result = resp.data.result;
if (result.Code === 1) {
- alertify.success(lg.successful_added_folder);
+ alertifyWrapper.success(lg.successful_added_folder);
getFolderInfo(result.Parent);
} else {
- alertify.error(result.Error);
+ alertifyWrapper.error(result.Error);
}
+ }).
+ fail(function (resp) {
+ alertifyWrapper.error(gettext('Error occurred while saving folder.'));
});
} else {
- alertify.error(lg.no_foldername);
+ alertifyWrapper.error(lg.no_foldername);
}
};