-
Notifications
You must be signed in to change notification settings - Fork 0
/
template_detailed_user.html
91 lines (78 loc) · 2.1 KB
/
template_detailed_user.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
<!DOCTYPE html>
<html>
<head>
<script src="../../report/toverview/js/pure.js"></script>
</head>
<body>
<div class="templateUser">
<div class="panel">
<div class="panel-heading" id="kopf">
<h3 class="panel-title"></h3>
</div>
<div class="panel-body">
<div class="well">
<div id="id"></div>
<div id="username"></div>
<div id="email"></div>
<div id="sprache"></div>
</div>
</div>
</div>
</div>
<script>
$
.ajax({
url : "../../report/toverview/rest/router.php/user/id/#ID#",
context : document.body
})
.done(
function(res) {
directive = {
'.panel-title' : function(a) {
//console.log(a.context);
a = a.context;
var userID = a.id;
var vorname = a.firstname;
var nachname = a.lastname;
var userLink = "<a href='../../user/profile.php?id=" + userID + "'>" + vorname
+ " " + nachname + "</a>";
return userLink;
},
'#kopf@style' : function (a) {
a = a.context;
var temp = "tu-darmstadt.de";
var email = a.email;
if(email.indexOf(temp) < 1) {
return "background-color: #F5A300;";
}
else {
return "background-color: #99A604;";
}
},
'#id' : function(a) {
a = a.context;
return "User ID: " + a.id;
},
'#username' : function(a) {
a = a.context;
return "Benutzername: " + a.username;
},
'#email' : function (a) {
a = a.context;
var email = a.email;
return "Email: " + "<a href='mailto:" + email + "'>" + email + "</a>";
},
'#sprache' : function (a) {
a = a.context;
var sprache = a.lang;
return "Sprache: " + sprache;
},
};
var json = JSON.parse(res);
$('div.templateUser')
.render(json.Records[0], directive);
// alert(res);
});
</script>
</body>
</html>