1
|
<%@page contentType="text/html" pageEncoding="UTF-8"%>
|
2
|
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
|
3
|
|
4
|
<!DOCTYPE html>
|
5
|
<html>
|
6
|
<head>
|
7
|
<meta charset="utf-8">
|
8
|
|
9
|
<link rel="stylesheet" href="css/main.css">
|
10
|
|
11
|
<script src="js/libs/jquery-1.8.3.js"></script>
|
12
|
<script src="js/userMenu.js"></script>
|
13
|
|
14
|
<title>IMiGEr</title>
|
15
|
</head>
|
16
|
|
17
|
<body>
|
18
|
<c:set var="HOME_URL" value="${initParam.HOME_URL}"/>
|
19
|
<c:set var="isLoggedIn" value="${sessionScope.isLoggedIn}"/>
|
20
|
<c:set var="user" value="${sessionScope.user}"/>
|
21
|
|
22
|
<header class="header" id="header">
|
23
|
<img src="images/logo.png" class="header-logo" alt="logo of University of West Bohemia" title="University of West Bohemia">
|
24
|
|
25
|
<h2 class="header-title">Interactive Multimodal Graph Explorer</h2>
|
26
|
|
27
|
<%@ include file="userMenu.jsp" %>
|
28
|
</header>
|
29
|
|
30
|
<main>
|
31
|
<div class="upload-form">
|
32
|
<h3>New diagram</h3>
|
33
|
|
34
|
<c:if test="${not empty errorMessage}">
|
35
|
<p class="alert">${errorMessage}</p>
|
36
|
</c:if>
|
37
|
|
38
|
<form method="post" enctype="multipart/form-data">
|
39
|
<div class="form-field">
|
40
|
<label for="file">Select SPADe data file:</label><br>
|
41
|
<input type="file" name="file" id="file">
|
42
|
</div>
|
43
|
|
44
|
<button type="submit">Start visualization</button>
|
45
|
</form>
|
46
|
</div>
|
47
|
|
48
|
<c:if test="${isLoggedIn}">
|
49
|
<div class="diagrams-menu">
|
50
|
<h3>My diagrams</h3>
|
51
|
|
52
|
<ul>
|
53
|
<c:forEach items="${diagramsPrivate}" var="diagram">
|
54
|
<li>
|
55
|
<a href="${HOME_URL}graph?diagramId=${diagram.id}">${diagram.name}</a>
|
56
|
<button class="removeDiagramButton" data-id="${diagram.id}"><img src="images/button_cancel.png" alt="odstranit"></a>
|
57
|
</li>
|
58
|
</c:forEach>
|
59
|
</ul>
|
60
|
</div>
|
61
|
</c:if>
|
62
|
|
63
|
<div class="diagrams-menu">
|
64
|
<h3>Public diagrams</h3>
|
65
|
|
66
|
<ul>
|
67
|
<c:forEach items="${diagramsPublic}" var="diagram">
|
68
|
<li>
|
69
|
<a href="${HOME_URL}graph?diagramId=${diagram.id}">${diagram.name}</a>
|
70
|
</li>
|
71
|
</c:forEach>
|
72
|
</ul>
|
73
|
</div>
|
74
|
</main>
|
75
|
|
76
|
<script>
|
77
|
$('.removeDiagramButton').click(function(e) {
|
78
|
$.ajax({
|
79
|
'type': 'delete',
|
80
|
'url': 'api/remove-diagram?diagram_id=' + $(this).data('id'),
|
81
|
'success': function() {
|
82
|
location.reload(true);
|
83
|
},
|
84
|
'error': function(xhr) {
|
85
|
switch (xhr.status) {
|
86
|
case 401:
|
87
|
alert('You are either not logged in or not an owner of this diagram.');
|
88
|
break;
|
89
|
default:
|
90
|
alert('Something went wrong.');
|
91
|
}
|
92
|
},
|
93
|
});
|
94
|
});
|
95
|
</script>
|
96
|
</body>
|
97
|
</html>
|