Wiki source code of TemplateSheet

Last modified by superadmin on 2025/05/22 17:45

Hide last authors
superadmin 1.1 1 {{info}}{{translation key="export.pdf.template.skinExtensionInfo"/}}{{/info}}
2
3 {{velocity}}
4 ## We have to use wiki=true because $doc.display() can produce wiki syntax.
5 {{html wiki="true" clean="false"}}
6 ## Load the JavaScript code required to make the object properties editable in-place.
7 #set ($discard = $xwiki.jsfx.use('uicomponents/edit/editableProperty.js', {
8 'forceSkinAction': true,
9 'language': $xcontext.locale
10 }))
11 #set ($editing = $xcontext.action == 'edit')
12 ## The object to display.
13 #set ($xobject = $doc.getObject('XWiki.PDFExport.TemplateClass'))
14 ## The class that describes the object properties.
15 #set ($xclass = $xobject.xWikiClass)
16 ## Make sure the following display* method calls use the right object.
17 #set ($discard = $doc.use($xobject))
18 ## Using the xform vertical form layout.
19 <div class="xform">
20 <dl>
21 #foreach ($property in $xclass.properties)
22 <dt #if (!$editing && $hasEdit)
23 class="editableProperty"
24 #set ($xobjectPropertyReference = $xobject.getPropertyReference($property.name))
25 data-property="$escapetool.xml($services.model.serialize($xobjectPropertyReference))"
26 data-property-type="object"#end>
27 ## This must match the id generated by the $doc.display() method below.
28 #set ($propertyId = "${xclass.name}_${xobject.number}_$property.name")
29 <label#if ($editing) for="$escapetool.xml($propertyId)"#end>
30 $escapetool.xml($property.translatedPrettyName)
31 </label>
32 ## Support for specifying a translation key as hint in the property definition.
33 <span class="xHint">$!escapetool.xml($services.localization.render($property.hint))</span>
34 </dt>
35 <dd>$doc.display($property.name)</dd>
36 #end
37 #if (!$xclass.properties || $xclass.properties.size() == 0)
38 ## Keep the empty definition term in order to have valid HTML.
39 <dt></dt>
40 <dd>$escapetool.xml($services.localization.render('xclass.defaultObjectSheet.noProperties'))</dd>
41 #end
42 </dl>
43 </div>
44 {{/html}}
45 {{/velocity}}