Merge branch 'master' into PROT-9-webservice
[proteocache.git] / webapp / view / reports / Sequences.jsp
diff --git a/webapp/view/reports/Sequences.jsp b/webapp/view/reports/Sequences.jsp
new file mode 100644 (file)
index 0000000..3ba5d10
--- /dev/null
@@ -0,0 +1,117 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<%@ page trimDirectiveWhitespaces="true"%>
+<%@ 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="/job/results" var="job_query" />
+               <spring:url value="/sequence/results?sequence=${prot}&searchtype=${searchtype}" 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="${csvfile != '' and csvfile != null}">
+                       <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">
+               <c:choose>
+                       <c:when test="${searchtype == 'whole'}">
+                               <p style="font-weight:bold;">
+                               Jobs for the protein sequence:
+                               <script> document.write(shorten('${prot}', '${shortensequencelength}'));</script>
+                               </p>
+                       </c:when>
+                       <c:otherwise>
+                               <p style="font-weight:bold;">
+                               Jobs for the protein sequences, which include the substring: 
+                               <script> document.write(shorten('${prot}', '${shortensequencelength}'));</script>
+                               </p>
+                       </c:otherwise>
+               </c:choose>
+       </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 jobs found</p>
+                       </c:when>
+                       <c:otherwise>
+                               <p>${njobs} jobs found</p>
+                               <div class="table-responsive">
+                                       <div class="grid-wrapper-div">
+                                       <table class="table table-striped table-hover table-bordered">
+                                               <thead>
+                                                       <tr>
+                                                               <th>Job ID</th>
+                                                               <th>annotation</th>
+                                                               <th>Sequence</th>
+                                                       </tr>
+                                               </thead>
+                                               <tbody>
+                                                       <c:forEach items="${results}" var="res" varStatus="status">
+                                                               <c:forEach items="${res.jobid}" var="id" varStatus="status">
+                                                               <tr>
+                                                                       <th rowspan="3"><a
+                                                                               title="Click to view the job log"
+                                                                               href="${job_query}?IdJob=${id}">${id}</a></th>
+                                                               </tr>
+                                                               <tr>
+                                                                       <td style="text-align: center; font-weight: bold; font-family: monospace">Sequence</td>
+                                                                       <c:if test="${searchtype == 'whole'}">
+                                                                               <td style="text-align: left; font-family: monospace">
+                                                                                               ${res.sequence}</td>
+                                                                       </c:if>
+                                                                       <c:if test="${searchtype == 'partial'}">
+                                                                               <td style="text-align: left; border-buttom: dotted; font-family: monospace">
+                                                                                       <c:forEach items="${res.subProt}" var="seq">
+                                                                                               <c:choose>
+                                                                                               <c:when test="${fn:contains(seq, prot)}">
+                                                                                               <span style="background-color: blue">${seq}</span></c:when>
+                                                                                               <c:otherwise>${seq}</c:otherwise>
+                                                                                               </c:choose>
+                                                                                       </c:forEach>
+                                                                               </td>
+                                                                       </c:if>
+                                                               </tr>
+                                                               <tr>
+                                                                       <td style="text-align: center; font-weight: bold; font-family: monospace">
+                                                                               Jnetpred
+                                                                       </td>
+                                                                       <td style="text-align: left; border-buttom: dotted; font-family: monospace">
+                                                                               ${res.jnetpred}
+                                                                       </td>
+                                                               </tr>
+                                                       </c:forEach>
+                                                       </c:forEach>
+                                               </tbody>
+                                       </table>
+                                       </div>
+                               </div>
+                       </c:otherwise>
+               </c:choose>
+
+       </div>
+       </div>
+
+               <jsp:include page="../fragments/footer.jsp" />
+       </div>
+</body>
+</html>