blob: 9f314360a26a05328f3486caf908bc15d9b1e8de (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
|
<?xml version="1.0" encoding="UTF-8"?>
<templates id="template" xml:space="preserve">
<t t-name="portal_rating.rating_stars_static">
<t t-set="val_integer" t-value="Math.floor(val)"/>
<t t-set="val_decimal" t-value="val - val_integer"/>
<t t-set="empty_star" t-value="5 - (val_integer+Math.ceil(val_decimal))"/>
<div class="o_website_rating_static" t-att-style="inline_mode ? 'display:inline' : ''" t-attf-aria-label="#{val} stars on 5" t-attf-title="#{val} stars on 5">
<t t-foreach="_.range(0, val_integer)" t-as="num">
<i class="fa fa-star" role="img"></i>
</t>
<t t-if="val_decimal">
<i class="fa fa-star-half-o" role="img"></i>
</t>
<t t-foreach="_.range(0, empty_star)" t-as="num">
<i class="fa fa-star text-black-25" role="img"></i>
</t>
</div>
</t>
<t t-name="portal_rating.rating_card">
<div class="row o_website_rating_card_container">
<div class="col-lg-3 offset-lg-2" t-if="!_.isEmpty(widget.get('rating_card_values'))">
<p><strong>Average</strong></p>
<div class="o_website_rating_avg text-center">
<h1><t t-esc="widget.get('rating_card_values')['avg']"/></h1>
<t t-call="portal_rating.rating_stars_static">
<t t-set="val" t-value="widget.get('rating_card_values')['avg'] || 0"/>
</t>
<t t-call="portal.chatter_message_count"/>
</div>
</div>
<div class="col-lg-6" t-if="!_.isEmpty(widget.get('rating_card_values'))">
<p><strong>Details</strong></p>
<div class="o_website_rating_progress_bars">
<table class="o_website_rating_progress_table">
<t t-foreach="widget.get('rating_card_values')['percent']" t-as="percent">
<tr class="o_website_rating_select" t-att-data-star="percent['num']" style="opacity: 1">
<td class="o_website_rating_table_star_num" t-att-data-star="percent['num']">
<t t-esc="percent['num']"/> stars
</td>
<td class="o_website_rating_table_progress">
<div class="progress">
<div class="progress-bar o_rating_progressbar" role="progressbar" t-att-aria-valuenow="percent['percent']" aria-valuemin="0" aria-valuemax="100" t-att-style="'width:' + percent['percent'] + '%;'">
</div>
</div>
</td>
<td class="o_website_rating_table_percent">
<strong><t t-esc="Math.round(percent['percent'] * 100) / 100"/>%</strong>
</td>
<td class="o_website_rating_table_reset">
<button class="btn btn-link o_website_rating_select_text" t-att-data-star="percent['num']">
<i class="fa fa-times d-block d-sm-none" role="img" aria-label="Remove Selection"/>
<span class="d-none d-sm-block">Remove Selection</span>
</button>
</td>
</tr>
</t>
</table>
</div>
</div>
</div>
</t>
<t t-name="portal_rating.rating_star_input">
<div class="o_rating_star_card" t-if="widget.options['display_rating']">
<t t-set="val_integer" t-value="Math.floor(default_rating)"/>
<t t-set="val_decimal" t-value="default_rating - val_integer"/>
<t t-set="empty_star" t-value="5 - (val_integer+Math.ceil(val_decimal))"/>
<div class="stars enabled">
<t t-foreach="_.range(0, val_integer)" t-as="num">
<i class="fa fa-star" role="img" aria-label="One star" title="One star"></i>
</t>
<t t-if="val_decimal">
<i class="fa fa-star-half-o" role="img" aria-label="Half a star" title="Half a star"></i>
</t>
<t t-foreach="_.range(0, empty_star)" t-as="num" role="img" t-attf-aria-label="#{empty_star} on 5" t-attf-title="#{empty_star} on 5">
<i class="fa fa-star-o text-black-25"></i>
</t>
</div>
<div class="rate_text">
<span class="badge badge-info"></span>
</div>
<input type="hidden" readonly="readonly" name="rating_value" t-att-value="default_rating || ''"/>
</div>
</t>
</templates>
|