Projekt

Obecné

Profil

Stáhnout (3.18 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
<!DOCTYPE html>
5
<html>
6
	<head>
7
		<meta charset="utf-8">
8
9
		<link rel="stylesheet" href="css/main.css">
10
11 2f31119d Pavel Fidranský
		<script src="js/libs/jquery-3.3.1.min.js"></script>
12 0ac9b68b Pavel Fidranský
		<script src="js/userMenu.js"></script>
13 1e2b2c27 Tomáš Šimandl
14 ee95801f Pavel Fidranský
		<title>IMiGEr</title>
15 1e2b2c27 Tomáš Šimandl
	</head>
16
17
	<body>
18 0ac9b68b Pavel Fidranský
		<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 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
						<label for="jsonFileFormat">Select type of JSON:</label><br>
46
						<select name="jsonFileFormat" id="jsonFileFormat">
47
							<option value="spade">Spade JSON</option>
48
							<option value="raw">Raw JSON</option>
49
						</select>
50
					</div>
51
52 26feb57f Pavel Fidranský
					<button type="submit">Start visualization</button>
53 0ac9b68b Pavel Fidranský
				</form>
54
			</div>
55
56
			<c:if test="${isLoggedIn}">
57
				<div class="diagrams-menu">
58
					<h3>My diagrams</h3>
59
60
					<ul>
61
						<c:forEach items="${diagramsPrivate}" var="diagram">
62
							<li>
63
								<a href="${HOME_URL}graph?diagramId=${diagram.id}">${diagram.name}</a>
64 50d7eafe Tomáš Šimandl
								<button class="removeDiagramButton" data-name="${diagram.name}" data-id="${diagram.id}"><img src="images/button_cancel.png" alt="odstranit"></button>
65 0ac9b68b Pavel Fidranský
							</li>
66
						</c:forEach>
67
					</ul>
68 1e2b2c27 Tomáš Šimandl
				</div>
69 0ac9b68b Pavel Fidranský
			</c:if>
70
71
			<div class="diagrams-menu">
72
				<h3>Public diagrams</h3>
73
74
				<ul>
75
					<c:forEach items="${diagramsPublic}" var="diagram">
76
						<li>
77
							<a href="${HOME_URL}graph?diagramId=${diagram.id}">${diagram.name}</a>
78
						</li>
79
					</c:forEach>
80
				</ul>
81
			</div>
82
		</main>
83 5c9e7c19 Pavel Fidranský
84
		<script>
85
			$('.removeDiagramButton').click(function(e) {
86 50d7eafe Tomáš Šimandl
87
			    if(confirm('Are you want to delete ' + $(this).data('name') + '?')) {
88
                    $.ajax({
89
                        'type': 'delete',
90
                        'url': 'api/remove-diagram?diagram_id=' + $(this).data('id'),
91
                        'success': function () {
92
                            location.reload(true);
93
                        },
94
                        'error': function (xhr) {
95
                            switch (xhr.status) {
96
                                case 401:
97
                                    alert('You are either not logged in or not an owner of this diagram.');
98
                                    break;
99
                                default:
100
                                    alert('Something went wrong.');
101
                            }
102
                        },
103
                    });
104
                }
105 5c9e7c19 Pavel Fidranský
			});
106
		</script>
107 1e2b2c27 Tomáš Šimandl
	</body>
108
</html>