-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
executable file
·334 lines (270 loc) · 10.8 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
<html>
<head>
<meta name='viewport' content='content="width=device-width, maximum-scale=1.0, minimum-scale=1.0, initial-scale=1.0' />
<!-- prototyper requires JS -->
<script type="text/javascript" src="bower_components/jquery/dist/jquery.min.js"></script>
<script type="text/javascript" src="bower_components/ractive/ractive.js"></script>
<script type="text/javascript" src="bower_components/moment/moment.js"></script>
<script type="text/javascript" src="bower_components/jquery-waypoints/waypoints.min.js"></script>
<script type="text/javascript" src="js/helpers_ractive.js"></script>
<script type="text/javascript" src="js/gimme.js"></script>
<script type="text/javascript" src="js/extras.js"></script>
<script type="text/javascript" src="js/jquery-ajax-localstorage-cache.js"></script><!-- avoid repeated ajax calls -->
<link href="css/whitney.css" type="text/css" rel="stylesheet" /> <!-- whitney will get bowerized -->
<link href="css/patch.css" type="text/css" rel="stylesheet" /> <!-- this includes sassquatch -->
<!-- page specific stuff -->
<link href="css/home.css" type="text/css" rel="stylesheet" />
<script type="text/javascript" src="js/demo_groups.js"></script>
<link rel="stylesheet" type="text/css" href="css/calendario.css" />
<script type="text/javascript" src="components/Calendario/js/jquery.calendario.js"></script>
<link rel="stylesheet" type="text/css" href="components/ElegantIcons/style.css" />
</head>
<body>
<script type="text/html" id="main-template">
<!-- screen start -->
<div class="doc-stripe" id="groupstuff">
<!-- header -->
<div class="fixflex extended-visible" id="navbar-group">
<div class="fix clickable" style="padding: 8px 8px 8px 0;">
<div class="arrow_carrot-left" style="font-size: 32px; line-height: 18px;"></div>
</div>
<div class="flex align-center" style="padding: 8px;">
<h4>{{group.name}}</h4>
</div>
<div class="fix clickable" id="action-search" style="padding: 8px;">
<div class="icon_cog" style="font-size: 18px; line-height: 18px;"></div>
</div>
</div>
<div id="groupheader" style="position: relative; overflow: hidden; border-bottom: 1px solid rgba(0,0,0,1); background-image: url({{banner}}); background-size: cover; background-position: center center;">
<div class="nametag-photo inverted" style="background: transparent; height: 100%;">
<div class="nametag-photo-name">
<h1>{{group.name}}</h1>
<h4 class="muted margin-bottom">We're {{helpers.numberFormat(group.members)}} {{group.who}} </h4>
</div>
</div>
</div>
</div>
<div id="header-bottom"></div>
<div class="doc-stripe bg-black inverted"><div class="doc-bounds">
<h3>Group info</h3>
<p><a href="http://www.meetup.com/meetup_api/docs/2/groups/">http://www.meetup.com/meetup_api/docs/2/groups/</a>
<p class="margin-minimal">Founded {{helpers.dateFormat(group.created, "MMMM YYYY")}}</p>
<p class="margin-minimal">42 Meetups and counting</p>
<p>
<!-- API does not give org photo, so we have to fake it -->
Organized by {{group.organizer.name}}
<span class="avatar avatar-30 clickable" style="background-image: url('http://api.randomuser.me/0.3/portraits/women/1.jpg'); margin-bottom: 0; margin-left: 2px; vertical-align: middle; width: 22px; height: 22px; -webkit-filter: grayscale(100%);"></span>
</p>
{{{group.description}}}
</div></div>
<div class="doc-stripe"><div class="doc-bounds">
<h3>Members</h3>
<p><a href="http://www.meetup.com/meetup_api/docs/2/members/">http://www.meetup.com/meetup_api/docs/2/members/</a></p>
<ul class="blockList has6 has4-at-medium has2-at-handheld" data-count="{{group.members}}">
{{#members}}
<li>
<div class="avatar avatar-55 margin-none" style="background-image: url({{photo}});"></div>
<br />{{name}}
</li>
{{/members}}
</ul>
</div></div>
<div class="doc-stripe"><div class="doc-bounds">
<h3>Events</h3>
<p><a href="http://www.meetup.com/meetup_api/docs/2/events/">http://www.meetup.com/meetup_api/docs/2/events/</a></p>
<ul class="dividedList">
{{#events}}
<li>
<p class="margin-none">{{helpers.dateFormat(time, "dddd, MMM D [at] h:mma")}}</p>
<h4 class="margin-minimal">{{name}}</h4>
<p class="small">{{helpers.numberFormat(yes_rsvp_count)}} {{group.who}} going</p>
</li>
{{/events}}
</ul>
</div></div>
<div class="doc-stripe"><div class="doc-bounds">
<h3>Calendario JS rendered calendar for events</h3>
<p>It's real data!</p>
<div class="calendar-wrapper calendar-mini hide-at-medium" id="mini-calendar">
<div class="custom-header">
<span class="custom-month"></span>
<span class="custom-year"></span>
<span class="custom-prev clickable arrow_carrot-left"></span>
<span class="custom-next clickable arrow_carrot-right"></span>
</div>
<div class="fc-calendar-container"></div>
</div>
</div></div>
<div class="doc-stripe"><div class="doc-bounds">
<!-- discussion -->
<h3>Members</h3>
<p>Message board API with faked photos + replies <a href="http://www.meetup.com/meetup_api/docs/:urlname/boards/:bid/discussions/">http://www.meetup.com/meetup_api/docs/:urlname/boards/:bid/discussions/</a></p>
<ul class="dividedList">
{{#discussions}}
{{#if started_by.name}}
<li>
<div class="figureset">
<div class="figureset-figure">
<div class="avatar avatar-55 margin-none clickable" style="background-image: url('{{started_by.photo}}')"></div>
</div>
<div class="figureset-description">
<h4>{{started_by.name}}</h4>
<p class="margin-minimal">{{helpers.truncate(body, 400)}}</p>
<p class="small">
{{#if likes}}
<strong>{{likes}} likes</strong> ·
{{/if}}
<a href="">Like</a> ·
<a href="">Comment</a> ·
<span class="less">{{helpers.dateRelative(created)}}</span>
</p>
{{#if replies}}
<div class="replies">
{{#replies}}
<div class="figureset">
<div class="figureset-figure">
<div class="avatar avatar-35 margin-none clickable" style="background-image: url('{{photo}}')"></div>
</div>
<div class="figureset-description">
<h4>{{name}}</h4>
<p class="margin-minimal">{{body}}</p>
<p class="small">
{{#if likes}}
<strong>{{likes}} likes</strong> ·
{{/if}}
<a href="">Like</a> ·
<a href="">Comment</a> ·
<span class="less">{{helpers.dateRelative(../created)}}</span>
</p>
</div>
</div>
{{/replies}}
</div>
{{/if}}
</div>
</div>
</li>
{{/if}}
{{/discussions}}
</ul>
</div></div>
<div class="doc-stripe bg-gray"><div class="doc-bounds">
<h3 class="margin-minimal">Members of this group are also in</h3>
<ul class="blockList has5" style="overflow-y: auto; white-space: nowrap; -webkit-overflow-scrolling: touch;">
{{#groups}}
<li style="min-width: 200px;">
<div class="doc-box clickable">
<div class="nametag-photo" style="background-image: url({{photo}})"><div class="nametag-photo-name">
<div class="doc-content inverted">
<h4 class="margin-minimal padding-none" style="white-space: normal;">{{name}}</h4>
</div>
</div></div>
</div>
<!-- no </li> tag to avoid whitespace -->
{{/groups}}
</ul>
</div></div>
</script>
<script type="text/javascript">
$(function(){
/*
* Uncomment the data you want -- it will be available in the template
* Check out the Meetup API docs for a list of fields to use in the template
* http://www.meetup.com/meetup_api/docs/
*
* A few notes:
* -- You can specify any field supported by the API
* -- You can leave every field unspecified except "gimme" -- something random/fun will be picked for you.
*/
/* Add your own pre-rendering JS here */
function getHashParams() {
var hashParams = {};
var e, a = /\+/g,
// Regex for replacing addition symbol with a space
r = /([^&;=]+)=?([^&;]*)/g,
d = function(s) {
return decodeURIComponent(s.replace(a, " "));
},
q = window.location.hash.substring(1);
while (e = r.exec(q))
hashParams[d(e[1])] = d(e[2]);
return hashParams;
}
var opts = getHashParams();
/*
var shoppingList = [
//{"gimme": "open_events"},
//{"gimme": "dates_with_open_events"},
//{"gimme": "event"},
//{"gimme": "rsvps"},
//{"gimme": "event_comments"},
//{"gimme": "photo_albums"},
//{"gimme": "photos"},
//{"gimme": "profile"},
//{"gimme": "categories"},
//{"gimme": "groups", "page": 5},
//{"gimme": "group", "group_id": 1227102},
//{"gimme": "events", "page": 15, "group_id": 1227102},
//{"gimme": "members", "page": 40, "group_id": 1227102},
//{"gimme": "discussions", "page": 9, "urlkey": "shutterbugexcursions", "board_id": 854675}
];
*/
// Rather than just one shoppingList
// we're using different shoppingLists in demo_groups.js
// you can pick one by adding #group=0, #group=1, #group=2, etc to the url
var demo = opts.group || 0;
var shoppingList = DEMO_GROUPS[demo].shoppingList;
var extraContext = $.extend( DEMO_GROUPS[demo].extraContext, {"opts": opts} ); // anything else to add to the handlebars context?
// Let's go!
var gme = new Gimme(shoppingList, function(){
var ractive = new Ractive( {el: 'body', template: '#main-template', data: $.extend(this.context, extraContext) });
defaultRenderCompleteActions(); // do standard javascript magicks
//-------------- HEADER --------------
$('#header-bottom').waypoint({
handler: function(direction) {
if(direction == 'down'){
$('#navbar-group').removeClass('extended-visible');
}
else{
$('#navbar-group').addClass('extended-visible');
}
}
});
// -------------- CALENDAR ---------------
// parse events into calendario-style data
// TODO support multiple events per day
var cal_events = {};
for(var i = 0; i < this.context.events.length; i++){
var ev = this.context.events[i];
var ev_date = moment( ev.time ).format("MM-DD-YYYY");
cal_events[ev_date] = "<div>"+ev.name+"</div>";
}
// render calendario
function setup_calendar($el, opts){
var $cal = $el.find(".fc-calendar-container:first");
var cal = $cal.calendario( opts );
console.dir(cal);
var $month = $el.find( '.custom-month' ).html( cal.getMonthName() );
var $year = $el.find( '.custom-year' ).html( cal.getYear() );
$el.find( '.custom-next' ).on( 'click', function() {
cal.gotoNextMonth( updateMonthYear );
} );
$el.find( '.custom-prev' ).on( 'click', function() {
cal.gotoPreviousMonth( updateMonthYear );
} );
function updateMonthYear() {
$month.html( cal.getMonthName() );
$year.html( cal.getYear() );
}
return cal;
}
setup_calendar( $( '#mini-calendar' ), {
caldata : cal_events,
displayWeekAbbr : true
});
}, extraContext);
});
</script>
<div id="template-holder"></div>
</body>
</html>