s/domain-constraints/domain_constraints for consistency.

This commit is contained in:
Dave Page 2016-05-26 15:27:06 +01:00
parent 0dabbf3dad
commit 7aea8f8536
19 changed files with 35 additions and 35 deletions

View File

@ -45,7 +45,7 @@ class DomainConstraintModule(CollectionNodeModule):
- Load the module script for the Domain Constraint, when any of the
Domain node is initialized.
"""
NODE_TYPE = 'domain-constraints'
NODE_TYPE = 'domain_constraints'
COLLECTION_LABEL = gettext("Domain Constraints")
def __init__(self, *args, **kwargs):
@ -81,7 +81,7 @@ class DomainConstraintModule(CollectionNodeModule):
"""
return [
render_template(
"domain-constraints/css/domain-constraints.css",
"domain_constraints/css/domain_constraints.css",
node_type=self.node_type
)
]
@ -105,7 +105,7 @@ class DomainConstraintView(PGChildNodeView):
-------
* module_js():
- Load JS file (domain-constraints.js) for this module.
- Load JS file (domain_constraints.js) for this module.
* check_precondition(f):
- Works as a decorator.
@ -230,11 +230,11 @@ class DomainConstraintView(PGChildNodeView):
def module_js(self):
"""
Load JS file (domain-constraints.js) for this module.
Load JS file (domain_constraints.js) for this module.
"""
return make_response(
render_template(
"domain-constraints/js/domain-constraints.js",
"domain_constraints/js/domain_constraints.js",
_=gettext
),
200, {'Content-Type': 'application/x-javascript'}
@ -264,9 +264,9 @@ class DomainConstraintView(PGChildNodeView):
# we will set template path for sql scripts
if ver >= 90200:
self.template_path = 'domain-constraints/sql/9.2_plus'
self.template_path = 'domain_constraints/sql/9.2_plus'
elif ver >= 90100:
self.template_path = 'domain-constraints/sql/9.1_plus'
self.template_path = 'domain_constraints/sql/9.1_plus'
return f(*args, **kwargs)
@ -319,11 +319,11 @@ class DomainConstraintView(PGChildNodeView):
for row in rset['rows']:
if 'convalidated' not in row:
icon = 'icon-domain-constraints'
icon = 'icon-domain_constraints'
elif row['convalidated']:
icon = 'icon-domain-constraints'
icon = 'icon-domain_constraints'
else:
icon = 'icon-domain-constraints-bad'
icon = 'icon-domain_constraints-bad'
res.append(
self.blueprint.generate_browser_node(
row['oid'],
@ -400,11 +400,11 @@ class DomainConstraintView(PGChildNodeView):
return internal_server_error(errormsg=coid)
if 'convalidated' not in data:
icon = 'icon-domain-constraints'
icon = 'icon-domain_constraints'
elif 'convalidated' in data and data['convalidated']:
icon = 'icon-domain-constraints'
icon = 'icon-domain_constraints'
else:
icon = 'icon-domain-constraints-bad'
icon = 'icon-domain_constraints-bad'
return jsonify(
node=self.blueprint.generate_browser_node(
@ -487,9 +487,9 @@ class DomainConstraintView(PGChildNodeView):
return internal_server_error(errormsg=res)
if 'convalidated' in data and data['convalidated']:
icon = 'icon-domain-constraints'
icon = 'icon-domain_constraints'
elif 'convalidated' in data and not data['convalidated']:
icon = 'icon-domain-constraints-bad'
icon = 'icon-domain_constraints-bad'
else:
icon = ''

View File

@ -1,21 +1,21 @@
.icon-coll-domain-constraints {
background-image: url('{{ url_for('NODE-%s.static' % node_type, filename='img/coll-domain-constraints.png' )}}') !important;
.icon-coll-domain_constraints {
background-image: url('{{ url_for('NODE-%s.static' % node_type, filename='img/coll-domain_constraints.png' )}}') !important;
background-repeat: no-repeat;
align-content: center;
vertical-align: middle;
height: 1.3em;
}
.icon-check-bad, .icon-domain-constraints-bad {
background-image: url('{{ url_for('NODE-%s.static' % node_type, filename='img/domain-constraints-bad.png' )}}') !important;
.icon-check-bad, .icon-domain_constraints-bad {
background-image: url('{{ url_for('NODE-%s.static' % node_type, filename='img/domain_constraints-bad.png' )}}') !important;
background-repeat: no-repeat;
align-content: center;
vertical-align: middle;
height: 1.3em;
}
.icon-check, .icon-domain-constraints {
background-image: url('{{ url_for('NODE-%s.static' % node_type, filename='img/domain-constraints.png' )}}') !important;
.icon-check, .icon-domain_constraints {
background-image: url('{{ url_for('NODE-%s.static' % node_type, filename='img/domain_constraints.png' )}}') !important;
background-repeat: no-repeat;
align-content: center;
vertical-align: middle;

View File

@ -4,25 +4,25 @@ define(
function($, _, S, pgAdmin, pgBrowser, alertify) {
// Define Domain Constraint Collection Node
if (!pgBrowser.Nodes['coll-domain-constraints']) {
var domain_constraints = pgAdmin.Browser.Nodes['coll-domain-constraints'] =
if (!pgBrowser.Nodes['coll-domain_constraints']) {
var domain_constraints = pgAdmin.Browser.Nodes['coll-domain_constraints'] =
pgAdmin.Browser.Collection.extend({
node: 'domain-constraints',
node: 'domain_constraints',
label: '{{ _('Domain Constraints') }}',
type: 'coll-domain-constraints',
type: 'coll-domain_constraints',
columns: ['name', 'description']
});
};
// Domain Constraint Node
if (!pgBrowser.Nodes['domain-constraints']) {
pgAdmin.Browser.Nodes['domain-constraints'] = pgBrowser.Node.extend({
type: 'domain-constraints',
if (!pgBrowser.Nodes['domain_constraints']) {
pgAdmin.Browser.Nodes['domain_constraints'] = pgBrowser.Node.extend({
type: 'domain_constraints',
sqlAlterHelp: 'sql-alterdomain.html',
sqlCreateHelp: 'sql-alterdomain.html',
dialogHelp: '{{ url_for('help.static', filename='domain_constraint_dialog.html') }}',
label: '{{ _('Domain Constraints') }}',
collection_type: 'coll-domain-constraints',
collection_type: 'coll-domain_constraints',
hasSQL: true,
hasDepends: true,
parent_type: ['domain'],
@ -34,22 +34,22 @@ function($, _, S, pgAdmin, pgBrowser, alertify) {
this.initialized = true;
pgBrowser.add_menus([{
name: 'create_domain_on_coll', node: 'coll-domain-constraints', module: this,
name: 'create_domain_on_coll', node: 'coll-domain_constraints', module: this,
applies: ['object', 'context'], callback: 'show_obj_properties',
category: 'create', priority: 5, label: '{{ _('Domain Constraint...') }}',
icon: 'wcTabIcon icon-domain-constraints', data: {action: 'create', check: true},
icon: 'wcTabIcon icon-domain_constraints', data: {action: 'create', check: true},
enable: 'canCreate'
},{
name: 'create_domain-constraints', node: 'domain-constraints', module: this,
name: 'create_domain_constraints', node: 'domain_constraints', module: this,
applies: ['object', 'context'], callback: 'show_obj_properties',
category: 'create', priority: 5, label: '{{ _('Domain Constraint...') }}',
icon: 'wcTabIcon icon-domain-constraints', data: {action: 'create', check: true},
icon: 'wcTabIcon icon-domain_constraints', data: {action: 'create', check: true},
enable: 'canCreate'
},{
name: 'create_domain-constraints', node: 'domain', module: this,
name: 'create_domain_constraints', node: 'domain', module: this,
applies: ['object', 'context'], callback: 'show_obj_properties',
category: 'create', priority: 5, label: '{{ _('Domain Constraint...') }}',
icon: 'wcTabIcon icon-domain-constraints', data: {action: 'create', check: false},
icon: 'wcTabIcon icon-domain_constraints', data: {action: 'create', check: false},
enable: 'canCreate'
}
]);