| 1 |
<?xml version="1.0" encoding="UTF-8"?> |
| 2 |
<templates id="template" xml:space="preserve"> |
| 3 |
|
| 4 |
<t t-name="hr_holidays.RadioImageField"> |
| 5 |
<div role="radiogroup" class="d-flex flex-wrap gap-4" t-att-aria-label="string"> |
| 6 |
<t t-if="props.readonly"> |
| 7 |
<t t-if="value !== false"> |
| 8 |
<div> |
| 9 |
<img t-attf-src="/hr_holidays/static/src/img/icons/{{items.find((item) => item[0] === value)[1]}}" width="48" height="48" /> |
| 10 |
</div> |
| 11 |
</t> |
| 12 |
</t> |
| 13 |
<t t-else=""> |
| 14 |
<t t-foreach="items" t-as="item" t-key="item[0]"> |
| 15 |
<div class="form-check o_radio_item" aria-atomic="true"> |
| 16 |
<input |
| 17 |
type="radio" |
| 18 |
class="form-check-input o_radio_input" |
| 19 |
t-att-checked="item[0] === value" |
| 20 |
t-att-disabled="props.readonly" |
| 21 |
t-att-name="id" |
| 22 |
t-att-data-value="item[0]" |
| 23 |
t-att-data-index="item_index" |
| 24 |
t-att-id="`${id}_${item[0]}`" |
| 25 |
t-on-change="() => this.onChange(item)" |
| 26 |
/> |
| 27 |
<label class="form-check-label o_form_label" t-att-for="`${id}_${item[0]}`"> |
| 28 |
<img t-attf-src="/hr_holidays/static/src/img/icons/{{item[1]}}" width="48" height="48" /> |
| 29 |
</label> |
| 30 |
</div> |
| 31 |
</t> |
| 32 |
</t> |
| 33 |
</div> |
| 34 |
</t> |
| 35 |
|
| 36 |
</templates> |