Merge branch 'master' into PROT-9-webservice
[proteocache.git] / webapp / view / reports / SequencesStatistics.jsp
diff --git a/webapp/view/reports/SequencesStatistics.jsp b/webapp/view/reports/SequencesStatistics.jsp
new file mode 100644 (file)
index 0000000..175f5f4
--- /dev/null
@@ -0,0 +1,80 @@
+<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+
+<%@ taglib uri="http://www.springframework.org/tags" prefix="spring"%>
+<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
+<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
+<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
+<%@ taglib prefix="sec" uri="http://www.springframework.org/security/tags"%>
+
+<html>
+<jsp:include page="../fragments/header.jsp" />
+
+<body>
+       <div class="container">
+               <jsp:include page="../fragments/mainmenu.jsp" />
+               <spring:url value="/sequence/results" var="sequence_query" />
+               <spring:url value="/sequence/counts/results?counterJob=${counter}" var="the_query" />
+               <c:set var="shortensequencelength" value="108"/>
+
+               <!-- reload and CSV buttons  -->
+               <ul class="nav navbar-nav navbar-right">
+                       <li>
+                       <a href="${the_query}" class="btn btn-default active">Reload</a>
+                       </li>
+                       <c:choose><c:when test="${njobs > 0}">
+                       <li>
+                       <a id="forCSVfile" download="data.csv" href="data:application/csv;charset=utf-8,${csvfile}" class="btn btn-default active">CSV</a>
+                       </li>
+                       </c:when></c:choose>
+               </ul>
+
+       <div class="panel panel-default">
+       <div class="panel-heading">
+               <p style="font-weight:bold;">Jobs Statistics</p>
+       </div>
+
+       <div class="panel-body">
+<sec:authorize access="hasRole('ROLE_ADMIN')">
+               <p>Servlet execution time: ${timeExecution} milliseconds</p>
+</sec:authorize>
+               <c:choose>
+               <c:when test="${njobs == 0}">
+                       <p>No proteins with at least ${counter} jobs found</p>
+               </c:when>
+               <c:otherwise>
+                       <p>${njobs} proteins with at least ${counter} jobs found</p>
+                       <div class="table-responsive">
+                       <table class="table table-striped table-hover table-bordered" id="counts">
+                       <thead>
+                               <tr>
+                                       <th style="text-align: centre">Number of jobs</th>
+                                       <th style="text-align: left">Protein</th>
+                               </tr>
+                       </thead>
+                       <tbody>
+                               <c:forEach items="${results}" var="res">
+                                       <tr>
+                                               <td>${res.totaljobs}</td>
+                                               <td style="text-overflow:ellipsis text-align: left; font-family: monospace" id="proteinline">
+                                                       <a title="Click to view all jobs" href="${sequence_query}?sequence=${res.name}&searchtype=whole">
+                                                       <script>
+                                                               document.write(shorten('${res.name}', '${shortensequencelength}'));
+                                                       </script>
+                                                       <!-- ${res.name}-->
+                                                       </a>
+                                               </td>
+                                       </tr>
+                               </c:forEach>
+                       </tbody>
+                       </table>
+                       </div>
+               </c:otherwise>
+               </c:choose>
+       </div>
+       </div>
+
+       <jsp:include page="../fragments/footer.jsp" />
+       </div>
+</body>
+</html>