summaryrefslogtreecommitdiff
path: root/addons/web/static/src
diff options
context:
space:
mode:
authorAntony Lesuisse <al@openerp.com>2012-05-25 14:26:31 +0200
committerAntony Lesuisse <al@openerp.com>2012-05-25 14:26:31 +0200
commit72b98f2b70743b975ded34a498cd49449b7b9690 (patch)
tree6139ab9e245ce2d326f9f81377476aed9b13dad7 /addons/web/static/src
parent91090f506f6c79fcb7db64afdabd7221a05ecf63 (diff)
parentb70dd5534f16ce590c2b52f0edc616b7c280d17d (diff)
[MERGE] trunk
bzr revid: al@openerp.com-20120525122631-ef5vt5dg5gx2y296
Diffstat (limited to 'addons/web/static/src')
-rw-r--r--addons/web/static/src/css/base.css15
-rw-r--r--addons/web/static/src/css/base.sass13
-rw-r--r--addons/web/static/src/js/chrome.js42
-rw-r--r--addons/web/static/src/js/corelib.js3
-rw-r--r--addons/web/static/src/js/coresetup.js4
5 files changed, 59 insertions, 18 deletions
diff --git a/addons/web/static/src/css/base.css b/addons/web/static/src/css/base.css
index 51adabe626d..a77ea87bf4e 100644
--- a/addons/web/static/src/css/base.css
+++ b/addons/web/static/src/css/base.css
@@ -1,4 +1,4 @@
-@charset "UTF-8";
+@charset "utf-8";
@font-face {
font-family: "mnmliconsRegular";
src: url("/web/static/src/font/mnmliconsv21-webfont.eot") format("eot");
@@ -605,6 +605,7 @@
background-color: none;
}
.openerp .oe_user_menu .oe_dropdown_options li a {
+ white-space: nowrap;
display: block;
padding: 4px 15px;
clear: both;
@@ -1802,6 +1803,9 @@
right: 5px;
top: 3px;
}
+.openerp .oe_form .oe_form_group_cell .oe_kanban_view {
+ position: static;
+}
.openerp .oe_form .oe_form_button.oe_button {
height: 22px;
color: #4c4c4c;
@@ -2154,6 +2158,15 @@
color: #333333;
}
+.kitten-mode-activated {
+ background-image: url(http://placekitten.com/g/1365/769);
+ background-size: cover;
+ background-attachment: fixed;
+}
+.kitten-mode-activated > * {
+ opacity: 0.7;
+}
+
.openerp .oe_form_field_many2one td:first-child {
position: relative;
}
diff --git a/addons/web/static/src/css/base.sass b/addons/web/static/src/css/base.sass
index 495251d3982..9fedeed6a51 100644
--- a/addons/web/static/src/css/base.sass
+++ b/addons/web/static/src/css/base.sass
@@ -507,6 +507,7 @@ $colour4: #8a89ba
display: block
background-color: none
a
+ white-space: nowrap
display: block
padding: 4px 15px
clear: both
@@ -1115,8 +1116,6 @@ $colour4: #8a89ba
position: absolute
left: 4px
top: -2px
-
- //background: url(/web/static/src/img/icons/gtk-apply.png) no-repeat
// after oe_selected so background color is not overridden
&:hover
background-color: $hover-background
@@ -1443,6 +1442,9 @@ $colour4: #8a89ba
filter: alpha(opacity=50)
right: 5px
top: 3px
+ .oe_form_group_cell .oe_kanban_view
+ // Hack due to absolute positioning of kanban view messing with o2m
+ position: static
// }}}
// FormView.buttons {{{
.oe_form
@@ -1750,6 +1752,13 @@ $colour4: #8a89ba
color: #333
// }}}
+.kitten-mode-activated
+ background-image: url(http://placekitten.com/g/1365/769)
+ background-size: cover
+ background-attachment: fixed
+ >*
+ opacity: 0.70
+
// Transitional overrides for old styles {{{
.openerp
.oe_form_field_many2one
diff --git a/addons/web/static/src/js/chrome.js b/addons/web/static/src/js/chrome.js
index eb2dcad8624..a36421f2b2b 100644
--- a/addons/web/static/src/js/chrome.js
+++ b/addons/web/static/src/js/chrome.js
@@ -450,6 +450,8 @@ instance.web.DatabaseManager = instance.web.Widget.extend({
instance.web.Login = instance.web.Widget.extend({
template: "Login",
remember_credentials: true,
+ _db_list: null,
+
init: function(parent) {
this._super(parent);
this.has_local_storage = typeof(localStorage) != 'undefined';
@@ -478,23 +480,33 @@ instance.web.Login = instance.web.Widget.extend({
self.databasemanager.destroy();
self.$element.find('.oe_login_bottom').show();
self.$element.find('.oe_login_pane').show();
- self.load_db_list();
+ self.load_db_list(true).then(self.proxy('_db_list_loaded'));
});
});
- self.load_db_list();
- },
- load_db_list: function () {
- var self = this;
- self.rpc("/web/database/get_list", {}, function(result) {
- self.set_db_list(result.db_list);
- }, function(error, event) {
- if (error.data.fault_code === 'AccessDenied') {
- event.preventDefault();
- }
- });
+ return self.load_db_list().then(self.proxy('_db_list_loaded'));
+ },
+ load_db_list: function (force) {
+ var d = $.when(), self = this;
+ if (_.isNull(this._db_list) || force) {
+ d = self.rpc("/web/database/get_list", {}, function(result) {
+ self._db_list = _.clone(result.db_list);
+ }, function(error, event) {
+ if (error.data.fault_code === 'AccessDenied') {
+ event.preventDefault();
+ }
+ });
+ }
+ return d;
},
- set_db_list: function (list) {
+ _db_list_loaded: function () {
+ var list = this._db_list,
+ dbdiv = this.$element.find('div.oe_login_dbpane');
this.$element.find("[name=db]").replaceWith(instance.web.qweb.render('Login.dblist', { db_list: list, selected_db: this.selected_db}));
+ if(list && list.length === 1) {
+ dbdiv.hide();
+ } else {
+ dbdiv.show();
+ }
},
on_submit: function(ev) {
if(ev) {
@@ -521,7 +533,7 @@ instance.web.Login = instance.web.Widget.extend({
do_login: function (db, login, password) {
var self = this;
this.$element.removeClass('oe_login_invalid');
- this.session.session_authenticate(db, login, password).then(function() {
+ return this.session.session_authenticate(db, login, password).pipe(function() {
if (self.has_local_storage) {
if(self.remember_credentials) {
localStorage.setItem('last_db_login_success', db);
@@ -846,7 +858,7 @@ instance.web.WebClient = instance.web.Widget.extend({
var self = this;
this.$element.addClass("openerp openerp-web-client-container");
if (jQuery.param !== undefined && jQuery.deparam(jQuery.param.querystring()).kitten !== undefined) {
- self.$element.addClass("kitten-mode-activated");
+ $("body").addClass("kitten-mode-activated");
self.$element.delegate('img.oe-record-edit-link-img', 'hover', function(e) {
self.$element.toggleClass('clark-gable');
});
diff --git a/addons/web/static/src/js/corelib.js b/addons/web/static/src/js/corelib.js
index a7ef3eb9b23..94c748f839c 100644
--- a/addons/web/static/src/js/corelib.js
+++ b/addons/web/static/src/js/corelib.js
@@ -331,6 +331,9 @@ instance.web.EventDispatcherMixin = _.extend({}, instance.web.ParentedMixin, {
},
on: function(events, dest, func) {
var self = this;
+ if (!(func instanceof Function)) {
+ throw new Error("Event handler must be a function.");
+ }
events = events.split(/\s+/);
_.each(events, function(eventName) {
self.__edispatcherEvents.on(eventName, func, dest);
diff --git a/addons/web/static/src/js/coresetup.js b/addons/web/static/src/js/coresetup.js
index 37e80e44d35..4defde54a3c 100644
--- a/addons/web/static/src/js/coresetup.js
+++ b/addons/web/static/src/js/coresetup.js
@@ -121,6 +121,10 @@ instance.web.Session = instance.web.JsonRPC.extend( /** @lends instance.web.Sess
var base_location = document.location.protocol + '//' + document.location.host;
var params = { db: db, login: login, password: password, base_location: base_location };
return this.rpc("/web/session/authenticate", params).pipe(function(result) {
+ if (!result.uid) {
+ return $.Deferred().reject();
+ }
+
_.extend(self, {
session_id: result.session_id,
db: result.db,