Wiki source code of homeopathsSheet

Version 1.31 by Jip-jan Alunkel on março 07, 22:27

Show last authors
1 {{include reference="assets.pagemaker.macros"/}}
2
3 {{velocity}}
4 #set($discard = $services.localization.use('document', 'homeopaths.Code.translations'))
5 #set($discard = $services.localization.use('document', 'assets.pagemaker.translations'))
6 #set($discard = $xwiki.ssx.use('assets.pagemaker.WebHome', {'minify': false}))
7 #set($discard = $xwiki.jsx.use('assets.pagemaker.WebHome', {'minify': false, 'language': $context.language, 'myParameter': 'value'}))
8 #set($theDoc = $xwiki.getDocument("${doc.fullName}").getTranslatedDocument())
9 #set($isInline = $xcontext.action == 'edit' && $request.get('editor') == 'inline')
10 ## Create object (important for sheet binding, do not remove)
11 #set($theDocObj = $doc.getObject("homeopaths.Code.homeopathsClass", true))
12 #set($hasRight = !$isGuest && ($theDocObj.getProperty('user').value == $context.getUser() || $hasAdmin))
13 $theDoc.getContent()
14 {{html wiki="true" clean="false"}}
15 #if(!$isGuest)
16 <script>
17 var pagemakerOffspring = "disable";
18 </script>
19 #end
20 #if($hasRight)
21 <p class="buttons text-align-right">
22 <a class="btn btn-primary" title="Edit" href="$doc.getURL("edit")?editor=wysiwyg" role="button" rel="nofollow">
23 <span class="fa fa-pencil"></span>
24 <span class="btn-label">Edit contents</span>
25 </a>
26 </p>
27 #end
28 #set($spaceReference = $services.model.resolveDocument('', 'default', $doc.documentReference.lastSpaceReference).parent)
29 #set($spaceTitle = $spaceReference.getName())
30 <div class="clearfix"></div>
31 #if($xcontext.action == "view")
32 <div id="${spaceTitle}" class="box sheet_properties">
33 <h2>Details</h2>
34 #set($classProperties = {
35 'practiceName': {'type': 'string'},
36 'pmStreet': {'type': 'string'},
37 'pmHousenumber': {'type': 'string'},
38 'pmPostcode': {'type': 'string'},
39 'pmCity': {'type': 'string'},
40 'pmCounty': {'type': 'string'},
41 'pmState': {'type': 'string'},
42 'pmCountry': {'type': 'string'},
43 'certification': {'type': 'bool'},
44 'certificationFrom': {'type': 'string'}
45 })
46 #foreach($property in $classProperties.keySet())
47 #if($theDocObj.getProperty($property))
48 <p class="property">
49 #if($theDocObj.getProperty($property).value != "" && $property != "pmHousenumber") ## Difference with added housenumber because of the streetaddress layout.
50 #if($property == "pmStreet") ## Difference with added housenumber because of the streetaddress layout.
51 <span class="property-name">$services.localization.render("homeopaths.classproperty.address")</span> <span class="property-value">$doc.display($property) $doc.display("pmHousenumber")</span>
52 #else
53 <span class="property-name">$services.localization.render("homeopaths.classproperty.${property}")</span> <span class="property-value">$doc.display($property)</span>
54 #end
55 </p>
56 #end
57 #end
58 #end
59
60 #if($hasRight)
61 <p class="buttons text-align-right">
62 <a class="btn btn-secondary" title="Edit" data-toggle="modal" data-target="#detailsModal" role="button" rel="nofollow">
63 <span class="btn-label">Edit details</span>
64 </a>
65 </p>
66 #end
67 </div>
68 #if($hasRight)
69 #set($form_start = {
70 "id": "homeopaths_form",
71 "product": "homeopath details",
72 "method": "post",
73 "url": "",
74 "use_captcha": "false"
75 })
76 #set($thisObj = {})
77 #foreach($item in $classProperties.keySet())
78 #set($label = $services.localization.render("homeopaths.classproperty.${item}"))
79 #if($theDocObj.getProperty($item))
80 #set($value = $theDocObj.getProperty($item).value)
81 #else
82 #set($value = "")
83 #end
84 $classProperties[$item].type
85 #set($newElem = {
86 "id": "$item",
87 "type": "text",
88 "required" : "false",
89 "label" : "$label",
90 "data-create-xobj" : "true",
91 "data-xobj-classname" : "homeopaths.Code.homeopathsClass",
92 "data-xobj-fieldname" : "$item",
93 "value": "$value"
94 })
95 #set($thisObj["$item"] = $newElem)
96 #end
97 #set($practiceName = {
98 "id": "practiceName",
99 "type": "text",
100 "required" : "false",
101 "label" : "Practice name",
102 "data-create-xobj" : "true",
103 "data-xobj-classname" : "homeopaths.Code.homeopathsClass",
104 "data-xobj-fieldname" : "practiceName",
105 "value": "$doc.getTitle()"
106 })
107 #set($city = {
108 "id": "city",
109 "type": "text",
110 "required" : "false",
111 "label" : "City",
112 "data-create-xobj" : "true",
113 "data-xobj-classname" : "homeopaths.Code.homeopathsClass",
114 "data-xobj-fieldname" : "pmCity",
115 "value": "$theDocObj.getProperty('pmCity').value"
116 })
117 #set($submit = {
118 "id" : "edit_details",
119 "button-text" : "Save changes",
120 "clean": "true",
121 "help-block" : ""
122 })
123 #set($form_end = {
124 "use_captcha": "false"
125 })
126 <div class="modal fade" id="detailsModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
127 <div class="modal-dialog modal-dialog-centered" role="document">
128 <div class="modal-content">
129 #createFormStart($form_start)
130 <div class="modal-header">
131 <h3 class="modal-title">Details</h3>
132 <button type="button" class="close" data-dismiss="modal" aria-label="Close">
133 <span aria-hidden="true">&times;</span>
134 </button>
135 </div>
136 <div class="modal-body">
137 #foreach($obj in $thisObj)
138 #createFormElement($obj)
139 #end
140 #createFormElement($practiceName)
141 #createFormElement($city)
142 </div>
143 <div class="modal-footer">
144 <button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
145 #createSubmit($submit)
146 </div>
147 #createFormEnd($form_end)
148 </div>
149 </div>
150 </div>
151 #end
152 #else
153 This page can not be viewed in inline mode.
154 #end
155 {{/html}}
156 {{/velocity}}