Wiki-Quellcode von homeopathsSheet
Version 1.25 von Jip-jan Alunkel am März 07, 19:27
Zeige letzte Bearbeiter
author | version | line-number | content |
---|---|---|---|
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 = ['practiceName','pmStreet','pmHousenumber','pmPostcode','pmCity','pmCounty','pmState','pmCountry','certification','certificationFrom']) | ||
35 | #foreach($property in $classProperties) | ||
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> | ||
40 | #else | ||
41 | <span class="property-name">$services.localization.render("homeopaths.classproperty.${property}")</span> <span class="property-value">$doc.display($property)</span> | ||
42 | #end | ||
43 | </p> | ||
44 | #end | ||
45 | #end | ||
46 | |||
47 | #if($hasRight) | ||
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> | ||
55 | #if($hasRight) | ||
56 | #set($form_start = { | ||
57 | "id": "homeopaths_form", | ||
58 | "product": "homeopath details", | ||
59 | "method": "post", | ||
60 | "url": "", | ||
61 | "use_captcha": "false" | ||
62 | }) | ||
63 | #set($thisObj = {}) | ||
64 | #foreach($item in $classProperties) | ||
65 | #set($label = $services.localization.render('homeopaths.classproperty.${item}')) | ||
66 | #set($newElem = { | ||
67 | "id": "$item", | ||
68 | "type": "text", | ||
69 | "required" : "false", | ||
70 | "label" : "$label", | ||
71 | "data-create-xobj" : "true", | ||
72 | "data-xobj-classname" : "homeopaths.Code.homeopathsClass", | ||
73 | "data-xobj-fieldname" : "$item", | ||
74 | "value": '$theDocObj.getProperty("$item").value' | ||
75 | }) | ||
76 | #set($thisObj["$item"] = $newElem) | ||
77 | #end | ||
78 | #set($practiceName = { | ||
79 | "id": "practiceName", | ||
80 | "type": "text", | ||
81 | "required" : "false", | ||
82 | "label" : "Practice name", | ||
83 | "data-create-xobj" : "true", | ||
84 | "data-xobj-classname" : "homeopaths.Code.homeopathsClass", | ||
85 | "data-xobj-fieldname" : "practiceName", | ||
86 | "value": "$doc.getTitle()" | ||
87 | }) | ||
88 | #set($city = { | ||
89 | "id": "city", | ||
90 | "type": "text", | ||
91 | "required" : "false", | ||
92 | "label" : "City", | ||
93 | "data-create-xobj" : "true", | ||
94 | "data-xobj-classname" : "homeopaths.Code.homeopathsClass", | ||
95 | "data-xobj-fieldname" : "pmCity", | ||
96 | "value": "$theDocObj.getProperty('pmCity').value" | ||
97 | }) | ||
98 | #set($submit = { | ||
99 | "id" : "edit_details", | ||
100 | "button-text" : "Save changes", | ||
101 | "clean": "true", | ||
102 | "help-block" : "" | ||
103 | }) | ||
104 | #set($form_end = { | ||
105 | "use_captcha": "false" | ||
106 | }) | ||
107 | <div class="modal fade" id="detailsModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true"> | ||
108 | <div class="modal-dialog modal-dialog-centered" role="document"> | ||
109 | <div class="modal-content"> | ||
110 | #createFormStart($form_start) | ||
111 | <div class="modal-header"> | ||
112 | <h3 class="modal-title">Details</h3> | ||
113 | <button type="button" class="close" data-dismiss="modal" aria-label="Close"> | ||
114 | <span aria-hidden="true">×</span> | ||
115 | </button> | ||
116 | </div> | ||
117 | <div class="modal-body"> | ||
118 | #foreach($obj in $thisObj) | ||
119 | #createFormElement($obj) | ||
120 | #end | ||
121 | #createFormElement($practiceName) | ||
122 | #createFormElement($city) | ||
123 | </div> | ||
124 | <div class="modal-footer"> | ||
125 | <button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button> | ||
126 | #createSubmit($submit) | ||
127 | </div> | ||
128 | #createFormEnd($form_end) | ||
129 | </div> | ||
130 | </div> | ||
131 | </div> | ||
132 | #end | ||
133 | #else | ||
134 | This page can not be viewed in inline mode. | ||
135 | #end | ||
136 | {{/html}} | ||
137 | {{/velocity}} |