-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmobilepage.html
More file actions
202 lines (159 loc) · 10 KB
/
mobilepage.html
File metadata and controls
202 lines (159 loc) · 10 KB
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
<!DOCTYPE html>
<html>
<head prefix="og: http://ogp.me/ns# fb: http://ogp.me/ns/fb# website: http://ogp.me/ns/fb/benetag#">
<meta property="fb:app_id" content="286512274727203" />
<meta property="og:type" content="website" />
<meta property="og:url" content="{{url}}" />
<meta property="og:title" content="{{name}}" />
<meta property="og:description" content="Made by {{producer.name}}" />
<meta property="og:image" content="{{qr_url}}" />
<meta name="apple-mobile-web-app-capable" content="yes">
<link rel="apple-touch-icon" href="icon.png"/>
<script src="http://code.jquery.com/jquery-1.7.1.min.js"></script>
{% include "styles.html" %}
<title>{{name}} by {{producer.name}} - BeneTag</title>
<script type="text/javascript" src="http://maps.googleapis.com/maps/api/js?sensor=false"></script>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<script src="//connect.facebook.net/en_US/all.js"></script>
<script type="text/javascript">
function initialize() {
{% if latitude and longitude %}
var latlng = new google.maps.LatLng({{latitude}}, {{longitude}});
var userLat;
var userLong;
var factName = '{{factory.name}}';
var factAdd = '{{factory.address}}';
if (navigator.geolocation) // check if browser support this feature or not
{
navigator.geolocation.getCurrentPosition(function(position)
{
userLat = position.coords.latitude;
userLong = position.coords.longitude;
var R = 3959; // miles
var dLat = (userLat-({{latitude}}))*(Math.PI/180);
var dLon = -(userLong-({{longitude}}))*(Math.PI/180);
var lat1 = {{latitude}}*(Math.PI/180);
var lat2 = userLat*(Math.PI/180);
var a = Math.sin(dLat/2) * Math.sin(dLat/2) + Math.sin(dLon/2) * Math.sin(dLon/2) * Math.cos(lat1) * Math.cos(lat2);
var c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1-a));
var d = R * c;
document.getElementById('distance').innerHTML = '<td><div id="distance-div"> <div id="distance-value">' + d.toFixed(1) + ' mi </div> <p id="away"> away</p></div></td> <td id="info" class = "spaced">' + factName + '<br>' + factAdd + '</td>';
}, function()
{
document.getElementById('distance').innerHTML = '<td id="info">' + factName + '<br>' + factAdd + '</td>';
});
}
else {
document.getElementById('distance').innerHTML = '<td id="info">' + factName + '<br>' + factAdd + '</td>';
}
{% endif %}
FB.init({
appId : '286512274727203', // App ID
channelUrl : 'benetag.com/view', // Channel File
status : true, // check login status
cookie : true, // enable cookies to allow the server to access the session
oauth : true, // enable OAuth 2.0
xfbml : true // parse XFBML
});
}
function fbshare() {
FB.login(function(response) {
if (response.authResponse) {
var request = $.ajax({
url: "https://graph.facebook.com/me/benetag:share",
type: "POST",
data: {website : '{{url}}', access_token: response.authResponse.accessToken},
success: function(data) {
},
});
}
}, {scope : 'publish_actions'});
}
</script>
</head>
<body onload="initialize()">
<!-- MAIN PANEL -->
<div>
<!-- panel style is a twitter bootstrap style -->
<!-- SCROLLABLE PANEL -->
<div id="scrollable-panel">
<!-- scrollable and panel styles are new styles -->
<!-- here, content -->
{% include "navbar.html" %}
<table id="productinfo">
{% if has_image %}
<td id="productimagecontainer"><img id="productimage" src="productimage?id={{id}}"></img></td>
{% endif %}
<td id="producttextinfo">
</td>
</table>
<p id="producername"><a href="/viewproducer?id={{producer.key}}">{{producer.name}}</a> </p>
<p id="productname"> {{ name }} </p>
{%if has_badges%}
<hr id="separator-line">
<table id="badges">
{% for badge in badges %}
{%if forloop.counter0|divisibleby:3 %}
<tr>
{%endif%}
<td><img id="badgeimage" src="badgeimage?key={{badge.key}}"></img </td>
{%if forloop.counter|divisibleby:3 %}
</tr>
{%endif%}
{%endfor%}
</table>
{%endif%}
<hr id="separator-line">
<p id="section-heading">Other info:</p>
<p id="price"> $25.00 </p>
<table id="buy-buttons">
<tr>
<td><button class="btn buy" id="sugretailer">Cheapest at Amazon</button></td>
<td><button class="btn buy" id="other">11 others</button></td>
</tr>
</table>
<p id="info"> super soft tri-blend fabric <br> sizes S-XXL </p>
{% if factory %}
<hr id="separator-line">
<p id="section-heading">Manufactured at:</p>
<table id="factory-table">
<tr id = "distance">
</tr>
</table>
<p id="moreinfo"> <a href="/viewfactory?id={{factory.key}}">see more info ></a></p>
{% endif %}
<!-- {% if latitude and longitude %}
<div id="map_canvas"></div>
{% endif %} -->
<hr id="separator-line">
<p id="section-heading">Made by:</p>
<p id="workerstory">Dave and his 10 robot friends.</p>
<p id="moreinfo"> <a href="/viewproductworkers?id={{id}}">see more info ></a></p>
{% if can_edit %}
<small><a href="/editproduct?id={{id}}">Edit your product's profile</a></small>
{% endif %}
{% if in_closet %}
<small>In your closet! (<a href="/removefromcloset?id={{id}}">Remove</a>)</small>
{% endif %}
{% if add_closet %}
<small>(<a href="/addtocloset?id={{id}}">Add to closet</a>)</small>
{% endif %}
<hr id="separator-line">
<div id="social-buttons">
<div><button class="btn secondary" id="fbshare" onclick="fbshare()">Share on Facebook</img></button></div>
<div id="social-row"><a href="https://twitter.com/share" class="twitter-share-button" data-size="large" data-hashtags="BeneTag">Tweet</a>
</div>
<div id="social-row"><g:plusone></g:plusone></div>
<div id="social-row"><a href="http://pinterest.com/pin/create/button/?url={{url}} &media={{qr_url}}&description=Made by {{producer.name}}" class="pin-it-button" count-layout="horizontal"><img border="0" src="//assets.pinterest.com/images/PinExt.png" title="Pin It" /></a></div>
</div>
<div id="fb-root"></div>
<hr id="separator-line">
<p id = "comments-link"> 59 reviews > </p>
<script type="text/javascript" src="//assets.pinterest.com/js/pinit.js"></script>
<script type="text/javascript" src="https://apis.google.com/js/plusone.js"></script>
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="//platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script>
</div>
</div>
{% include "footer.html" %}
</body>
</html>