Add the "Reload" and "CSV" buttons
[proteocache.git] / webapp / view / reportProteinSequences.jsp
1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
2 <%@ page trimDirectiveWhitespaces="true"%>
3 <%@ taglib uri="http://www.springframework.org/tags" prefix="spring"%>
4 <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
5 <%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
6 <%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
7 <%@page import="java.util.ArrayList"%>
8
9 <html>
10 <jsp:include page="fragments/header.jsp" />
11 <body>
12         <div class="container">
13                 <jsp:include page="fragments/mainmenu.jsp" />
14                 <spring:url value="/job/results" var="job_query" />
15                 <spring:url value="/sequence/sequence/results?sequence=${prot}&searchtype=${searchtype}" var="the_query"/>
16                 <c:set var="shortensequencelength" value="108"/>
17
18                 <!-- reload and CSV buttons  -->
19                 <ul class="nav navbar-nav navbar-right">
20                         <li>
21                         <a href="${the_query}" class="btn btn-default active">Reload</a>
22                         </li>
23                         <c:choose><c:when test="${csvfile != '' and csvfile != null}">
24                         <li>
25                         <a id="forCSVfile" download="data.csv" href="data:application/csv;charset=utf-8,${csvfile}" class="btn btn-default active">CSV</a>
26                         </li>
27                         </c:when></c:choose>
28                 </ul>
29                 
30         <div class="panel panel-default">
31         <div class="panel-heading">
32                 <c:choose>
33                         <c:when test="${searchtype == 'whole'}">
34                                 <p style="font-weight:bold;">
35                                 Jobs for the protein sequence:
36                                 <script> document.write(shorten('${prot}', '${shortensequencelength}'));</script>
37                                 </p>
38                         </c:when>
39                         <c:otherwise>
40                                 <p style="font-weight:bold;">
41                                 Jobs for the protein sequences, which include the substring: 
42                                 <script> document.write(shorten('${prot}', '${shortensequencelength}'));</script>
43                                 </p>
44                         </c:otherwise>
45                 </c:choose>
46         </div>
47
48         <div class="panel-body">
49                 <c:choose>
50                         <c:when test="${njobs == 0}">
51                                 <p>No jobs found</p>
52                         </c:when>
53                         <c:otherwise>
54                                 <p>${njobs} jobs found</p>
55                                 <div class="table-responsive">
56                                         <div class="grid-wrapper-div">
57                                         <table class="table table-striped table-hover table-bordered">
58                                                 <thead>
59                                                         <tr>
60                                                                 <th>Job ID</th>
61                                                                 <th>annotation</th>
62                                                                 <th>Sequence</th>
63                                                         </tr>
64                                                 </thead>
65                                                 <tbody>
66                                                         <c:forEach items="${results}" var="res" varStatus="status">
67                                                                 <c:forEach items="${res.jobid}" var="id" varStatus="status">
68                                                                 <tr>
69                                                                         <th rowspan="${res.size + 2}"><a
70                                                                                 title="Click to view the job log"
71                                                                                 href="${job_query}?IdJob=${id}">${id}</a></th>
72                                                                 </tr>
73                                                                 <tr>
74                                                                         <td style="text-align: center; font-weight: bold; font-family: monospace">Sequence</td>
75                                                                         <c:if test="${searchtype == 'whole'}">
76                                                                                 <td
77                                                                                         style="text-align: left; border-buttom: dotted; font-family: monospace"><c:out
78                                                                                                 value="${res.sequence}" /></td>
79                                                                         </c:if>
80                                                                         <c:if test="${searchtype == 'partial'}">
81                                                                                 <td
82                                                                                         style="text-align: left; border-buttom: dotted; font-family: monospace">
83                                                                                         <c:forEach items="${res.subProt}" var="seq">
84                                                                                                 <c:choose>
85                                                         <c:when test="${fn:contains(seq, prot)}">
86                                                         <span style="background-color: blue">${seq}</span></c:when>
87                                                         <c:otherwise>${seq}</c:otherwise>
88                                                                                                 </c:choose>
89                                                                                         </c:forEach>
90                                                                                 </td>
91                                                                         </c:if>
92                                                                 </tr>
93                                                                 <c:forEach items="${res.predictions}" var="seq"
94                                                                         varStatus="status">
95                                                                         <tr>
96                                                                                 <td
97                                                                                         style="text-align: center; font-weight: bold; font-family: monospace"><c:out
98                                                                                                 value="${seq.key}" /></td>
99                                                                                 <td
100                                                                                         style="text-align: left; border-buttom: dotted; font-family: monospace"><c:out
101                                                                                                 value="${seq.value}" /></td>
102                                                                         </tr>
103                                                                 </c:forEach>
104                                                         </c:forEach>
105                                                         </c:forEach>
106                                                 </tbody>
107                                         </table>
108                                         </div>
109                                 </div>
110                         </c:otherwise>
111                 </c:choose>
112
113         </div>
114         </div>
115
116                 <jsp:include page="fragments/footer.jsp" />
117         </div>
118 </body>
119 </html>