summaryrefslogtreecommitdiff
path: root/addons/web/static
diff options
context:
space:
mode:
authorFabien Meghazi <fme@openerp.com>2012-12-17 12:38:42 +0100
committerFabien Meghazi <fme@openerp.com>2012-12-17 12:38:42 +0100
commitc1e9e6f12e343244f86fbf56bf4e5eb983b334d5 (patch)
tree25b700d47006479c71f36c6231a64619d6715574 /addons/web/static
parenta724c43257252e19a9bb37fca9a01aae0c8bf8f5 (diff)
parentc8b5413f371fde077c872a9b782b7b60394f5e0d (diff)
[MERGE] trunk
bzr revid: fme@openerp.com-20121217113842-j3a013i7xrsb5a69
Diffstat (limited to 'addons/web/static')
-rw-r--r--addons/web/static/src/css/base.css54
-rw-r--r--addons/web/static/src/css/base.sass35
-rw-r--r--addons/web/static/src/img/nologo.pngbin0 -> 3977 bytes
-rw-r--r--addons/web/static/src/js/chrome.js31
-rw-r--r--addons/web/static/src/js/search.js2
-rw-r--r--addons/web/static/src/js/view_form.js13
-rw-r--r--addons/web/static/src/js/view_list.js4
-rw-r--r--addons/web/static/src/js/view_tree.js5
-rw-r--r--addons/web/static/src/js/views.js25
-rw-r--r--addons/web/static/src/xml/base.xml4
10 files changed, 125 insertions, 48 deletions
diff --git a/addons/web/static/src/css/base.css b/addons/web/static/src/css/base.css
index c71e26adb48..2665ee263a9 100644
--- a/addons/web/static/src/css/base.css
+++ b/addons/web/static/src/css/base.css
@@ -998,6 +998,39 @@
background-image: -o-linear-gradient(top, #646060, #262626);
background-image: linear-gradient(to bottom, #646060, #262626);
}
+.openerp .oe_topbar .oe_topbar_anonymous_login {
+ background-color: #dc5f59;
+ color: #eeeeee;
+ background-color: #fc8787;
+ background-image: -webkit-gradient(linear, left top, left bottom, from(#fc8787), to(maroon));
+ background-image: -webkit-linear-gradient(top, #fc8787, maroon);
+ background-image: -moz-linear-gradient(top, #fc8787, maroon);
+ background-image: -ms-linear-gradient(top, #fc8787, maroon);
+ background-image: -o-linear-gradient(top, #fc8787, maroon);
+ background-image: linear-gradient(to bottom, #fc8787, maroon);
+}
+.openerp .oe_topbar .oe_topbar_anonymous_login a {
+ display: block;
+ padding: 5px 10px 7px;
+ line-height: 20px;
+ height: 20px;
+ text-decoration: none;
+ color: white;
+ background: transparent;
+ -webkit-transition: all 0.2s ease-out;
+ -moz-transition: all 0.2s ease-out;
+ -ms-transition: all 0.2s ease-out;
+ -o-transition: all 0.2s ease-out;
+ transition: all 0.2s ease-out;
+}
+.openerp .oe_topbar .oe_topbar_anonymous_login a:hover {
+ background: rgba(0, 0, 0, 0.1);
+ color: white;
+ text-shadow: 0px 0px 3px rgba(0, 0, 0, 0.2);
+ -moz-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2) inset;
+ -webkit-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2) inset;
+ box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2) inset;
+}
.openerp .oe_topbar .oe_topbar_item {
display: block;
padding: 5px 10px 7px;
@@ -1152,12 +1185,8 @@
width: 220px;
display: block;
text-align: center;
- height: 70px;
- line-height: 70px;
}
.openerp a.oe_logo img {
- height: 40px;
- width: 157px;
margin: 14px 0;
border: 0;
}
@@ -1170,14 +1199,11 @@
text-align: center;
}
.openerp .oe_footer a {
- font-weight: 800;
- font-family: serif;
- font-size: 16px;
+ font-weight: bold;
color: black;
}
.openerp .oe_footer a span {
color: #c81010;
- font-style: italic;
}
.openerp .oe_secondary_menu_section {
font-weight: bold;
@@ -1210,7 +1236,7 @@
color: white;
padding: 2px 4px;
margin: 1px 6px 0 0;
- border: 1px solid lightgrey;
+ border: 1px solid lightGray;
text-shadow: 0 1px 1px rgba(0, 0, 0, 0.2);
-moz-border-radius: 4px;
-webkit-border-radius: 4px;
@@ -1235,7 +1261,7 @@
transform: scale(1.1);
}
.openerp .oe_secondary_submenu .oe_active {
- border-top: 1px solid lightgrey;
+ border-top: 1px solid lightGray;
border-bottom: 1px solid #dedede;
text-shadow: 0 1px 1px rgba(0, 0, 0, 0.2);
-moz-box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.2), inset 0 -1px 3px rgba(40, 40, 40, 0.2);
@@ -2039,6 +2065,12 @@
margin: -16px -16px 0 -16px;
padding: 0;
}
+.openerp .oe_form_nosheet.oe_form_nomargin {
+ margin: 0;
+}
+.openerp .oe_form_nosheet.oe_form_nomargin > header {
+ margin: 0;
+}
.openerp .oe_form_sheetbg {
padding: 16px 0;
}
@@ -2178,7 +2210,7 @@
}
.openerp .oe_form .oe_form_label_help[for] span, .openerp .oe_form .oe_form_label[for] span {
font-size: 80%;
- color: darkgreen;
+ color: darkGreen;
vertical-align: top;
position: relative;
top: -4px;
diff --git a/addons/web/static/src/css/base.sass b/addons/web/static/src/css/base.sass
index 8efc85c2a04..a8445f0ff06 100644
--- a/addons/web/static/src/css/base.sass
+++ b/addons/web/static/src/css/base.sass
@@ -827,6 +827,24 @@ $sheet-padding: 16px
height: 32px
background-color: #414141
@include vertical-gradient(#646060, #262626)
+ .oe_topbar_anonymous_login
+ background-color: #dc5f59
+ color: #eeeeee
+ @include vertical-gradient(#FC8787, #800000)
+ a
+ display: block
+ padding: 5px 10px 7px
+ line-height: 20px
+ height: 20px
+ text-decoration: none
+ color: white
+ background: transparent
+ @include transition(all 0.2s ease-out)
+ a:hover
+ background: rgba(0,0,0,0.1)
+ color: white
+ text-shadow: 0px 0px 3px rgba(0,0,0,0.2)
+ @include box-shadow(0 1px 2px rgba(0,0,0,0.2) inset)
.oe_topbar_item
display: block
padding: 5px 10px 7px
@@ -943,11 +961,7 @@ $sheet-padding: 16px
width: 220px
display: block
text-align: center
- height: 70px
- line-height: 70px
img
- height: 40px
- width: 157px
margin: 14px 0
border: 0
.oe_footer
@@ -958,13 +972,10 @@ $sheet-padding: 16px
width: 220px
text-align: center
a
- font-weight: 800
- font-family: serif
- font-size: 16px
+ font-weight: bold
color: black
span
color: #c81010
- font-style: italic
// }}}
// Webclient.leftbar items {{{
@@ -1624,6 +1635,10 @@ $sheet-padding: 16px
> header
margin: -16px -16px 0 -16px
padding: 0
+ .oe_form_nosheet.oe_form_nomargin
+ margin: 0
+ > header
+ margin: 0
.oe_form_sheetbg
padding: 16px 0
.oe_form_sheet_width
@@ -1673,7 +1688,7 @@ $sheet-padding: 16px
width: 400px
padding-bottom: 0
div.oe_chatter
- box-sizing: border-box
+ box-sizing: border-box
min-width: $sheet-min-width + 2* $sheet-padding
max-width: $sheet-max-width + 2* $sheet-padding
margin: 0 auto
@@ -1945,7 +1960,7 @@ $sheet-padding: 16px
overflow: hidden
width: 24px
overflow: hidden
- background: transparent
+ background: transparent
color: #7C7BAD
box-shadow: none
border: none
diff --git a/addons/web/static/src/img/nologo.png b/addons/web/static/src/img/nologo.png
new file mode 100644
index 00000000000..711269813a1
--- /dev/null
+++ b/addons/web/static/src/img/nologo.png
Binary files differ
diff --git a/addons/web/static/src/js/chrome.js b/addons/web/static/src/js/chrome.js
index a6f75a5de6c..e3d5c9452f4 100644
--- a/addons/web/static/src/js/chrome.js
+++ b/addons/web/static/src/js/chrome.js
@@ -1139,6 +1139,8 @@ instance.web.WebClient = instance.web.Client.extend({
init: function(parent) {
this._super(parent);
this._current_state = null;
+ this.menu_dm = new instance.web.DropMisordered();
+ this.action_mutex = new $.Mutex();
},
start: function() {
var self = this;
@@ -1190,6 +1192,7 @@ instance.web.WebClient = instance.web.Client.extend({
show_application: function() {
var self = this;
self.toggle_bars(true);
+ self.update_logo();
self.menu = new instance.web.Menu(self);
self.menu.replace(this.$el.find('.oe_menu_placeholder'));
self.menu.on('menu_click', this, this.on_menu_action);
@@ -1201,6 +1204,10 @@ instance.web.WebClient = instance.web.Client.extend({
self.set_title();
self.check_timezone();
},
+ update_logo: function() {
+ var img = this.session.url('/web/binary/company_logo');
+ this.$el.find('.oe_logo img').attr('src', '').attr('src', img);
+ },
check_timezone: function() {
var self = this;
return new instance.web.Model('res.users').call('read', [[this.session.uid], ['tz_offset']]).then(function(result) {
@@ -1304,18 +1311,20 @@ instance.web.WebClient = instance.web.Client.extend({
},
on_menu_action: function(options) {
var self = this;
- return this.rpc("/web/action/load", { action_id: options.action_id })
+ return this.menu_dm.add(this.rpc("/web/action/load", { action_id: options.action_id }))
.then(function (result) {
- if (options.needaction) {
- result.context = new instance.web.CompoundContext(
- result.context,
- {search_default_message_unread: true});
- }
- return $.when(self.action_manager.do_action(result, {
- clear_breadcrumbs: true,
- action_menu_id: self.menu.current_menu,
- })).fail(function() {
- self.menu.open_menu(options.previous_menu_id);
+ return self.action_mutex.exec(function() {
+ if (options.needaction) {
+ result.context = new instance.web.CompoundContext(
+ result.context,
+ {search_default_message_unread: true});
+ }
+ return $.when(self.action_manager.do_action(result, {
+ clear_breadcrumbs: true,
+ action_menu_id: self.menu.current_menu,
+ })).fail(function() {
+ self.menu.open_menu(options.previous_menu_id);
+ });
});
});
},
diff --git a/addons/web/static/src/js/search.js b/addons/web/static/src/js/search.js
index eea8bba726d..34ab101fea7 100644
--- a/addons/web/static/src/js/search.js
+++ b/addons/web/static/src/js/search.js
@@ -640,7 +640,7 @@ instance.web.SearchView = instance.web.Widget.extend(/** @lends instance.web.Sea
.then(this.proxy('setup_default_query'));
return $.when(drawer_started, defaults_fetched)
- .done(function () {
+ .then(function () {
self.trigger("search_view_loaded", data);
self.ready.resolve();
});
diff --git a/addons/web/static/src/js/view_form.js b/addons/web/static/src/js/view_form.js
index 3f6952e5da4..cfc8be391b4 100644
--- a/addons/web/static/src/js/view_form.js
+++ b/addons/web/static/src/js/view_form.js
@@ -128,13 +128,15 @@ instance.web.FormView = instance.web.View.extend(instance.web.form.FieldManagerM
self.init_pager();
});
self.on("load_record", self, self.load_record);
- this.on('view_loaded', self, self.load_form);
instance.web.bus.on('clear_uncommitted_changes', this, function(e) {
if (!this.can_be_discarded()) {
e.preventDefault();
}
});
},
+ view_loading: function(r) {
+ return this.load_form(r);
+ },
destroy: function() {
_.each(this.get_widgets(), function(w) {
w.off('focused blurred');
@@ -2542,6 +2544,7 @@ instance.web.form.FieldText = instance.web.form.AbstractField.extend(instance.we
initialize_content: function() {
var self = this;
this.$textarea = this.$el.find('textarea');
+ this.auto_sized = false;
this.default_height = this.$textarea.css('height');
if (this.get("effective_readonly")) {
this.$textarea.attr('disabled', 'disabled');
@@ -2561,13 +2564,17 @@ instance.web.form.FieldText = instance.web.form.AbstractField.extend(instance.we
}
},
render_value: function() {
- $(window).resize();
var show_value = instance.web.format_value(this.get('value'), this, '');
if (show_value === '') {
this.$textarea.css('height', parseInt(this.default_height)+"px");
}
this.$textarea.val(show_value);
- this.$textarea.autosize();
+ if (! this.auto_sized) {
+ this.auto_sized = true;
+ this.$textarea.autosize();
+ } else {
+ this.$textarea.trigger("autosize");
+ }
},
is_syntax_valid: function() {
if (!this.get("effective_readonly") && this.$textarea) {
diff --git a/addons/web/static/src/js/view_list.js b/addons/web/static/src/js/view_list.js
index 04ff8b48923..f6794bd435c 100644
--- a/addons/web/static/src/js/view_list.js
+++ b/addons/web/static/src/js/view_list.js
@@ -90,7 +90,9 @@ instance.web.ListView = instance.web.View.extend( /** @lends instance.web.ListVi
this.no_leaf = false;
this.grouped = false;
- this.on('view_loaded', self, self.load_list);
+ },
+ view_loading: function(r) {
+ return this.load_list(r);
},
set_default_options: function (options) {
this._super(options);
diff --git a/addons/web/static/src/js/view_tree.js b/addons/web/static/src/js/view_tree.js
index acac93f1842..2f9efad9171 100644
--- a/addons/web/static/src/js/view_tree.js
+++ b/addons/web/static/src/js/view_tree.js
@@ -37,7 +37,10 @@ instance.web.TreeView = instance.web.View.extend(/** @lends instance.web.TreeVie
this.options = _.extend({}, this.defaults, options || {});
_.bindAll(this, 'color_for');
- this.on('view_loaded', this, this.load_tree);
+ },
+
+ view_loading: function(r) {
+ return this.load_tree(r);
},
/**
diff --git a/addons/web/static/src/js/views.js b/addons/web/static/src/js/views.js
index c949762a5f6..92f66849fec 100644
--- a/addons/web/static/src/js/views.js
+++ b/addons/web/static/src/js/views.js
@@ -467,6 +467,7 @@ instance.web.ViewManager = instance.web.Widget.extend({
this.flags = flags || {};
this.registry = instance.web.views;
this.views_history = [];
+ this.view_completely_inited = $.Deferred();
},
/**
* @returns {jQuery.Deferred} initial view loading promise
@@ -586,6 +587,8 @@ instance.web.ViewManager = instance.web.Widget.extend({
&& self.flags.auto_search
&& view.controller.searchable !== false) {
self.searchview.ready.done(self.searchview.do_search);
+ } else {
+ self.view_completely_inited.resolve();
}
self.trigger("controller_inited",view_type,controller);
});
@@ -700,7 +703,9 @@ instance.web.ViewManager = instance.web.Widget.extend({
if (_.isString(groupby)) {
groupby = [groupby];
}
- controller.do_search(results.domain, results.context, groupby || []);
+ $.when(controller.do_search(results.domain, results.context, groupby || [])).then(function() {
+ self.view_completely_inited.resolve();
+ });
});
},
/**
@@ -782,7 +787,7 @@ instance.web.ViewManagerAction = instance.web.ViewManager.extend({
var main_view_loaded = this._super();
- var manager_ready = $.when(searchview_loaded, main_view_loaded);
+ var manager_ready = $.when(searchview_loaded, main_view_loaded, this.view_completely_inited);
this.$el.find('.oe_debug_view').change(this.on_debug_changed);
this.$el.addClass("oe_view_manager_" + (this.action.target || 'current'));
@@ -1186,32 +1191,36 @@ instance.web.View = instance.web.Widget.extend({
},
load_view: function(context) {
var self = this;
- var view_loaded;
+ var view_loaded_def;
if (this.embedded_view) {
- view_loaded = $.Deferred();
+ view_loaded_def = $.Deferred();
$.async_when().done(function() {
- view_loaded.resolve(self.embedded_view);
+ view_loaded_def.resolve(self.embedded_view);
});
} else {
if (! this.view_type)
console.warn("view_type is not defined", this);
- view_loaded = instance.web.fields_view_get({
+ view_loaded_def = instance.web.fields_view_get({
"model": this.dataset._model,
"view_id": this.view_id,
"view_type": this.view_type,
"toolbar": !!this.options.$sidebar,
});
}
- return view_loaded.then(function(r) {
+ return view_loaded_def.then(function(r) {
self.fields_view = r;
- self.trigger('view_loaded', r);
// add css classes that reflect the (absence of) access rights
self.$el.addClass('oe_view')
.toggleClass('oe_cannot_create', !self.is_action_enabled('create'))
.toggleClass('oe_cannot_edit', !self.is_action_enabled('edit'))
.toggleClass('oe_cannot_delete', !self.is_action_enabled('delete'));
+ return $.when(self.view_loading(r)).then(function() {
+ self.trigger('view_loaded', r);
+ });
});
},
+ view_loading: function(r) {
+ },
set_default_options: function(options) {
this.options = options || {};
_.defaults(this.options, {
diff --git a/addons/web/static/src/xml/base.xml b/addons/web/static/src/xml/base.xml
index 1897eed3292..62e123f6695 100644
--- a/addons/web/static/src/xml/base.xml
+++ b/addons/web/static/src/xml/base.xml
@@ -437,7 +437,7 @@
<tr>
<td class="oe_leftbar" valign="top">
<t t-set="debug" t-value="__debug__ ? '&amp;debug' : ''"/>
- <a class="oe_logo" t-attf-href="/?ts=#{Date.now()}#{debug}"><img t-att-src='_s + "/web/static/src/img/logo.png"'/></a>
+ <a class="oe_logo" t-attf-href="/?ts=#{Date.now()}#{debug}"><img t-att-src='widget.session.url("/web/binary/company_logo")'/></a>
<div class="oe_secondary_menus_container"/>
<div class="oe_footer">
Powered by <a href="http://www.openerp.com" target="_blank"><span>OpenERP</span></a>
@@ -1366,7 +1366,7 @@
</t>
<t t-name="SelectCreatePopup.search.buttons">
<t t-if="! widget.options.disable_multiple_selection">
- <button type="button" class="oe_button oe_selectcreatepopup-search-select" disabled="disabled">Select</button>
+ <button type="button" class="oe_button oe_selectcreatepopup-search-select oe_highlight" disabled="disabled">Select</button>
</t>
<button type="button" class="oe_button oe_selectcreatepopup-search-create">Create</button>
or <a class="oe_button oe_selectcreatepopup-search-close oe_bold oe_form_button_cancel" href="javascript:void(0)">Cancel</a>