clovsky.swagger-coverage-commons.1.5.0.source-code.ui.ftl Maven / Gradle / Ivy
<#macro progressbar current full height=16>
<#if full gt 0 >
<#assign percentValue = 100*current/(full)>
<#assign bgStyle = "bg-danger">
<#if percentValue gt 33>
<#assign bgStyle = "bg-warning">
#if>
<#if percentValue gt 66>
<#assign bgStyle = "bg-success">
#if>
#if>
#macro>
<#macro progress current full postfix>
<#if full gt 0 >
${current}/${full}
(${100*(current/full)}%)
<#else>
--
#if>
${postfix}
<#if full gt 0 >
<@progressbar current = current full = full />
#if>
#macro>
<#macro coverageBadget counter>
<#if counter.all gt 0>
<#assign fullValue = counter.full * 100 / counter.all>
<#assign partlyValue = counter.party * 100 / counter.all>
<#assign emptyValue = counter.empty * 100 / counter.all>
${i18["badged.full"]}: ${counter.full * 100 / counter.all}%
${i18["badged.partial"]}: ${counter.party * 100 / counter.all}%
${i18["badged.empty"]}: ${counter.empty * 100 / counter.all}%
#if>
#macro>
<#macro coverageStateBadget operationResult>
<#if operationResult.processCount == 0>
${i18["common.state.no_call"]}
<#else>
<#switch operationResult.state>
<#case "FULL">
${i18["common.state.full"]}
<#break>
<#case "PARTY">
${i18["common.state.partial"]}
<#break>
<#case "EMPTY">
${i18["common.state.empty"]}
<#break>
<#default>
#switch>
#if>
#macro>
<#macro success text>
${text}
#macro>
<#macro danger text>
${text}
#macro>
<#macro question text>
${text}
#macro>