This repository has been archived by the owner on May 30, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmeetups.js
55 lines (49 loc) · 2.21 KB
/
meetups.js
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
var meetups = [
{ id: 'Docker-Quebec-Meetup', name: 'Docker Québec' },
{ id: 'AzureQC', name: 'Communauté Microsoft Azure Québec' },
{ id: 'Quebec-City-HashiCorp-User-Group', name: 'Quebec City HashiCorp User Group' },
{ id: 'DotNet-Quebec', name: 'DotNet Quebec' },
{ id: 'Ansible-Quebec', name: 'Ansible Québec' }
];
var events = [];
$.each(meetups, function() {
$("#icons").append('<div class="col-md-3">'
+ '<div class="card mb-3">'
// + '<div style="background-image: url(meetups/'+this.id+'.png); background-position: bottom; background-repeat: repeat;"></div>'
+ '<img class="card-img-top" style="width: auto; height: auto;max-width: 100%;max-height: 120px" src="meetups/' + this.id + '.png" alt="' + this.name + ' logo" />'
+ '<div class="card-body">'
+ '<h5 class="card-title">' + this.name + '</h5>'
+ '<a href="https://www.meetup.com/' + this.id + '/" class="btn btn-primary">Plus d\'information</a>'
+ '</div>'
+ '</div>'
+ '</div>');
// + "<span class='meetup-title'><a class='border-0' href='https://www.meetup.com/"+this.id+"/'>"+this.name+"</a></span></div>" );
$.getScript("https://api.meetup.com/"+this.id+"/events?fields=featured_photo&callback=addEvents");
});
addEvents = function(json) {
$.each(json.data, function() {
var pos = 0;
while (pos < events.length) {
if (events[pos].time >= this.time) {
break;
}
pos++;
}
events.splice(pos,0, this);
$('#events li:eq('+pos+')').after(
"<li class='col-md-4'>"
+ "<div class='card mb-4 box-shadow'>"
+ "<img class='card-img-top' >"
+ "<img class='card-img-top' style='height: 180px; width: 100%; display: block;' src='meetups/"+ this.group.urlname + ".png'>"
+ "<div class='card-body'>"
+ "<h5 class='card-title'>"+this.name+"</h5>"
+ "<h6 class='card-subtitle'><i class='far fa-calendar'></i> "+this.local_date+"</h6>"
+ "<div class='card-text'>"
+ this.description
+ "</div>"
+ "<div class='d-flex justify-content-between align-items-center'>"
+ "<a href='"+this.link+"'>En savoir plus ...</a>"
+ "</div></div></div>"
+ "</li>");
});
}