Modifications pour le document homeopathsSheet
Modifié par Jip-jan Alunkel le mars 26, 17:31
Depuis la version 1.155
modifié par Jip-jan Alunkel
sur mars 08, 19:01
sur mars 08, 19:01
Commentaire de modification :
Il n'y a aucun commentaire pour cette version
À la version 3.3
modifié par Jip-jan Alunkel
sur mars 08, 21:40
sur mars 08, 21:40
Commentaire de modification :
Rollback to version 1.38
Résumé
-
Propriétés de la Page (2 modifications, 0 ajouts, 0 suppressions)
Détails
- Propriétés de la Page
-
- Titre
-
... ... @@ -1,0 +1,1 @@ 1 +$xwiki.getDocument("${doc.fullName}").getObject("homeopaths.Code.homeopathsClass").getProperty("practiceName").value - Contenu
-
... ... @@ -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,19 +84,15 @@ 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) 100 100 #if($propertyType == "checkbox" || $propertyType == "radio") 101 101 #set($value = "1") 102 102 #end ... ... @@ -104,13 +104,13 @@ 104 104 #set($value = "") 105 105 #end 106 106 #set($newElem = { 107 - "id" : "$ key",116 + "id" : "$propertyName", 108 108 "type" : $propertyType, 109 109 "required" : "false", 110 110 "label" : "$label", 111 111 "data-create-xobj" : "true", 112 112 "data-xobj-classname" : $theClass, 113 - "data-xobj-fieldname" : "$ key",122 + "data-xobj-fieldname" : "$propertyName", 114 114 "value" : "$value" 115 115 }) 116 116 #if($extraAttributes.keySet().size() > 0) ... ... @@ -130,7 +130,6 @@ 130 130 #end 131 131 #createFormElement($newElem) 132 132 #if($propertyOpener) 133 -##$value 134 134 #createExpandStart($newElem $value) 135 135 #end 136 136 #end