forked from MovingBlocks/legacy-website
-
Notifications
You must be signed in to change notification settings - Fork 0
/
mentors.html
252 lines (207 loc) · 8.82 KB
/
mentors.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
---
---
<html>
<head>
<meta charset="utf-8">
<meta name="google-site-verification" content="1Zo5ff2j0ysKtpdf-TvSQW6y2-hoD3ASV1CiR9Bq6-0" />
<meta name="keywords"
content="Terasology, Minecraft, Open, Source, Free, Mahmood, Dhia, Dwarf, Fortress, Dungeon, Keeper, Voxel, Creature, Creatures, Empire, Civilization, Portal, Moving, Blocks" />
<title>GSoC 2020 Mentors list</title>
{% include imports.html %}
<link type="text/css" rel="stylesheet" href="{{ "/css/mentors.css" | prepend: site.baseurl }}"
media="screen,projection" />
<!--Let browser know website is optimized for mobile-->
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
</head>
<body>
{% include nav.html %}
<main>
<div class="slider">
<ul class="slides">
<li>
<img src="/img/ss_1.jpg"> <!-- random image -->
</li>
<li>
<img src="/img/ss_2.jpg"> <!-- random image -->
</li>
<li>
<img src="/img/ss_3.jpg"> <!-- random image -->
</li>
<li>
<img src="/img/ss_4.jpg"> <!-- random image -->
</li>
</ul>
</div>
<div class="section white">
<div class="container">
<div class="card-panel green lighten-3">
<div class="row">
<h1 class="header green-text text-darken-3">
<center>Mentors</center>
</h1>
</div>
<div>
<div class="container" id="container">
<!-- Web Version -->
<div class="row hide-on-med-and-down" id="webhere">
<!-- Cards for Web view will be populated here -->
</div>
<!-- Mobile version -->
<div class="row hide-on-large-only" id="mobilehere">
<!-- Cards for Mobile view will be populated here -->
</div>
</div>
<script>
//set the list_id to id of mentor list in trello board
const list_id = "5eb715b48caa18614425c25e";
function makeCard(image, trelloCard_name = " ", github = " ", Country = " ", TimeZone = " ", description = " ", Label = " ") {
const time = moment.tz(moment(), TimeZone).format('HH:mm [(GMT] Z[)]');
const webcard = `
<div class="col m6">
<div class="card light-green lighten-5">
<div class="card-content black-text">
<img class="img-circle" src=`+ image + `>
<div class="card-text">
<span class="card-title"> ` + trelloCard_name + ` </span>
<a class="waves-effect waves-light btn modal-trigger" href="#modal`+ github + `">More about me!</a>
</div>
</div>
<div class="card-action">
<div class="chip light-green lighten-2">
<img src=/flags/`+ Country + `.svg alt="Flag">
`+ getCountryName(Country) + `
</div>
<div class="chip light-green lighten-2">
Local Time:`+ time + `
</div>
</div>
</div>
</div>`;
const mobilecard = `
<div class="col s12">
<div class="card light-green lighten-5">
<div class="card-content black-text">
<img class="img-circle" src=`+ image + `>
<div class="card-text">
<span class="card-title"> ` + trelloCard_name + ` </span>
<a class="waves-effect waves-light btn modal-trigger" href="#modal`+ github + `">More about me!</a>
</div>
</div>
<div class="card-action">
<div class="chip light-green lighten-2">
<img src=/flags/`+ Country + `.svg alt="Flag">
`+ getCountryName(Country) + `
</div>
<div class="chip light-green lighten-2">
Local Time:`+ time + `
</div>
</div>
</div>
</div>`;
const modal =
`<div id="modal` + github + `" class="modal">
<div class="modal-content">
<div class="black-text">
<h1>`+ trelloCard_name + `</h1>
<h2>Introduction :</h2>
<h4>`+ description + `</h4>
<blockquote>
<div>Github: <a href="https://github.com/`+ github + `">@` + github + `</a></div>
<div>Country:
`+ getCountryName(Country) + `
</div>
<div>
Local Time:
`+ time + `
</div>
</blockquote>
<br/>
<h3>Talk to this mentor about:</h3>
<div>
`+ Label + `
</div>
</div>
</div>
<div class="modal-footer">
<a href="#!" class="modal-action modal-close waves-effect waves-green btn-flat">Close</a>
</div>
</div>`;
$('#webhere').append(webcard);
$('#mobilehere').append(mobilecard);
$('#container').append(modal);
}
$.getJSON('https://api.trello.com/1/lists/' + list_id + '/cards', function (trelloList) {
$.each(trelloList, function (index, trelloCards) {
const url = trelloCards.url + '.json?fields=name,labels,cover,desc&customFields=true&customFieldItems=true'
var Label = '';
var github;
var TimeZone;
var Country;
var description;
$.getJSON(url, function (trelloCard) {
// uncomment following block to store all labels in Label variable (Space Sperated)
var image="/img/profile-placeholder.png";
if(trelloCard.cover.scaled!=undefined){
image = trelloCard.cover.scaled[4].url;}
$.each(trelloCard.labels, function (index, element) {
Label = Label + '<div class="chip light-green lighten-2">' + element.name + '</div> ';
});
description = trelloCard.desc;
$.each(trelloCard.customFieldItems, function (index, customFieldItem) {
if (customFieldItem.value.text != undefined) {
$.each(trelloCard.customFields, function (index2, customField) {
if (customFieldItem.idCustomField == customField.id) {
if (customField.name == "Github") {
github = customFieldItem.value.text;
}
else if (customField.name == "TimeZone") {
TimeZone = customFieldItem.value.text;
}
else if (customField.name == "Country") {
Country = customFieldItem.value.text;
}
}
});
}
});
makeCard(image, trelloCard.name, github, Country, TimeZone, description, Label);
// Init Modal
$(document).ready(function () {
$('.modal').modal();
});
}); //each-card call
});// for each
}); //list call
</script>
</div>
</div>
</div>
</div>
<div class="section grey lighten-3">
<div class="container">
</div>
</div>
<div class="parallax-container">
<div class="parallax"><img src="/img/ss_2.jpg"></div>
</div>
</main>
{% include footer.html %}
</body>
<!-- Filter Feature for mentor cards -->
<!-- <script>
function filter(sortby) {
resetVisibility();
var Filter = document.querySelectorAll("[id*=' " + sortby + " ']");
Array.prototype.forEach.call(Filter, function (node) {
node.style.display = "none";
});
}
function resetVisibility() //makes all columns visible
{
const allColumns = document.getElementsByClassName("column");
for (var i = 0; i < allColumns.length;) {
allColumns[i].style.display = "block";
}
}
</script> -->
</html>