-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
208 lines (180 loc) · 6.88 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
<!DOCTYPE html>
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 8]> <html class="no-js lt-ie9"> <![endif]-->
<!--[if gt IE 8]><!-->
<script type='text/javascript'
src='https://cdn.firebase.com/v0/firebase-auth-client.js'>
</script>
<script src="http://code.jquery.com/jquery-1.9.1.min.js"></script>
<script type='text/javascript'>
function userCreated(userid, successful) {
if(!successful) {
console.log('user ' + userid + ' already existed')
}else {
console.log('user ' + userid + ' just created')
}
};
function facebookLogin(){
var reqwipURL = 'https://reqwip-launch.firebaseio.com/';
var chatRef = new Firebase(reqwipURL);
var authClient = new FirebaseAuthClient(chatRef, function(error, user) {
if (error) {
// an error occurred while attempting login
console.log(error);
} else if (user) {
// user authenticated with Firebase
console.log('User ID: ' + user.id + ', Provider: ' + user.provider);
var reqwipUsersURL = reqwipURL + 'users';
var userRef = new Firebase(reqwipUsersURL);
var userData= { "id": user.id, "provider": user.provider};
userRef.child(user.id).transaction(
function(currentUserData) {
if(currentUserData == null) {
return userData;
}
},
function(error, committed) {
userCreated(user.id, committed);
}
);
} else {
// user is logged out
}});
authClient.login('facebook');
};
</script>
<html class="no-js">
<!--<![endif]-->
<head>
<meta charset="utf-8" />
<!-- Always force latest IE rendering engine (even in intranet) & Chrome Frame
Remove this if you use the .htaccess -->
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<title>User Board</title>
<meta name="description" content="" />
<meta name="author" content="Jonathan" />
<meta name="viewport" content="width=device-width" />
<!-- Replace favicon.ico & apple-touch-icon.png in the root of your domain and delete these references -->
<link rel="stylesheet" href="css/bootstrap.min.css" media="screen" />
<link rel="stylesheet" href="css/bootstrap-responsive.min.css" />
<link href='http://fonts.googleapis.com/css?family=Noto+Sans:400,700' rel='stylesheet' type='text/css'>
<!-- Custom css -->
<link rel="stylesheet" href="css/main.css" />
<link rel="shortcut icon" href="/favicon.ico" />
<link rel="apple-touch-icon" href="/apple-touch-icon.png" />
<script data-main="js/main" src="js/require.js"></script>
</head>
<body>
<!--[if lt IE 7]>
<p class="chromeframe">You are using an <strong>outdated</strong> browser. Please <a href="http://browsehappy.com/">upgrade your browser</a> or <a href="http://www.google.com/chromeframe/?redirect=true">activate Google Chrome Frame</a> to improve your experience.</p>
<![endif]-->
<div class="container-fluid">
<header>
<div class="navbar navbar-fixed-top">
<div class="navbar-inner">
<ul class="nav">
<li><a href="#">My Account</a></li>
<li><a href="#" id="facebook-auth-login" onclick="facebookLogin()">Log In</a></li>
</ul>
<a class="logo pull-right" href="/"><img src="img/logo.png"></a>
</div>
</div>
</header>
<div class="row-fluid">
<div id="content">
</div>
</div>
<footer>
</footer>
</div>
<div id="page-loader">Loading page...</div>
<!-- Modal -->
<div id="myModal" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
</div>
<script>
/*
var _gaq=[['_setAccount','UA-XXXXX-X'],['_trackPageview']];
(function(d,t){var g=d.createElement(t),s=d.getElementsByTagName(t)[0];
g.src=('https:'==location.protocol?'//ssl':'//www')+'.google-analytics.com/ga.js';
s.parentNode.insertBefore(g,s)}(document,'script'));
*/
</script>
<!-- Homepage -->
<script type="text/template" id="template-homepage">
<div class="home">
<h1>Buy and Sell <br />Cycling and Triathlon Gear <br />With Your Community!</h1>
<div class="action-bar">
<a id="listing-results" class="pull-right">Find Gear</a>
<a id="list-item" class="pull-left">Sell Gear</a>
</div>
</div>
<div class="sign-up">
<a href="#">Sign up</a> or <a href="#">Log in</a> using Facebook
</div>
</script>
<!-- Listing -->
<script type="text/template" id="template-listing">
<div class="secondary-nav">
<button type="button" id="back" class="btn btn-black">Back to Gear</button>
<span class="pull-right price">$<%= price %></span>
</div>
<span class="thumbnail individual-listing" data-id="<%= id %>">
<h4><%= title %></h4>
<img src="<%= listingPicture %>" alt="" />
<div class="inner">
<dl class="dl-horizontal">
<dt>Description: </dt><dd><%= description %></dd>
<dt>Condition Rating:</dt><dd> <%= condition %></dd>
<dt>Location:</dt><dd> <%= location %></dd>
<iframe width="425" height="350" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="https://maps.google.com/maps?q=<%= location.replace(/ /g, '+') %>&ie=UTF8&hq=&hnear=<%= location.replace(/ /g, '+') %>&output=embed"></iframe><br />
</dl>
<a class="btn btn-blue" href="tel:<%= phone %>">Contact seller</a>
<div class="action-offer">
<button type="button" class="btn btn-green btn-large">BUY IT!</button>
</div>
</div>
</span>
</script>
<!-- Listing Hit -->
<script type="text/template" id="template-listing-hit">
<a class="thumbnail" data-id="<%= id %>" ><li>
<div><img src="<%= listingPicture %>" alt=""></div>
<h4><%= title %></h4>
<h5>$<%= price %></h5>
<button class="btn btn-blue" type="button">View</button>
</li></a>
</script>
<script type="text/template" id="user-template">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">
×
</button>
<h3 id="myModalLabel">Modal header <%- name %></h3>
</div>
<div class="modal-body">
<div class="view">
<a class="toggle"><%- email %></label>
</div>
<input class="edit" type="text" data-key="email" value="<%- email %>" />
</div>
<div class="modal-footer">
<button class="btn" data-dismiss="modal" aria-hidden="true">
Close
</button>
<button class="btn btn-primary">
Save changes
</button>
</div>
</script>
<script type="text/template" id="user-list-template">
<a class="thumbnail" data-id="<%= id %>" data-toggle="modal" data-target="#myModal"><li>
<img src="<%= profile_picture %>" alt="">
<h4><%= name %></h4>
<h5><%= participant_role %></h5>
<h5><%= email %></h5>
</li></a>
</script>
<!-- <img src="http://www.gravatar.com/avatar/9e029d00d3a3173b7005527df415f736?s=180" alt=""> -->
</body>
</html>