[IMP] view_form: radio button: change style for required field

bzr revid: chm@openerp.com-20130411090654-ujf7fio6lnsppv90
This commit is contained in:
Christophe Matthieu
2013-04-11 11:06:54 +02:00
parent f2beb97168
commit 67452d290e
4 changed files with 42 additions and 8 deletions
+6 -4
View File
@@ -1112,7 +1112,7 @@
</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 t-attf-class="oe_form_field oe_form_field_radio #{widget.horizontal ? 'oe_horizontal' : 'oe_vertical'} #{widget.field.required or widget.node.attrs.required ? 'oe_required' : ''}" t-att-style="widget.node.attrs.style">
<span class="oe_radio_edit_only">
<t t-if="widget.horizontal">
<t t-set="width" t-value="Math.floor(100 / widget.selection.length)"/>
@@ -1123,13 +1123,15 @@
<br/>
</t>
<t t-foreach="widget.selection" t-as="selection">
<input type="radio" t-att-name="widget.uniqueId" t-att-id="widget.uniqueId + '_' + selection[0]" t-att-style="'width: ' + width + '%;'" t-att-value="selection[0]"/>
<div t-att-style="'width: ' + width + '%;'">
<span class="oe_radio_input"><input type="radio" t-att-name="widget.uniqueId" t-att-id="widget.uniqueId + '_' + selection[0]" t-att-value="selection[0]"/></span>
</div>
</t>
</t>
<t t-if="!widget.horizontal">
<t t-foreach="widget.selection" t-as="selection">
<div t-att-data-id="selection[0]">
<input type="radio" t-att-id="widget.uniqueId + '_' + selection[0]" t-att-name="widget.uniqueId" t-att-value="selection[0]"/>&amp;nbsp;<label t-if="!widget.no_radiolabel" t-att-for="widget.uniqueId + '_' + selection[0]"><t t-esc="selection[1]"/></label>
<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>
</div>
</t>
</t>