Wiki source code of homeopathsSheet

Version 1.26 by Jip-jan Alunkel on March 07, 19:28

Hide last authors
Jip-jan Alunkel 1.1 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'}))
Jip-jan Alunkel 1.5 8 #set($theDoc = $xwiki.getDocument("${doc.fullName}").getTranslatedDocument())
Jip-jan Alunkel 1.1 9 #set($isInline = $xcontext.action == 'edit' && $request.get('editor') == 'inline')
Jip-jan Alunkel 1.5 10 ## Create object (important for sheet binding, do not remove)
11 #set($theDocObj = $doc.getObject("homeopaths.Code.homeopathsClass", true))
Jip-jan Alunkel 1.7 12 #set($hasRight = !$isGuest && ($theDocObj.getProperty('user').value == $context.getUser() || $hasAdmin))
Jip-jan Alunkel 1.5 13 $theDoc.getContent()
Jip-jan Alunkel 1.4 14 {{html wiki="true" clean="false"}}
Jip-jan Alunkel 1.7 15 #if(!$isGuest)
Jip-jan Alunkel 1.4 16 <script>
17 var pagemakerOffspring = "disable";
18 </script>
Jip-jan Alunkel 1.7 19 #end
20 #if($hasRight)
Jip-jan Alunkel 1.1 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>
Jip-jan Alunkel 1.7 27 #end
Jip-jan Alunkel 1.1 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>
Jip-jan Alunkel 1.19 34 #set($classProperties = ['practiceName','pmStreet','pmHousenumber','pmPostcode','pmCity','pmCounty','pmState','pmCountry','certification','certificationFrom'])
Jip-jan Alunkel 1.11 35 #foreach($property in $classProperties)
Jip-jan Alunkel 1.17 36 <p class="property">
37 #if($theDocObj.getProperty($property).value != "" && $property != "pmHousenumber")
38 #if($property == "pmStreet")
39 <span class="property-name">$services.localization.render("homeopaths.classproperty.address")</span> <span class="property-value">$doc.display($property) $doc.display("pmHousenumber")</span>
Jip-jan Alunkel 1.16 40 #else
Jip-jan Alunkel 1.17 41 <span class="property-name">$services.localization.render("homeopaths.classproperty.${property}")</span> <span class="property-value">$doc.display($property)</span>
Jip-jan Alunkel 1.16 42 #end
Jip-jan Alunkel 1.1 43 </p>
Jip-jan Alunkel 1.13 44 #end
Jip-jan Alunkel 1.12 45 #end
Jip-jan Alunkel 1.11 46
Jip-jan Alunkel 1.7 47 #if($hasRight)
Jip-jan Alunkel 1.1 48 <p class="buttons text-align-right">
49 <a class="btn btn-secondary" title="Edit" data-toggle="modal" data-target="#detailsModal" role="button" rel="nofollow">
50 <span class="btn-label">Edit details</span>
51 </a>
52 </p>
53 #end
54 </div>
Jip-jan Alunkel 1.23 55 #if($hasRight)
Jip-jan Alunkel 1.1 56 #set($form_start = {
Jip-jan Alunkel 1.5 57 "id": "homeopaths_form",
58 "product": "homeopath details",
Jip-jan Alunkel 1.1 59 "method": "post",
60 "url": "",
61 "use_captcha": "false"
62 })
Jip-jan Alunkel 1.23 63 #set($thisObj = {})
64 #foreach($item in $classProperties)
Jip-jan Alunkel 1.26 65 #set($label = $services.localization.render("homeopaths.classproperty.${item}"))
66 $label
Jip-jan Alunkel 1.23 67 #set($newElem = {
68 "id": "$item",
69 "type": "text",
70 "required" : "false",
Jip-jan Alunkel 1.25 71 "label" : "$label",
Jip-jan Alunkel 1.23 72 "data-create-xobj" : "true",
73 "data-xobj-classname" : "homeopaths.Code.homeopathsClass",
74 "data-xobj-fieldname" : "$item",
75 "value": '$theDocObj.getProperty("$item").value'
76 })
Jip-jan Alunkel 1.24 77 #set($thisObj["$item"] = $newElem)
Jip-jan Alunkel 1.23 78 #end
Jip-jan Alunkel 1.19 79 #set($practiceName = {
Jip-jan Alunkel 1.18 80 "id": "practiceName",
81 "type": "text",
82 "required" : "false",
Jip-jan Alunkel 1.19 83 "label" : "Practice name",
Jip-jan Alunkel 1.18 84 "data-create-xobj" : "true",
85 "data-xobj-classname" : "homeopaths.Code.homeopathsClass",
Jip-jan Alunkel 1.19 86 "data-xobj-fieldname" : "practiceName",
Jip-jan Alunkel 1.22 87 "value": "$doc.getTitle()"
Jip-jan Alunkel 1.18 88 })
Jip-jan Alunkel 1.20 89 #set($city = {
Jip-jan Alunkel 1.5 90 "id": "city",
91 "type": "text",
Jip-jan Alunkel 1.1 92 "required" : "false",
Jip-jan Alunkel 1.5 93 "label" : "City",
Jip-jan Alunkel 1.1 94 "data-create-xobj" : "true",
Jip-jan Alunkel 1.5 95 "data-xobj-classname" : "homeopaths.Code.homeopathsClass",
Jip-jan Alunkel 1.10 96 "data-xobj-fieldname" : "pmCity",
97 "value": "$theDocObj.getProperty('pmCity').value"
98 })
99 #set($submit = {
100 "id" : "edit_details",
101 "button-text" : "Save changes",
102 "clean": "true",
103 "help-block" : ""
104 })
105 #set($form_end = {
106 "use_captcha": "false"
107 })
108 <div class="modal fade" id="detailsModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
109 <div class="modal-dialog modal-dialog-centered" role="document">
110 <div class="modal-content">
111 #createFormStart($form_start)
112 <div class="modal-header">
113 <h3 class="modal-title">Details</h3>
114 <button type="button" class="close" data-dismiss="modal" aria-label="Close">
115 <span aria-hidden="true">&times;</span>
116 </button>
117 </div>
118 <div class="modal-body">
Jip-jan Alunkel 1.23 119 #foreach($obj in $thisObj)
120 #createFormElement($obj)
121 #end
Jip-jan Alunkel 1.21 122 #createFormElement($practiceName)
Jip-jan Alunkel 1.5 123 #createFormElement($city)
Jip-jan Alunkel 1.1 124 </div>
125 <div class="modal-footer">
126 <button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
127 #createSubmit($submit)
128 </div>
129 #createFormEnd($form_end)
130 </div>
131 </div>
132 </div>
133 #end
Jip-jan Alunkel 1.7 134 #else
135 This page can not be viewed in inline mode.
Jip-jan Alunkel 1.1 136 #end
137 {{/html}}
138 {{/velocity}}