Changes for page homeopathsSheet

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

From version 1.154
edited by Jip-jan Alunkel
on March 08, 18:58
Change comment: There is no comment for this version
To version 3.11
edited by Jip-jan Alunkel
on March 09, 00:22
Change comment: Rollback to version 1.38

Summary

Details

Page properties
Content
... ... @@ -22,7 +22,7 @@
22 22   <p class="buttons text-align-right">
23 23   <a class="btn btn-primary" title="Edit" href="$doc.getURL("edit")?editor=wysiwyg" role="button" rel="nofollow">
24 24   <span class="fa fa-pencil"></span>
25 - <span class="btn-label">Edit contents</span>
25 + <span class="btn-label">Edit content</span>
26 26   </a>
27 27   </p>
28 28  #end
... ... @@ -33,19 +33,34 @@
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', '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'},
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
49 49  
50 50   #if($hasRight)
51 51   <p class="buttons text-align-right">
... ... @@ -83,60 +83,63 @@
83 83   </button>
84 84   </div>
85 85   <div class="modal-body">
101 + <fieldset class="fieldset">
102 + <address>
103 +$doc.getTitle()<br />
104 +$theDocObj.getProperty('pmStreet') $theDocObj.getProperty('pmHousenumber')<br /><br />
105 +$theDocObj.getProperty('pmPostcode') $theDocObj.getProperty('pmCity')<br />
106 +$theDocObj.getProperty('pmCounty,') $theDocObj.getProperty('pmState')<br />
107 +$theDocObj.getProperty('pmCountry').toUpperCase()
108 + </address>
109 + </fieldset>
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())
111 +#foreach($propertyName in $classProperties.keySet())
112 + #set($item = $classProperties["$propertyName"])
113 + #if($item.containsKey("disabled"))
114 + #else
92 92   #set($propertyType = $item.type)
93 93   #set($propertyOpener = $item.opener)
94 94   #set($propertyParent = $item.parent)
95 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 -$value + 4
101 -#if(!$value)
102 -$propertyType
119 + #set($label = $services.localization.render("homeopaths.classproperty.${propertyName}"))
120 + #if($theDocObj.getProperty($propertyName) || $propertyType == "address")
121 + #set($value = $theDocObj.getProperty($propertyName).value)
103 103   #if($propertyType == "checkbox" || $propertyType == "radio")
104 104   #set($value = "1")
105 -$propertyType - $value
106 - #else
124 + #end
125 + #if(!$value)
107 107   #set($value = "")
108 108   #end
109 - #end
110 - #set($newElem = {
111 - "id" : "$key",
112 - "type" : $propertyType,
113 - "required" : "false",
114 - "label" : "$label",
115 - "data-create-xobj" : "true",
116 - "data-xobj-classname" : $theClass,
117 - "data-xobj-fieldname" : "$key",
118 - "value" : "$value"
119 - })
120 - #if($extraAttributes.keySet().size() > 0)
121 - #set($attrMap = $extraAttributes)
122 - #foreach($attr in $attrMap.keySet())
123 - #set($discard = $newElem.put("$attr", $attrMap[$attr]))
128 + #set($newElem = {
129 + "id" : "$propertyName",
130 + "type" : $propertyType,
131 + "required" : "false",
132 + "label" : "$label",
133 + "data-create-xobj" : "true",
134 + "data-xobj-classname" : $theClass,
135 + "data-xobj-fieldname" : "$propertyName",
136 + "value" : "$value"
137 + })
138 + #if($extraAttributes.keySet().size() > 0)
139 + #set($attrMap = $extraAttributes)
140 + #foreach($attr in $attrMap.keySet())
141 + #set($discard = $newElem.put("$attr", $attrMap[$attr]))
142 + #end
124 124   #end
144 + #if($propertyOpener)
145 + #set($discard = $newElem.put("data-opener", "true"))
146 + #end
147 + #if($propertyParent)
148 + #set($lastChild = "$key")
149 + #elseif($lastChild != "")
150 + #set($lastChild = "")
151 + #createExpandEnd()
152 + #end
153 + #createFormElement($newElem)
154 + #if($propertyOpener)
155 + #createExpandStart($newElem $value)
156 + #end
125 125   #end
126 - #if($propertyOpener)
127 - #set($discard = $newElem.put("data-opener", "true"))
128 - #end
129 - #if($propertyParent)
130 - #set($lastChild = "$key")
131 - #elseif($lastChild != "")
132 - #set($lastChild = "")
133 - #createExpandEnd()
134 - #end
135 - #createFormElement($newElem)
136 - #if($propertyOpener)
137 -##$value
138 - #createExpandStart($newElem $value)
139 - #end
140 140   #end
141 141  #end
142 142   </div>