mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-02-10 07:26:01 -06:00
Icon and toolbar cleanup/consistency.
This commit is contained in:
parent
58fcbd943a
commit
4d7d3bd5e1
@ -7,7 +7,7 @@ function(_, pgAdmin) {
|
|||||||
pgAdmin.Browser.Frame = function(options) {
|
pgAdmin.Browser.Frame = function(options) {
|
||||||
var defaults = [
|
var defaults = [
|
||||||
'name', 'title', 'width', 'height', 'showTitle', 'isCloseable',
|
'name', 'title', 'width', 'height', 'showTitle', 'isCloseable',
|
||||||
'isPrivate', 'url'];
|
'isPrivate', 'url', 'icon'];
|
||||||
_.extend(this, _.pick(options, defaults));
|
_.extend(this, _.pick(options, defaults));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -20,6 +20,7 @@ function(_, pgAdmin) {
|
|||||||
isClosable: true,
|
isClosable: true,
|
||||||
isPrivate: false,
|
isPrivate: false,
|
||||||
url: '',
|
url: '',
|
||||||
|
icon: '',
|
||||||
panel: null,
|
panel: null,
|
||||||
frame: null,
|
frame: null,
|
||||||
load: function(docker) {
|
load: function(docker) {
|
||||||
@ -31,8 +32,12 @@ function(_, pgAdmin) {
|
|||||||
onCreate: function(myPanel) {
|
onCreate: function(myPanel) {
|
||||||
$(myPanel).data('pgAdminName', that.name);
|
$(myPanel).data('pgAdminName', that.name);
|
||||||
myPanel.initSize(that.width, that.height);
|
myPanel.initSize(that.width, that.height);
|
||||||
|
|
||||||
if (myPanel.showTitle == false)
|
if (myPanel.showTitle == false)
|
||||||
myPanel.title(false);
|
myPanel.title(false);
|
||||||
|
|
||||||
|
myPanel.icon(that.icon)
|
||||||
|
|
||||||
myPanel.closeable(!!that.isCloseable);
|
myPanel.closeable(!!that.isCloseable);
|
||||||
|
|
||||||
var $frameArea = $('<div style="width:100%;height:100%;position:relative;display:table">');
|
var $frameArea = $('<div style="width:100%;height:100%;position:relative;display:table">');
|
||||||
|
@ -7,7 +7,7 @@ function(_, pgAdmin) {
|
|||||||
pgAdmin.Browser.Panel = function(options) {
|
pgAdmin.Browser.Panel = function(options) {
|
||||||
var defaults = [
|
var defaults = [
|
||||||
'name', 'title', 'width', 'height', 'showTitle', 'isCloseable',
|
'name', 'title', 'width', 'height', 'showTitle', 'isCloseable',
|
||||||
'isPrivate', 'content', 'events'];
|
'isPrivate', 'content', 'icon', 'events'];
|
||||||
_.extend(this, _.pick(options, defaults));
|
_.extend(this, _.pick(options, defaults));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -20,6 +20,7 @@ function(_, pgAdmin) {
|
|||||||
isCloseable: true,
|
isCloseable: true,
|
||||||
isPrivate: false,
|
isPrivate: false,
|
||||||
content: '',
|
content: '',
|
||||||
|
icon: '',
|
||||||
panel: null,
|
panel: null,
|
||||||
load: function(docker, title) {
|
load: function(docker, title) {
|
||||||
var that = this;
|
var that = this;
|
||||||
@ -30,10 +31,15 @@ function(_, pgAdmin) {
|
|||||||
onCreate: function(myPanel) {
|
onCreate: function(myPanel) {
|
||||||
$(myPanel).data('pgAdminName', that.name);
|
$(myPanel).data('pgAdminName', that.name);
|
||||||
myPanel.initSize(that.width, that.height);
|
myPanel.initSize(that.width, that.height);
|
||||||
|
|
||||||
if (!that.showTitle)
|
if (!that.showTitle)
|
||||||
myPanel.title(false);
|
myPanel.title(false);
|
||||||
else
|
else {
|
||||||
myPanel.title(title || that.title);
|
myPanel.title(title || that.title);
|
||||||
|
if (that.icon != '')
|
||||||
|
myPanel.icon(that.icon)
|
||||||
|
}
|
||||||
|
|
||||||
myPanel.closeable(!!that.isCloseable);
|
myPanel.closeable(!!that.isCloseable);
|
||||||
myPanel.layout().addItem(
|
myPanel.layout().addItem(
|
||||||
$('<div>', {
|
$('<div>', {
|
||||||
|
@ -64,6 +64,7 @@ function(require, $, _, S, Bootstrap, pgAdmin, alertify, CodeMirror) {
|
|||||||
'properties': new pgAdmin.Browser.Panel({
|
'properties': new pgAdmin.Browser.Panel({
|
||||||
name: 'properties',
|
name: 'properties',
|
||||||
title: '{{ _('Properties') }}',
|
title: '{{ _('Properties') }}',
|
||||||
|
icon: 'fa fa-cogs',
|
||||||
width: 500,
|
width: 500,
|
||||||
isCloseable: false,
|
isCloseable: false,
|
||||||
isPrivate: true,
|
isPrivate: true,
|
||||||
@ -74,6 +75,7 @@ function(require, $, _, S, Bootstrap, pgAdmin, alertify, CodeMirror) {
|
|||||||
'statistics': new pgAdmin.Browser.Panel({
|
'statistics': new pgAdmin.Browser.Panel({
|
||||||
name: 'statistics',
|
name: 'statistics',
|
||||||
title: '{{ _('Statistics') }}',
|
title: '{{ _('Statistics') }}',
|
||||||
|
icon: 'fa fa-line-chart',
|
||||||
width: 500,
|
width: 500,
|
||||||
isCloseable: false,
|
isCloseable: false,
|
||||||
isPrivate: true,
|
isPrivate: true,
|
||||||
@ -84,6 +86,7 @@ function(require, $, _, S, Bootstrap, pgAdmin, alertify, CodeMirror) {
|
|||||||
'sql': new pgAdmin.Browser.Panel({
|
'sql': new pgAdmin.Browser.Panel({
|
||||||
name: 'sql',
|
name: 'sql',
|
||||||
title: '{{ _('SQL') }}',
|
title: '{{ _('SQL') }}',
|
||||||
|
icon: 'fa fa-file-text-o',
|
||||||
width: 500,
|
width: 500,
|
||||||
isCloseable: false,
|
isCloseable: false,
|
||||||
isPrivate: true,
|
isPrivate: true,
|
||||||
@ -93,6 +96,7 @@ function(require, $, _, S, Bootstrap, pgAdmin, alertify, CodeMirror) {
|
|||||||
'dependencies': new pgAdmin.Browser.Panel({
|
'dependencies': new pgAdmin.Browser.Panel({
|
||||||
name: 'dependencies',
|
name: 'dependencies',
|
||||||
title: '{{ _('Dependencies') }}',
|
title: '{{ _('Dependencies') }}',
|
||||||
|
icon: 'fa fa-hand-o-up',
|
||||||
width: 500,
|
width: 500,
|
||||||
isCloseable: false,
|
isCloseable: false,
|
||||||
isPrivate: true,
|
isPrivate: true,
|
||||||
@ -103,6 +107,7 @@ function(require, $, _, S, Bootstrap, pgAdmin, alertify, CodeMirror) {
|
|||||||
'dependents': new pgAdmin.Browser.Panel({
|
'dependents': new pgAdmin.Browser.Panel({
|
||||||
name: 'dependents',
|
name: 'dependents',
|
||||||
title: '{{ _('Dependents') }}',
|
title: '{{ _('Dependents') }}',
|
||||||
|
icon: 'fa fa-hand-o-down',
|
||||||
width: 500,
|
width: 500,
|
||||||
isCloseable: false,
|
isCloseable: false,
|
||||||
isPrivate: true,
|
isPrivate: true,
|
||||||
@ -111,6 +116,7 @@ function(require, $, _, S, Bootstrap, pgAdmin, alertify, CodeMirror) {
|
|||||||
})/* 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 }}',
|
||||||
title: '{{ panel_item.title }}',
|
title: '{{ panel_item.title }}',
|
||||||
|
icon: '{{ panel_item.icon }}',
|
||||||
width: {{ panel_item.width }},
|
width: {{ panel_item.width }},
|
||||||
height: {{ panel_item.height }},
|
height: {{ panel_item.height }},
|
||||||
showTitle: {% if panel_item.showTitle %}true{% else %}false{% endif %},
|
showTitle: {% if panel_item.showTitle %}true{% else %}false{% endif %},
|
||||||
@ -126,6 +132,7 @@ function(require, $, _, S, Bootstrap, pgAdmin, alertify, CodeMirror) {
|
|||||||
'dashboard': new pgAdmin.Browser.Frame({
|
'dashboard': new pgAdmin.Browser.Frame({
|
||||||
name: 'dashboard',
|
name: 'dashboard',
|
||||||
title: '{{ _('Dashboard') }}',
|
title: '{{ _('Dashboard') }}',
|
||||||
|
icon: 'fa fa-tachometer',
|
||||||
width: 500,
|
width: 500,
|
||||||
isCloseable: false,
|
isCloseable: false,
|
||||||
isPrivate: true,
|
isPrivate: true,
|
||||||
@ -134,6 +141,7 @@ function(require, $, _, S, Bootstrap, pgAdmin, alertify, CodeMirror) {
|
|||||||
'{{ panel_item.name }}' : new pgAdmin.Browser.Frame({
|
'{{ panel_item.name }}' : new pgAdmin.Browser.Frame({
|
||||||
name: '{{ panel_item.name }}',
|
name: '{{ panel_item.name }}',
|
||||||
title: '{{ panel_item.title }}',
|
title: '{{ panel_item.title }}',
|
||||||
|
icon: '{{ panel_item.icon }}',
|
||||||
width: {{ panel_item.width }},
|
width: {{ panel_item.width }},
|
||||||
height: {{ panel_item.height }},
|
height: {{ panel_item.height }},
|
||||||
showTitle: {% if panel_item.showTitle %}true{% else %}false{% endif %},
|
showTitle: {% if panel_item.showTitle %}true{% else %}false{% endif %},
|
||||||
|
@ -670,12 +670,6 @@ function($, _, S, pgAdmin, Menu, Backbone, Alertify, pgBrowser, Backform) {
|
|||||||
// Create a view to show the properties in fieldsets
|
// Create a view to show the properties in fieldsets
|
||||||
view = that.getView(item, 'properties', content, data, 'fieldset');
|
view = that.getView(item, 'properties', content, data, 'fieldset');
|
||||||
if (view) {
|
if (view) {
|
||||||
panel.icon(
|
|
||||||
_.isFunction(that['node_image']) ?
|
|
||||||
(that['node_image']).apply(that, [data, view.model]) :
|
|
||||||
(that['node_image'] || ('icon-' + that.type))
|
|
||||||
);
|
|
||||||
|
|
||||||
// Save it for release it later
|
// Save it for release it later
|
||||||
j.data('obj-view', view);
|
j.data('obj-view', view);
|
||||||
|
|
||||||
@ -701,7 +695,7 @@ function($, _, S, pgAdmin, Menu, Backbone, Alertify, pgBrowser, Backform) {
|
|||||||
label: '', type: 'help',
|
label: '', type: 'help',
|
||||||
tooltip: '{{ _("Help on the SQL for this object type") }}',
|
tooltip: '{{ _("Help on the SQL for this object type") }}',
|
||||||
extraClasses: ['btn-default'],
|
extraClasses: ['btn-default'],
|
||||||
icon: 'fa fa-lg fa-question-circle',
|
icon: 'fa fa-lg fa-info',
|
||||||
disabled: (that.sqlAlterHelp == '' && that.sqlCreateHelp == '') ? true : false,
|
disabled: (that.sqlAlterHelp == '' && that.sqlCreateHelp == '') ? true : false,
|
||||||
register: function(btn) {
|
register: function(btn) {
|
||||||
btn.click(function() {
|
btn.click(function() {
|
||||||
@ -755,11 +749,7 @@ function($, _, S, pgAdmin, Menu, Backbone, Alertify, pgBrowser, Backform) {
|
|||||||
// Update the panel
|
// Update the panel
|
||||||
iframe = $(pnlSqlHelp).data('embeddedFrame');
|
iframe = $(pnlSqlHelp).data('embeddedFrame');
|
||||||
pnlSqlHelp.title('SQL: ' + that.label);
|
pnlSqlHelp.title('SQL: ' + that.label);
|
||||||
pnlSqlHelp.icon(
|
|
||||||
_.isFunction(that['node_image']) ?
|
|
||||||
(that['node_image']).apply(that, [data, view.model]) :
|
|
||||||
(that['node_image'] || ('icon-' + that.type))
|
|
||||||
);
|
|
||||||
pnlSqlHelp.focus();
|
pnlSqlHelp.focus();
|
||||||
iframe.openURL(url);
|
iframe.openURL(url);
|
||||||
}.bind(panel),
|
}.bind(panel),
|
||||||
@ -828,9 +818,9 @@ function($, _, S, pgAdmin, Menu, Backbone, Alertify, pgBrowser, Backform) {
|
|||||||
// Create proper buttons
|
// Create proper buttons
|
||||||
createButtons([{
|
createButtons([{
|
||||||
label: '', type: 'help',
|
label: '', type: 'help',
|
||||||
tooltip: '{{ _("Help on the SQL for this object type") }}',
|
tooltip: '{{ _("SQL info for this object type") }}',
|
||||||
extraClasses: ['btn-default'],
|
extraClasses: ['btn-default'],
|
||||||
icon: 'fa fa-lg fa-question-circle',
|
icon: 'fa fa-lg fa-info',
|
||||||
disabled: that.sqlCreateHelp == '' ? true : false,
|
disabled: that.sqlCreateHelp == '' ? true : false,
|
||||||
register: function(btn) {
|
register: function(btn) {
|
||||||
btn.click(function() {
|
btn.click(function() {
|
||||||
|
@ -28,18 +28,21 @@ class HelpModule(PgAdminModule):
|
|||||||
label=gettext('Online Help'),
|
label=gettext('Online Help'),
|
||||||
priority=100,
|
priority=100,
|
||||||
target='_blank',
|
target='_blank',
|
||||||
|
icon='fa fa-question',
|
||||||
url=url_for('help.static', filename='index.html')),
|
url=url_for('help.static', filename='index.html')),
|
||||||
|
|
||||||
MenuItem(name='mnu_pgadmin_website',
|
MenuItem(name='mnu_pgadmin_website',
|
||||||
label= gettext('pgAdmin Website'),
|
label= gettext('pgAdmin Website'),
|
||||||
priority= 200,
|
priority= 200,
|
||||||
target= '_blank',
|
target= '_blank',
|
||||||
|
icon='fa fa-external-link',
|
||||||
url= 'http://www.pgadmin.org/' ),
|
url= 'http://www.pgadmin.org/' ),
|
||||||
|
|
||||||
MenuItem(name= 'mnu_postgresql_website',
|
MenuItem(name= 'mnu_postgresql_website',
|
||||||
label= gettext('PostgreSQL Website'),
|
label= gettext('PostgreSQL Website'),
|
||||||
priority= 300,
|
priority= 300,
|
||||||
target= '_blank',
|
target= '_blank',
|
||||||
|
icon='fa fa-external-link',
|
||||||
url= 'http://www.postgresql.org/' )]}
|
url= 'http://www.postgresql.org/' )]}
|
||||||
|
|
||||||
def get_panels(self):
|
def get_panels(self):
|
||||||
@ -48,21 +51,25 @@ class HelpModule(PgAdminModule):
|
|||||||
name='pnl_online_help',
|
name='pnl_online_help',
|
||||||
priority=100,
|
priority=100,
|
||||||
title=gettext('Online Help'),
|
title=gettext('Online Help'),
|
||||||
|
icon='fa fa-question',
|
||||||
content=url_for('help.static', filename='index.html')),
|
content=url_for('help.static', filename='index.html')),
|
||||||
|
|
||||||
Panel(name='pnl_pgadmin_website',
|
Panel(name='pnl_pgadmin_website',
|
||||||
priority=200,
|
priority=200,
|
||||||
title=gettext('pgAdmin Website'),
|
title=gettext('pgAdmin Website'),
|
||||||
|
icon='fa fa-external-link',
|
||||||
content='http://www.pgadmin.org/'),
|
content='http://www.pgadmin.org/'),
|
||||||
|
|
||||||
Panel(name='pnl_postgresql_website',
|
Panel(name='pnl_postgresql_website',
|
||||||
priority=300,
|
priority=300,
|
||||||
title=gettext('PostgreSQL Website'),
|
title=gettext('PostgreSQL Website'),
|
||||||
|
icon='fa fa-external-link',
|
||||||
content='http://www.postgresql.org/'),
|
content='http://www.postgresql.org/'),
|
||||||
|
|
||||||
Panel(name='pnl_sql_help',
|
Panel(name='pnl_sql_help',
|
||||||
priority=400,
|
priority=400,
|
||||||
isPrivate=True,
|
isPrivate=True,
|
||||||
|
icon='fa fa-info',
|
||||||
title=gettext('SQL Help'))]
|
title=gettext('SQL Help'))]
|
||||||
|
|
||||||
def register_preferences(self):
|
def register_preferences(self):
|
||||||
|
@ -788,6 +788,36 @@ div.inline-tab-panel > ul.tab-content > div.tab-pane > *:last-child {
|
|||||||
padding: 3px 3px;
|
padding: 3px 3px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.pg-prop-btn-group > .btn {
|
||||||
|
min-width: 40px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.pg-prop-btn-group > .btn-group > .btn {
|
||||||
|
min-width: 40px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.pg-prop-btn-group > .btn-group > .btn + .dropdown-toggle {
|
||||||
|
min-width: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.pg-prop-btn-group button.dropdown-toggle {
|
||||||
|
padding-left: 5px !important;
|
||||||
|
padding-right: 5px !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.pg-prop-btn-group .dropdown-menu {
|
||||||
|
min-width: initial;
|
||||||
|
}
|
||||||
|
|
||||||
|
.pg-prop-btn-group .backgrid-filter.form-search {
|
||||||
|
position: relative;
|
||||||
|
width: 248px;
|
||||||
|
height: 30px;
|
||||||
|
float: right;
|
||||||
|
margin-top: 2px;
|
||||||
|
margin-right: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
td.edit-cell.editable.sortable.renderable.editor {
|
td.edit-cell.editable.sortable.renderable.editor {
|
||||||
outline: 0px;
|
outline: 0px;
|
||||||
}
|
}
|
||||||
|
@ -254,6 +254,7 @@
|
|||||||
text-align: center;
|
text-align: center;
|
||||||
padding-left: 20px;
|
padding-left: 20px;
|
||||||
margin-top: -5px;
|
margin-top: -5px;
|
||||||
|
margin-right: 5px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.wcFrameTitleBar {
|
.wcFrameTitleBar {
|
||||||
@ -324,3 +325,7 @@ ul.dropdown-menu > li.menu-item > a > i.wcTabIcon {
|
|||||||
span.fa.fa-arrow-left, .fa-arrow-right {
|
span.fa.fa-arrow-left, .fa-arrow-right {
|
||||||
margin-top: 4px;
|
margin-top: 4px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.wcMenuSubMenu {
|
||||||
|
visibility: hidden;
|
||||||
|
}
|
@ -53,36 +53,6 @@
|
|||||||
font-size: 13px;
|
font-size: 13px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.sql-editor-btn-group {
|
|
||||||
background-color: #D2D2D2;
|
|
||||||
border: 2px solid #A9A9A9;
|
|
||||||
left: 0px;
|
|
||||||
right: 0px;
|
|
||||||
padding: 2px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.sql-editor-btn-group button {
|
|
||||||
padding: 5px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.sql-editor-btn-group button.dropdown-toggle {
|
|
||||||
padding-left: 5px !important;
|
|
||||||
padding-right: 5px !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
.sql-editor-btn-group .dropdown-menu {
|
|
||||||
min-width: initial;
|
|
||||||
}
|
|
||||||
|
|
||||||
.sql-editor-btn-group .backgrid-filter.form-search {
|
|
||||||
position: relative;
|
|
||||||
width: 248px;
|
|
||||||
height: 30px;
|
|
||||||
float: right;
|
|
||||||
margin-top: 2px;
|
|
||||||
margin-right: 10px;
|
|
||||||
}
|
|
||||||
|
|
||||||
#output-panel .wcDocker {
|
#output-panel .wcDocker {
|
||||||
top: 0px;
|
top: 0px;
|
||||||
bottom: 0px;
|
bottom: 0px;
|
||||||
|
@ -166,7 +166,7 @@ define(
|
|||||||
* the backgrid inside this div.
|
* the backgrid inside this div.
|
||||||
*/
|
*/
|
||||||
template: _.template([
|
template: _.template([
|
||||||
'<div id="btn-toolbar" class="sql-editor-btn-group" role="toolbar" aria-label="">',
|
'<div id="btn-toolbar" class="pg-prop-btn-group" role="toolbar" aria-label="">',
|
||||||
'<div class="btn-group" role="group" aria-label="">',
|
'<div class="btn-group" role="group" aria-label="">',
|
||||||
'<button id="btn-save" type="button" class="btn btn-default" title="{{ _('Save') }}" disabled>',
|
'<button id="btn-save" type="button" class="btn btn-default" title="{{ _('Save') }}" disabled>',
|
||||||
'<i class="fa fa-floppy-o" aria-hidden="true"></i>',
|
'<i class="fa fa-floppy-o" aria-hidden="true"></i>',
|
||||||
@ -468,7 +468,7 @@ define(
|
|||||||
self.$el.find('#datagrid-paginator').append(paginator.render().el);
|
self.$el.find('#datagrid-paginator').append(paginator.render().el);
|
||||||
|
|
||||||
// Render the client side filter
|
// Render the client side filter
|
||||||
self.$el.find('.sql-editor-btn-group').append(clientSideFilter.render().el);
|
self.$el.find('.pg-prop-btn-group').append(clientSideFilter.render().el);
|
||||||
|
|
||||||
// Forcefully sorting by the first column.
|
// Forcefully sorting by the first column.
|
||||||
if (columns.length > 1) {
|
if (columns.length > 1) {
|
||||||
|
Loading…
Reference in New Issue
Block a user