Commit 94d0448d authored by Matija Obreza's avatar Matija Obreza

Fixed rendering of ES term results

parent e048caf1
......@@ -3,7 +3,7 @@
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>
<%@ attribute name="termResult" required="true" type="org.springframework.data.elasticsearch.core.facet.result.TermResult" %>
<%@ attribute name="termResult" required="true" type="org.genesys2.server.service.ElasticsearchService.TermResult" %>
<%@ attribute name="type" required="true" type="java.lang.String"%>
<%@ attribute name="messageCode" required="true" type="java.lang.String"%>
<%@ attribute name="count" required="false" type="java.lang.Integer" %>
......
......@@ -11,7 +11,7 @@
<c:choose>
<c:when test="${count eq null or count eq 0}">
<c:set var="totalCount" value="${termResult.totalCount+termResult.missingCount}" />
<c:set var="totalCount" value="${termResult.totalCount+termResult.missing}" />
</c:when>
<c:otherwise>
<c:set var="totalCount" value="${count}" />
......@@ -32,10 +32,10 @@
<c:when test="${type=='instCode'}">
<a href="<c:url value="/wiews/${term.term.toUpperCase()}" />"><c:out value="${term.term.toUpperCase()}" /></a>
</c:when>
<c:when test="${type=='bool' and term.term=='T'}">
<c:when test="${type=='bool' and term.term=='1'}">
<spring:message code="boolean.true" />
</c:when>
<c:when test="${type=='bool' and term.term=='F'}">
<c:when test="${type=='bool' and term.term=='0'}">
<spring:message code="boolean.false" />
</c:when>
<c:when test="${type ne null && type.startsWith('i18n')}">
......@@ -56,25 +56,25 @@
</div>
</div>
</c:forEach>
<c:if test="${termResult.otherCount gt 0}">
<c:if test="${termResult.other gt 0}">
<div class="row">
<div class="col-lg-6 col-md-6 col-sm-6 col-xs-6 ${status.count % 2 == 0 ? 'even' : 'odd'}">
<span><em><spring:message code="data-overview.otherCount" /></em></span>
</div>
<div class="col-lg-6 col-md-6 col-sm-6 col-xs-6">
<span class="stats-number"><fmt:formatNumber value="${termResult.otherCount}" /></span>
<%--<span class="terms-percent"><fmt:formatNumber pattern="#,##0.00%" value="${termResult.otherCount/totalCount}" /></span>--%>
<span class="stats-number"><fmt:formatNumber value="${termResult.other}" /></span>
<%--<span class="terms-percent"><fmt:formatNumber pattern="#,##0.00%" value="${termResult.other/totalCount}" /></span>--%>
</div>
</div>
</c:if>
<c:if test="${termResult.missingCount gt 0}">
<c:if test="${termResult.missing gt 0}">
<div class="row">
<div class="col-lg-6 col-md-6 col-sm-6 col-xs-6 ${status.count % 2 == 0 ? 'even' : 'odd'}">
<span><em><spring:message code="data-overview.missingCount" /></em></span>
</div>
<div class="col-lg-6 col-md-6 col-sm-6 col-xs-6">
<span class="stats-number"><fmt:formatNumber value="${termResult.missingCount}" /></span>
<%--<span class="terms-percent"><fmt:formatNumber pattern="#,##0.00%" value="${termResult.missingCount/totalCount}" /></span>--%>
<span class="stats-number"><fmt:formatNumber value="${termResult.missing}" /></span>
<%--<span class="terms-percent"><fmt:formatNumber pattern="#,##0.00%" value="${termResult.missing/totalCount}" /></span>--%>
</div>
</div>
</c:if>
......@@ -93,10 +93,10 @@
<c:when test="${type=='instCode'}">
<a href="<c:url value="/wiews/${term.term.toUpperCase()}" />"><c:out value="${term.term.toUpperCase()}" /></a>
</c:when>
<c:when test="${type=='bool' and term.term=='T'}">
<c:when test="${type=='bool' and term.term=='1'}">
<spring:message code="boolean.true" />
</c:when>
<c:when test="${type=='bool' and term.term=='F'}">
<c:when test="${type=='bool' and term.term=='0'}">
<spring:message code="boolean.false" />
</c:when>
<c:when test="${type ne null && type.startsWith('i18n')}">
......@@ -113,13 +113,13 @@
</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/totalCount}" /></span></td></tr>
<c:if test="${termResult.other gt 0}">
<tr><td><em><spring:message code="data-overview.otherCount" /></em></td><td class="text-right"><fmt:formatNumber value="${termResult.other}" /> <span class="terms-percent"><fmt:formatNumber pattern="#,##0.00%" value="${termResult.other/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/totalCount}" /></span></td></tr>
<c:if test="${termResult.missing gt 0}">
<tr><td><em><spring:message code="data-overview.missingCount" /></em></td><td class="text-right"><fmt:formatNumber value="${termResult.missing}" /> <span class="terms-percent"><fmt:formatNumber pattern="#,##0.00%" value="${termResult.missing/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> --%>
<%-- <tr><td><spring:message code="data-overview.totalCount" /></td><td class="text-right">!<fmt:formatNumber value="${termResult.totalCount+termResult.missing}" /></td></tr> --%>
<%--</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