Improve message display.

This commit is contained in:
Dave Page 2016-03-15 15:45:40 +00:00
parent c814698328
commit 62bd1a21cc
5 changed files with 25 additions and 16 deletions

View File

@ -65,7 +65,7 @@ function(require, $, _, S, Bootstrap, pgAdmin, alertify, CodeMirror) {
width: 500,
isCloseable: false,
isPrivate: true,
content: '<div class="obj_properties">No object selected!</div>',
content: '<div class="obj_properties"><div class="alert alert-info pg-panel-message">{{ _('Please select an object in the tree view.') }}</div></div>',
events: panelEvents
}),
// Statistics of the object
@ -94,7 +94,7 @@ function(require, $, _, S, Bootstrap, pgAdmin, alertify, CodeMirror) {
width: 500,
isCloseable: false,
isPrivate: true,
content: '<div><div class="pg-panel-depends-message">No object selected!</div><div class="pg-panel-depends-container hidden"></div></div>',
content: '<div><div class="alert alert-info pg-panel-message pg-panel-depends-message">{{ _('Please select an object in the tree view.') }}</div><div class="pg-panel-depends-container hidden"></div></div>',
events: panelEvents
}),
// Dependents of the object
@ -104,7 +104,7 @@ function(require, $, _, S, Bootstrap, pgAdmin, alertify, CodeMirror) {
width: 500,
isCloseable: false,
isPrivate: true,
content: '<div><div class="pg-panel-depends-message">No object selected!</div><div class="pg-panel-depends-container hidden"></div></div>',
content: '<div><div class="alert alert-info pg-panel-message pg-panel-depends-message">{{ _('Please select an object in the tree view.') }}</div><div class="pg-panel-depends-container hidden"></div></div>',
events: panelEvents
})/* Add hooked-in panels by extensions */{% for panel_item in current_app.panels %}{% if not panel_item.isIframe %},'{{ panel_item.name }}' : new pgAdmin.Browser.Panel({
name: '{{ panel_item.name }}',

View File

@ -237,7 +237,7 @@ function($, _, S, pgAdmin, Menu, Backbone, Alertify, pgBrowser, Backform) {
showTitle: true,
isCloseable: true,
isPrivate: true,
content: '<div class="obj_properties">No object selected!</div>'
content: '<div class="obj_properties"><div class="alert alert-info pg-panel-message">{{ _('Please select an object in the tree view.') }}</div></div>'
});
p.load(pgBrowser.docker);
},
@ -422,14 +422,14 @@ function($, _, S, pgAdmin, Menu, Backbone, Alertify, pgBrowser, Backform) {
var msg, title;
if (input.url == 'delete') {
msg = S('{{ _('Are you sure you want to drop %%s "%%s" and all the objects that depend on it?"?') }}')
msg = S('{{ _('Are you sure you want to drop %%s "%%s" and all the objects that depend on it?') }}')
.sprintf(obj.label, d.label).value();
title = S('{{ _('Drop CASACDE %%s?') }}').sprintf(obj.label).value();
title = S('{{ _('DROP CASCADE %%s?') }}').sprintf(obj.label).value();
if (!(_.isFunction(obj.canDropCascade) ?
obj.canDropCascade.apply(obj, [d, i]) : obj.canDropCascade)) {
Alertify.notify(
S('The %s - "%s" can not be deleted!')
S('The %s - "%s" can not be dropped!')
.sprintf(obj.label, d.label).value(),
'error',
10
@ -439,12 +439,12 @@ function($, _, S, pgAdmin, Menu, Backbone, Alertify, pgBrowser, Backform) {
} else {
msg = S('{{ _('Are you sure you want to drop %%s "%%s"?') }}')
.sprintf(obj.label, d.label).value();
title = S('{{ _('Drop %%s?') }}').sprintf(obj.label).value();
title = S('{{ _('DROP %%s?') }}').sprintf(obj.label).value();
if (!(_.isFunction(obj.canDrop) ?
obj.canDrop.apply(obj, [d, i]) : obj.canDrop)) {
Alertify.notify(
S('The %s - "%s" can not be deleted!')
S('The %s - "%s" can not be dropped!')
.sprintf(obj.label, d.label).value(),
'error', 10
);
@ -797,7 +797,7 @@ function($, _, S, pgAdmin, Menu, Backbone, Alertify, pgBrowser, Backform) {
});
}
},{
label: '{{ _("Reset") }}', type: 'reset',
label: '{{ _('Reset') }}', type: 'reset',
extraClasses: ['btn-warning'],
icon: 'fa fa-lg fa-recycle',
disabled: true,

View File

@ -245,8 +245,8 @@ define(
self.dependentCollection,
self.dependentsPanels,
node.generate_url(item, 'dependent', data, true),
['-- No object selected!', '-- No dependent information is available for the current selection.',
'-- Please wait while we fetch the dependent information from the server.'],
['No object selected.', 'No dependent information is available for the current object.',
'Fetching dependent information from the server...'],
node
), 400
);
@ -284,8 +284,8 @@ define(
self.dependenciesCollection,
self.dependenciesPanels,
node.generate_url(item, 'dependency', data, true),
['-- No object selected!', '-- No dependency information is available for the current selection.',
'-- Please wait while we fetch the dependency information from the server.'],
['Please select an object in the tree view.', 'No dependency information is available for the current object.',
'Fetching dependency information from the server...'],
node
), 400
);

View File

@ -57,9 +57,9 @@ function(_, $, pgBrowser) {
}
this.timeout = setTimeout(
function() {
var sql = '-- No object selected!';
var sql = '-- Please select an object in the tree view.';
if (node) {
sql = '-- No SQL generated for the selected object.';
sql = '-- No SQL could be generated for the selected object.';
if (node.hasSQL) {
sql = '';

View File

@ -780,4 +780,13 @@ td.edit-cell.editable.sortable.renderable.editor {
.select2-container .select2-selection--single .select2-selection__rendered
{
padding-left: 3px;
}
/* Message panel shown on browser tabs */
.pg-panel-message {
margin-top: 25px !important;
width: 600px;
margin: 0 auto;
position: relative;
text-align: center;
}