Fix the Backup module where it was not working if user changes its preference language other than english. Fixes #2354

This commit is contained in:
Murtuza Zabuawala 2017-05-04 16:06:10 +01:00 committed by Dave Page
parent 95f763463f
commit 155348d712
4 changed files with 30 additions and 20 deletions

View File

@ -123,10 +123,10 @@ TODO LIST FOR BACKUP:
width: "100%"
},
options: [
{label: "Custom", value: "custom"},
{label: "Tar", value: "tar"},
{label: "Plain", value: "plain"},
{label: "Directory", value: "directory"}
{label: '{{ _('Custom') }}', value: "custom"},
{label: '{{ _('Tar') }}', value: "tar"},
{label: '{{ _('Plain') }}', value: "plain"},
{label: '{{ _('Directory') }}', value: "directory"}
]
},{
id: 'ratio', label: '{{ _('Compression ratio') }}',
@ -447,9 +447,11 @@ TODO LIST FOR BACKUP:
url: '{{ url_for('help.static', filename='backup_dialog.html') }}'
}
},{
text: '{{ _('Backup') }}', key: 27, className: 'btn btn-primary fa fa-lg fa-save pg-alertify-button'
text: '{{ _('Backup') }}', key: 27, className: 'btn btn-primary fa fa-lg fa-save pg-alertify-button',
'data-btn-name': 'backup'
},{
text: '{{ _('Cancel') }}', key: 27, className: 'btn btn-danger fa fa-lg fa-times pg-alertify-button'
text: '{{ _('Cancel') }}', key: 27, className: 'btn btn-danger fa fa-lg fa-times pg-alertify-button',
'data-btn-name': 'cancel'
}],
// Set options for dialog
options: {
@ -537,7 +539,7 @@ TODO LIST FOR BACKUP:
return;
}
if (e.button.text === '{{ _('Backup') }}') {
if (e.button['data-btn-name'] === "backup") {
if (!d)
return;
@ -660,9 +662,11 @@ TODO LIST FOR BACKUP:
attrs:{name:'dialog_help', type:'button', label: '{{ _('Backup') }}',
url: '{{ url_for('help.static', filename='backup_dialog.html') }}'}
},{
text: '{{ _('Backup') }}', key: 27, className: 'btn btn-primary fa fa-lg fa-save pg-alertify-button'
text: '{{ _('Backup') }}', key: 27, className: 'btn btn-primary fa fa-lg fa-save pg-alertify-button',
'data-btn-name': 'backup'
},{
text: '{{ _('Cancel') }}', key: 27, className: 'btn btn-danger fa fa-lg fa-times pg-alertify-button'
text: '{{ _('Cancel') }}', key: 27, className: 'btn btn-danger fa fa-lg fa-times pg-alertify-button',
'data-btn-name': 'cancel'
}],
// Set options for dialog
options: {
@ -748,7 +752,7 @@ TODO LIST FOR BACKUP:
return;
}
if (e.button.text === "Backup") {
if (e.button['data-btn-name'] === "backup") {
if (!d)
return;

View File

@ -374,10 +374,12 @@ define(
return {
buttons:[{
text: "{{ _('OK') }}", key: 27, disable: true,
'data-btn-name': 'ok',
className:
"btn btn-primary fa fa-lg fa-save pg-alertify-button"
}, {
text: "{{ _('Cancel') }}", key: 27,
'data-btn-name': 'cancel',
className:
"btn btn-danger fa fa-lg fa-times pg-alertify-button"
}],
@ -393,7 +395,7 @@ define(
// Callback functions when click on the buttons of the Alertify dialogs
callback: function(e) {
if (e.button.text === "{{ _('OK') }}") {
if (e.button['data-btn-name'] === "ok") {
var n = this.settings['pg_node'],
i = this.settings['pg_item'],

View File

@ -269,9 +269,11 @@ define(
attrs:{name:'dialog_help', type:'button', label: '{{ _('Maintenance') }}',
url: '{{ url_for('help.static', filename='maintenance_dialog.html') }}'}
},{
text: "{{ _('OK') }}", key: 27, className: "btn btn-primary fa fa-lg fa-save pg-alertify-button"
text: "{{ _('OK') }}", key: 27, className: "btn btn-primary fa fa-lg fa-save pg-alertify-button",
'data-btn-name': 'ok',
},{
text: "{{ _('Cancel') }}", key: 27, className: "btn btn-danger fa fa-lg fa-times pg-alertify-button"
text: "{{ _('Cancel') }}", key: 27, className: "btn btn-danger fa fa-lg fa-times pg-alertify-button",
'data-btn-name': 'cancel',
}],
options: { modal: 0, pinnable: false}
};
@ -289,7 +291,7 @@ define(
return;
}
if (e.button.text === "{{ _('OK') }}") {
if (e.button['data-btn-name'] === "ok") {
var schema = undefined,
table = undefined,

View File

@ -36,7 +36,7 @@ define([
custom: false,
file: undefined,
role: undefined,
format: 'Custom or tar',
format: 'custom',
verbose: true,
blobs: true,
encoding: undefined,
@ -81,8 +81,8 @@ define([
width: "100%"
},
options: [
{label: "Custom or tar", value: "custom"},
{label: "Directory", value: "directory"}
{label: '{{ _('Custom or tar') }}', value: "custom"},
{label: '{{ _('Directory') }}', value: "directory"}
]
},{
id: 'file', label: '{{ _('Filename') }}',
@ -374,10 +374,12 @@ define([
url: '{{ url_for('help.static', filename='restore_dialog.html') }}'}
},{
text: '{{ _('Restore') }}', key: 27,
className: 'btn btn-primary fa fa-upload pg-alertify-button', restore: true
className: 'btn btn-primary fa fa-upload pg-alertify-button', restore: true,
'data-btn-name': 'restore'
},{
text: '{{ _('Cancel') }}', key: 27,
className: 'btn btn-danger fa fa-lg fa-times pg-alertify-button', restore: false
className: 'btn btn-danger fa fa-lg fa-times pg-alertify-button', restore: false,
'data-btn-name': 'cancel'
}],
// Set options for dialog
options: {
@ -473,7 +475,7 @@ define([
return;
}
if (e.button.restore) {
if (e.button['data-btn-name'] === "restore") {
if (!d)
return;