[MERGE] manual reimplementation of progress bar for better cross-platform consistency and usability
html5 progress bar can not show progress in letters, so much less precision bzr revid: xmo@openerp.com-20120713125527-994faqcd1jlm0wyh
This commit is contained in:
@@ -1613,6 +1613,33 @@ label.error {
|
||||
background: white;
|
||||
min-width: 90px;
|
||||
}
|
||||
.openerp .oe_list_progressbar_outer {
|
||||
position: relative;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
border: 1px solid #AAAAAA;
|
||||
background: #EEEEEE;
|
||||
border-radius: 3px;
|
||||
font-size: 11px;
|
||||
}
|
||||
.openerp .oe_list_progressbar_inner {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
border: 1px solid #AAAAAA;
|
||||
background: #AAAAAA;
|
||||
height: 100%;
|
||||
margin-top: -1px;
|
||||
margin-bottom: -1px;
|
||||
}
|
||||
.openerp .oe_list_progressbar_text {
|
||||
position: relative;
|
||||
text-align: center;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
.openerp tbody.ui-widget-content {
|
||||
margin-bottom: 10px;
|
||||
border-spacing: 4px;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
|
||||
openerp.web.formats = function(openerp) {
|
||||
var _t = openerp.web._t;
|
||||
|
||||
var QWeb = openerp.web.qweb;
|
||||
/**
|
||||
* Intersperses ``separator`` in ``str`` at the positions indicated by
|
||||
* ``indices``.
|
||||
@@ -336,11 +336,8 @@ openerp.web.format_cell = function (row_data, column, options) {
|
||||
href: download_url,
|
||||
size: row_data[column.id].value
|
||||
});
|
||||
case 'progressbar':
|
||||
return _.template(
|
||||
'<progress value="<%-value%>" max="100"><%-value%>%</progress>', {
|
||||
value: _.str.sprintf("%.0f", row_data[column.id].value || 0)
|
||||
});
|
||||
case 'progressbar':
|
||||
return QWeb.render('ListView.ProgressBar', {value: _.str.sprintf("%.0f", row_data[column.id].value || 0)})
|
||||
}
|
||||
|
||||
return _.escape(openerp.web.format_value(
|
||||
|
||||
@@ -730,7 +730,12 @@
|
||||
<t t-name="ListView.row.form">
|
||||
<t t-raw="frame.render()"/>
|
||||
</t>
|
||||
|
||||
<t t-name="ListView.ProgressBar">
|
||||
<div class="oe_list_progressbar_outer">
|
||||
<div class="oe_list_progressbar_inner" t-att-style="'width: ' + value + '%;'"></div>
|
||||
<div class="oe_list_progressbar_text"><span><t t-esc="value"/>%</span></div>
|
||||
</div>
|
||||
</t>
|
||||
<t t-name="FormView">
|
||||
<div class="oe_form_header">
|
||||
<div class="oe_form_buttons" t-if="widget.options.action_buttons !== false">
|
||||
|
||||
Reference in New Issue
Block a user