Created
January 27, 2014 15:15
-
-
Save florentx/8650174 to your computer and use it in GitHub Desktop.
OpenERP 6.1: different layout for Production and Test environments, based on hostname
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* /web_mycompany/static/src/css/mycompany.css */ | |
/* Header */ | |
.openerp.production .company_logo { | |
background: url('/web_mycompany/static/src/img/logo.png'); | |
/* width:180px; */ | |
/* height:46px; */ | |
} | |
/* ... and similar CSS hacks ... */ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* /web_mycompany/static/src/js/mycompany.js */ | |
openerp.web_mycompany = function(openerp) { | |
var hostname = window.location.hostname, | |
params = jQuery.param != undefined && jQuery.deparam(jQuery.param.querystring()), | |
production = hostname == 'my.hostname.com' || hostname == 'alt.hostname.com' || params.production != undefined; | |
if (!openerp.web_mycompany) { | |
/** @namespace */ | |
openerp.web_mycompany = {}; | |
} | |
if (production) { | |
$(document.body).addClass('production'); | |
openerp.web.Login = openerp.web.Login.extend({ | |
start: function() { | |
this._super.apply(this, arguments); | |
var logoimg = this.$element.find('#logo img'); | |
logoimg.attr('src', '/web_mycompany/static/src/img/logo.png'); | |
} | |
}); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment