Changes for page homeopathsSheet

Last modified by Jip-jan Alunkel on March 26, 17:31

From version 1.26
edited by Jip-jan Alunkel
on March 07, 19:28
Change comment: There is no comment for this version
To version 1.31
edited by Jip-jan Alunkel
on March 07, 22:27
Change comment: There is no comment for this version

Summary

Details

Page properties
Content
... ... @@ -31,16 +31,29 @@
31 31  #if($xcontext.action == "view")
32 32  <div id="${spaceTitle}" class="box sheet_properties">
33 33   <h2>Details</h2>
34 -#set($classProperties = ['practiceName','pmStreet','pmHousenumber','pmPostcode','pmCity','pmCounty','pmState','pmCountry','certification','certificationFrom'])
35 -#foreach($property in $classProperties)
34 +#set($classProperties = {
35 + 'practiceName': {'type': 'string'},
36 + 'pmStreet': {'type': 'string'},
37 + 'pmHousenumber': {'type': 'string'},
38 + 'pmPostcode': {'type': 'string'},
39 + 'pmCity': {'type': 'string'},
40 + 'pmCounty': {'type': 'string'},
41 + 'pmState': {'type': 'string'},
42 + 'pmCountry': {'type': 'string'},
43 + 'certification': {'type': 'bool'},
44 + 'certificationFrom': {'type': 'string'}
45 +})
46 +#foreach($property in $classProperties.keySet())
47 + #if($theDocObj.getProperty($property))
36 36   <p class="property">
37 - #if($theDocObj.getProperty($property).value != "" && $property != "pmHousenumber")
38 - #if($property == "pmStreet")
49 + #if($theDocObj.getProperty($property).value != "" && $property != "pmHousenumber") ## Difference with added housenumber because of the streetaddress layout.
50 + #if($property == "pmStreet") ## Difference with added housenumber because of the streetaddress layout.
39 39   <span class="property-name">$services.localization.render("homeopaths.classproperty.address")</span> <span class="property-value">$doc.display($property) $doc.display("pmHousenumber")</span>
40 - #else
52 + #else
41 41   <span class="property-name">$services.localization.render("homeopaths.classproperty.${property}")</span> <span class="property-value">$doc.display($property)</span>
42 - #end
54 + #end
43 43   </p>
56 + #end
44 44   #end
45 45  #end
46 46  
... ... @@ -61,9 +61,14 @@
61 61   "use_captcha": "false"
62 62   })
63 63   #set($thisObj = {})
64 - #foreach($item in $classProperties)
77 + #foreach($item in $classProperties.keySet())
65 65   #set($label = $services.localization.render("homeopaths.classproperty.${item}"))
66 - $label
79 + #if($theDocObj.getProperty($item))
80 + #set($value = $theDocObj.getProperty($item).value)
81 + #else
82 + #set($value = "")
83 + #end
84 + $classProperties[$item].type
67 67   #set($newElem = {
68 68   "id": "$item",
69 69   "type": "text",
... ... @@ -72,7 +72,7 @@
72 72   "data-create-xobj" : "true",
73 73   "data-xobj-classname" : "homeopaths.Code.homeopathsClass",
74 74   "data-xobj-fieldname" : "$item",
75 - "value": '$theDocObj.getProperty("$item").value'
93 + "value": "$value"
76 76   })
77 77   #set($thisObj["$item"] = $newElem)
78 78   #end