[MERGE] trunk
bzr revid: al@openerp.com-20120525122631-ef5vt5dg5gx2y296
This commit is contained in:
commit
72b98f2b70
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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();
|
||||
return self.load_db_list().then(self.proxy('_db_list_loaded'));
|
||||
},
|
||||
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();
|
||||
}
|
||||
});
|
||||
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');
|
||||
});
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -1,8 +1,10 @@
|
|||
@charset "utf-8";
|
||||
.openerp .oe_kanban_view {
|
||||
position: absolute;
|
||||
top: 111px;
|
||||
top: 118px;
|
||||
bottom: 0;
|
||||
left: 221px;
|
||||
right: 0;
|
||||
}
|
||||
.openerp .oe_kanban_view .ui-sortable-placeholder {
|
||||
border: 1px dotted black;
|
||||
|
@ -20,6 +22,7 @@
|
|||
}
|
||||
.openerp .oe_kanban_view .oe_kanban_groups {
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
}
|
||||
.openerp .oe_kanban_view .oe_kanban_group_title {
|
||||
margin: 1px 1px 4px;
|
||||
|
@ -141,7 +144,7 @@
|
|||
position: relative;
|
||||
display: block;
|
||||
min-height: 50px;
|
||||
margin: 6px 0;
|
||||
margin: 0;
|
||||
display: block;
|
||||
-moz-border-radius: 4px;
|
||||
-webkit-border-radius: 4px;
|
||||
|
@ -154,6 +157,9 @@
|
|||
font-weight: bold;
|
||||
margin: 2px 4px;
|
||||
}
|
||||
.openerp .oe_kanban_view .oe_kanban_grouped .oe_kanban_record {
|
||||
margin-bottom: 6px;
|
||||
}
|
||||
.openerp .oe_kanban_view .oe_kanban_gravatar {
|
||||
display: block;
|
||||
width: 20px;
|
||||
|
@ -296,7 +302,6 @@
|
|||
border: 1px solid #d8d8d8;
|
||||
border-bottom-color: #b9b9b9;
|
||||
padding: 6px;
|
||||
margin: 6px 0;
|
||||
display: block;
|
||||
-moz-border-radius: 4px;
|
||||
-webkit-border-radius: 4px;
|
||||
|
@ -315,6 +320,11 @@
|
|||
}
|
||||
.openerp .oe_kanban_view .oe_kanban_card h3 {
|
||||
margin: 0 16px 0 0;
|
||||
color: #4c4c4c;
|
||||
text-decoration: none;
|
||||
}
|
||||
.openerp .oe_kanban_view .oe_kanban_card h3:hover {
|
||||
text-decoration: none;
|
||||
}
|
||||
.openerp .oe_kanban_view .oe_kanban_star {
|
||||
float: left;
|
||||
|
|
|
@ -22,8 +22,10 @@
|
|||
.openerp .oe_kanban_view
|
||||
// KanbanView {{{
|
||||
position: absolute
|
||||
top: 111px
|
||||
top: 118px
|
||||
bottom: 0
|
||||
left: 221px
|
||||
right: 0
|
||||
.ui-sortable-placeholder
|
||||
border: 1px dotted black
|
||||
visibility: visible !important
|
||||
|
@ -38,6 +40,7 @@
|
|||
// KanbanGroups {{{
|
||||
.oe_kanban_groups
|
||||
height: 100%
|
||||
width: 100%
|
||||
.oe_kanban_group_title
|
||||
margin: 1px 1px 4px
|
||||
padding-left: 2px
|
||||
|
@ -139,7 +142,7 @@
|
|||
position: relative
|
||||
display: block
|
||||
min-height: 50px
|
||||
margin: 6px 0
|
||||
margin: 0
|
||||
display: block
|
||||
@include radius(4px)
|
||||
&:last-child
|
||||
|
@ -147,6 +150,8 @@
|
|||
.oe_kanban_title
|
||||
font-weight: bold
|
||||
margin: 2px 4px
|
||||
.oe_kanban_grouped .oe_kanban_record
|
||||
margin-bottom: 6px
|
||||
.oe_kanban_gravatar
|
||||
display: block
|
||||
width: 20px
|
||||
|
@ -256,7 +261,6 @@
|
|||
border: 1px solid #d8d8d8
|
||||
border-bottom-color: #b9b9b9
|
||||
padding: 6px
|
||||
margin: 6px 0
|
||||
display: block
|
||||
@include radius(4px)
|
||||
&:last-child
|
||||
|
@ -267,6 +271,10 @@
|
|||
display: block
|
||||
h3
|
||||
margin: 0 16px 0 0
|
||||
color: #4c4c4c
|
||||
text-decoration: none
|
||||
h3:hover
|
||||
text-decoration: none
|
||||
.oe_kanban_star
|
||||
float: left
|
||||
position: inline-block
|
||||
|
|
|
@ -39,20 +39,16 @@ instance.web_kanban.KanbanView = instance.web.View.extend({
|
|||
var self = this;
|
||||
this._super.apply(this, arguments);
|
||||
// Bind kanban cards dropdown menus
|
||||
this.$element.on('click', '.oe_kanban_menuaction', function() {
|
||||
var $menu = $(this).next('.oe_kanban_menu');
|
||||
var toggle = $menu.is(':visible');
|
||||
self.$element.find('.oe_kanban_menu').hide();
|
||||
$menu.toggle(!toggle);
|
||||
return false;
|
||||
$('html').on('click.kanban', function() {
|
||||
self.trigger('hide_menus');
|
||||
});
|
||||
$('html').on('click', function() {
|
||||
this.on('hide_menus', this, function() {
|
||||
self.$element.find('.oe_kanban_menu').hide();
|
||||
});
|
||||
},
|
||||
destroy: function() {
|
||||
this._super.apply(this, arguments);
|
||||
$('html').off('click');
|
||||
$('html').off('click.kanban');
|
||||
},
|
||||
on_loaded: function(data) {
|
||||
this.fields_view = data;
|
||||
|
@ -590,8 +586,8 @@ instance.web_kanban.KanbanRecord = instance.web.OldWidget.extend({
|
|||
this.$element.children(':first').addClass('oe_kanban_draghandle');
|
||||
}
|
||||
|
||||
this.$element.find('.oe_kanban_action').click(function(ev) {
|
||||
ev.preventDefault();
|
||||
this.$element.find('.oe_kanban_action').click(function() {
|
||||
self.view.trigger('hide_menus');
|
||||
var $action = $(this),
|
||||
type = $action.data('type') || 'button',
|
||||
method = 'do_action_' + (type === 'action' ? 'object' : type);
|
||||
|
@ -602,7 +598,31 @@ instance.web_kanban.KanbanRecord = instance.web.OldWidget.extend({
|
|||
} else {
|
||||
self.do_warn("Kanban: no action for type : " + type);
|
||||
}
|
||||
return false;
|
||||
});
|
||||
|
||||
this.$element.on('click', '.oe_kanban_menuaction', function() {
|
||||
var $menu = $(this).next('.oe_kanban_menu');
|
||||
var show = !$menu.is(':visible');
|
||||
self.view.trigger('hide_menus');
|
||||
var doc_width = $(document).width();
|
||||
$menu.toggle(show);
|
||||
if (show) {
|
||||
var offset = $menu.offset();
|
||||
var menu_width = $menu.width();
|
||||
var x = doc_width - offset.left - menu_width - 15;
|
||||
if (x < 0) {
|
||||
$menu.offset({ left: offset.left + x }).width(menu_width);
|
||||
}
|
||||
}
|
||||
return false;
|
||||
});
|
||||
|
||||
this.$element.on('click', this.on_card_clicked);
|
||||
},
|
||||
on_card_clicked: function() {
|
||||
this.view.trigger('hide_menus');
|
||||
this.view.open_record(this.id);
|
||||
},
|
||||
setup_color_picker: function() {
|
||||
var self = this;
|
||||
|
@ -611,8 +631,8 @@ instance.web_kanban.KanbanRecord = instance.web.OldWidget.extend({
|
|||
$el.html(QWeb.render('KanbanColorPicker', {
|
||||
widget: this
|
||||
}));
|
||||
$el.on('click', 'a', function(ev) {
|
||||
ev.preventDefault();
|
||||
$el.on('click', 'a', function() {
|
||||
self.view.trigger('hide_menus');
|
||||
var color_field = $(this).parents('.oe_kanban_colorpicker').first().data('field') || 'color';
|
||||
var data = {};
|
||||
data[color_field] = $(this).data('color');
|
||||
|
@ -620,6 +640,7 @@ instance.web_kanban.KanbanRecord = instance.web.OldWidget.extend({
|
|||
self.record[color_field] = $(this).data('color');
|
||||
self.do_reload();
|
||||
});
|
||||
return false;
|
||||
});
|
||||
}
|
||||
},
|
||||
|
@ -654,6 +675,7 @@ instance.web_kanban.KanbanRecord = instance.web.OldWidget.extend({
|
|||
var $render = $(self.render());
|
||||
self.$element.replaceWith($render);
|
||||
self.$element = $render;
|
||||
self.$element.data('widget', self);
|
||||
self.bind_events();
|
||||
self.group.compute_cards_auto_height();
|
||||
} else {
|
||||
|
|
Loading…
Reference in New Issue