font-weight: bold;
font-size: 13px;
}
-
.tooltip .tooltip-inner .oe_tooltip_help {
white-space: pre-wrap;
}
padding-right: 0px;
}
.openerp .btn-group.state {
- padding-top: 3px;
+ padding-top: 8px;
}
.openerp .btn-group.state a {
color: #333333;
background-image: -moz-radial-gradient(#55dd55 0%, #44cc44 40%, #33bb33 100%);
background-image: -webkit-radial-gradient(circle, #55dd55 0%, #44cc44 40%, #33bb33 100%);
}
-.openerp .oe_star_left {
- float: left;
- margin-right: 8px;
-}
padding-right: 0px
font-size: 13px
.btn-group.state
- padding-top: 3px
+ padding-top: 8px
.btn-group.state a
color: #333333
.btn-group.state a:hover
background-image: radial-gradient(#55dd55 0%, #44cc44 40%, #33bb33 100%)
background-image: -moz-radial-gradient(#55dd55 0%, #44cc44 40%, #33bb33 100%)
background-image: -webkit-radial-gradient(circle, #55dd55 0%, #44cc44 40%, #33bb33 100%)
-
- .oe_star_left
- float: left
- margin-right: 8px
// au BufWritePost,FileWritePost *.sass :!sass --style expanded --line-numbers <afile> > "%:p:r.css"
// vim:tabstop=4:shiftwidth=4:softtabstop=4:fdm=marker:
this._super(field_manager, node);
},
prepare_dropdown_selection: function() {
- return [{ 'name': 'normal', 'state_name': ' In Progress', 'state_icon': 'status' },
- { 'name': 'blocked', 'state_name': ' Blocked', 'state_icon': 'status error' },
- { 'name': 'done', 'state_name': ' Ready', 'state_icon': 'status ok' }]
+ var self = this;
+ var data = [];
+ var selection = self.field.selection || [];
+ _.map(selection, function(res) {
+ var state_class;
+ if (res[0] == 'normal')
+ state_class = 'status'
+ else if(res[0] == 'done')
+ state_class = 'status ok'
+ else
+ state_class = 'status error'
+ value = {
+ 'name': res[0],
+ 'tooltip': res[1],
+ 'state_name': res[1],
+ 'state_class': state_class
+ }
+ data.push(value)
+ });
+ return data;
},
render_value: function() {
var self = this;
data['states'] = self.prepare_dropdown_selection();
this.$el.html(QWeb.render("DropdownSelection", data));
this.$el.find('.oe_legend').click(self.do_action.bind(self));
- this.$el.on('mouseenter mouseleave', function(e) {
- self.$el.find('.caret').toggleClass('hidden', e.type == 'mouseleave');
- });
},
do_action: function(e) {
var self = this;
'legend_name': res[1]
}
if (res[0] == '0') {
- value['legend']= '<img src="/web/static/src/img/icons/star-off.png"/>';
+ value['legend']= '<span class="oe_e oe_star_off">7</span>';
} else {
- value['legend']= '<img src="/web/static/src/img/icons/star-on.png"/>';
+ value['legend']= '<span class="oe_e oe_star_on">7</span>';
}
data.push(value)
});
<t t-foreach="states" t-as="rec">
<a>
<a class="oe_legend dropdown-toggle" data-toggle="dropdown">
- <span t-att-class="rec.state_icon" t-if="widget.get('value') === rec.name" t-att-title="rec.state_name"></span>
+ <span t-att-class="rec.state_class" t-if="widget.get('value') === rec.name" t-att-title="rec.tooltip" ></span>
<span class="sr-only">Toggle Dropdown</span></a>
</a>
</t>
<t t-foreach="states" t-as="rec">
<t t-if="widget.get('value') !== rec.name">
<li class="oe_legend" t-att-data-value="rec.name" ><a href="#">
- <span t-att-class="rec.state_icon"/> <t t-raw="rec.state_name" /></a>
+ <span t-att-class="rec.state_class"/> <t t-raw="rec.state_name" /></a>
</li>
</t>
</t>
<ul style="list-style: none; padding-left: 2px;">
<t t-foreach="legends" t-as="rec" >
<t t-if="widget.get('value') gte rec.name and !rec_first">
- <li t-att-data-value="rec.name" class="oe_star_left oe_legend"><a href="#" t-att-title="rec.legend_name"><t t-raw="rec.legend"/></a></li>
+ <li t-att-data-value="rec.name" class="pull-left oe_legend"><a href="#" t-att-title="rec.legend_name"><t t-raw="rec.legend"/></a></li>
</t>
</t>
<t t-foreach="legends" t-as="rec" >
<t t-if="widget.get('value') lt rec.name">
- <li t-att-data-value="rec.name" class="oe_star_left oe_legend"><a href="#" t-att-title="rec.legend_name"><t t-raw="legends[0].legend"/></a></li>
+ <li t-att-data-value="rec.name" class="pull-left oe_legend"><a href="#" t-att-title="rec.legend_name"><t t-raw="legends[0].legend"/></a></li>
</t>
</t>
</ul>
'legend_name': res[1]
}
if (res[0] == '0') {
- value['legend'] = '<img src="/web/static/src/img/icons/star-off.png"/>';
+ value['legend'] = '<span class="oe_e oe_star_off">7</span>';
} else {
- value['legend'] = '<img src="/web/static/src/img/icons/star-on.png"/>';
+ value['legend'] = '<span class="oe_e oe_star_on">7</span>';
}
data.push(value)
});
this.parent = parent;
},
prepare_dropdown_selection: function() {
- return [{ 'name': 'normal', 'state_name': ' In Progress', 'state_icon': 'status' },
- { 'name': 'blocked', 'state_name': ' Blocked', 'state_icon': 'status error' },
- { 'name': 'done', 'state_name': ' Ready', 'state_icon': 'status ok' }]
+ var self = this;
+ var data = [];
+ var selection = self.field.selection || [];
+ _.map(selection, function(res) {
+ var state_class;
+ if (res[0] == 'normal')
+ state_class = 'status'
+ else if(res[0] == 'done')
+ state_class = 'status ok'
+ else
+ state_class = 'status error'
+ value = {
+ 'name': res[0],
+ 'tooltip': res[1],
+ 'state_name': res[1],
+ 'state_class': state_class
+ }
+ data.push(value)
+ });
+ return data;
},
renderElement: function() {
var self = this;
data['states'] = self.prepare_dropdown_selection();
this.$el = $(QWeb.render("DropdownSelection", data));
this.$el.find('.oe_legend').click(self.do_action.bind(self));
- this.$el.on('mouseenter mouseleave', function(e) {
- self.$el.find('.caret').toggleClass('hidden', e.type == 'mouseleave');
- });
},
do_action: function(e) {
var self = this;