index.jsp 6.34 KB
Newer Older
Matija Obreza's avatar
Crops  
Matija Obreza committed
1 2
<!DOCTYPE html>

3
<%@ include file="/WEB-INF/jsp/init.jsp" %>
Matija Obreza's avatar
Crops  
Matija Obreza committed
4 5 6

<html>
<head>
Matija Obreza's avatar
Matija Obreza committed
7 8
	<title><c:out value="${crop.getName(pageContext.response.locale)}" /></title>
	<meta name="description" content="<c:out value="${jspHelper.htmlToText(blurp.summary)}" />" />
Matija Obreza's avatar
Crops  
Matija Obreza committed
9 10
</head>
<body>
11
	<gui:alert type="error" display="${crop eq null}">
Alexander Basov's avatar
Alexander Basov committed
12
		<spring:message code="data.error.404"/>
13
	</gui:alert>
Matija Obreza's avatar
Crops  
Matija Obreza committed
14

Matija Obreza's avatar
Matija Obreza committed
15 16 17 18 19 20 21 22
<div class="informative-h1 row">
		<div class="col-md-12 col-sm-12">
			<h1>
				<c:out value="${crop.getName(pageContext.response.locale)}"/>
			</h1>
			<c:out value="${blurp.summary}" escapeXml="false" />
		</div>
</div>
Matija Obreza's avatar
Crops  
Matija Obreza committed
23

Matija Obreza's avatar
Matija Obreza committed
24 25
<security:authorize access="hasRole('ADMINISTRATOR') or hasPermission(#crop, 'ADMINISTRATION')">
	<a href="<c:url value="/acl/${crop.getClass().name}/${crop.id}/permissions"><c:param name="back"><c:url value="/c/${crop.shortName}" /></c:param></c:url>"
Alexander Basov's avatar
Alexander Basov committed
26 27 28
	   class="close">
		<spring:message code="edit-acl"/>
	</a>
Matija Obreza's avatar
Matija Obreza committed
29 30
</security:authorize>
<security:authorize access="hasRole('ADMINISTRATOR') or hasRole('CONTENTMANAGER') or hasPermission(#crop, 'ADMINISTRATION')">
Alexander Basov's avatar
Alexander Basov committed
31 32 33 34
	<a href="<c:url value="/c/${crop.shortName}/edit" />" class="close">
		<spring:message code="edit"/>
	</a>
</security:authorize>
Matija Obreza's avatar
Matija Obreza committed
35

36
<cms:blurb blurb="${blurp}" />
37

Matija Obreza's avatar
Matija Obreza committed
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
	<div class="content-section-2015">
		<h3>
			<span>
				<spring:message code="heading.general-info" />
			</span>
		</h3>
		<div class="row">
			<div class="col-md-offset-2 col-md-10">
				<ul class="funny-list statistics">
					<li class="clearfix odd">
						<span class="stats-number">
							<fmt:formatNumber value="${cropCount}" />
						</span>
						<spring:message code="faoInstitutes.stat.accessionCount" />
					</li>
				</ul>
				<div class="row" style="margin-top: 2em;">
					<div class="col-sm-12">
						<a class="btn btn-primary" title="" href="<c:url value="/c/${crop.shortName}/data" />">
							<span class="glyphicon glyphicon-list"></span>
							<spring:message code="view.accessions" />
						</a>
						
						<a class="btn btn-default" title="" href="<c:url value="/c/${crop.shortName}/overview" />">
							<span class="glyphicon glyphicon-eye-open"></span>
							<spring:message code="data-overview.short" />
						</a>

						<a class="btn btn-default" href="<c:url value="/c/${crop.shortName}/descriptors" />"><spring:message code="crop.view-descriptors"/></a>
					</div>
				</div>
			</div>
		</div>
	</div>

	<div class="content-section-2015">
		<h3>
			<span>
				<spring:message code="chart.collections.title" />
			</span>
		</h3>
		<div class="row">
			<div class="col-md-offset-2 col-md-10">
				<div id="cropMap" style="min-height: 500px; min-width: 200px; margin: 0 auto"></div>
			</div>
		</div>
	</div>
85

Matija Obreza's avatar
Matija Obreza committed
86 87 88 89 90 91 92 93 94 95 96
	<div class="content-section-2015">
		<h3>
			<span>
				<spring:message code="crop.taxonomy-rules"/>
			</span>
		</h3>
		<div class="row">
			<div class="col-md-offset-2 col-md-10">
				<ul class="funny-list">
					<c:forEach items="${cropRules}" var="rule">
						<li class="${rule.included ? '' : 'excluded'}"/>
Matija Obreza's avatar
Matija Obreza committed
97
						<b><c:out value="${rule.included ? '+' : '-'}" /></b> <c:out value="${rule.genus}"/> <c:out
Matija Obreza's avatar
Matija Obreza committed
98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118
							value="${rule.species eq null ? '*' : rule.species}"/></li>
					</c:forEach>
				</ul>
				
			<%-- 	<h3><spring:message code="taxonomy-list"/></h3> --%>
				<ul class="funny-list">
					<c:forEach items="${cropTaxonomies.content}" var="cropTaxonomy" varStatus="status">
						<li class="${status.count % 2 == 0 ? 'even' : 'odd'}"><a
								href="<c:url value="/acn/t/${cropTaxonomy.taxonomy.genus}/${cropTaxonomy.taxonomy.species}" />"><c:out
								value="${cropTaxonomy.taxonomy.taxonName}"/></a></li>
					</c:forEach>
					<c:if test="${cropTaxonomies.hasNext()}">
						<li id="loadMoreTaxonomies">
							<button class="btn"><spring:message code="label.load-more-data" /></button>
						</li>
					</c:if>
				</ul>
			</div>
		</div>
	</div>
	
Alexander Basov's avatar
Alexander Basov committed
119
<content tag="javascript">
120
	<script type="text/javascript">
Alexander Basov's avatar
Alexander Basov committed
121 122
		jQuery(document).ready(function () {
			$("body").on("click", "#loadMoreTaxonomies", function (event) {
123
				event.preventDefault();
Alexander Basov's avatar
Alexander Basov committed
124 125
				var loader = $(this);
				var page = loader.attr("page") || 2;
126
				$.ajax({
Alexander Basov's avatar
Alexander Basov committed
127 128 129 130
					url: "<c:url value="/c/${crop.shortName}/ajax/taxonomies" />",
					type: "GET",
					data: {
						"page": page
131
					},
Alexander Basov's avatar
Alexander Basov committed
132
					success: function (data) {
133
						loader.before(data);
Alexander Basov's avatar
Alexander Basov committed
134
						loader.attr("page", parseInt(page) + 1);
135
					},
Alexander Basov's avatar
Alexander Basov committed
136
					error: function (err) {
137 138 139 140 141 142
						loader.remove();
					}
				});
			});
		});
	</script>
Matija Obreza's avatar
Matija Obreza committed
143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198

    <script type="text/javascript" src="<c:url value="/html/js/genesyshighcharts.min.js" />"></script>
    <script type="text/javascript">
        $(function () {
            'use strict';

            $.getJSON('/${pageContext.response.locale}/explore/0/charts/data/country-collection-size?filter=${jsonFilter}', function (data) {
                var mapData = Highcharts.geojson(Highcharts.maps['custom/world']);

                $('#cropMap').highcharts('Map', {
                    chart: {
                        borderWidth: 0
                    },

                    title: {
                        text: '<spring:message code="chart.collections.title" />'
                    },
<%--
                    subtitle: {
                        text: '<spring:message code="chart.attribution-text" />' 
                    },
--%>
                    legend: {
                        enabled: false
                    },

                    mapNavigation: {
                        enabled: true,
                        buttonOptions: {
                            verticalAlign: 'top'
                        }
                    },

                    series: [{
                        name: 'World',
                        mapData: mapData,
                        color: '#88ba42',
                        enableMouseTracking: false
                    }, {
                        type: 'mapbubble',
                        mapData: mapData,
                        name: '<spring:message code="chart.collections.series" />',
                        joinBy: ['iso-a2', 'code'],
                        data: data,
                        sizeBy: 'width',
                        color: '#88ba42',
                        minSize: '3',
                        maxSize: '30%',
                        tooltip: {
                            pointFormat: '{point.country}: {point.z}'
                        }
                    }]
                });
            });
        });
    </script>
199
</content>
Matija Obreza's avatar
Crops  
Matija Obreza committed
200 201
</body>
</html>