gui: Improve revert/override/delete warning modals (#7847)

1. Change each modal title text to match the action that is being
   executed (i.e. "Revert" to "Revert Local Additions", "Override" to
   "Override Changes", "Delete" to "Delete Unexpected Items").
2. Change the icons to match the icons used by each action (i.e. arrow-
   circle-down for Revert, arrow-circle-up for Override). Replace the
   broken lock icon for Delete with minus-circle.
3. Rearrange the order in the modal HTML code to simplify it a little.
This commit is contained in:
tomasz1986 2021-08-03 18:46:20 +09:00 committed by GitHub
parent 5a1f6cb813
commit abdf024517
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 48 additions and 27 deletions

View File

@ -26,10 +26,12 @@
"Anonymous Usage Reporting": "Anonymous Usage Reporting",
"Anonymous usage report format has changed. Would you like to move to the new format?": "Anonymous usage report format has changed. Would you like to move to the new format?",
"Are you sure you want to continue?": "Are you sure you want to continue?",
"Are you sure you want to override all remote changes?": "Are you sure you want to override all remote changes?",
"Are you sure you want to permanently delete all these files?": "Are you sure you want to permanently delete all these files?",
"Are you sure you want to remove device {%name%}?": "Are you sure you want to remove device {{name}}?",
"Are you sure you want to remove folder {%label%}?": "Are you sure you want to remove folder {{label}}?",
"Are you sure you want to restore {%count%} files?": "Are you sure you want to restore {{count}} files?",
"Are you sure you want to revert all local changes?": "Are you sure you want to revert all local changes?",
"Are you sure you want to upgrade?": "Are you sure you want to upgrade?",
"Auto Accept": "Auto Accept",
"Automatic Crash Reporting": "Automatic Crash Reporting",
@ -40,6 +42,7 @@
"Available debug logging facilities:": "Available debug logging facilities:",
"Be careful!": "Be careful!",
"Bugs": "Bugs",
"Cancel": "Cancel",
"Changelog": "Changelog",
"Clean out after": "Clean out after",
"Cleaning Versions": "Cleaning Versions",
@ -68,6 +71,7 @@
"Default Folder": "Default Folder",
"Default Folder Path": "Default Folder Path",
"Defaults": "Defaults",
"Delete": "Delete",
"Delete Unexpected Items": "Delete Unexpected Items",
"Deleted": "Deleted",
"Deselect All": "Deselect All",

View File

@ -557,7 +557,7 @@
<span class="fa fa-arrow-circle-down"></span>&nbsp;<span translate>Revert Local Changes</span>
</button>
<button type="button" class="btn btn-sm btn-danger pull-left" ng-click="revertOverrideConfirmationModal('deleteEnc', folder.id)" ng-if="hasReceiveEncryptedItems(folder)">
<span class="fa fa-arrow-lock"></span>&nbsp;<span translate>Delete Unexpected Items</span>
<span class="fa fa-minus-circle"></span>&nbsp;<span translate>Delete Unexpected Items</span>
</button>
<span class="pull-right">
<button ng-if="!folder.paused" type="button" class="btn btn-sm btn-default" ng-click="setFolderPause(folder.id, true)">

View File

@ -2635,15 +2635,18 @@ angular.module('syncthing.core')
};
switch (type) {
case "override":
params.heading = $translate.instant("Override");
params.heading = $translate.instant("Override Changes");
params.icon = "fas fa-arrow-circle-up"
params.operation = "override";
break;
case "revert":
params.heading = $translate.instant("Revert");
params.heading = $translate.instant("Revert Local Changes");
params.icon = "fas fa-arrow-circle-down"
params.operation = "revert";
break;
case "deleteEnc":
params.heading = $translate.instant("Delete Unexpected Items");
params.icon = "fas fa-minus-circle"
params.operation = "revert";
break;
}

View File

@ -1,33 +1,47 @@
<modal id="revert-override-confirmation" status="danger" icon="fas fa-question-circle" heading="{{revertOverrideParams.heading}}" large="no" closeable="yes">
<div class="modal-body" ng-switch="revertOverrideParams.type">
<div ng-switch-when="deleteEnc">
<p>
<span translate>Unexpected items have been found in this folder.</span></br>
<span translate translate-value-receive-encrypted="{{'Receive Encrypted' | translate}}">You should never add or change anything locally in a "{%receiveEncrypted%}" folder.</span>
</p>
<p translate>
Are you sure you want to permanently delete all these files?
</p>
</div>
<div ng-switch-default>
<p>
<span translate>Warning</span>:</br>
<span ng-switch="revertOverrideParams.type">
<span ng-switch-when="override" translate>The folder content on other devices will be overwritten to become identical with this device. Files not present here will be deleted on other devices.</span>
<span ng-switch-default translate>The folder content on this device will be overwritten to become identical with other devices. Files newly added here will be deleted.</span>
</span>
</p>
<p translate>
Are you sure you want to continue?
</p>
<modal id="revert-override-confirmation" status="danger" icon="{{revertOverrideParams.icon}}" heading="{{revertOverrideParams.heading}}" large="no" closeable="yes">
<div class="modal-body">
<p>
<span translate>Warning</span>!
</p>
<div ng-switch="revertOverrideParams.type">
<div ng-switch-when="deleteEnc">
<p>
<span translate>Unexpected items have been found in this folder.</span>
<span translate translate-value-receive-encrypted="{{'Receive Encrypted' | translate}}">You should never add or change anything locally in a "{%receiveEncrypted%}" folder.</span>
</p>
<p translate>
Are you sure you want to permanently delete all these files?
</p>
</div>
<div ng-switch-when="override">
<p translate>
The folder content on other devices will be overwritten to become identical with this device. Files not present here will be deleted on other devices.
</p>
<p translate>
Are you sure you want to override all remote changes?
</p>
</div>
<div ng-switch-default>
<p translate>
The folder content on this device will be overwritten to become identical with other devices. Files newly added here will be deleted.
</p>
<p translate>
Are you sure you want to revert all local changes?
</p>
</div>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-danger pull-left btn-sm" data-dismiss="modal" ng-click="revertOverride()">
<span class="fas fa-check"></span>&nbsp;<span translate>Yes</span>
<span class="fas fa-check"></span>&nbsp;
<span ng-switch="revertOverrideParams.type">
<span ng-switch-when="deleteEnc" translate>Delete</span>
<span ng-switch-when="override" translate>Override</span>
<span ng-switch-default translate>Revert</span>
</span>
</button>
<button type="button" class="btn btn-default btn-sm" data-dismiss="modal">
<span class="fas fa-times"></span>&nbsp;<span translate>No</span>
<span class="fas fa-times"></span>&nbsp;<span translate>Cancel</span>
</button>
</div>
</modal>