Commit a79de6bc authored by Matija Obreza's avatar Matija Obreza

Limit institute stats to 30 entries

parent 8635e088
......@@ -76,8 +76,11 @@ public class WiewsController extends BaseController {
model.addAttribute("faoInstitute", faoInstitute);
model.addAttribute("countByInstitute", genesysService.countByInstitute(faoInstitute));
model.addAttribute("statisticsGenus", genesysService.statisticsGenusByInstitute(faoInstitute));
model.addAttribute("statisticsTaxonomy", genesysService.statisticsTaxonomyByInstitute(faoInstitute));
// FIXME some institutes have *a lot* of different taxa
// TODO needs pagination
model.addAttribute("statisticsGenus", genesysService.statisticsGenusByInstitute(faoInstitute).subList(0, 30));
model.addAttribute("statisticsTaxonomy", genesysService.statisticsTaxonomyByInstitute(faoInstitute).subList(0, 30));
return "/wiews/details";
}
......
......@@ -57,7 +57,7 @@
<div class="clearfix" style="margin-top: 2em;">
<div class="pull-left" style="margin-right: 3em;">
<h4>By Genus</h4>
<h4>Top 30 by Genus</h4>
<ul class="funny-list statistics">
<c:forEach items="${statisticsGenus}" var="stat" varStatus="status">
<li><span class="stats-number"><fmt:formatNumber value="${stat[1]}" /></span> <c:out value="${stat[0]}" /></li>
......@@ -66,7 +66,7 @@
</div>
<div class="pull-left" style="margin-right: 3em;">
<h4>By Species</h4>
<h4>Top 30 by Species</h4>
<ul class="funny-list statistics">
<c:forEach items="${statisticsTaxonomy}" var="stat" varStatus="status">
<li><span class="stats-number"><fmt:formatNumber value="${stat[1]}" /></span> <a href="<c:url value="/wiews/${faoInstitute.code.toLowerCase()}/t/${stat[0].genus}/${stat[0].species}" />"><c:out value="${stat[0].taxonName}" /></a></li>
......
......@@ -79,7 +79,7 @@
</error-page>
<error-page>
<error-code>500</error-code>
<location>/WEB-INF/jsps/500.jsp</location>
<location>/WEB-INF/jsp/500.jsp</location>
</error-page>
<session-config>
<session-timeout>30</session-timeout>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment