forked from fizzed/template-benchmark
-
Notifications
You must be signed in to change notification settings - Fork 0
/
stocks.HtTemplate.html
97 lines (72 loc) · 1.83 KB
/
stocks.HtTemplate.html
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
88
89
90
91
92
93
94
95
96
97
<!DOCTYPE html>
<html>
<head>
<title>Stock Prices</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<meta http-equiv="Content-Style-Type" content="text/css"/>
<meta http-equiv="Content-Script-Type" content="text/javascript"/>
<meta ht-import="com.mitchellbosecke.benchmark.model.Stock, java.util.*">
<meta ht-variables="List<Stock>, items">
<link rel="shortcut icon" href="/images/favicon.ico"/>
<link rel="stylesheet" type="text/css" href="/css/style.css" media="all"/>
<script type="text/javascript" src="/js/util.js"></script>
<style type="text/css">
/*<![CDATA[*/
body {
color: #333333;
line-height: 150%;
}
thead {
font-weight: bold;
background-color: #CCCCCC;
}
.odd {
background-color: #FFCCCC;
}
.even {
background-color: #CCCCFF;
}
.minus {
color: #FF0000;
}
/*]]>*/
</style>
</head>
<body>
<h1>Stock Prices</h1>
<table>
<thead>
<tr>
<th>#</th>
<th>symbol</th>
<th>name</th>
<th>price</th>
<th>change</th>
<th>ratio</th>
</tr>
</thead>
<tbody>
<tr ht-for="index,item in @items" ht-class="((index+1) % 2 ==0)?'even':'odd'">
<td>{{index+1}}</td>
<td>
<a ht-href="'/stocks/'+item.getSymbol()">{{item.getSymbol()}}</a>
</td>
<td>
<a ht-href="item.getUrl()">{{item.getName()}}</a>
</td>
<td>
<strong>{{item.getPrice()}}</strong>
</td>
<td ht-if="item.getChange() < 0" class="minus">{{item.getChange()}}
</td>
<td ht-else>{{item.getChange()}}
</td>
<td ht-if="item.getRatio() < 0" class="minus">{{item.getRatio()}}
</td>
<td ht-else>{{item.getRatio()}}
</td>
</tr>
</tbody>
</table>
</body>
</html>