index.jsp 3.86 KB
Newer Older
1
2
3
4
5
6
7
<!DOCTYPE html>

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

<html>
<head>
Matija Obreza's avatar
Matija Obreza committed
8
<title><spring:message code="search.page.title" /></title>
9
10
</head>
<body>
11
12
	<h1><spring:message code="search.page.title" /></h1>
	
13
14
15
	<div class="main-col-header clearfix">
	<form class="" method="get" action="<c:url value="/search" />">
			<div class="input-group col-lg-3"><span class="input-group-btn"><input type="text" name="q" class="span3 form-control" value="<c:out value="${q}" />" /><input type="submit" value="<spring:message code="search.button.label" />" class="btn" /></span></div>
16
	</form>
17
	</div>
18

Matija Obreza's avatar
Matija Obreza committed
19
	<c:if test="${pagedData.totalElements eq 0}">
Matija Obreza's avatar
Matija Obreza committed
20
		<div class="alert alert-info"><spring:message code="search.no-results" /></div>
21
	</c:if>
22

Matija Obreza's avatar
Matija Obreza committed
23
	<c:if test="${pagedData ne null and pagedData.totalElements gt 0}">
24
25
26
27
28
29
30
	<div class="main-col-header clearfix">
		<div class="nav-header pull-left">
			<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>
31
		</div>
32
	</div>
33
34
35


		<ul class="funny-list">
Matija Obreza's avatar
Matija Obreza committed
36
			<c:forEach items="${pagedData.content}" var="searchResult" varStatus="status">
Matija Obreza's avatar
Matija Obreza committed
37
				<c:set value="${searchResult.getClass().simpleName}" var="clazz" />
38
39
				<c:if test="${clazz.contains('_$$_')}">
					<c:set var="clazz" value="${clazz.substring(0, clazz.indexOf('_$$_'))}" />
Matija Obreza's avatar
Matija Obreza committed
40
41
				</c:if>
			
Matija Obreza's avatar
Matija Obreza committed
42
				<li><small>${clazz} <b><fmt:formatNumber value="${status.count + (pagedData.number)*pagedData.size}" /></b>.</small> 
Matija Obreza's avatar
Matija Obreza committed
43
44
				<c:choose>
				<c:when test="${clazz eq 'Taxonomy'}">
45
					<a href="<c:url value="/acn/t/${searchResult.genus}/${searchResult.species}" />"><c:out value="${searchResult.taxonName}" /></a>
Matija Obreza's avatar
Matija Obreza committed
46
47
48
49
50
				</c:when>
				<c:when test="${clazz eq 'Organization'}">
					<a href="<c:url value="/org/${searchResult.slug}" />"><c:out value="${searchResult.slug}" /></a> <c:out value="${searchResult.title}" />
				</c:when>
				<c:when test="${clazz eq 'Accession'}">
51
					<a href="<c:url value="/acn/id/${searchResult.id}" />">${searchResult.accessionName}</a> ${searchResult.taxonomy.taxonName} ${searchResult.instituteCode}
Matija Obreza's avatar
Matija Obreza committed
52
				</c:when>
53
54
55
				<c:when test="${clazz eq 'AccessionAlias'}">
					<a href="<c:url value="/acn/id/${searchResult.accession.id}" />">${searchResult.name}</a> ${searchResult.accession.taxonomy.taxonName} ${searchResult.accession.instituteCode}
				</c:when>
Matija Obreza's avatar
Matija Obreza committed
56
				<c:when test="${clazz eq 'Crop'}">
57
					<a href="<c:url value="/c/${searchResult.shortName}/data" />">${searchResult.name}</a>
Matija Obreza's avatar
Matija Obreza committed
58
59
				</c:when>
				<c:when test="${clazz eq 'FaoInstitute'}">
60
					<a href="<c:url value="/wiews/${searchResult.code.toLowerCase()}" />">${searchResult.fullName}</a>
Matija Obreza's avatar
Matija Obreza committed
61
					${searchResult.code} ${searchResult.country.getName(pageContext.response.locale)}
Matija Obreza's avatar
Matija Obreza committed
62
63
				</c:when>
				<c:when test="${clazz eq 'Metadata'}">
64
					<a href="<c:url value="/data/view/${searchResult.id}" />">${searchResult.title}</a>
Matija Obreza's avatar
Matija Obreza committed
65
66
				</c:when>
				<c:when test="${clazz eq 'ActivityPost'}">
67
					${searchResult.title}
Matija Obreza's avatar
Matija Obreza committed
68
69
				</c:when>
				<c:when test="${clazz eq 'Country'}">
Matija Obreza's avatar
Matija Obreza committed
70
					<a href="<c:url value="/geo/${searchResult.code3.toLowerCase()}" />">${searchResult.getName(pageContext.response.locale)}</a>
Matija Obreza's avatar
Matija Obreza committed
71
72
				</c:when>
				<c:when test="${clazz eq 'Article'}">
73
					<a href="<c:url value="/content/${searchResult.slug}" />">${searchResult.title}</a>
Matija Obreza's avatar
Matija Obreza committed
74
75
76
77
78
				</c:when>
				<c:otherwise>
					${searchResult}
				</c:otherwise>
				</c:choose>
79
				</li>
Matija Obreza's avatar
Matija Obreza committed
80
81
				
				<c:remove var="clazz" />
82
83
84
85
86
			</c:forEach>
		</ul>
	</c:if>
</body>
</html>