nitweb: rewrite stars display
[nit.git] / share / nitweb / directives / entity / rating.html
1 <h4>Grade this entity</h4>
2
3 <div class='container-fluid'>
4 <div class='col-xs-8'>
5 <dl class='dl-horizontal'>
6 <dt>Feature</dt>
7 <dd>
8 <entity-stars mentity='mentity' dimension='feature' mean='ratings.feature.mean' list='ratings.feature.ratings' user='ratings.feature.user' ratings='ratings' />
9 <p class='text-muted'><i>This entity is useful, usable and has a good API. It helps me getting things done.</i></p>
10 </dd>
11 <dt>Documentation</dt>
12 <dd>
13 <entity-stars mentity='mentity' dimension='doc' mean='ratings.doc.mean' list='ratings.doc.ratings' user='ratings.doc.user' ratings='ratings' />
14 <p class='text-muted'><i>This entity is well documented, the explanations are clear and useful. They help me understand the feature and how to use it.</i></p>
15 </dd>
16 <dt>Examples</dt>
17 <dd>
18 <entity-stars mentity='mentity' dimension='examples' mean='ratings.examples.mean' list='ratings.examples.ratings' user='ratings.examples.user' ratings='ratings' />
19 <p class='text-muted'><i>This entity is provided with examples, they are runnable and free of bugs. They help me understand the feature behavior and how to use it.</i></p>
20 </dd>
21 <dt>Code</dt>
22 <dd>
23 <entity-stars mentity='mentity' dimension='code' mean='ratings.code.mean' list='ratings.code.ratings' user='ratings.code.user' ratings='ratings' />
24 <p class='text-muted'><i>This entity is well coded and respects the Nit standards.</i></p>
25 </dd>
26 </dl>
27 </div>
28 <div class='col-xs-4'>
29 <h1 class='text-center'>
30 <span class='text-danger'>{{ratings.feature.mean + ratings.doc.mean + ratings.examples.mean + ratings.code.mean | number: 1}} / 20</span><br><small>{{ratings.ratings.length}} votes</small>
31 </h1>
32 </div>
33 </div>
34
35 <h4>History</h4>
36
37 <table class='table'>
38 <tr ng-repeat='rating in ratings.ratings | orderBy: "-timestamp"'>
39 <td>{{rating.timestamp * 1000 | date: 'yy/MM/dd hh:mm a'}}</td>
40 <td>
41 <i>{{rating.user ? rating.user : "anon"}}<i>
42 </td>
43 <td>
44 rated the <b>{{rating.dimension}}</b>
45 </td>
46 <td>
47 <span class='stars' ng-repeat='star in [1, 2, 3, 4, 5]'>
48 <span
49 class='star glyphicon'
50 ng-class='star <= rating.rating? "glyphicon-star": "glyphicon-star-empty"' />
51 </span>
52 </td>
53 </tr>
54 </table>