details.jsp 10.1 KB
Newer Older
Matija Obreza's avatar
Matija Obreza committed
1
2
3
4
5
6
<!DOCTYPE html>

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

<html>
<head>
Matija Obreza's avatar
Matija Obreza committed
7
<title><spring:message code="faoInstitutes.page.profile.title" arguments="${faoInstitute.fullName}" argumentSeparator="|" /></title>
Matija Obreza's avatar
Matija Obreza committed
8
</head>
9
<body typeof="schema:Organization">
Matija Obreza's avatar
Matija Obreza committed
10
	<h1>
Matija Obreza's avatar
Matija Obreza committed
11
		<img class="country-flag bigger" src="<c:url value="${cdnFlagsUrl}" />/${faoInstitute.country.code3.toUpperCase()}.png" />
12
		<span property="schema:Organization#name"><c:out value="${faoInstitute.fullName}" /></span>
Matija Obreza's avatar
Matija Obreza committed
13
		<small><c:out value="${faoInstitute.code}" /></small>
Matija Obreza's avatar
Matija Obreza committed
14
	</h1>
Matija Obreza's avatar
Matija Obreza committed
15

16
17
18
	<c:if test="${not faoInstitute.current}">
		<div class="alert alert-warning">
			<spring:message code="faoInstitute.institute-not-current" />
19
			<a href="<c:url value="/wiews/${faoInstitute.vCode}" />"><spring:message code="faoInstitute.view-current-institute" arguments="${faoInstitute.vCode}" /></a>
20
21
22
23
		</div>
	</c:if>

	<c:if test="${faoInstitute.current and countByInstitute eq 0}">
Matija Obreza's avatar
Matija Obreza committed
24
		<div class="alert alert-info">
Matija Obreza's avatar
Matija Obreza committed
25
26
			<spring:message code="faoInstitute.no-accessions-registered" />
		</div>
Matija Obreza's avatar
Matija Obreza committed
27
28
	</c:if>

Matija Obreza's avatar
Matija Obreza committed
29
	<div class="jumbotron">
30
		<spring:message code="faoInstitutes.stat.accessionCount" arguments="${countByInstitute}" />
Matija Obreza's avatar
Matija Obreza committed
31
		<c:if test="${countByInstitute gt 0}">
32
			<a href="<c:url value="/wiews/${faoInstitute.code}/data" />"><spring:message code="view.accessions" /></a>
Matija Obreza's avatar
Matija Obreza committed
33
		</c:if>
34
35
		<spring:message code="faoInstitutes.stat.datasetCount" arguments="${datasetCount}" />
		<c:if test="${datasetCount gt 0}">
36
			<a href="<c:url value="/wiews/${faoInstitute.code}/datasets" />"><spring:message code="view.datasets" /></a>
37
		</c:if>
38
	</div>
39
	
Matija Obreza's avatar
Matija Obreza committed
40
	<div class="">
41
		<security:authorize access="hasRole('ADMINISTRATOR') or hasPermission(#faoInstitute, 'ADMINISTRATION')">
42
43
			<a href="<c:url value="/acl/${faoInstitute.class.name}/${faoInstitute.id}/permissions"><c:param name="back">/wiews/${faoInstitute.code}</c:param></c:url>" class="close"> <spring:message code="edit-acl" /></a>
			<a href="<c:url value="/wiews/${faoInstitute.code}/edit" />" class="close">
44
45
46
47
				<spring:message code="edit" />
			</a>
		</security:authorize>

48
		<span property="schema:Organization#description">
49
		<%@include file="/WEB-INF/jsp/content/include/blurp-display.jsp" %>
50
51
		</span>
				
Matija Obreza's avatar
Matija Obreza committed
52
		<div class="row" style="">
53
		<div class="col-sm-4" property="schema:Organization#location">
Matija Obreza's avatar
Matija Obreza committed
54
			<spring:message code="faoInstitute.country" />:
Matija Obreza's avatar
Matija Obreza committed
55
			<%-- <img src="<c:url value="${cdnFlagsUrl}" />/${faoInstitute.country.code3.toUpperCase()}.png" /> --%>
56
			<a href="<c:url value="/geo/${faoInstitute.country.code3}" />">
57
58
59
60
				<span typeof="schema:Country"><span property="schema:Country#name">
					<c:out value="${faoInstitute.country.getName(pageContext.response.locale)}" />
				</span></span>
			</a>
Matija Obreza's avatar
Matija Obreza committed
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
		</div>
		<%-- <div class="col-sm-4">
			<spring:message code="faoInstitute.code" />:
			<c:out value="${faoInstitute.code}" />
		</div>
		<div class="col-sm-4">
			<spring:message code="faoInstitute.acronym" />:
			<c:out value="${faoInstitute.acronym}" />
		</div> --%>
		</div>
		
		<div class="row" style="">
		<%-- <div class="col-sm-4">
			<spring:message code="faoInstitute.email" />:
			<c:out value="${faoInstitute.email}" />
		</div> --%>
<%-- 		<p>
			<c:out value="${faoInstitute.type}" />
		</p>
 --%>
		<div class="col-sm-12">
			<spring:message code="faoInstitute.url" />:
83
			<a href="<c:out value="${faoInstitute.url}" />"><span property="schema:Organization#sameAs"><c:out value="${faoInstitute.url}" /></span></a>
Matija Obreza's avatar
Matija Obreza committed
84
85
		</div>
		</div>
86
87
88
89
90
91
92
93
94
95
96
		
		<c:if test="${organizations.size() gt 0}">
		<div class="row" style="">
		<div class="col-sm-12">
			<spring:message code="faoInstitute.member-of-organizations-and-networks" />
			<c:forEach items="${organizations}" var="organization">
				<a href="<c:url value="/org/${organization.slug}" />"><c:out value="${organization.title}" /></a>
			</c:forEach>
		</div>
		</div>
		</c:if>
Matija Obreza's avatar
Matija Obreza committed
97
98
	</div>

Matija Obreza's avatar
Matija Obreza committed
99
100
101
	<c:if test="${faoInstitute.latitude ne null}">
		<div class="row" style="">
		<div class="col-sm-12">
102
			<div id="map" class="gis-map"></div>
103
104
105
			<span property="schema:Organization#location"><span typeof="schema:Place"><span property="schema:Place#geo"><span typeof="schema:GeoCoordinates">
				<span property="schema:GeoCoordinates#latitude">${faoInstitute.latitude}</span>, <span property="schema:GeoCoordinates#longitude">${faoInstitute.longitude}</span>
			</span></span></span></span>
Matija Obreza's avatar
Matija Obreza committed
106
107
108
		</div>
		</div>
	</c:if>
109

Matija Obreza's avatar
Matija Obreza committed
110
111
112
113

	<%-- <h3>
		<spring:message code="faoInstitute.statistics" />
	</h3> --%>
igoshin's avatar
igoshin committed
114
115
116
117
118
119



    <div class="row">
        <div id="flot" style="width:555px;height:300px"></div>
    </div>
Matija Obreza's avatar
Matija Obreza committed
120
121

	<div class="row" style="margin-top: 2em;">
Matija Obreza's avatar
Matija Obreza committed
122
		<%-- <c:if test="${statisticsCrop ne null}">
Matija Obreza's avatar
Matija Obreza committed
123
		<div class="col-sm-4">
124
			<h4><spring:message code="faoInstitute.stat-by-crop" arguments="${statisticsCrop.numberOfElements}" /></h4>
Matija Obreza's avatar
Matija Obreza committed
125
			<ul class="funny-list statistics">
126
				<c:forEach items="${statisticsCrop.content}" var="stat" varStatus="status">
127
					<li class="clearfix ${status.count % 2 == 0 ? 'even' : 'odd'}"><span class="stats-number"><fmt:formatNumber value="${stat[1]}" /></span> <a href="<c:url value="/wiews/${faoInstitute.code}/" />"><c:out value="${stat[0].getName(pageContext.response.locale)}" /></a></li>
128
				</c:forEach>
Matija Obreza's avatar
Matija Obreza committed
129
130
			</ul>
		</div>
Matija Obreza's avatar
Matija Obreza committed
131
		</c:if> --%>
Matija Obreza's avatar
Matija Obreza committed
132
		
Matija Obreza's avatar
Matija Obreza committed
133
		<div class="col-sm-6">
134
			<h4><spring:message code="faoInstitute.stat-by-genus" arguments="${statisticsGenus.numberOfElements}" /></h4>
Matija Obreza's avatar
Matija Obreza committed
135
			<ul class="funny-list statistics">
136
				<c:forEach items="${statisticsGenus.content}" var="stat" varStatus="status">
Matija Obreza's avatar
Matija Obreza committed
137
					<li class="clearfix ${status.count % 2 == 0 ? 'even' : 'odd'}"><span class="stats-number"><fmt:formatNumber value="${stat[1]}" /></span> <a href="<c:url value="/wiews/${faoInstitute.code.toLowerCase()}/t/${stat[0]}" />"><c:out value="${stat[0]}" /></a></li>
Matija Obreza's avatar
Matija Obreza committed
138
139
140
141
				</c:forEach>
			</ul>
		</div>

Matija Obreza's avatar
Matija Obreza committed
142
		<div class="col-sm-6">
143
			<h4><spring:message code="faoInstitute.stat-by-species" arguments="${statisticsTaxonomy.numberOfElements}" /></h4>
Matija Obreza's avatar
Matija Obreza committed
144
			<ul class="funny-list statistics">
145
				<c:forEach items="${statisticsTaxonomy.content}" var="stat" varStatus="status">
146
					<li class="clearfix ${status.count % 2 == 0 ? 'even' : 'odd'}"><span class="stats-number"><fmt:formatNumber value="${stat[1]}" /></span> <a href="<c:url value="/wiews/${faoInstitute.code}/t/${stat[0].genus}/${stat[0].species}" />"><c:out value="${stat[0].taxonName}" /></a></li>
Matija Obreza's avatar
Matija Obreza committed
147
148
149
				</c:forEach>
			</ul>
		</div>
150
				
Matija Obreza's avatar
Matija Obreza committed
151
152
153
	</div>


154
155
156
157
158
159
160
	<c:if test="${countByInstitute gt 0}">
		<form class="form-horizontal" method="post" action="/wiews/${faoInstitute.code}/dwca">
		<input type="hidden" name="${_csrf.parameterName}" value="${_csrf.token}"/>
		<div class="row" style="margin-top: 2em;">
			<div class="col-sm-4">
				<button class="btn btn-primary" type="submit"><spring:message code="metadata.download-dwca" /></button>
			</div>
161
		</div>
162
163
		</form>
	</c:if>
164

165
<content tag="javascript">
Matija Obreza's avatar
Matija Obreza committed
166
		<c:if test="${faoInstitute.latitude ne null}">
Matija Obreza's avatar
Matija Obreza committed
167
168
		<script type="text/javascript">
			jQuery(document).ready(function() {
169
				var map=GenesysMaps.map("${pageContext.response.locale.language}", $("#map"), {
170
					minZoom: 4,
171
					maxZoom: 6, /* WIEWS does not provide enough detail */
172
					center: new GenesysMaps.LatLng(${faoInstitute.latitude}, ${faoInstitute.longitude}), 
Matija Obreza's avatar
Matija Obreza committed
173
174
175
					markerTitle: "<spring:escapeBody javaScriptEscape="true">${faoInstitute.fullName}</spring:escapeBody>" 
				});
			});
Matija Obreza's avatar
Matija Obreza committed
176
177
178
179
		</script>
		</c:if>
		<script type="text/javascript">
			<%@include file="/WEB-INF/jsp/wiews/ga.jsp"%>
Matija Obreza's avatar
Matija Obreza committed
180
			_pageDim = { institute: '${faoInstitute.code}' };
Matija Obreza's avatar
Matija Obreza committed
181
		</script>
igoshin's avatar
igoshin committed
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
    <script>
        jQuery(document).ready(function() {

            function makeDataForFlot(data){
                var dataFlot = [];

                var other = 0;
                $.each(data, function (idx, statistic) {

                    if (idx < 9) {
                        dataFlot[idx] = {
                            label: statistic[0],
                            data: statistic[1]
                        }
                    } else {
                        other = statistic[1] + other;
                        dataFlot[9] = {
                            label: "Other",
                            data: other
                        }
                    }
                });
                return dataFlot;
            }

            $.ajax("/wiews/statJson", {
                data: "wiewsCode=" + "${faoInstitute.code}",
                success: function (data) {

                    var placeholder = $('#flot');
                    $("<div id='tooltip'></div>").css({
                        position: "absolute",
                        display: "none",
                        border: "1px solid #929292",
                        padding: "2px",
                        "background-color": "#929292",
                        opacity: 0.80
                    }).appendTo("body");

                    $.plot(placeholder, makeDataForFlot(data), {
                        series: {
                            pie: {
                                show: true
                            }
                        },
                        grid: {
                            hoverable: true,
                            clickable: true
                        },
                        legend: {
                            show: false
                        }
                    });

                    placeholder.bind("plothover", function (event, pos, obj) {
                        if (obj != null) {
                            var str = obj.series.label + " (" + obj.datapoint[1][0][1] + ")";
                            $("#hoverdata").text(str);
                            $("#tooltip").html(str)
                                    .css({top: pos.pageY - 25, left: pos.pageX + 5})
                                    .show();
                        }else{
                            $("#tooltip").hide();
                        }
                    });

                    placeholder.bind("plotclick", function (event, pos, obj) {
                        if (obj != null) {
                            window.location.replace(window.location.href + "/t/" + obj.series.label);
                        }
                    });
                },
                error: function (error) {
                    console.log(error);
                }
            });
        });
    </script>
260
</content>
Matija Obreza's avatar
Matija Obreza committed
261
262
</body>
</html>