0 Votes

Changes for page Public Web Site

Last modified by Alex Cotiugă on 2025/11/27 10:42

From version 3.69
edited by Alex Cotiugă
on 2025/11/24 15:54
Change comment: There is no comment for this version
To version 3.60
edited by Alex Cotiugă
on 2025/11/24 12:32
Change comment: There is no comment for this version

Summary

Details

Page properties
Content
... ... @@ -172,23 +172,20 @@
172 172   </div>
173 173  #end
174 174  
175 -#macro (stripHTMLMacro $displayOutput)
176 - $stringtool.removeEnd($stringtool.removeStart($displayOutput, '{{html clean="false" wiki="false"}}'), '{{/html}}')
177 -#end
178 -
179 179  #macro (displayFormFromSheetCode)
180 - #set ($editing = true)
176 + #set ($editing = $xcontext.action == 'edit')
181 181   ## The object to display.
182 - #set ($xobject = $doc.newObject('Agnease.Code.Lead.LeadClass'))
178 + #set ($xobject = $doc.getObject('Agnease.Code.Lead.LeadClass'))
183 183   ## The class that describes the object properties.
184 184   #set ($xclass = $xwiki.getClass('Agnease.Code.Lead.LeadClass'))
181 + $xclass
185 185   ## Make sure the following display* method calls use the right object.
186 186   #set ($discard = $doc.use($xobject))
187 187   ## Using the xform vertical form layout.
188 - <div class="xform half">
185 + <div class="xform">
189 189   <dl>
190 190   #foreach ($property in $xclass.properties)
191 - <dt #if (!$editing)
188 + <dt #if (!$editing && $hasEdit)
192 192   class="editableProperty"
193 193   #set ($xobjectPropertyReference = $xobject.getPropertyReference($property.name))
194 194   data-property="$escapetool.xml($services.model.serialize($xobjectPropertyReference))"
... ... @@ -201,8 +201,7 @@
201 201   ## Support for specifying a translation key as hint in the property definition.
202 202   <span class="xHint">$!escapetool.xml($services.localization.render($property.hint))</span>
203 203   </dt>
204 - #set ($displayOutput = $doc.display($property.name, 'edit'))
205 - <dd>#stripHTMLMacro($displayOutput)</dd>
201 + <dd>$doc.display($property.name)</dd>
206 206   #end
207 207   #if (!$xclass.properties || $xclass.properties.size() == 0)
208 208   ## Keep the empty definition term in order to have valid HTML.