Wiki source code of homeopathsSheet
Version 1.22 by Jip-jan Alunkel on March 07, 19:10
Hide last authors
author | version | line-number | content |
---|---|---|---|
![]() |
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'})) | ||
![]() |
1.5 | 8 | #set($theDoc = $xwiki.getDocument("${doc.fullName}").getTranslatedDocument()) |
![]() |
1.1 | 9 | #set($isInline = $xcontext.action == 'edit' && $request.get('editor') == 'inline') |
![]() |
1.5 | 10 | ## Create object (important for sheet binding, do not remove) |
11 | #set($theDocObj = $doc.getObject("homeopaths.Code.homeopathsClass", true)) | ||
![]() |
1.7 | 12 | #set($hasRight = !$isGuest && ($theDocObj.getProperty('user').value == $context.getUser() || $hasAdmin)) |
![]() |
1.5 | 13 | $theDoc.getContent() |
![]() |
1.4 | 14 | {{html wiki="true" clean="false"}} |
![]() |
1.7 | 15 | #if(!$isGuest) |
![]() |
1.4 | 16 | <script> |
17 | var pagemakerOffspring = "disable"; | ||
18 | </script> | ||
![]() |
1.7 | 19 | #end |
20 | #if($hasRight) | ||
![]() |
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> | ||
![]() |
1.7 | 27 | #end |
![]() |
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> | ||
![]() |
1.19 | 34 | #set($classProperties = ['practiceName','pmStreet','pmHousenumber','pmPostcode','pmCity','pmCounty','pmState','pmCountry','certification','certificationFrom']) |
![]() |
1.11 | 35 | #foreach($property in $classProperties) |
![]() |
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> | ||
![]() |
1.16 | 40 | #else |
![]() |
1.17 | 41 | <span class="property-name">$services.localization.render("homeopaths.classproperty.${property}")</span> <span class="property-value">$doc.display($property)</span> |
![]() |
1.16 | 42 | #end |
![]() |
1.1 | 43 | </p> |
![]() |
1.13 | 44 | #end |
![]() |
1.12 | 45 | #end |
![]() |
1.11 | 46 | |
![]() |
1.7 | 47 | #if($hasRight) |
![]() |
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> | ||
![]() |
1.7 | 55 | #if($hasRight) ## Ook de rechts situatie uitlezen en meenemen. |
![]() |
1.1 | 56 | #set($form_start = { |
![]() |
1.5 | 57 | "id": "homeopaths_form", |
58 | "product": "homeopath details", | ||
![]() |
1.1 | 59 | "method": "post", |
60 | "url": "", | ||
61 | "use_captcha": "false" | ||
62 | }) | ||
![]() |
1.19 | 63 | #set($practiceName = { |
![]() |
1.18 | 64 | "id": "practiceName", |
65 | "type": "text", | ||
66 | "required" : "false", | ||
![]() |
1.19 | 67 | "label" : "Practice name", |
![]() |
1.18 | 68 | "data-create-xobj" : "true", |
69 | "data-xobj-classname" : "homeopaths.Code.homeopathsClass", | ||
![]() |
1.19 | 70 | "data-xobj-fieldname" : "practiceName", |
![]() |
1.22 | 71 | "value": "$doc.getTitle()" |
![]() |
1.18 | 72 | }) |
![]() |
1.20 | 73 | #set($city = { |
![]() |
1.5 | 74 | "id": "city", |
75 | "type": "text", | ||
![]() |
1.1 | 76 | "required" : "false", |
![]() |
1.5 | 77 | "label" : "City", |
![]() |
1.1 | 78 | "data-create-xobj" : "true", |
![]() |
1.5 | 79 | "data-xobj-classname" : "homeopaths.Code.homeopathsClass", |
![]() |
1.10 | 80 | "data-xobj-fieldname" : "pmCity", |
81 | "value": "$theDocObj.getProperty('pmCity').value" | ||
82 | }) | ||
83 | #set($submit = { | ||
84 | "id" : "edit_details", | ||
85 | "button-text" : "Save changes", | ||
86 | "clean": "true", | ||
87 | "help-block" : "" | ||
88 | }) | ||
89 | #set($form_end = { | ||
90 | "use_captcha": "false" | ||
91 | }) | ||
92 | <div class="modal fade" id="detailsModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true"> | ||
93 | <div class="modal-dialog modal-dialog-centered" role="document"> | ||
94 | <div class="modal-content"> | ||
95 | #createFormStart($form_start) | ||
96 | <div class="modal-header"> | ||
97 | <h3 class="modal-title">Details</h3> | ||
98 | <button type="button" class="close" data-dismiss="modal" aria-label="Close"> | ||
99 | <span aria-hidden="true">×</span> | ||
100 | </button> | ||
101 | </div> | ||
102 | <div class="modal-body"> | ||
![]() |
1.21 | 103 | #createFormElement($practiceName) |
![]() |
1.5 | 104 | #createFormElement($city) |
![]() |
1.1 | 105 | </div> |
106 | <div class="modal-footer"> | ||
107 | <button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button> | ||
108 | #createSubmit($submit) | ||
109 | </div> | ||
110 | #createFormEnd($form_end) | ||
111 | </div> | ||
112 | </div> | ||
113 | </div> | ||
114 | #end | ||
![]() |
1.7 | 115 | #else |
116 | This page can not be viewed in inline mode. | ||
![]() |
1.1 | 117 | #end |
118 | {{/html}} | ||
119 | {{/velocity}} |