forked from HubSpot/BidHub-WebAdmin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
344 lines (298 loc) · 11.6 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
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
<!DOCTYPE html>
<html ng-app="auctionApp">
<head lang="en">
<meta charset="UTF-8">
<link href='http://fonts.googleapis.com/css?family=Roboto:400,300,100,500' rel='stylesheet' type='text/css'>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.0/angular.min.js"></script>
<script src="controllers.js"></script>
<script src="client.js"></script>
<title>Manage Auction</title>
<style>
body {
margin: 0px;
font-family: 'Roboto', sans-serif;
background: #303030;
}
#container {
padding-top: 20px;
width: 740px;
margin-left: auto;
margin-right: auto;
}
#header {
height: 80px;
line-height: 80px;
text-align: left;
font-weight: 200;
font-size: 26px;
color: #fff;
}
#content {
min-height: 300px;
}
.card {
width: 360px;
background: #515359;
border-radius: 3px;
-webkit-box-shadow: -2px 4px 16px -3px rgba(0,0,0,0.75);
-moz-box-shadow: -2px 4px 16px -3px rgba(0,0,0,0.75);
box-shadow: -2px 4px 16px -3px rgba(0,0,0,0.75);
margin-bottom: 20px;
}
.left {
float: left;
}
.right {
float: right;
}
.header {
height: 30px;
background-color: #669900;
border-top-left-radius: 3px;
border-top-right-radius: 3px;
}
.footer {
height: 10px;
background-color: #669900;
border-bottom-left-radius: 3px;
border-bottom-right-radius: 3px;
}
.image {
width: 360px;
height: 160px;
overflow: hidden;
}
.image img {
width: 360px;
}
.infocontainer {
padding: 10px;
min-height: 50px;
}
.names {
float: left;
}
.title {
font-weight: 200;
color: #fff;
font-size: 22px;
}
.donor {
font-size: 14px;
color: #999;
font-weight: 200;
text-transform: uppercase;
}
.bids {
float: right;
text-align: right;
}
.winningbid {
color: #669900;
font-size: 22px;
}
.description {
color: #fff;
font-weight: 300;
font-size: 13px;
padding: 10px;
min-height: 120px;
max-height: 120px;
overflow: scroll;
}
input {
background: transparent;
border: none;
border-bottom: 1px solid #ccc;
font-family: "Roboto", sans-serif;
font-weight: 200;
font-size: 16px;
padding: 5px;
color: #fff;
}
textarea {
background: transparent;
border: none;
border-bottom: 1px solid #ccc;
font-family: "Roboto", sans-serif;
font-weight: 200;
font-size: 13px;
width: 100%;
min-height: 50px;
color: #fff;
}
::-webkit-input-placeholder {
color: #777;
}
:-moz-placeholder { /* Firefox 18- */
color: #777;
}
::-moz-placeholder { /* Firefox 19+ */
color: #777;
}
:-ms-input-placeholder {
color: #777;
}
.removebutton {
display: none;
}
.card:hover .removebutton {
display: block;
}
</style>
<script>
function showImg() {
$("#newimg").attr("src", $("#imgurl").val());
}
function createItem() {
var newItem = JSON.stringify(
{
"name": $("#itemname").val(),
"donorname": $("#donorname").val(),
"price": parseInt($("#price").val()),
"imageurl": $("#imgurl").val(),
"description": $("#descriptionbody").val()
}
);
$.ajax({
type: "POST",
url: "https://api.parse.com/1/classes/Item",
beforeSend: function(xhr){
xhr.setRequestHeader('X-Parse-Application-Id', '<your app id>');
xhr.setRequestHeader('X-Parse-REST-API-Key', '<your rest api key>');
},
data: newItem,
success: function () {
location.reload();
},
contentType:"application/json; charset=utf-8",
dataType:"json"
});
}
</script>
</head>
<body ng-controller="ItemCardsCtrl">
<div id="container">
<div id="header">
AUCTION MONITORING
</div>
<div id="content">
<div class="card left">
<div class="header" style="background: #999"></div>
<div style="height: 3px; background: #777"></div>
<div style="padding: 25px; color: #fff;">
<table cellPadding="0" cellspacing="10">
<tr>
<td style="text-align: right">
<span class="donor">Raised so far </span></td>
<td><span class="title">{{totalRaised | noFractionCurrency}}</span></td>
</tr>
<tr>
<td style="text-align: right">
<span class="donor">Bid count </span></td>
<td><span class="title">{{bidCount}}</span></td>
</tr>
</table>
<br/>
<span class="title">{{mostPopularBidCount}}</span><br/>
<span class="donor">Most popular by bid count</span>
<br/><br/>
<span class="title">{{mostPopularPrice}}</span><br/>
<span class="donor">Most popular by highest bid</span>
<br/><br/>
<span class="title">{{highestGrossing}}</span><br/>
<span class="donor">Highest Grossing</span>
</div>
<div style="height: 3px; background: #777"></div>
<div class="footer" style="background: #999"></div>
</div>
<div class="card right">
<div class="header" style="background: #999"></div>
<div style="height: 3px; background: #777"></div>
<div style="padding: 25px; color: #fff;">
<table cellPadding="0" cellspacing="10">
<tr>
<td style="text-align: right">
<span class="donor">Number of items </span></td>
<td><span class="title">{{itemCount}}</span></td>
</tr>
<tr>
<td style="text-align: right">
<span class="donor">items with no bids </span></td>
<td><span class="title">{{noBidCount}}</span></td>
</tr>
</table>
<br/>
<div ng-repeat="item in items | orderObjectBy:'gross'">
<span class="title">${{item.gross}}: {{item.name}} <span style="color: #aaa">by {{item.donorname}}</span></span><br/>
<div class="donor" ng-repeat="bidObj in item.bidObjs">${{bidObj.amt}} by {{bidObj.who}}</div>
<br/><br/>
</div>
</div>
<div style="height: 3px; background: #777"></div>
<div class="footer" style="background: #999"></div>
</div>
<!-- OLD CODE FOR ADDING/DISPLAYING/REMOVING ITEMS FROM THE WEB -->
<!--
<div class="card left">
<div class="header" style="background: #999"></div>
<div style="height: 3px; background: #777"></div>
<div class="image" id="imgcontainer" style="text-align: center; position: relative">
<img id="newimg" src="{{item.imageurl}}" style="position: relative" />
<input id="imgurl" type="text" placeholder="image url" style="position: absolute; margin-left: 10px; margin-bottom: 10px; left: 0; bottom: 0; right: 0; margin-top: 70px; background: #515359;" onBlur="showImg()" />
<input type="button" value="submit item"
style="position: absolute; top: 0; right: 0; margin-top: 10px; margin-right: 10px; background: #669900;
border: 1px solid #fff;"
onClick="createItem()"/>
</div>
<div style="height: 1px; background: #aaaaaa"></div>
<div class="infocontainer" style="min-height: 70px;">
<div class="names">
<span class="title"><input id="itemname" type="text" class="title" placeholder="item name. keep it short" style="width: 230px;" /></span><br/>
<span class="donor"><input id="donorname" type="text" class="donor" placeholder="your name. keep it real" style="width: 230px;" /></span>
</div>
<div class="bids">
<span class="winningbid">$<input id="price" type="text" class="winningbid" placeholder="$$" style="width: 40px; margin-left: 5px;"/></span><br/>
<span class="donor">LIST PRICE</span>
</div>
</div>
<div style="height: 1px; background: #aaaaaa"></div>
<div class="description" id="description" style="max-height: 100px; min-height: 100px;">
<textarea id="descriptionbody" style="height: 90px;" placeholder="talk about your item. this can be as long as you want. the reader's attention span is the limit!"></textarea>
</div>
<div style="height: 3px; background: #777"></div>
<div class="footer" style="background: #999"></div>
</div>
<div class="card left" ng-repeat="item in items" ng-class-even="'left'" ng-class-odd="'right'">
<div class="header"></div>
<div style="height: 3px; background: #558800"></div>
<div class="image"style="text-align: center; position: relative">
<img src="{{item.imageurl}}" style="position: relative" />
<input type="button" value="remove item" class="removebutton"
style="position: absolute; top: 0; right: 0; margin-top: 10px; margin-right: 10px; background: #990000;
border: 1px solid #fff;"
ng-click="deleteItem(item)"/>
</div>
<div style="height: 1px; background: #aaaaaa"></div>
<div class="infocontainer">
<div class="names">
<span class="title">{{item.name}}</span><br/>
<span class="donor">{{item.donorname | uppercase}}</span>
</div>
<div class="bids">
<span class="winningbid">${{item.price}}</span><br/>
<span class="donor">LIST PRICE</span>
</div>
</div>
<div style="height: 1px; background: #aaaaaa"></div>
<div class="description">
{{item.description}}
</div>
<div style="height: 3px; background: #558800"></div>
<div class="footer"></div>
</div>-->
</div>
</div>
</body>
</html>