Holger Knublauch

Applied to * logic to cells as well

...@@ -5,25 +5,27 @@ ...@@ -5,25 +5,27 @@
5 <ui:setContext ui:queryGraph="&lt;http://www.reportinghub.no/ep/spin/ddr-tables&gt;"> 5 <ui:setContext ui:queryGraph="&lt;http://www.reportinghub.no/ep/spin/ddr-tables&gt;">
6 <h2>{= ui:label(?template) }</h2> 6 <h2>{= ui:label(?template) }</h2>
7 </ui:setContext> 7 </ui:setContext>
8 - <table class="ddrTable"> 8 + <table class="ddrTable" letrs:hrs="{#
9 - <ui:setContext ui:queryGraph="&lt;http://www.reportinghub.no/ep/spin/ddr-tables&gt;"> 9 + SELECT ?header ?left
10 - <tr class="ddrTR">
11 - <ui:forEach ui:resultSet="{#
12 - SELECT ?header
13 WHERE { 10 WHERE {
11 + GRAPH &lt;http://www.reportinghub.no/ep/spin/ddr-tables&gt; {
14 ?template rhspin:tableHeaders ?list . 12 ?template rhspin:tableHeaders ?list .
15 - ?list &lt;http://jena.hpl.hp.com/ARQ/list#member&gt; ?header . 13 + ?list &lt;http://jena.hpl.hp.com/ARQ/list#member&gt; ?str .
14 + BIND (fn:starts-with(?str, '*') AS ?left) .
15 + BIND (IF(?left, fn:substring(?str, 2), ?str) AS ?header) .
16 + }
16 } 17 }
17 }"> 18 }">
18 - <th class="ddrTH" style="{= IF(fn:starts-with(?header, '*'), 'text-align: left', ?none) }" 19 + <tr class="ddrTR">
19 - let:h="{= IF(fn:starts-with(?header, '*'), fn:substring(?header, 2), ?header) }"><ui:parse ui:str="{= html:encodeBRs(spif:replaceAll(?h, ' ', '&nbsp;')) }" /></th> 20 + <ui:forEach ui:resultSet="{= ?hrs }">
21 + <th class="ddrTH" style="{= IF(?left, 'text-align: left', ?none) }"
22 + ><ui:parse ui:str="{= html:encodeBRs(spif:replaceAll(?header, ' ', '&nbsp;')) }" /></th>
20 </ui:forEach> 23 </ui:forEach>
21 </tr> 24 </tr>
22 - </ui:setContext>
23 <ui:forEach ui:resultSet="{# SELECT ?row ?rowIndex WHERE { ?rs spr:rowIndices ?rowIndex } }"> 25 <ui:forEach ui:resultSet="{# SELECT ?row ?rowIndex WHERE { ?rs spr:rowIndices ?rowIndex } }">
24 <tr class="ddrTR"> 26 <tr class="ddrTR">
25 - <ui:forEach ui:resultSet="{# SELECT ?cell WHERE { (?rs ?rowIndex) spr:rowCells (?cell ?cellIndex) } }"> 27 + <ui:forEach ui:resultSet="{# SELECT ?cell ?colIndex WHERE { (?rs ?rowIndex) spr:rowCells (?cell ?colIndex) } }">
26 - <td class="ddrTD">{= ?cell }</td> 28 + <td class="ddrTD" style="{= IF(spr:cell(?hrs, ?colIndex, 1), 'text-align: left', 'text-align: center') }">{= ?cell }</td>
27 </ui:forEach> 29 </ui:forEach>
28 </tr> 30 </tr>
29 </ui:forEach> 31 </ui:forEach>
......