Projekt

Obecné

Profil

Stáhnout (3.24 KB) Statistiky
| Větev: | Tag: | Revize:
1 1e2b2c27 Tomáš Šimandl
<%@page contentType="text/html" pageEncoding="UTF-8"%>
2
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
3
4 2a2f32c2 Pavel Fidranský
<c:set var="HOME_URL" value="${initParam.HOME_URL}"/>
5
<c:set var="isLoggedIn" value="${sessionScope.isLoggedIn}"/>
6
<c:set var="user" value="${sessionScope.user}"/>
7
8 1e2b2c27 Tomáš Šimandl
<!DOCTYPE html>
9
<html>
10
	<head>
11
		<meta charset="utf-8">
12
13
		<link rel="stylesheet" href="css/main.css">
14
15 2f31119d Pavel Fidranský
		<script src="js/libs/jquery-3.3.1.min.js"></script>
16 0ac9b68b Pavel Fidranský
		<script src="js/userMenu.js"></script>
17 1e2b2c27 Tomáš Šimandl
18 ee95801f Pavel Fidranský
		<title>IMiGEr</title>
19 1e2b2c27 Tomáš Šimandl
	</head>
20
21 2a2f32c2 Pavel Fidranský
	<body class="${isLoggedIn ? 'loggedIn' : 'loggedOut'}">
22 0ac9b68b Pavel Fidranský
		<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 26feb57f Pavel Fidranský
		<main>
31
			<div class="upload-form">
32
				<h3>New diagram</h3>
33
34 0ac9b68b Pavel Fidranský
				<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 26feb57f Pavel Fidranský
						<label for="file">Select SPADe data file:</label><br>
41
						<input type="file" name="file" id="file">
42 0ac9b68b Pavel Fidranský
					</div>
43
44 f19bcf07 Tomáš Šimandl
					<div class="form-field">
45 3c3bc9ca Pavel Fidranský
						Select type of data file:<br>
46
						<label for="spade"><input type="radio" name="jsonFileFormat" value="spade" id="spade" checked> Spade JSON</label><br>
47
						<label for="raw"><input type="radio" name="jsonFileFormat" value="raw" id="raw"> Raw JSON</label><br>
48 f19bcf07 Tomáš Šimandl
					</div>
49
50 26feb57f Pavel Fidranský
					<button type="submit">Start visualization</button>
51 0ac9b68b Pavel Fidranský
				</form>
52
			</div>
53
54 2a2f32c2 Pavel Fidranský
			<div class="diagrams-menu loggedInOnly">
55
				<h3>My diagrams</h3>
56
57
				<ul id="privateDiagramList">
58
					<c:forEach items="${diagramsPrivate}" var="diagram">
59
						<li>
60
							<a href="${HOME_URL}graph?diagramId=${diagram.id}">${diagram.name}</a>
61
							<button class="removeDiagramButton" data-name="${diagram.name}" data-id="${diagram.id}"><img src="images/button_cancel.png" alt="odstranit"></button>
62
						</li>
63
					</c:forEach>
64
				</ul>
65
			</div>
66 0ac9b68b Pavel Fidranský
67
			<div class="diagrams-menu">
68
				<h3>Public diagrams</h3>
69
70
				<ul>
71
					<c:forEach items="${diagramsPublic}" var="diagram">
72
						<li>
73
							<a href="${HOME_URL}graph?diagramId=${diagram.id}">${diagram.name}</a>
74
						</li>
75
					</c:forEach>
76
				</ul>
77
			</div>
78
		</main>
79 5c9e7c19 Pavel Fidranský
80
		<script>
81
			$('.removeDiagramButton').click(function(e) {
82 50d7eafe Tomáš Šimandl
83
			    if(confirm('Are you want to delete ' + $(this).data('name') + '?')) {
84
                    $.ajax({
85
                        'type': 'delete',
86
                        'url': 'api/remove-diagram?diagram_id=' + $(this).data('id'),
87
                        'success': function () {
88
                            location.reload(true);
89
                        },
90
                        'error': function (xhr) {
91
                            switch (xhr.status) {
92
                                case 401:
93
                                    alert('You are either not logged in or not an owner of this diagram.');
94
                                    break;
95
                                default:
96
                                    alert('Something went wrong.');
97
                            }
98
                        },
99
                    });
100
                }
101 5c9e7c19 Pavel Fidranský
			});
102
		</script>
103 1e2b2c27 Tomáš Šimandl
	</body>
104
</html>