[MERGE] latest trunk

bzr revid: abo@openerp.com-20120822175835-jvy2b1m0e3rvlt06
This commit is contained in:
Antonin Bourguignon 2012-08-22 19:58:35 +02:00
commit 031909d29e
9 changed files with 212 additions and 82 deletions

View File

@ -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");
@ -243,21 +243,9 @@
cursor: default;
text-shadow: 0 1px 1px white !important;
}
.openerp .ui-widget {
font-family: "Lucida Grande", Helvetica, Verdana, Arial, sans-serif;
font-size: 13px;
}
.openerp .ui-widget-content a {
color: #7c7bad;
}
.openerp .ui-menu .ui-menu-item {
margin: 0 8px 0 0;
padding: 0 0 0 12px;
width: auto;
}
.openerp .ui-menu .ui-menu-item a.ui-state-active {
background: #f0f0fa;
}
.openerp.ui-dialog {
display: none;
padding: 6px;
@ -475,6 +463,13 @@
-webkit-box-shadow: 0 0 1px rgba(0, 0, 0, 0.2);
box-shadow: 0 0 1px rgba(0, 0, 0, 0.2);
}
.openerp ul.oe_flatlist, .openerp ol.oe_flatlist {
margin: 0;
padding: 0;
}
.openerp ul.oe_flatlist li, .openerp ol.oe_flatlist li {
list-style-type: none;
}
.openerp .oe_form_dirty .oe_highlight_on_dirty {
color: white;
background: #dc5f59;
@ -514,8 +509,8 @@
margin: 4px;
}
.openerp .oe_avatar > img {
height: 90px;
max-width: 100px;
max-height: 90px;
max-width: 90px;
-moz-border-radius: 3px;
-webkit-border-radius: 3px;
border-radius: 3px;
@ -1021,7 +1016,7 @@
.openerp .oe_topbar {
width: 100%;
height: 31px;
border-top: solid 1px lightgrey;
border-top: solid 1px #d3d3d3;
background-color: #646060;
background-image: -webkit-gradient(linear, left top, left bottom, from(#646060), to(#262626));
background-image: -webkit-linear-gradient(top, #646060, #262626);
@ -1046,14 +1041,6 @@
-webkit-box-shadow: 0 1px 2px rgba(255, 255, 255, 0.3) inset;
box-shadow: 0 1px 2px rgba(255, 255, 255, 0.3) inset;
}
.openerp .oe_topbar .oe_topbar_item .oe_active {
background: #303030;
font-weight: bold;
color: white;
-moz-box-shadow: 0 1px 2px rgba(255, 255, 255, 0.3) inset;
-webkit-box-shadow: 0 1px 2px rgba(255, 255, 255, 0.3) inset;
box-shadow: 0 1px 2px rgba(255, 255, 255, 0.3) inset;
}
.openerp .oe_topbar .oe_topbar_avatar {
width: 24px;
height: 24px;
@ -1164,10 +1151,10 @@
padding: 0;
margin: 0;
}
.openerp .oe_menu li {
.openerp .oe_menu > li {
float: left;
}
.openerp .oe_menu a {
.openerp .oe_menu > li > a {
display: block;
padding: 5px 10px 7px;
line-height: 20px;
@ -1176,14 +1163,14 @@
vertical-align: top;
text-shadow: 0 1px 1px rgba(0, 0, 0, 0.2);
}
.openerp .oe_menu a:hover {
.openerp .oe_menu > li > a:hover {
background: #303030;
color: white;
-moz-box-shadow: 0 1px 2px rgba(255, 255, 255, 0.3) inset;
-webkit-box-shadow: 0 1px 2px rgba(255, 255, 255, 0.3) inset;
box-shadow: 0 1px 2px rgba(255, 255, 255, 0.3) inset;
}
.openerp .oe_menu .oe_active {
.openerp .oe_menu > li > .oe_active {
background: #303030;
font-weight: bold;
color: white;
@ -1220,7 +1207,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;
@ -1237,8 +1224,8 @@
}
.openerp .oe_secondary_submenu .oe_active {
background: #7c7bad;
border-top: 1px solid lightgrey;
border-bottom: 1px solid lightgrey;
border-top: 1px solid lightGray;
border-bottom: 1px solid lightGray;
text-shadow: 0 1px 1px rgba(0, 0, 0, 0.2);
-moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.2);
-webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.2);
@ -1330,6 +1317,9 @@
.openerp .oe_view_manager table.oe_view_manager_header h2 a {
color: #7c7bad;
}
.openerp .oe_view_manager table.oe_view_manager_header .oe_dropdown_menu {
line-height: normal;
}
.openerp .oe_view_manager table.oe_view_manager_header .oe_button_group {
display: inline-block;
border: 1px solid #ababab;
@ -1969,7 +1959,7 @@
padding: 16px 0 48px;
}
.openerp .oe_form div.oe_form_configuration div.oe_horizontal_separator {
margin: 25px 0 10px 0;
margin: 12px 0 8px 0;
}
.openerp .oe_form div.oe_form_configuration p {
color: #aaaaaa;
@ -1978,6 +1968,12 @@
.openerp .oe_form div.oe_form_configuration label {
min-width: 150px;
}
.openerp .oe_form div.oe_form_configuration .oe_form_group_cell_label {
padding: 2px 0;
}
.openerp .oe_form div.oe_form_configuration .oe_form_group_cell div div {
padding: 1px 0;
}
.openerp ul.oe_form_steps, .openerp ul.oe_form_steps_clickable {
display: inline-block;
padding-right: 18px;
@ -2169,7 +2165,7 @@
.openerp .oe_form td.oe_form_group_cell_label label {
line-height: 18px;
display: block;
min-width: 120px;
min-width: 160px;
}
.openerp .oe_form td.oe_form_group_cell + .oe_form_group_cell {
padding-left: 6px;
@ -2188,7 +2184,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;
@ -2201,7 +2197,7 @@
font-weight: bold;
font-size: 20px;
margin: 8px 0px 8px 0px;
color: #53637e;
color: #7c7bad;
}
.openerp .oe_horizontal_separator:empty {
height: 5px;
@ -2753,3 +2749,45 @@ div.ui-widget-overlay {
filter: alpha(opacity=30);
opacity: 0.3;
}
.ui-widget {
font-family: "Lucida Grande", Helvetica, Verdana, Arial, sans-serif;
color: #4c4c4c;
font-size: 13px;
}
.ui-menu {
padding: 2px 0;
-moz-box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
-webkit-box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
margin-top: 4px;
}
.ui-menu .ui-menu-item {
width: 100%;
padding: 0;
}
.ui-menu .ui-menu-item a {
padding: 1px 16px;
}
.ui-menu .ui-menu-item a.ui-corner-all {
-moz-border-radius: 0;
-webkit-border-radius: 0;
border-radius: 0;
}
.ui-menu .ui-menu-item a.ui-state-active {
background: #f0f0fa;
}
.ui-menu .ui-menu-item a.ui-state-hover, .ui-menu .ui-menu-item a.ui-state-active {
background: #7c7bad;
}
.ui-corner-all {
-moz-border-radius: 3px;
-webkit-border-radius: 3px;
border-radius: 3px;
}
.ui-widget-content {
border: 1px solid #afafb6;
}

View File

@ -249,18 +249,8 @@ $sheet-max-width: 860px
text-shadow: 0 1px 1px #fff !important
// }}}
// Jquery ui Overrides {{{
.ui-widget
font-family: "Lucida Grande", Helvetica, Verdana, Arial, sans-serif
font-size: 13px
.ui-widget-content a
color: $link-color
.ui-menu
.ui-menu-item
margin: 0 8px 0 0
padding: 0 0 0 12px
width: auto
a.ui-state-active
background: #f0f0fa
// Modal box
&.ui-dialog
@ -400,6 +390,13 @@ $sheet-max-width: 860px
@include vertical-gradient(#DF6B66, #BF3A33)
//@include vertical-gradient(lighten(#dc5f59, 3%), lighten(#b33630, 3%))
@include box-shadow(0 0 1px rgba(0, 0, 0, 0.2))
ul.oe_flatlist, ol.oe_flatlist
margin: 0
padding: 0
li
list-style-type: none
.oe_form_dirty
.oe_highlight_on_dirty
color: white
@ -426,8 +423,8 @@ $sheet-max-width: 860px
margin: 4px
.oe_avatar
> img
height: 90px
max-width: 100px
max-height: 90px
max-width: 90px
@include radius(3px)
@include box-shadow(0 1px 3px rgba(0, 0, 0, 0.3))
border: none
@ -814,11 +811,6 @@ $sheet-max-width: 860px
background: #303030
color: white
@include box-shadow(0 1px 2px rgba(255,255,255,0.3) inset)
.oe_active
background: #303030
font-weight: bold
color: white
@include box-shadow(0 1px 2px rgba(255,255,255,0.3) inset)
.oe_topbar_avatar
width: 24px
@ -906,25 +898,25 @@ $sheet-max-width: 860px
float: left
padding: 0
margin: 0
li
> li
float: left
a
display: block
padding: 5px 10px 7px
line-height: 20px
height: 20px
color: #eee
vertical-align: top
text-shadow: 0 1px 1px rgba(0,0,0,0.2)
&:hover
> a
display: block
padding: 5px 10px 7px
line-height: 20px
height: 20px
color: #eee
vertical-align: top
text-shadow: 0 1px 1px rgba(0,0,0,0.2)
&:hover
background: #303030
color: white
@include box-shadow(0 1px 2px rgba(255,255,255,0.3) inset)
> .oe_active
background: #303030
font-weight: bold
color: white
@include box-shadow(0 1px 2px rgba(255,255,255,0.3) inset)
.oe_active
background: #303030
font-weight: bold
color: white
@include box-shadow(0 1px 2px rgba(255,255,255,0.3) inset)
.oe_secondary_menu_section
font-weight: bold
margin-left: 8px
@ -1039,6 +1031,8 @@ $sheet-max-width: 860px
float: left
a
color: $link-color
.oe_dropdown_menu
line-height: normal
.oe_button_group
display: inline-block
border: 1px solid #ababab
@ -1526,12 +1520,16 @@ $sheet-max-width: 860px
padding: 16px 0 48px
div.oe_form_configuration
div.oe_horizontal_separator
margin: 25px 0 10px 0
margin: 12px 0 8px 0
p
color: #aaa
max-width: 650px
label
min-width: 150px
.oe_form_group_cell_label
padding: 2px 0
.oe_form_group_cell div div
padding: 1px 0
ul.oe_form_steps, ul.oe_form_steps_clickable
@ -1654,7 +1652,7 @@ $sheet-max-width: 860px
label
line-height: 18px
display: block
min-width: 120px
min-width: 160px
td.oe_form_group_cell + .oe_form_group_cell
padding-left: 6px
.oe_form_group
@ -1684,7 +1682,7 @@ $sheet-max-width: 860px
font-weight: bold
font-size: 20px
margin: 8px 0px 8px 0px
color: #53637e
color: $section-title-color
.oe_horizontal_separator:empty
height: 5px
.oe_vertical_separator
@ -2140,10 +2138,39 @@ $sheet-max-width: 860px
// }}}
// The jQuery-ui overlay is outside the .openerp div, please don't add indentation !!!
// The jQuery-ui overlay and Autocomplete are outside the .openerp div, please don't add indentation !!!
div.ui-widget-overlay
background: black
@include opacity(0.3)
.ui-widget
font-family: "Lucida Grande", Helvetica, Verdana, Arial, sans-serif
color: #4c4c4c
font-size: 13px
.ui-menu
padding: 2px 0
@include box-shadow(0 1px 4px rgba(0,0,0,0.3))
margin-top: 4px
.ui-menu-item
width: 100%
padding: 0
a
padding: 1px 16px
a.ui-corner-all
@include radius(0)
a.ui-state-active
background: #f0f0fa
.ui-menu-item a.ui-state-hover, .ui-menu-item a.ui-state-active
background: $tag-bg-dark
//color: #4c4c4c
//@include vertical-gradient(#f0f0fa, #eeeef6)
.ui-corner-all
@include radius(3px)
.ui-widget-content
border: 1px solid $tag-border
// au BufWritePost,FileWritePost *.sass :!sass --style expanded --line-numbers <afile> > "%:p:r.css"
// vim:tabstop=4:shiftwidth=4:softtabstop=4:fdm=marker:

View File

@ -411,7 +411,7 @@ instance.web.DatabaseManager = instance.web.Widget.extend({
'login': 'admin',
'password': form_obj['create_admin_pwd'],
'login_successful': function() {
instance.webclient.show_application();
self.do_action("reload");
},
},
};
@ -712,6 +712,11 @@ instance.web.Menu = instance.web.Widget.extend({
this.data = data;
this.renderElement();
this.limit_entries();
// Hide toplevel item if there is only one
var $toplevel = this.$("li")
if($toplevel.length == 1) {
$toplevel.hide();
}
this.$secondary_menus.html(QWeb.render("Menu.secondary", { widget : this }));
this.$element.on('click', 'a[data-menu]', this.on_menu_click);
// Hide second level submenus
@ -730,6 +735,7 @@ instance.web.Menu = instance.web.Widget.extend({
var $more = $(QWeb.render('Menu.more')),
$index = this.$element.find('li').eq(maximum_visible_links - 1);
$index.after($more);
//$('.oe_topbar').append($more);
$more.find('.oe_menu_more').append($index.next().nextAll());
}
},

View File

@ -528,6 +528,14 @@ if ($.blockUI) {
$.blockUI.defaults.css["background-color"] = '';
}
var messages_by_seconds = [
[0, "Loading..."],
[30, "Still Loading..."],
[60, "Still Loading...<br />Please be patient."],
[120, "Hey, guess what?<br />It's still loading."],
[300, "You may not believe it,<br/>but the application is actually loading..."],
];
instance.web.Throbber = instance.web.Widget.extend({
template: "Throbber",
start: function() {
@ -548,6 +556,23 @@ instance.web.Throbber = instance.web.Widget.extend({
left: 'auto' // Left position relative to parent in px
};
this.spin = new Spinner(opts).spin(this.$element[0]);
this.start_time = new Date().getTime();
this.act_message();
},
act_message: function() {
var self = this;
setTimeout(function() {
if (self.isDestroyed())
return;
var seconds = (new Date().getTime() - self.start_time) / 1000;
var mes;
_.each(messages_by_seconds, function(el) {
if (seconds >= el[0])
mes = el[1];
});
self.$(".oe_throbber_message").html(mes);
self.act_message();
}, 1000);
},
destroy: function() {
if (this.spin)

View File

@ -4635,19 +4635,31 @@ instance.web.form.FieldBinaryImage = instance.web.form.FieldBinary.extend({
this.render_value();
},
render_value: function() {
var self = this;
var url;
if (this.get('value') && ! /^\d+(\.\d*)? \w+$/.test(this.get('value'))) {
url = 'data:image/png;base64,' + this.get('value');
} else if (this.get('value')) {
var id = escape(JSON.stringify(this.view.datarecord.id || null));
var field = this.name;
if (this.options.preview_image)
field = this.options.preview_image;
url = '/web/binary/image?session_id=' + this.session.session_id + '&model=' +
this.view.dataset.model +'&id=' + id + '&field=' + this.name + '&t=' + (new Date().getTime());
this.view.dataset.model +'&id=' + id + '&field=' + field + '&t=' + (new Date().getTime());
} else {
url = "/web/static/src/img/placeholder.png";
}
var img = QWeb.render("FieldBinaryImage-img", { widget: this, url: url });
var $img = $(QWeb.render("FieldBinaryImage-img", { widget: this, url: url }));
this.$element.find('> img').remove();
this.$element.prepend(img);
this.$element.prepend($img);
$img.load(function() {
if (! self.options.size)
return;
$img.css("max-width", "" + self.options.size[0] + "px");
$img.css("max-height", "" + self.options.size[1] + "px");
$img.css("margin-left", "" + (self.options.size[0] - $img.width()) / 2 + "px");
$img.css("margin-top", "" + (self.options.size[1] - $img.height()) / 2 + "px");
});
},
on_file_change: function() {
this.render_value();

View File

@ -1736,7 +1736,7 @@
<div class="oe_blockui_spin" style="height: 50px">
</div>
<br />
<div style="color:white">Loading...</div>
<div class="oe_throbber_message" style="color:white"></div>
</div>
</t>
</templates>

View File

@ -1,4 +1,3 @@
@charset "utf-8";
.openerp .oe_kanban_view {
height: inherit;
}
@ -10,6 +9,15 @@
visibility: visible !important;
height: 60px !important;
}
.openerp .oe_kanban_view .ui-sortable-helper {
-moz-box-shadow: 0 1px 20px rgba(0, 0, 0, 0.9);
-webkit-box-shadow: 0 1px 20px rgba(0, 0, 0, 0.9);
-box-shadow: 0 1px 20px rgba(0, 0, 0, 0.9);
-moz-transform: rotate(3deg);
-webkit-transform: rotate(3deg);
-o-transform: rotate(3deg);
-ms-transform: rotate(3deg);
}
.openerp .oe_kanban_view .oe_kanban_left {
float: left;
}
@ -342,9 +350,10 @@
margin-bottom: 0;
}
.openerp .oe_kanban_view .oe_kanban_card:hover {
-moz-box-shadow: 0 0 3px rgba(0, 0, 0, 0.6);
-webkit-box-shadow: 0 0 3px rgba(0, 0, 0, 0.6);
-box-shadow: 0 0 3px rgba(0, 0, 0, 0.6);
border: 1px solid #7c7bad;
-moz-box-shadow: 0 0 4px #7c7bad;
-webkit-box-shadow: 0 0 4px #7c7bad;
-box-shadow: 0 0 4px #7c7bad;
}
.openerp .oe_kanban_view .oe_kanban_card:hover .oe_dropdown_kanban > span {
visibility: visible;

View File

@ -26,6 +26,12 @@
-moz-box-shadow: $bsval
-webkit-box-shadow: $bsval
-box-shadow: $bsval
@mixin transform($transform)
-moz-transform: $transform
-webkit-transform: $transform
-o-transform: $transform
-ms-transform: $transform
// }}}
.openerp .oe_kanban_view
@ -38,6 +44,9 @@
border: 1px dotted black
visibility: visible !important
height: 60px !important
.ui-sortable-helper
@include box-shadow(0 1px 20px rgba(0, 0, 0, 0.9))
@include transform(rotate(3deg))
.oe_kanban_left
float: left
.oe_kanban_right
@ -304,7 +313,8 @@
&:last-child
margin-bottom: 0
&:hover
@include box-shadow(0 0 3px rgba(0,0,0,0.6))
border: 1px solid #7C7BAD
@include box-shadow(0 0 4px #7C7BAD)
.oe_dropdown_kanban > span
visibility: visible
h3

View File

@ -865,7 +865,8 @@ instance.web_kanban.KanbanRecord = instance.web.Widget.extend({
var email_md5 = $.md5(email);
return 'http://www.gravatar.com/avatar/' + email_md5 + '.png?s=' + size + '&d=' + default_;
},
kanban_image: function(model, field, id, cache) {
kanban_image: function(model, field, id, cache, options) {
options = options || {};
var url;
if (this.record[field] && this.record[field].value && ! /^\d+(\.\d*)? \w+$/.test(this.record[field].value)) {
url = 'data:image/png;base64,' + this.record[field].value;
@ -873,6 +874,8 @@ instance.web_kanban.KanbanRecord = instance.web.Widget.extend({
url = "/web/static/src/img/placeholder.png";
} else {
id = escape(JSON.stringify(id));
if (options.preview_image)
field = options.preview_image;
url = instance.session.prefix + '/web/binary/image?session_id=' + this.session.session_id + '&model=' + model + '&field=' + field + '&id=' + id;
if (cache !== undefined) {
// Set the cache duration in seconds.