-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
129 lines (110 loc) · 4.41 KB
/
index.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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
<!DOCTYPE html>
<html ng-app="stockbook">
<head>
<title>Stock Book</title>
<meta charset="UTF-8">
<link rel="stylesheet" href="css/bootstrap.min.css">
<link rel="stylesheet" href="css/jquery.datetimepicker.css">
<link rel="stylesheet" href="css/ngDialog.min.css">
<link rel="stylesheet" href="css/ngDialog-theme-default.min.css">
<link rel="stylesheet" href="css/style.css">
</head>
<body ng-controller="StockListCtrl">
<div class="spinner">
<div class="bounce1"></div>
<div class="bounce2"></div>
<div class="bounce3"></div>
</div>
<div id="all">
<div id="sidebar">
<!-- new stock input -->
<div class="input-group">
<input type="text" class="form-control" placeholder="輸入股票名稱" ng-model="newStockName">
<span class="input-group-btn">
<button class="btn btn-default" type="button" ng-click="addStock(newStockName)"><i class="glyphicon glyphicon-plus"></i></button>
</span>
</div>
<!-- new stock input end -->
<hr>
<!-- stock list -->
<div>
<div ng-repeat="stock in stocks">
<p class="stock-link" ng-click="showContent(stock)" ng-class="{'stock-link-active': stock.name == selectedStock}"># {{ stock.name }}</p>
</div>
</div>
<!-- stock list end -->
</div>
<div id="container">
<div id="wrapper" ng-hide="isEmpty">
<!-- new record input -->
<div id="input">
<form class="form-inline" role="form" ng-submit="addRecord()">
<div class="form-group">
<input type="text" id="datepicker" class="form-control" placeholder="日期" ng-model="date">
</div>
<div class="form-group">
<select class="form-control" ng-model="action" ng-options="action for action in actions"><option></option></select>
</div>
<div class="form-group">
<input type="number" class="form-control" placeholder="股數" ng-model="share">
</div>
<div class="form-group">
<input type="number" class="form-control" placeholder="單價" ng-model="price">
</div>
<div class="form-group">
<input type="number" class="form-control" placeholder="總額" ng-model="amount">
</div>
<button type="submit" class="btn btn-default"><i class="glyphicon glyphicon-plus"></i></button>
</form>
<button id="delete-stock-btn" class="btn btn-danger" ng-click="deleteStock(selectedStock)"><i class="glyphicon glyphicon-trash"></i></button>
</div>
<!-- new record input end -->
<!-- records table -->
<div id="content">
<div class="info">
<div ng-model="currentPrice">目前股價: {{ currentPrice }}</div>
<div ng-model="change">漲跌幅度: {{ change }}</div>
<div ng-model="totalShare">持有股數: {{ totalShare }}</div>
<div ng-model="totalAmount">投資金額: {{ totalAmount }}</div>
</div>
<table class="table table-hover">
<thead>
<tr>
<th>日期</th>
<th>類型</th>
<th>股數</th>
<th>單價</th>
<th>總額</th>
<th></th>
</tr>
</thead>
<tbody>
<tr ng-repeat="record in records">
<td>{{ record.date }}</td>
<td>{{ record.action }}</td>
<td>{{ record.share }}</td>
<td>{{ record.price }}</td>
<td>{{ record.amount }}</td>
<td>
<button class="btn btn-danger" ng-click="deleteRecord(record._id)"><i class="glyphicon glyphicon-trash"></i></button>
</td>
</tr>
</tbody>
</table>
</div>
<!-- records table end -->
</div>
<div id="message" ng-show="isEmpty">
請在視窗左上角新增一個股票開始!
</div>
</div>
</div>
<script>
window.$ = window.jQuery = require("./js/jquery-1.11.3.min.js");
</script>
<script type="text/javascript" src="js/angular.min.js"></script>
<script type="text/javascript" src="js/ngDialog.min.js"></script>
<script type="text/javascript" src="js/jquery.datetimepicker.js"></script>
<script type="text/javascript" src="js/script.js"></script>
</body>
</html>