Commit 35d2f2f8 authored by Matija Obreza's avatar Matija Obreza

STORAGE, DUPLSITE stats % must be based on accessionCount

parent d56e89b1
......@@ -455,6 +455,7 @@ public class ExplorerController extends BaseController {
model.addAttribute("jsonFilter", appliedFilters.toString());
// Composition overview
model.addAttribute("accessionCount", elasticService.termStatisticsAuto(appliedFilters, FilterConstants.INSTCODE, 10).getTotalCount());
overviewInstitutes(model, appliedFilters);
overviewComposition(model, appliedFilters);
overviewAvailability(model, appliedFilters);
......
......@@ -185,9 +185,11 @@
<div class="col-xs-12 col-sm-6 row-section">
<h4 id="stats-duplsite"><spring:message code="filter.duplSite" /></h4>
<c:set var="type" value="instCode" />
<c:set var="count" value="${accessionCount}" />
<c:set var="termResult" value="${statsDuplSite}" />
<%@include file="termresult.jspf"%>
<c:remove var="termResult" />
<c:remove var="count" />
<c:remove var="type" />
</div>
<div class="col-xs-12 col-sm-6 row-section">
......@@ -203,9 +205,11 @@
<div class="col-xs-12 col-sm-6 row-section">
<h4 id="stats-storage"><spring:message code="filter.storage" /></h4>
<c:set var="type" value="i18n.accession.storage" />
<c:set var="count" value="${accessionCount}" />
<c:set var="termResult" value="${statsStorage}" />
<%@include file="termresult.jspf"%>
<c:remove var="termResult" />
<c:remove var="count" />
<c:remove var="type" />
</div>
</div>
......
......@@ -4,6 +4,15 @@
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<c:choose>
<c:when test="${count eq null or count eq 0}">
<c:set var="totalCount" value="${termResult.totalCount+termResult.missingCount}" />
</c:when>
<c:otherwise>
<c:set var="totalCount" value="${count}" />
</c:otherwise>
</c:choose>
<table class="terms-table">
<c:forEach items="${termResult.terms}" var="term">
<tr><td>
......@@ -29,13 +38,15 @@
<c:otherwise>${term.term}</c:otherwise>
</c:choose>
</td><td class="text-right"><fmt:formatNumber value="${term.count}" /> <span class="terms-percent"><fmt:formatNumber pattern="#,##0.00%" value="${term.count/(termResult.totalCount+termResult.missingCount)}" /></span></td></tr>
</td><td class="text-right"><fmt:formatNumber value="${term.count}" /> <span class="terms-percent"><fmt:formatNumber pattern="#,##0.00%" value="${term.count/totalCount}" /></span></td></tr>
</c:forEach>
<c:if test="${termResult.otherCount gt 0}">
<tr><td><em><spring:message code="data-overview.otherCount" /></em></td><td class="text-right"><fmt:formatNumber value="${termResult.otherCount}" /> <span class="terms-percent"><fmt:formatNumber pattern="#,##0.00%" value="${termResult.otherCount/(termResult.totalCount+termResult.missingCount)}" /></span></td></tr>
<tr><td><em><spring:message code="data-overview.otherCount" /></em></td><td class="text-right"><fmt:formatNumber value="${termResult.otherCount}" /> <span class="terms-percent"><fmt:formatNumber pattern="#,##0.00%" value="${termResult.otherCount/totalCount}" /></span></td></tr>
</c:if>
<c:if test="${termResult.missingCount gt 0}">
<tr><td><em><spring:message code="data-overview.missingCount" /></em></td><td class="text-right"><fmt:formatNumber value="${termResult.missingCount}" /> <span class="terms-percent"><fmt:formatNumber pattern="#,##0.00%" value="${termResult.missingCount/(termResult.totalCount+termResult.missingCount)}" /></span></td></tr>
<tr><td><em><spring:message code="data-overview.missingCount" /></em></td><td class="text-right"><fmt:formatNumber value="${termResult.missingCount}" /> <span class="terms-percent"><fmt:formatNumber pattern="#,##0.00%" value="${termResult.missingCount/totalCount}" /></span></td></tr>
</c:if>
<%-- <tr><td><spring:message code="data-overview.totalCount" /></td><td class="text-right">!<fmt:formatNumber value="${termResult.totalCount+termResult.missingCount}" /></td></tr> --%>
</table>
\ No newline at end of file
</table>
<c:remove var="totalCount" />
\ No newline at end of file
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