Changes for page homeopathsSheet
Last modified by Jip-jan Alunkel on March 26, 17:31
From version 3.7
edited by Jip-jan Alunkel
on March 08, 23:21
on March 08, 23:21
Change comment:
Rollback to version 1.38
To version 1.155
edited by Jip-jan Alunkel
on March 08, 19:01
on March 08, 19:01
Change comment:
There is no comment for this version
Summary
-
Page properties (1 modified, 0 added, 0 removed)
Details
- Page properties
-
- Content
-
... ... @@ -33,34 +33,19 @@ 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', '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 contents 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'}, 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") 54 - <span class="property-name">$services.localization.render("homeopaths.classproperty.address")</span> <span class="property-value">$doc.display($property) $doc.display("pmHousenumber")</span> 55 - #elseif($property == "practiceName") ## Difference, should receive the title from the page. 56 - <span class="property-name">$services.localization.render("homeopaths.classproperty.${property}")</span> <span class="property-value">$doc.getTitle()</span> 57 - #else ## Normal situation. 58 - <span class="property-name">$services.localization.render("homeopaths.classproperty.${property}")</span> <span class="property-value">$doc.display($property)</span> 59 - #end 60 - </p> 61 - #end 62 - #end 63 -#end 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 +]) 64 64 65 65 #if($hasRight) 66 66 <p class="buttons text-align-right"> ... ... @@ -99,15 +99,19 @@ 99 99 </div> 100 100 <div class="modal-body"> 101 101 #set($lastChild = "") 102 -#foreach($propertyName in $classProperties.keySet()) 103 - #set($item = $classProperties["$propertyName"]) 104 - #set($propertyType = $item.type) 105 - #set($propertyOpener = $item.opener) 106 - #set($propertyParent = $item.parent) 107 - #set($extraAttributes = $item.extraAttributes) 108 - #set($label = $services.localization.render("homeopaths.classproperty.${propertyName}")) 109 - #if($theDocObj.getProperty($propertyName) || $propertyType == "address") 110 - #set($value = $theDocObj.getProperty($propertyName).value) 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) 111 111 #if($propertyType == "checkbox" || $propertyType == "radio") 112 112 #set($value = "1") 113 113 #end ... ... @@ -115,13 +115,13 @@ 115 115 #set($value = "") 116 116 #end 117 117 #set($newElem = { 118 - "id" : "$ propertyName",107 + "id" : "$key", 119 119 "type" : $propertyType, 120 120 "required" : "false", 121 121 "label" : "$label", 122 122 "data-create-xobj" : "true", 123 123 "data-xobj-classname" : $theClass, 124 - "data-xobj-fieldname" : "$ propertyName",113 + "data-xobj-fieldname" : "$key", 125 125 "value" : "$value" 126 126 }) 127 127 #if($extraAttributes.keySet().size() > 0) ... ... @@ -141,6 +141,7 @@ 141 141 #end 142 142 #createFormElement($newElem) 143 143 #if($propertyOpener) 133 +##$value 144 144 #createExpandStart($newElem $value) 145 145 #end 146 146 #end