summaryrefslogtreecommitdiff
path: root/addons/web/static/src/xml/base.xml
diff options
context:
space:
mode:
authorMathieu Duckerts-Antoine <dam@odoo.com>2018-08-23 17:38:41 +0200
committerMathieu Duckerts-Antoine <dam@odoo.com>2018-09-04 17:37:14 +0200
commitc4557580ef28be701b20646644f190a7949fd1bb (patch)
tree7387e94b558a6e52fc13699047f4f18bf5528646 /addons/web/static/src/xml/base.xml
parent5510d808b8f1f33720412f48bbe31bda2df0e5ec (diff)
[IMP] web: review time range menu rendering
This commit changes two things in the time range menu appearance: - the order of range options - the spacing between them (now two different groups are separated by an empty lines) Some tests had to be changed accordingly.
Diffstat (limited to 'addons/web/static/src/xml/base.xml')
-rw-r--r--addons/web/static/src/xml/base.xml31
1 files changed, 18 insertions, 13 deletions
diff --git a/addons/web/static/src/xml/base.xml b/addons/web/static/src/xml/base.xml
index 93f2a044c07..04ad1907f0b 100644
--- a/addons/web/static/src/xml/base.xml
+++ b/addons/web/static/src/xml/base.xml
@@ -1136,7 +1136,7 @@
</button>
<div class="dropdown-menu o_dropdown_menu o_time_range_menu" role="menu">
<div class="dropdown-item-text">
- <label for="date_field_selector">Date Field</label>
+ <label for="date_field_selector">Based On</label>
<select id="date_field_selector" class="o_input o_date_field_selector">
<t t-foreach="widget.dateFields" t-as="field">
<t t-if="widget.dateField.name === field.name">
@@ -1153,19 +1153,24 @@
</select>
</div>
<div class="dropdown-item-text">
- <label for="time_range_selector">Date Range</label>
+ <label for="time_range_selector">Range</label>
<select id="time_range_selector" class="o_input o_time_range_selector">
- <t t-foreach="widget.periodOptions" t-as="option">
- <t t-if="widget.timeRangeId === option.optionId">
- <option t-att-value="option.optionId" selected="selected">
- <t t-esc="option.description"/>
- </option>
- </t>
- <t t-else="">
- <option t-att-value="option.optionId">
- <t t-esc="option.description"/>
- </option>
- </t>
+ <t t-foreach="widget.periodGroups" t-as="group">
+ <optgroup t-if="group !== 1"/>
+ <t t-foreach="widget.periodOptions" t-as="option">
+ <t t-if="option.groupId === group">
+ <t t-if="widget.timeRangeId === option.optionId">
+ <option t-att-value="option.optionId" selected="selected">
+ <t t-esc="option.description"/>
+ </option>
+ </t>
+ <t t-else="">
+ <option t-att-value="option.optionId">
+ <t t-esc="option.description"/>
+ </option>
+ </t>
+ </t>
+ </t>
</t>
</select>
</div>