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, width: 500,
isCloseable: false, isCloseable: false,
isPrivate: 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>',
events: panelEvents events: panelEvents
}), }),
// Statistics of the object // Statistics of the object
@ -94,7 +94,7 @@ function(require, $, _, S, Bootstrap, pgAdmin, alertify, CodeMirror) {
width: 500, width: 500,
isCloseable: false, isCloseable: false,
isPrivate: true, 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 events: panelEvents
}), }),
// Dependents of the object // Dependents of the object
@ -104,7 +104,7 @@ function(require, $, _, S, Bootstrap, pgAdmin, alertify, CodeMirror) {
width: 500, width: 500,
isCloseable: false, isCloseable: false,
isPrivate: true, 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 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({ })/* 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 }}', name: '{{ panel_item.name }}',

View File

@ -237,7 +237,7 @@ function($, _, S, pgAdmin, Menu, Backbone, Alertify, pgBrowser, Backform) {
showTitle: true, showTitle: true,
isCloseable: true, isCloseable: true,
isPrivate: 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); p.load(pgBrowser.docker);
}, },
@ -422,14 +422,14 @@ function($, _, S, pgAdmin, Menu, Backbone, Alertify, pgBrowser, Backform) {
var msg, title; var msg, title;
if (input.url == 'delete') { 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(); .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) ? if (!(_.isFunction(obj.canDropCascade) ?
obj.canDropCascade.apply(obj, [d, i]) : obj.canDropCascade)) { obj.canDropCascade.apply(obj, [d, i]) : obj.canDropCascade)) {
Alertify.notify( Alertify.notify(
S('The %s - "%s" can not be deleted!') S('The %s - "%s" can not be dropped!')
.sprintf(obj.label, d.label).value(), .sprintf(obj.label, d.label).value(),
'error', 'error',
10 10
@ -439,12 +439,12 @@ function($, _, S, pgAdmin, Menu, Backbone, Alertify, pgBrowser, Backform) {
} else { } else {
msg = S('{{ _('Are you sure you want to drop %%s "%%s"?') }}') msg = S('{{ _('Are you sure you want to drop %%s "%%s"?') }}')
.sprintf(obj.label, d.label).value(); .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) ? if (!(_.isFunction(obj.canDrop) ?
obj.canDrop.apply(obj, [d, i]) : obj.canDrop)) { obj.canDrop.apply(obj, [d, i]) : obj.canDrop)) {
Alertify.notify( Alertify.notify(
S('The %s - "%s" can not be deleted!') S('The %s - "%s" can not be dropped!')
.sprintf(obj.label, d.label).value(), .sprintf(obj.label, d.label).value(),
'error', 10 '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'], extraClasses: ['btn-warning'],
icon: 'fa fa-lg fa-recycle', icon: 'fa fa-lg fa-recycle',
disabled: true, disabled: true,

View File

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

View File

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

View File

@ -781,3 +781,12 @@ td.edit-cell.editable.sortable.renderable.editor {
{ {
padding-left: 3px; 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;
}