110 lines
5.2 KiB
HTML
110 lines
5.2 KiB
HTML
<!DOCTYPE html>
|
|
<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
~ Autorskie Prawa Majątkowe - Moose Spółka z ograniczoną odpowiedzialnością
|
|
~
|
|
~ Copyright 2017 Moose Spółka z ograniczoną odpowiedzialnością
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
|
|
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://xmlns.jcp.org/jsf/html" xmlns:ui="http://java.sun.com/jsf/facelets"
|
|
xmlns:c="http://java.sun.com/jsp/jstl/core" xmlns:f="http://xmlns.jcp.org/jsf/core"
|
|
lang="pl">
|
|
<h:head>
|
|
<meta charset="UTF-8"/>
|
|
<meta http-equiv="X-UA-COMPATIBLE" content="IE=edge"/>
|
|
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"/>
|
|
<title>List of documents</title>
|
|
<h:outputStylesheet library="css" name="bootstrap.min.css"/>
|
|
<h:outputStylesheet library="css" name="style.css"/>
|
|
|
|
<!--[if lt IE 9]>
|
|
<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
|
|
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
|
|
<![endif]-->
|
|
</h:head>
|
|
<h:body class="bg-light">
|
|
<nav class="navbar navbar-expand-lg navbar-dark bg-dark">
|
|
<span class="navbar-brand mr-auto">
|
|
<h:graphicImage library="img" name="icon.png" alt="logo" styleClass="logo mr-2"/>
|
|
List of Documents
|
|
</span>
|
|
|
|
<ul class="navbar-nav flex-row ml-md-auto d-md-flex">
|
|
<c:if test="#{UserBean.getUserName().length() > 0}">
|
|
<li class="nav-item">
|
|
<span class="navbar-text mr-2">
|
|
Hello, <h:outputText value="#{UserBean.getUserName()}"/>
|
|
</span>
|
|
</li>
|
|
</c:if>
|
|
<li class="nav-item">
|
|
<span>
|
|
<h:form>
|
|
<h:commandLink value="Logout" styleClass="nav-link btn btn-sm btn-info text-white"
|
|
action="#{UserBean.logout}"/>
|
|
</h:form>
|
|
</span>
|
|
</li>
|
|
</ul>
|
|
</nav>
|
|
|
|
<div class="container">
|
|
<c:if test="#{request.isUserInRole('admin')}">
|
|
<div class="row">
|
|
<div class="col mt-3 mb-3">
|
|
<h:form enctype="multipart/form-data" id="uploadForm">
|
|
<a type="button" class="upload-button"
|
|
onclick="document.getElementById('uploadForm:uploadControl').click();">
|
|
<h:graphicImage library="img" name="file-upload.svg" styleClass="top-icon"/>
|
|
</a>
|
|
<h:inputFile value="#{UploadFileBean.document}" id="uploadControl" style="display: none;">
|
|
<f:ajax listener="#{UploadFileBean.save(request)}"/>
|
|
</h:inputFile>
|
|
</h:form>
|
|
</div>
|
|
</div>
|
|
</c:if>
|
|
<div class="row">
|
|
<div class="col mt-3">
|
|
<table class="table table-striped">
|
|
<thead>
|
|
<tr>
|
|
<th scope="col" style="width: 10%">No.</th>
|
|
<th scope="col" style="width: 80%">Name</th>
|
|
<th scope="col" style="width: 10%">Options</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<c:if test="#{FilesBean.documents.size() eq 0}">
|
|
<tr>
|
|
<td colspan="3">No files</td>
|
|
</tr>
|
|
</c:if>
|
|
<ui:repeat value="#{FilesBean.documents}" var="documentName" varStatus="status">
|
|
<tr>
|
|
<th scope="row"><h:outputText value="#{status.index + 1}"/></th>
|
|
<td><h:outputText value="#{documentName}"/></td>
|
|
<td>
|
|
<h:form>
|
|
<h:commandLink action="#{FilesBean.downloadDocument(documentName)}">
|
|
<h:graphicImage library="img" name="file-download.svg" styleClass="table-icon mr-2"/>
|
|
</h:commandLink>
|
|
|
|
<c:if test="#{request.isUserInRole('admin')}">
|
|
<h:commandLink action="#{FilesBean.deleteDocument(documentName, request)}">
|
|
<h:graphicImage library="img" name="trash-alt.svg" styleClass="table-icon"/>
|
|
</h:commandLink>
|
|
</c:if>
|
|
</h:form>
|
|
</td>
|
|
</tr>
|
|
</ui:repeat>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<h:outputScript library="js" name="jquery.slim.min.js"/>
|
|
<h:outputScript library="js" name="popper.min.js"/>
|
|
<h:outputScript library="js" name="bootstrap.min.js"/>
|
|
</h:body>
|
|
</html> |