Changes for page homeopathsSheet
Last modified by Jip-jan Alunkel on March 26, 17:31
From version 3.18
edited by Jip-jan Alunkel
on March 09, 00:52
on March 09, 00:52
Change comment:
Rollback to version 1.38
To version 3.25
edited by Jip-jan Alunkel
on March 09, 01:44
on March 09, 01:44
Change comment:
Rollback to version 1.38
Summary
-
Page properties (1 modified, 0 added, 0 removed)
Details
- Page properties
-
- Content
-
... ... @@ -35,14 +35,15 @@ 35 35 ## The classProperties Map has to be in the order of how you want the form elements to appear in the form. 36 36 #set($classProperties = { 37 37 'practiceName': {'type': 'text', 'extraAttributes': {"disabled": "disabled", "help-block" : 'The name of your practice is the title of this page. If you want to change it, you should edit the content of this page.'}}, 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'}, 38 + 'editAddress': {'type': 'checkbox', 'opener': 1, 'classless': 1}, 39 + 'pmAddress': {'type': 'address', 'parent': 'editAddress', '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.'}}, 40 + 'pmStreet': {'type': 'text', 'disabled': 1}, 41 + 'pmHousenumber': {'type': 'text', 'disabled': 1}, 42 + 'pmPostcode': {'type': 'text', 'disabled': 1}, 43 + 'pmCity': {'type': 'text', 'disabled': 1}, 44 + 'pmCounty': {'type': 'text', 'disabled': 1}, 45 + 'pmState': {'type': 'text', 'disabled': 1}, 46 + 'pmCountry': {'type': 'text', 'disabled': 1}, 46 46 'certification': {'type': 'checkbox', 'opener': 1}, 47 47 'certificationFrom': {'type': 'text', 'parent': 'certification'} 48 48 }) ... ... @@ -128,44 +128,53 @@ 128 128 #set($propertyParent = $item.parent) 129 129 #set($extraAttributes = $item.extraAttributes) 130 130 #set($label = $services.localization.render("homeopaths.classproperty.${propertyName}")) 131 - #if($theDocObj.getProperty($propertyName) || $propertyType == "address") 132 + #if($propertyType == "checkbox" || $propertyType == "radio") 133 + #set($value = "yes") 134 + #elseif($theDocObj.getProperty($propertyName) || $propertyType == "address") ## 'address' is not a property in the current class 132 132 #set($value = $theDocObj.getProperty($propertyName).value) 133 - #if($propertyType == "checkbox" || $propertyType == "radio") 134 - #set($value = "1") 135 - #end 136 - #if(!$value) 137 - #set($value = "") 138 - #end 136 + #end 137 + #if(!$value) 138 + #set($value = "") 139 + #end 140 + #if($item.containsKey("classless")) 139 139 #set($newElem = { 140 140 "id" : "$propertyName", 141 141 "type" : $propertyType, 142 142 "required" : "false", 143 143 "label" : "$label", 146 + "value" : "$value" 147 + }) 148 + #else 149 + #set($newElem = { 150 + "id" : "$propertyName", 151 + "type" : $propertyType, 152 + "required" : "false", 153 + "label" : "$label", 144 144 "data-create-xobj" : "true", 145 145 "data-xobj-classname" : $theClass, 146 146 "data-xobj-fieldname" : "$propertyName", 147 147 "value" : "$value" 148 148 }) 149 - if($extraAttributes.keySet().size() > 0)150 - set($attrMap = $extraAttributes)151 - foreach($attrin$attrMap.keySet())152 - set($discard = $newElem.put("$attr",$attrMap[$attr]))153 - #e nd159 + #end 160 + #if($extraAttributes.keySet().size() > 0) 161 + #set($attrMap = $extraAttributes) 162 + #foreach($attr in $attrMap.keySet()) 163 + #set($discard = $newElem.put("$attr", $attrMap[$attr])) 154 154 #end 155 - #if($propertyOpener) 156 - #set($discard = $newElem.put("data-opener", "true")) 157 - #end 158 - #if($propertyParent) 159 - #set($lastChild = "$key") 160 - #elseif($lastChild != "") 161 - #set($lastChild = "") 162 - #createExpandEnd() 163 - #end 164 - #createFormElement($newElem) 165 - #if($propertyOpener) 166 - #createExpandStart($newElem $value) 167 - #end 168 168 #end 166 + #if($propertyOpener) 167 + #set($discard = $newElem.put("data-opener", "true")) 168 + #end 169 + #if($propertyParent) 170 + #set($lastChild = "$key") 171 + #elseif($lastChild != "") 172 + #set($lastChild = "") 173 + #createExpandEnd() 174 + #end 175 + #createFormElement($newElem) 176 + #if($propertyOpener) 177 + #createExpandStart($newElem $value) 178 + #end 169 169 #end 170 170 #end 171 171 </div>