1
|
<%@page contentType="text/html" pageEncoding="UTF-8"%>
|
2
|
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
|
3
|
|
4
|
<c:set var="APP_NAME" value="${initParam.APP_NAME}"/>
|
5
|
<c:set var="APP_HOME_URL" value="${initParam.APP_HOME_URL}"/>
|
6
|
<c:set var="isLoggedIn" value="${sessionScope.isLoggedIn}"/>
|
7
|
<c:set var="user" value="${sessionScope.user}"/>
|
8
|
|
9
|
<!DOCTYPE html>
|
10
|
<html>
|
11
|
<head>
|
12
|
<meta charset="utf-8">
|
13
|
|
14
|
<link rel="stylesheet" href="css/common.css">
|
15
|
<link rel="stylesheet" href="css/upload-files.css">
|
16
|
|
17
|
<link rel="stylesheet" href="css/components/header.css">
|
18
|
<link rel="stylesheet" href="css/components/popup.css">
|
19
|
|
20
|
<script id="htmlTags" type="application/json"><%@ include file="node_modules/html-tags/html-tags.json" %></script>
|
21
|
<script id="svgTags" type="application/json"><%@ include file="node_modules/svg-tags/lib/svg-tags.json" %></script>
|
22
|
|
23
|
<script src="js/components/generic/popup.js"></script>
|
24
|
<script src="js/components/loginPopup.js"></script>
|
25
|
<script src="js/components/registerPopup.js"></script>
|
26
|
|
27
|
<script src="js/errors/abstractMethodError.js"></script>
|
28
|
<script src="js/errors/httpError.js"></script>
|
29
|
|
30
|
<script src="js/events/loggedInEvent.js"></script>
|
31
|
<script src="js/events/loggedOutEvent.js"></script>
|
32
|
<script src="js/events/registeredEvent.js"></script>
|
33
|
|
34
|
<script src="js/utils/ajax.js"></script>
|
35
|
<script src="js/utils/dom.js"></script>
|
36
|
|
37
|
<script src="js/constants.js"></script>
|
38
|
|
39
|
<title>${APP_NAME}</title>
|
40
|
</head>
|
41
|
|
42
|
<body class="${isLoggedIn ? 'loggedIn' : 'loggedOut'}">
|
43
|
<header class="header" id="header">
|
44
|
<img src="images/logo_cs.svg" class="header-logo" alt="logo of University of West Bohemia" title="University of West Bohemia">
|
45
|
|
46
|
<h2 class="header-title">Interactive Multimodal Graph Explorer</h2>
|
47
|
|
48
|
<div class="user-menu loggedInOnly">
|
49
|
<span class="username" id="usernameLabel">${user.username}</span>
|
50
|
<button class="button" id="logoutButton">Log out</button>
|
51
|
</div>
|
52
|
|
53
|
<div class="user-menu loggedOutOnly">
|
54
|
<button class="button" id="toggleLoginPopupButton">Log in</button>
|
55
|
<button class="button" id="toggleRegisterPopupButton">Register</button>
|
56
|
</div>
|
57
|
</header>
|
58
|
|
59
|
<main>
|
60
|
<div class="upload-form">
|
61
|
<h3>New diagram</h3>
|
62
|
|
63
|
<c:if test="${not empty errorMessage}">
|
64
|
<p class="alert">${errorMessage}</p>
|
65
|
</c:if>
|
66
|
|
67
|
<form method="post" enctype="multipart/form-data">
|
68
|
<div class="form-field">
|
69
|
<label for="file">Select JSON data file:</label><br>
|
70
|
<input type="file" name="file" id="file">
|
71
|
</div>
|
72
|
|
73
|
<div class="form-field">
|
74
|
Select type of data file:<br>
|
75
|
<label for="spade"><input type="radio" name="jsonFileFormat" value="spade" id="spade" checked> Spade JSON</label><br>
|
76
|
<label for="raw"><input type="radio" name="jsonFileFormat" value="raw" id="raw"> Raw JSON</label><br>
|
77
|
</div>
|
78
|
|
79
|
<button id="btnLoad" type="submit">Start visualization</button>
|
80
|
</form>
|
81
|
</div>
|
82
|
|
83
|
<div class="diagrams-menu loggedInOnly">
|
84
|
<h3>My diagrams</h3>
|
85
|
|
86
|
<ul id="privateDiagramList">
|
87
|
<c:forEach items="${diagramsPrivate}" var="diagram">
|
88
|
<li>
|
89
|
<a href="${APP_HOME_URL}graph?diagramId=${diagram.id}">${diagram.name}</a>
|
90
|
|
91
|
<button class="button remove-diagram-button" data-id="${diagram.id}" data-name="${diagram.name}">
|
92
|
<img src="images/button_cancel.png" alt="odstranit">
|
93
|
</button>
|
94
|
</li>
|
95
|
</c:forEach>
|
96
|
</ul>
|
97
|
</div>
|
98
|
|
99
|
<div class="diagrams-menu">
|
100
|
<h3>Public diagrams</h3>
|
101
|
|
102
|
<ul id="publicDiagramList">
|
103
|
<c:forEach items="${diagramsPublic}" var="diagram">
|
104
|
<li>
|
105
|
<a href="${APP_HOME_URL}graph?diagramId=${diagram.id}">${diagram.name}</a>
|
106
|
</li>
|
107
|
</c:forEach>
|
108
|
</ul>
|
109
|
</div>
|
110
|
</main>
|
111
|
|
112
|
<script type="module">
|
113
|
import UploadFilesApp from './js/uploadFilesApp.js';
|
114
|
|
115
|
window.app = new UploadFilesApp('${APP_NAME}', '${APP_HOME_URL}');
|
116
|
|
117
|
document.addEventListener('DOMContentLoaded', () => {
|
118
|
app.run();
|
119
|
});
|
120
|
</script>
|
121
|
</body>
|
122
|
</html>
|