accessions.jsp 3.99 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 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90
<!DOCTYPE html>

<%@include file="/WEB-INF/jsp/init.jsp"%>
<%@ taglib prefix="sec" uri="http://www.springframework.org/security/tags"%>

<html>
<head>
<title><spring:message code="search.page.title" /></title>
</head>
<body>
	<h1><spring:message code="search.page.title" /></h1>
	
	<div class="main-col-header clearfix">
		<div class="nav-header">
			<div class="results"><spring:message code="paged.totalElements" arguments="${pagedData.totalElements}" /></div>
			<div class="pagination">
				<spring:message code="paged.pageOfPages" arguments="${pagedData.number+1},${pagedData.totalPages}" />
				<a class="${pagedData.number eq 0 ? 'disabled' :''}" href="?q=${q}&amp;page=${pagedData.number eq 0 ? 1 : pagedData.number}"><spring:message code="pagination.previous-page" /></a> <a href="?q=${q}&amp;page=${pagedData.number + 2}"><spring:message code="pagination.next-page" /></a>
			</div>
		</div>
	</div>
	
	<div class="applied-filters">
		<form class="" method="get" action="<c:url value="/acn/search" />">
			<div class="row">
				<div class="col-md-4"><input type="text" name="q" class="form-control" value="<c:out value="${q}" />" /></div>
				<div class="col-md-2"><input type="submit" value="<spring:message code="search.button.label" />" class="btn" /></div>
			</div>
		</form>
	</div>

	<c:if test="${pagedData ne null and pagedData.totalElements gt 0}">
	<table class="accessions">
			<thead>
				<tr>
					<td class="idx-col"></td>
					<c:if test="${selection ne null}">
						<td />
					</c:if>
					<td><spring:message code="accession.accessionName" /></td>
					<td><spring:message code="accession.otherNames" /></td>
					<td><spring:message code="accession.taxonomy" /></td>
					<td class="notimportant"><spring:message code="accession.origin" /></td>
					<td class="notimportant"><spring:message code="accession.sampleStatus" /></td>
					<td class="notimportant"><spring:message code="accession.holdingInstitute" /></td>
				</tr>
			</thead>
			<tbody>
				<c:forEach items="${pagedData.content}" var="searchResult" varStatus="status">
					<c:set value="${searchResult.getClass().simpleName}" var="clazz" />
					<c:if test="${clazz.contains('_$$_')}">
						<c:set var="clazz" value="${clazz.substring(0, clazz.indexOf('_$$_'))}" />
					</c:if>
					<c:choose>
						<c:when test="${clazz eq 'Accession'}">
							<c:set var="accession" value="${searchResult}" />
							<c:set var="name" value="" />
						</c:when>
						<c:when test="${clazz eq 'AccessionAlias'}">
							<c:set var="accession" value="${searchResult.accession}" />
							<c:set var="name" value="${searchResult.name}" />
						</c:when>
						<c:otherwise>
							<c:remove var="accession" />
							<c:remove var="name" />
						</c:otherwise>
					</c:choose>
				
					<tr class="acn">
						<td class="idx-col">${status.count + pagedData.size * pagedData.number}</td>
						<c:if test="${selection ne null}">
							<td class="sel ${selection.containsId(accession.id) ? 'picked' : ''}" x-aid="${accession.id}"></td>
						</c:if>
						<td><a href="<c:url value="/acn/id/${accession.id}" />"><b>
							<c:out value="${accession.accessionName}" />
						</b></a></td>
						<td><c:out value="${name}" /></td>
						<%-- <td><a href="<c:url value="/acn/t/${accession.taxonomy.genus}/${accession.taxonomy.species}" />"><c:out value="${accession.taxonomy.taxonName}" /></a></td> --%>
						<td><c:out value="${accession.taxonomy.taxonName}" /></td>
						<%-- <td class="notimportant"><a href="<c:url value="/geo/${accession.origin.toLowerCase()}" />"><c:out value="${accession.countryOfOrigin.name}" /></a></td> --%>
						<td class="notimportant"><c:out value="${accession.countryOfOrigin.getName(pageContext.response.locale)}" /></td>
						<td class="notimportant"><spring:message code="accession.sampleStatus.${accession.sampleStatus}" /></td>
						<td class="notimportant"><a href="<c:url value="/wiews/${accession.institute.code.toLowerCase()}" />"><c:out value="${accession.institute.code}" /></a></td>
					</tr>
				</c:forEach>
			</tbody>
		</table>
	</c:if>
</body>
</html>