PageRenderTime 14ms CodeModel.GetById 10ms app.highlight 1ms RepoModel.GetById 2ms app.codeStats 0ms

/testability-explorer/src/main/resources/com/google/test/metric/report/source/Macro.ftl

http://testability-explorer.googlecode.com/
Freemarker Template | 75 lines | 72 code | 3 blank | 0 comment | 6 complexity | dde8945ca79419b95e1d60fbde1b58d8 MD5 | raw file
 1<#function code text>
 2  <#return "<tt>" + text?html?replace(' ', '&nbsp;') +"</tt>">
 3</#function>
 4
 5<#function color value>
 6  <#if (value <= maxExcellentCost) >
 7    <#return "style='background-color:#DDF9CC'">
 8  <#elseif (value <= maxAcceptableCost)>
 9    <#return "style='background-color:#FFFF77'">
10  <#else>
11    <#return "style='background-color:#FFBBBB'">
12  </#if>  
13</#function>
14
15<#macro overview report name listName>
16<table class="source" cellspacing="0" cellpadding="0">
17  <tr>
18    <td class="head" width="100">Metric:</td>
19    <td class="head" width="100">Value:</td>
20    <td class="head" colspan="2" width="100%">Chart:</td>
21  </tr>
22  <tr>
23    <td nowrap class="metric">${name} cost:</td>
24    <td class="score" ${color(report.overallCost)}>${report.overallCost} 
25      <a href="http://code.google.com/p/testability-explorer/wiki/OverallCostsExplanation">[?]</a>
26    </td>
27    <td rowspan="2" align="center" class="score" style="border-right:none">${report.overallCostChart}</td>
28    <td class="score" rowspan="7">${report.histogramChart}</td>
29  </tr>
30  <tr>
31    <td class="score">&nbsp;</td>
32    <td class="score">&nbsp;</td>
33  </tr>
34  <tr>
35    <td class="metric">${listName} count:</td>
36    <td class="score">${report.count}</td>
37    <td rowspan="5" align="center" class="score" style="border-right:none">${report.distributionChart}</td>
38  </tr>
39  <tr>
40    <td class="metric">&nbsp;&nbsp;&nbsp;Excellent:</td>
41    <td class="score" style="background-color:#DDF9CC">${report.excellentCount}&nbsp;[${(report.excellentPercent)?string.percent}]</td>
42  </tr>
43  <tr>
44    <td class="metric">&nbsp;&nbsp;&nbsp;Good:</td>
45    <td class="score" style="background-color:#FFFF77">${report.goodCount}&nbsp;[${(report.goodPercent)?string.percent}]</td>
46  </tr>
47  <tr>
48    <td class="metric">&nbsp;&nbsp;&nbsp;Needs work:</td>
49    <td class="score" style="background-color:#FFBBBB">${report.needsWorkCount}&nbsp;[${(report.needsWorkPercent)?string.percent}]</td>
50  </tr>
51  <tr>
52    <td class="score">&nbsp;</td>
53    <td class="score">&nbsp;</td>
54  </tr>
55</table>
56</#macro>
57
58<#macro unitList list name keys=["cost"] headers=["Cost"]>
59<table class="source" cellspacing="0" cellpadding="0">
60  <tr>
61    <td class="head">${name}:</td>
62    <#list headers as header>
63    <td class="head">${header}:</td>
64    </#list>
65  </tr>
66  <#list list as unit>
67  <tr>
68    <td class="score" ${color(unit.cost)}><a href="<#nested unit>"><tt>${unit.name}</tt></a></td>
69    <#list keys as key>
70    <td nowrap class="score" ${color(unit.cost)}>${printCost(unit[key])}&nbsp;</td>
71    </#list>
72  </tr>
73  </#list>
74</table>
75</#macro>