index.jsp 2.01 KB
Newer Older
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
<!DOCTYPE html>

<%@include file="/WEB-INF/jsp/init.jsp"%>

<html>
	<head>
        <title><spring:message code="admin.page.title" /></title>
	</head>
	<body>
        <c:if test="${not empty errorMessage}">
            <div class="alert alert-warning">${errorMessage}</div>
        </c:if>
        <div class="row">
            <div class="col-md-2">
                <form action="<c:out value="/admin/repository/upload?${_csrf.parameterName}=${_csrf.token}" />"
                      method="post" enctype="multipart/form-data">
                    <input type="hidden" name="repositoryPath" value="${currentPath}">
                    <input type="file" name="file">
                    <button type="submit" class="btn btn-default">Upload file or image</button>
                </form>
            </div>
            <%--<div class="col-md-1">--%>
                <%--<form action="<c:out value="/admin/repository/upload" />" method="post">--%>
                    <%--<input type="file" name="image">--%>
                    <%--<button type="submit">Upload image</button>--%>
                <%--</form>--%>
            <%--</div>--%>
        </div>
		<c:forEach var="file" items="${fileList}" varStatus="i">
			<div class="row">
				<div class="col-md-4">
					<c:out value="${i.count}."/>
                    <a href="<c:url value="/repository${currentPath}${file.uuid}${file.extension}" />">${file.originalFilename}</a>
				</div>
				<div class="col-md-2">
					<a href="<c:url value="/admin/repository/edit" />?uuid=${file.uuid}&repositoryPath=${currentPath}"
                       class="btn btn-default">Edit metadata</a>
				</div>
				<div class="col-md-2">
					<form action="<c:out value="/admin/repository/delete?${_csrf.parameterName}=${_csrf.token}"/>" method="post">
						<input type="hidden" name="uuid" value="${file.uuid}">
						<input type="hidden" name="repositoryPath" value="${currentPath}">
						<input type="submit" value="Delete file" class="btn btn-default">
					</form>
				</div>
			</div>
		</c:forEach>
	</body>
</html>