forked from xriley/DevConf-Theme
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathmentee.html
143 lines (127 loc) · 5.76 KB
/
mentee.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
---
permalink: /mentee-details/
---
<!doctype html>
<html lang="pl">
<head>
<!-- Required meta tags -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<!-- Bootstrap CSS -->
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css"
integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh" crossorigin="anonymous">
<title>Azure Community Mentoring Program 2020</title>
<meta name="theme-color" content="#563d7c">
<style>
.bd-placeholder-img {
font-size: 1.125rem;
text-anchor: middle;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}
@media (min-width: 768px) {
.bd-placeholder-img-lg {
font-size: 3.5rem;
}
}
</style>
<script>
function get() {
var code = getParameterByName('code');
var id = getParameterByName('id');
console.log(id);
if (code != null) {
var code = fetch('https://mentoring-func.azurewebsites.net/api/read-mentee?code=' + code + '&id=' + + id).then(handleErrorsRead)
.then(response => response.json())
.then((body) => {
document.getElementById("zgloszenia").innerHTML += '<div id="' + body.Id + '" class="jumbotron mt-3"></div>'
for (var key in body) {
if ((body.hasOwnProperty(key) && key == "Id")) {
document.getElementById(body.Id).innerHTML += '<h4>Zgłoszenie ' + body[key] + '</h4>'
}
if ((body.hasOwnProperty(key)) && key != "Id") {
document.getElementById(body.Id).innerHTML += '<h4>' + key + '</h4><p>' + body[key] + '</p>'
}
}
try { document.getElementById('spinner').remove(); } catch { }
})
.catch(error => showError(error));
} else {
notAuthorized();
}
}
function handleErrorsRead(response) {
if (!response.ok) {
if (response.status == '401') {
notAuthorized();
throw Error();
} else {
throw Error(response.statusText);
}
}
return response;
}
function getParameterByName(name, url) {
if (!url) url = window.location.href;
name = name.replace(/[\[\]]/g, '\\$&');
var regex = new RegExp('[?&]' + name + '(=([^&#]*)|&|#|$)'),
results = regex.exec(url);
if (!results) return null;
if (!results[2]) return '';
return decodeURIComponent(results[2].replace(/\+/g, ' '));
}
function notAuthorized() {
try { document.getElementById('spinner').remove(); } catch { }
document.getElementById('zgloszenia').innerHTML = '<div class="alert alert-danger" role="alert">Użyj własciwego linku albo skontaktuj się z <a href="mailto:kontakt@azurecommunity.pl">organizatorami</a></div>'
}
function showError(error) {
try { document.getElementById('spinner').remove(); } catch{ }
console.dir(error);
if (error != "Error") {
document.getElementById('zgloszenia').innerHTML = '<div class="alert alert-danger" role="alert">' + error + '</div>'
}
}
</script>
<!-- Google Tag Manager -->
<script>(function (w, d, s, l, i) {
w[l] = w[l] || []; w[l].push({
'gtm.start':
new Date().getTime(), event: 'gtm.js'
}); var f = d.getElementsByTagName(s)[0],
j = d.createElement(s), dl = l != 'dataLayer' ? '&l=' + l : ''; j.async = true; j.src =
'https://www.googletagmanager.com/gtm.js?id=' + i + dl; f.parentNode.insertBefore(j, f);
})(window, document, 'script', 'dataLayer', 'GTM-KWCRNJT');</script>
<!-- End Google Tag Manager -->
</head>
<body onload="get()">
<!-- Google Tag Manager (noscript) -->
<noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-KWCRNJT" height="0" width="0"
style="display:none;visibility:hidden"></iframe></noscript>
<!-- End Google Tag Manager (noscript) -->
<div class="container">
<div class="jumbotron mt-3">
<h1>Azure Community Mentoring Program 2020</h1>
</div>
<div class="d-flex justify-content-center" id="spinner">
<div class="spinner-border m-5" role="status" style="width: 4rem; height: 4rem;">
<span class="sr-only">Loading...</span>
</div>
</div>
<section id="zgloszenia">
</section>
</div>
<!-- Optional JavaScript -->
<!-- jQuery first, then Popper.js, then Bootstrap JS -->
<script src="https://code.jquery.com/jquery-3.4.1.slim.min.js"
integrity="sha384-J6qa4849blE2+poT4WnyKhv5vZF5SrPo0iEjwBvKU7imGFAV0wwj1yYfoRSJoZ+n"
crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/popper.js@1.16.0/dist/umd/popper.min.js"
integrity="sha384-Q6E9RHvbIyZFJoft+2mJbHaEWldlvI9IOYy5n3zV9zzTtmI3UksdQRVvoxMfooAo"
crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/js/bootstrap.min.js"
integrity="sha384-wfSDF2E50Y2D1uUdj0O3uMBJnjuUD4Ih7YwaYd1iqfktj0Uod8GCExl3Og8ifwB6"
crossorigin="anonymous"></script>
</body>
</html>