diff --git a/src/octoprint/static/js/app/viewmodels/files.js b/src/octoprint/static/js/app/viewmodels/files.js index 6b40e0e9e..85da9ebcf 100644 --- a/src/octoprint/static/js/app/viewmodels/files.js +++ b/src/octoprint/static/js/app/viewmodels/files.js @@ -89,7 +89,7 @@ $(function () { self.moveDestinationFilename = ko.observable(undefined); self.moveDestinationFullpath = ko.pureComputed(function () { // Join the paths for renaming - if (self.moveSourceFilename() != self.moveDestinationFilename()) { + if (self.moveSourceFilename() !== self.moveDestinationFilename()) { if (self.moveDestination() === "/") { return self.moveDestination() + self.moveDestinationFilename(); } else { @@ -100,6 +100,16 @@ $(function () { } }); self.moveError = ko.observable(""); + self.moveButtonText = ko.pureComputed(function () { + if (self.moveSource() === self.moveDestination()) { + return gettext("Rename"); + } else { + // Moving, but maybe also renaming + if (self.moveSourceFilename() !== self.moveDestinationFilename()) { + return gettext("Move & Rename"); + } else return gettext("Move"); + } + }); self.folderList = ko.observableArray(["/"]); self.addFolderDialog = undefined; diff --git a/src/octoprint/templates/dialogs/files.jinja2 b/src/octoprint/templates/dialogs/files.jinja2 index 44e6c16a6..07c0012b5 100644 --- a/src/octoprint/templates/dialogs/files.jinja2 +++ b/src/octoprint/templates/dialogs/files.jinja2 @@ -23,7 +23,7 @@
diff --git a/src/octoprint/templates/sidebar/files.jinja2 b/src/octoprint/templates/sidebar/files.jinja2 index e6c143d8b..8ce10c8db 100644 --- a/src/octoprint/templates/sidebar/files.jinja2 +++ b/src/octoprint/templates/sidebar/files.jinja2 @@ -24,7 +24,7 @@