[IMP]improved css as well as improved stagemode widget

bzr revid: mba@tinyerp.com-20131219083851-c2hp4dddtpfxm0l6
This commit is contained in:
Mahendra Barad (OpenERP)
2013-12-19 14:08:51 +05:30
parent b5feff9153
commit 752fa2e2a5
6 changed files with 76 additions and 14 deletions
+35 -3
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");
@@ -2290,7 +2290,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;
@@ -3434,7 +3434,6 @@ div.ui-widget-overlay {
overflow: hidden !important;
}
}
.nav li > a {
padding: 3px 4px 2px 18px;
color: #4c4c4c;
@@ -3569,6 +3568,39 @@ h5 {
color: #eeeeee;
}
.dropdown-menu.with-arrow {
background: white;
background: white !important;
}
.dropdown-menu.with-arrow:before {
position: absolute;
top: -12px;
left: 9px;
display: inline-block;
border-right: 12px solid transparent;
border-bottom: 12px solid #cccccc;
border-left: 12px solid transparent;
border-bottom-color: rgba(0, 0, 0, 0.2);
content: "";
}
.dropdown-menu.with-arrow:after {
position: absolute;
top: -11px;
left: 10px;
display: inline-block;
border-right: 11px solid transparent;
border-bottom: 11px solid white;
border-left: 11px solid transparent;
content: "";
}
.dropdown-menu.with-arrow li a {
color: black;
font-weight: bold;
}
.ui-icon {
width: 18px;
height: 18px;
+25
View File
@@ -2843,6 +2843,31 @@ h5
li
a,a:hover,a:focus
color: #eeeeee
.dropdown-menu.with-arrow
background: #FFF
background: #FFF !important
.dropdown-menu.with-arrow:before
position: absolute
top: -12px
left: 9px
display: inline-block
border-right: 12px solid transparent
border-bottom: 12px solid #ccc
border-left: 12px solid transparent
border-bottom-color: rgba(0, 0, 0, 0.2)
content: ''
.dropdown-menu.with-arrow:after
position: absolute
top: -11px
left: 10px
display: inline-block
border-right: 11px solid transparent
border-bottom: 11px solid #ffffff
border-left: 11px solid transparent
content: ''
.dropdown-menu.with-arrow li a
color: #000
font-weight: bold
// End hack }}}
// Hack for ui icon {{{
+3 -2
View File
@@ -2334,14 +2334,15 @@ instance.web.form.StageMode = instance.web.form.FieldChar.extend({
init: function (field_manager, node) {
this._super(field_manager, node);
this.options = py.eval(node.attrs.options)
this.stage_dataset = new instance.web.DataSetStatic(this, this.options.stage_model, this.build_context());
this.stage_dataset = new instance.web.DataSetStatic(this, 'ir.ui.legend', this.build_context());
this.stage_field = this.options.stage_field;
},
get_stage_value: function(){
var def = $.Deferred();
var stage_id = this.field_manager.fields[this.stage_field].get_value()
this.stage_dataset.call('search_read', [[[this.stage_field,'=', stage_id],['type','=',this.name]]]).then(function (res){
var model = this.field_manager.fields[this.stage_field].field.relation
this.stage_dataset.call('search_read', [[['res_id','=', stage_id],['type','=',this.name],['res_model','=',model]]]).then(function (res){
def.resolve(res);
})
return def
+2 -1
View File
@@ -1104,10 +1104,11 @@ instance.web.ListView.List = instance.web.Class.extend( /** @lends instance.web.
record.set(column.id, false);
}
}
return column.format(record.toForm().data, {
var value = column.format(record.toForm().data, {
model: this.dataset.model,
id: record.get('id')
});
return _.unescape(value)
},
render: function () {
this.$current.empty().append(
+3 -3
View File
@@ -1040,17 +1040,17 @@
<t t-raw="rec.body" />
</a>
</t>
<ul class="dropdown-menu">
<ul class="dropdown-menu with-arrow">
<t t-foreach="res" t-as="rec">
<t t-if="widget.get('value') !== rec.name">
<li><a t-att-data-value="rec.name" href="#"><t t-raw="rec.body" /></a></li>
<li><a t-att-data-value="rec.name" href="#"><t t-raw="rec.body" /><t t-raw="rec.legend_name" /></a></li>
</t>
</t>
</ul>
</div>
</t>
<t t-name="StageMode.priority">
<ul style="list-style: none;">
<ul style="list-style: none; padding-left: 2px;">
<t t-foreach="res" t-as="test" >
<t t-if="widget.get('value') gte test.name and !test_first">
<li class="oe_left"><a t-att-data-value="test.name - 1" href="#"><t t-raw="test.body"/></a></li>
+8 -5
View File
@@ -34,6 +34,7 @@ instance.web_kanban.KanbanView = instance.web.View.extend({
};
this.groups = [];
this.aggregates = {};
this.legend = {};
this.group_operators = ['avg', 'max', 'min', 'sum', 'count'];
this.qweb = new QWeb2.Engine();
this.qweb.debug = instance.session.debug;
@@ -624,7 +625,10 @@ instance.web_kanban.KanbanGroup = instance.web.Widget.extend({
}
this.$el.data('widget', this);
this.$records.data('widget', this);
this.$has_been_started.resolve();
var def_tooltip = this.fetch_tooltip();
$.when(def_tooltip).done(function (){
self.$has_been_started.resolve();
});
var add_btn = this.$el.find('.oe_kanban_add');
add_btn.tipsy({delayIn: 500, delayOut: 1000});
this.$records.find(".oe_kanban_column_cards").click(function (ev) {
@@ -635,8 +639,6 @@ instance.web_kanban.KanbanGroup = instance.web.Widget.extend({
}
});
this.is_started = true;
var def_tooltip = this.fetch_tooltip();
return $.when(def_tooltip);
},
fetch_tooltip: function() {
if (! this.group)
@@ -665,8 +667,9 @@ instance.web_kanban.KanbanGroup = instance.web.Widget.extend({
if (this.value) {
return (new instance.web.Model(field.relation)).query([options.tooltip_on_group_by])
.filter([["id", "=", this.value]]).first().then(function(res) {
self.tooltip = res[options.tooltip_on_group_by];
self.$(".oe_kanban_group_title_text").attr("title", self.tooltip || self.title || "").tipsy({html: true});
self.legend = res[options.tooltip_on_group_by];
var title = self.legend.tooltip || self.legend || self.title || ""
self.$(".oe_kanban_group_title_text").attr("title", title).tipsy({html: true,className: 'oe_tooltip_kanban_message'});
});
}
},