Wiki source code of test Bootstrap Tabs
Last modified by admin on 2025/01/15 13:36
Show last authors
| author | version | line-number | content |
|---|---|---|---|
| 1 | {{velocity}} | ||
| 2 | ## tab and table CSS | ||
| 3 | #set($discard = $xwiki.ssx.use("Sandbox.BootstrapTabSheet")) | ||
| 4 | #if ($xcontext.action == 'view') | ||
| 5 | ## Apply a specific CSS style in view mode (to hide tooltip icone) | ||
| 6 | #set($discard = $xwiki.ssx.use("Sandbox.BootstrapTabClass")) | ||
| 7 | #end | ||
| 8 | |||
| 9 | ## Javascript to drop a cookie to save last opened tab | ||
| 10 | #set($discard = $xwiki.jsx.use("Sandbox.BootstrapTabSheet")) | ||
| 11 | |||
| 12 | ##Prefix to identify HTML code to display it | ||
| 13 | #set ($PrefxHtml= 'CodeH') | ||
| 14 | |||
| 15 | {{html wiki="true"}} | ||
| 16 | |||
| 17 | ## Class to use | ||
| 18 | #set($class = $doc.getObject('Sandbox.BootstrapTabClass').xWikiClass) | ||
| 19 | ## loop on Class properties | ||
| 20 | #foreach($prop in $class.properties) | ||
| 21 | ## display HTML code (stored in Prettyname property) for tab and container | ||
| 22 | #if ($prop.Name.startsWith("$!{PrefxHtml}_")=='true') | ||
| 23 | ##Insert HTML code inserted in the property PrettyName | ||
| 24 | #set ($StrLine= $prop.prettyName) | ||
| 25 | #else | ||
| 26 | ##display data in a table | ||
| 27 | ##start the line | ||
| 28 | #set ($StrLine= "<div class='BstRow'>") | ||
| 29 | #if ($stringtool.trimToEmpty($prop.prettyName)!='') | ||
| 30 | #set($classWidthColumn='BtsColumnNormalWidth') | ||
| 31 | ## display PrettyName in first Column | ||
| 32 | #set ($StrLine= $!StrLine+"<div class='BstColumn1'>$prop.prettyName</div>") | ||
| 33 | #else | ||
| 34 | #set($classWidthColumn='BtsColumnLargeWidth') | ||
| 35 | #end | ||
| 36 | ## display data in second Column | ||
| 37 | ## #set ($StrLine= $!StrLine+" <div class='BstColumn2 BstViewValue'>$doc.display($prop.getName())</div>") | ||
| 38 | #set ($StrLine= $!StrLine+" <div class='BstColumn2 BstViewValue " + $classWidthColumn + "'>$doc.display($prop.getName())</div>") | ||
| 39 | ## end of the line | ||
| 40 | #set ($StrLine= $!StrLine+"</div>") | ||
| 41 | #end | ||
| 42 | ## display the table line | ||
| 43 | $!StrLine | ||
| 44 | ## and reinit it | ||
| 45 | #set ($StrLine='') | ||
| 46 | #end | ||
| 47 | |||
| 48 | {{/html}} | ||
| 49 | |||
| 50 | {{/velocity}} |