[IMP] view_form: widget radio: clean code
bzr revid: chm@openerp.com-20130415103041-8xogdacjx43v4cgk
This commit is contained in:
@@ -1112,11 +1112,11 @@
|
||||
</span>
|
||||
</t>
|
||||
<t t-name="FieldRadio">
|
||||
<span t-attf-class="oe_form_field oe_form_field_radio #{widget.horizontal ? 'oe_horizontal' : 'oe_vertical'}" t-att-style="widget.node.attrs.style">
|
||||
<span class="oe_radio_edit_only">
|
||||
<t t-if="widget.horizontal">
|
||||
<span t-attf-class="oe_form_field oe_form_field_radio #{widget.options.horizontal ? 'oe_horizontal' : 'oe_vertical'}" t-att-style="widget.node.attrs.style">
|
||||
<span t-if="!widget.get('effective_readonly')">
|
||||
<t t-if="widget.options.horizontal">
|
||||
<t t-set="width" t-value="Math.floor(100 / widget.selection.length)"/>
|
||||
<t t-if="!widget.no_radiolabel">
|
||||
<t t-if="!widget.options.no_radiolabel">
|
||||
<t t-foreach="widget.selection" t-as="selection">
|
||||
<label t-att-for="widget.uniqueId + '_' + selection[0]" t-att-style="'width: ' + width + '%;'"><t t-esc="selection[1]"/></label>
|
||||
</t>
|
||||
@@ -1128,15 +1128,15 @@
|
||||
</div>
|
||||
</t>
|
||||
</t>
|
||||
<t t-if="!widget.horizontal">
|
||||
<t t-if="!widget.options.horizontal">
|
||||
<t t-foreach="widget.selection" t-as="selection">
|
||||
<div>
|
||||
<span class="oe_radio_input"><input type="radio" t-att-id="widget.uniqueId + '_' + selection[0]" t-att-name="widget.uniqueId" t-att-value="selection[0]"/></span><label t-if="!widget.no_radiolabel" t-att-for="widget.uniqueId + '_' + selection[0]"><t t-esc="selection[1]"/></label>
|
||||
<span class="oe_radio_input"><input type="radio" t-att-id="widget.uniqueId + '_' + selection[0]" t-att-name="widget.uniqueId" t-att-value="selection[0]"/></span><label t-if="!widget.options.no_radiolabel" t-att-for="widget.uniqueId + '_' + selection[0]"><t t-esc="selection[1]"/></label>
|
||||
</div>
|
||||
</t>
|
||||
</t>
|
||||
</span>
|
||||
<span class="oe_radio_read_only"><t t-esc="widget.get('value')[1]"/></span>
|
||||
<span t-if="widget.get('effective_readonly')" class="oe_radio_readonly"><t t-esc="widget.get('value')[1]"/></span>
|
||||
</span>
|
||||
</t>
|
||||
<t t-name="FieldMany2One">
|
||||
|
||||
Reference in New Issue
Block a user