index.jsp 3.58 KB
Newer Older
Matija Obreza's avatar
Matija Obreza committed
1
2
3
4
5
6
7
8
9
10
11
12
13
<!DOCTYPE html>

<%@include file="/WEB-INF/jsp/init.jsp"%>

<html>
<head>
<title><spring:message code="selection.page.title" /></title>
</head>
<body>
	<h1>
		<spring:message code="selection.page.title" />
	</h1>

Matija Obreza's avatar
Matija Obreza committed
14
	<c:if test="${pagedData == null}">
Matija Obreza's avatar
Matija Obreza committed
15
16
17
18
19
		<div class="alert">
			<spring:message code="selection.empty-list-warning" />
		</div>
	</c:if>

Matija Obreza's avatar
Matija Obreza committed
20
	<c:if test="${pagedData != null}">
Matija Obreza's avatar
Matija Obreza committed
21
		
Matija Obreza's avatar
Matija Obreza committed
22
		<div class="nav-header">
Matija Obreza's avatar
Matija Obreza committed
23
			<spring:message code="accessions.number" arguments="${pagedData.totalElements}" />
Matija Obreza's avatar
Matija Obreza committed
24
			<br />
Matija Obreza's avatar
Matija Obreza committed
25
26
			<spring:message code="paged.pageOfPages" arguments="${pagedData.number+1},${pagedData.totalPages}" />
			<a class="${pagedData.number eq 0 ? 'disabled' :''}" href="?page=${pagedData.number eq 0 ? 1 : pagedData.number}">⇇ Previous</a> <a href="?page=${pagedData.number + 2}">Next ⇉</a>
Matija Obreza's avatar
Matija Obreza committed
27
28
		</div>

Matija Obreza's avatar
Matija Obreza committed
29
		<table class="accessions">
Matija Obreza's avatar
Matija Obreza committed
30
31
32
			<thead>
				<tr>
					<td class="idx-col"></td>
Matija Obreza's avatar
Matija Obreza committed
33
					<c:if test="${selection ne null}">
Matija Obreza's avatar
Matija Obreza committed
34
						<td />
Matija Obreza's avatar
Matija Obreza committed
35
					</c:if>
Matija Obreza's avatar
Matija Obreza committed
36
37
38
39
40
41
42
43
44
					<td><spring:message code="accession.accessionName" /></td>
					<td><spring:message code="accession.origin" /></td>
					<td><spring:message code="accession.taxonomy" /></td>
					<td><spring:message code="accession.holdingInstitute" /></td>
					<td><spring:message code="accession.holdingCountry" /></td>
					<td></td>
				</tr>
			</thead>
			<tbody>
Matija Obreza's avatar
Matija Obreza committed
45
				<c:forEach items="${pagedData.content}" var="accession" varStatus="status">
Matija Obreza's avatar
Matija Obreza committed
46
					<tr id="a${accession.id}" class="acn targeted ${status.count % 2 == 0 ? 'even' : 'odd'}">
Matija Obreza's avatar
Matija Obreza committed
47
						<td class="idx-col">${status.count + pagedData.size * pagedData.number}</td>
Matija Obreza's avatar
Matija Obreza committed
48
						<c:if test="${selection ne null}">
Matija Obreza's avatar
Matija Obreza committed
49
							<td class="sel ${selection.containsId(accession.id) ? 'picked' : ''}" x-aid="${accession.id}"></td>
Matija Obreza's avatar
Matija Obreza committed
50
						</c:if>
Matija Obreza's avatar
Matija Obreza committed
51
52
53
54
55
56
57
58
59
60
						<td><a href="<c:url value="/acn/id/${accession.id}" />"><b><c:out value="${accession.accessionName}" /></b></a></td>
						<td><c:out value="${accession.countryOfOrigin.name}" /></td>
						<td><c:out value="${accession.taxonomy.taxonName}" /></td>
						<td><a href="<c:url value="/wiews/${accession.institute.code.toLowerCase()}" />"><c:out value="${accession.institute.code}" /></a></td>
						<td><a href="<c:url value="/geo/${accession.institute.country.code3.toLowerCase()}" />"><c:out value="${accession.institute.country.name}" /></a></td>
						<td class="idx-col"><a href="<c:url value="/sel/remove/${accession.id}" />">Remove</a></td>
					</tr>
				</c:forEach>
			</tbody>
		</table>
Matija Obreza's avatar
Matija Obreza committed
61
62
63
64
65
66
67
68
		
		<form method="post" action="<c:url value="/sel/order" />" class="form-vertical">
			<div class="form-actions">
				<button class="btn btn-primary" type="submit">Send request for germplasm</button>
				<a href="<c:url value="/sel/clear" />"><button class="btn" type="button">Clear list</button></a>
			</div>
		</form>
		
Matija Obreza's avatar
Matija Obreza committed
69
70
71
	</c:if>


Matija Obreza's avatar
Matija Obreza committed
72
	<c:if test="${pagedData eq null or pagedData.number eq 0}">
Matija Obreza's avatar
Matija Obreza committed
73
74
75
76
77
78
79
80
81
		<h4 style="margin-top: 3em">Add multiple accessions</h4>
		<form method="post" action="<c:url value="/sel/add-many" />" class="form-horizontal">
			<div class="control-group">
				<label for="accessionIds" class="control-label"><spring:message code="selection.add-many.accessionIds" /></label>
				<div class="controls">
					<textarea class="form-control" placeholder="12345 123545 423231" name="accessionIds"></textarea>
				</div>
			</div>
			<div class="form-actions clearfix">
Matija Obreza's avatar
Matija Obreza committed
82
				<input type="submit" class="btn" value="<spring:message code="selection.add-many" />" />
Matija Obreza's avatar
Matija Obreza committed
83
84
85
86
87
88
			</div>
		</form>
	</c:if>


	<script type="text/javascript">
Matija Obreza's avatar
Matija Obreza committed
89
90
91
92
93
		/*  jQuery(document).ready(function(){
			if(document.location.hash != '') {
				setTimeout(function() { document.location.hash=''; }, 2000);
			} 
		 }); */
Matija Obreza's avatar
Matija Obreza committed
94
95
96
	</script>
</body>
</html>