-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmeetup-card.html
50 lines (36 loc) · 1.47 KB
/
meetup-card.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
<link rel="import" href="../paper-checkbox/paper-checkbox.html">
<polymer-element name="meetup-card" attributes="meetup hideDescription">
<template>
<link rel="stylesheet" href="styles/meetup-card.css">
<div class="attendeecard" layout center vertical>
<div id="name">
<a href="{{meetup.event_url}}">{{meetup.name}}</a>
</div>
<div>
<p id="meetupDate"></p>
<p>Current Headcount: {{meetup.headcount}}</p>
<p id="waitlistCount">Current Waitlist Count: {{meetup.waitlist_count}}</p>
</div>
<div id="descriptionContainer">
Show description
<paper-checkbox id="showDetailCheckbox" on-click="{{showDetail}}"></paper-checkbox>
<div id="description" hidden></div>
</div>
<br /><br />
</div>
</template>
<script>
var noDescription = "No description has been added yet for this event.";
Polymer({
ready: function() {
this.injectBoundHTML(this.meetup.description || noDescription, this.$.description);
this.$.descriptionContainer.hidden = this.hideDescription;
this.$.meetupDate.innerHTML = "When: " + new Date(this.meetup.time);
this.$.waitlistCount.hidden = this.meetup.waitlist_count === 0;
},
showDetail: function (){
this.$.description.hidden = this.$.showDetailCheckbox.checked;
}
});
</script>
</polymer-element>