Wiki source code of homeopathsSheet
Version 1.12 by Jip-jan Alunkel on March 07, 17:51
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.11 | 34 | #set($classProperties = ['pmCountry','pmState','pmCounty','pmPostcode','pmCity','pmStreet','pmHousenumber']) |
35 | #* | ||
36 | { | ||
37 | 'pmCountry': '$services.localization.render("homeopaths.pmCountry")', | ||
38 | 'pmState': '$services.localization.render("homeopaths.classproperty.pmState")', | ||
39 | 'pmCounty': '$services.localization.render("homeopaths.classproperty.pmCounty")', | ||
40 | 'pmPostcode': '$services.localization.render("homeopaths.classproperty.pmPostcode")', | ||
41 | 'pmCity': '$services.localization.render("homeopaths.classproperty.pmCity")', | ||
42 | 'pmStreet': '$services.localization.render("homeopaths.classproperty.pmStreet")', | ||
43 | 'pmHousenumber': '$services.localization.render("homeopaths.classproperty.pmHousenumber")' | ||
44 | }) | ||
45 | *# | ||
46 | #foreach($property in $classProperties) | ||
![]() |
1.1 | 47 | <p class="property"> |
![]() |
1.12 | 48 | <span class="property-name">$services.localization.render("homeopaths.classproperty.${property}")</span> <span class="property-value">$doc.display($property)</span> |
![]() |
1.1 | 49 | </p> |
![]() |
1.12 | 50 | #end |
![]() |
1.11 | 51 | |
![]() |
1.7 | 52 | #if($hasRight) |
![]() |
1.1 | 53 | <p class="buttons text-align-right"> |
54 | <a class="btn btn-secondary" title="Edit" data-toggle="modal" data-target="#detailsModal" role="button" rel="nofollow"> | ||
55 | <span class="btn-label">Edit details</span> | ||
56 | </a> | ||
57 | </p> | ||
58 | #end | ||
59 | </div> | ||
![]() |
1.7 | 60 | #if($hasRight) ## Ook de rechts situatie uitlezen en meenemen. |
![]() |
1.1 | 61 | #set($form_start = { |
![]() |
1.5 | 62 | "id": "homeopaths_form", |
63 | "product": "homeopath details", | ||
![]() |
1.1 | 64 | "method": "post", |
65 | "url": "", | ||
66 | "use_captcha": "false" | ||
67 | }) | ||
![]() |
1.5 | 68 | #set($city = { |
69 | "id": "city", | ||
70 | "type": "text", | ||
![]() |
1.1 | 71 | "required" : "false", |
![]() |
1.5 | 72 | "label" : "City", |
![]() |
1.1 | 73 | "data-create-xobj" : "true", |
![]() |
1.5 | 74 | "data-xobj-classname" : "homeopaths.Code.homeopathsClass", |
![]() |
1.10 | 75 | "data-xobj-fieldname" : "pmCity", |
76 | "value": "$theDocObj.getProperty('pmCity').value" | ||
77 | }) | ||
78 | #set($submit = { | ||
79 | "id" : "edit_details", | ||
80 | "button-text" : "Save changes", | ||
81 | "clean": "true", | ||
82 | "help-block" : "" | ||
83 | }) | ||
84 | #set($form_end = { | ||
85 | "use_captcha": "false" | ||
86 | }) | ||
87 | <div class="modal fade" id="detailsModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true"> | ||
88 | <div class="modal-dialog modal-dialog-centered" role="document"> | ||
89 | <div class="modal-content"> | ||
90 | #createFormStart($form_start) | ||
91 | <div class="modal-header"> | ||
92 | <h3 class="modal-title">Details</h3> | ||
93 | <button type="button" class="close" data-dismiss="modal" aria-label="Close"> | ||
94 | <span aria-hidden="true">×</span> | ||
95 | </button> | ||
96 | </div> | ||
97 | <div class="modal-body"> | ||
![]() |
1.5 | 98 | #createFormElement($city) |
![]() |
1.1 | 99 | </div> |
100 | <div class="modal-footer"> | ||
101 | <button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button> | ||
102 | #createSubmit($submit) | ||
103 | </div> | ||
104 | #createFormEnd($form_end) | ||
105 | </div> | ||
106 | </div> | ||
107 | </div> | ||
108 | #end | ||
![]() |
1.7 | 109 | #else |
110 | This page can not be viewed in inline mode. | ||
![]() |
1.1 | 111 | #end |
112 | {{/html}} | ||
113 | {{/velocity}} |