Changes for page homeopathsSheet
Last modified by Jip-jan Alunkel on March 26, 17:31
From version 1.152
edited by Jip-jan Alunkel
on March 08, 18:56
on March 08, 18:56
Change comment:
There is no comment for this version
To version 3.2
edited by Jip-jan Alunkel
on March 08, 20:14
on March 08, 20:14
Change comment:
Rollback to version 1.38
Summary
-
Page properties (1 modified, 0 added, 0 removed)
Details
- Page properties
-
- Content
-
... ... @@ -33,19 +33,32 @@ 33 33 <div id="${spaceTitle}" class="box sheet_properties"> 34 34 <h2>Details</h2> 35 35 ## The classProperties Map has to be in the order of how you want the form elements to appear in the form. 36 -#set($classProperties = [ 37 - {'practiceName': {'type': 'text'}}, 38 - {'pmAddress': {'type': 'address', 'extraAttributes': {"aria-label": "Input and select the address of your practice", "placeholder": "$services.localization.render('homeopaths.multiword.address.placeholder')", "data-auto-first-capital": "true", "data-query-type": "address", "data-query-reference": "", "data-query-list-type": "suggest-select", "data-query-list-header": "$services.localization.render('pagemaker.line.suggest_select_list')", "data-query-list-contents": "value/key", "data-query-list-editable": "false", "data-create-xobj": "true", "data-xobj-classname": "homeopaths.Code.homeopathsClass", "help-block" : 'Input street and number, then select the address of your practice.'}}}, 39 - {'pmStreet': {'type': 'text'}}, 40 - {'pmHousenumber': {'type': 'text'}}, 41 - {'pmPostcode': {'type': 'text'}}, 42 - {'pmCity': {'type': 'text'}}, 43 - {'pmCounty': {'type': 'text'}}, 44 - {'pmState': {'type': 'text'}}, 45 - {'pmCountry': {'type': 'text'}}, 46 - {'certification': {'type': 'checkbox', 'opener': 1}}, 47 - {'certificationFrom': {'type': 'text', 'parent': 'certification'}} 48 -]) 36 +#set($classProperties = { 37 + 'practiceName': {'type': 'text'}, 38 + 'pmAddress': {'type': 'address', 'extraAttributes': {"aria-label": "Input and select the address of your practice", "placeholder": "$services.localization.render('homeopaths.multiword.address.placeholder')", "data-auto-first-capital": "true", "data-query-type": "address", "data-query-reference": "", "data-query-list-type": "suggest-select", "data-query-list-header": "$services.localization.render('pagemaker.line.suggest_select_list')", "data-query-list-contents": "value/key", "data-query-list-editable": "false", "data-create-xobj": "true", "data-xobj-classname": "homeopaths.Code.homeopathsClass", "help-block" : 'Input street and number, then select the address of your practice.'}}, 39 + 'pmStreet': {'type': 'text'}, 40 + 'pmHousenumber': {'type': 'text'}, 41 + 'pmPostcode': {'type': 'text'}, 42 + 'pmCity': {'type': 'text'}, 43 + 'pmCounty': {'type': 'text'}, 44 + 'pmState': {'type': 'text'}, 45 + 'pmCountry': {'type': 'text'}, 46 + 'certification': {'type': 'checkbox', 'opener': 1}, 47 + 'certificationFrom': {'type': 'text', 'parent': 'certification'} 48 +}) 49 +#foreach($property in $classProperties.keySet()) 50 + #if($theDocObj.getProperty($property)) 51 + <p class="property"> 52 + #if($theDocObj.getProperty($property).value != "" && $property != "pmHousenumber") ## Difference with added housenumber because of the streetaddress layout. 53 + #if($property == "pmStreet") ## Difference with added housenumber because of the streetaddress layout. 54 + <span class="property-name">$services.localization.render("homeopaths.classproperty.address")</span> <span class="property-value">$doc.display($property) $doc.display("pmHousenumber")</span> 55 + #else 56 + <span class="property-name">$services.localization.render("homeopaths.classproperty.${property}")</span> <span class="property-value">$doc.display($property)</span> 57 + #end 58 + </p> 59 + #end 60 + #end 61 +#end 49 49 50 50 #if($hasRight) 51 51 <p class="buttons text-align-right"> ... ... @@ -84,35 +84,29 @@ 84 84 </div> 85 85 <div class="modal-body"> 86 86 #set($lastChild = "") 87 -#foreach($property in $classProperties) 88 - #foreach($item in $property.keySet()) 89 - #set($key = $item) 90 - #end 91 - #foreach($item in $property.values()) 92 - #set($propertyType = $item.type) 93 - #set($propertyOpener = $item.opener) 94 - #set($propertyParent = $item.parent) 95 - #set($extraAttributes = $item.extraAttributes) 96 - #end 97 - #set($label = $services.localization.render("homeopaths.classproperty.${key}")) 98 - #if($theDocObj.getProperty($key) || $propertyType == "address") 99 - #set($value = $theDocObj.getProperty($key).value) 100 +#foreach($propertyName in $classProperties.keySet()) 101 + #set($item = $classProperties["$propertyName"]) 102 + #set($propertyType = $item.type) 103 + #set($propertyOpener = $item.opener) 104 + #set($propertyParent = $item.parent) 105 + #set($extraAttributes = $item.extraAttributes) 106 + #set($label = $services.localization.render("homeopaths.classproperty.${propertyName}")) 107 + #if($theDocObj.getProperty($propertyName) || $propertyType == "address") 108 + #set($value = $theDocObj.getProperty($propertyName).value) 109 + #if($propertyType == "checkbox" || $propertyType == "radio") 110 + #set($value = "1") 111 + #end 100 100 #if(!$value) 101 - #if($propertyType == "checkbox" || $propertyType == "radio") 102 - #set($value = "1") 103 -$propertyType - $value 104 - #else 105 - #set($value = "") 106 - #end 113 + #set($value = "") 107 107 #end 108 108 #set($newElem = { 109 - "id" : "$ key",116 + "id" : "$propertyName", 110 110 "type" : $propertyType, 111 111 "required" : "false", 112 112 "label" : "$label", 113 113 "data-create-xobj" : "true", 114 114 "data-xobj-classname" : $theClass, 115 - "data-xobj-fieldname" : "$ key",122 + "data-xobj-fieldname" : "$propertyName", 116 116 "value" : "$value" 117 117 }) 118 118 #if($extraAttributes.keySet().size() > 0) ... ... @@ -132,7 +132,6 @@ 132 132 #end 133 133 #createFormElement($newElem) 134 134 #if($propertyOpener) 135 -##$value 136 136 #createExpandStart($newElem $value) 137 137 #end 138 138 #end