Changes for page Homeopaths

Last modified by Jip-jan Alunkel on March 14, 20:13

From version 8.132
edited by Jip-jan Alunkel
on December 22, 14:27
Change comment: Renamed from xwiki:practices.WebHome
To version 8.129
edited by Jip-jan Alunkel
on December 09, 20:16
Change comment: Renamed from xwiki:practices.WebHome

Summary

Details

Page properties
Content
... ... @@ -2,27 +2,26 @@
2 2  
3 3  {{velocity}}
4 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}))
5 5  
6 6  {{html wiki="false" clean="false"}}
7 7  <p>
8 8  All about homeopaths.
9 -</p>
10 -<div id="homeopaths_map"></div>
12 +
11 11  #set($q = $services.query.xwql("where doc.space like 'homeopaths.%' and doc.name like :usr"))
12 12  #set($r = $q.bindValue('usr', $xcontext.getUserReference().getName()).execute())
13 -#set($practice_exists = $r.size() > 0)
14 -#if($practice_exists != false)
15 -{{/html}}
16 -{{/velocity}}
17 17  
18 -{{include reference="assets.pagemaker.macros"/}}
16 +#if($r.size() > 0)
17 +Practice page exists.
18 +#else
19 +No practice page.
20 +#end
21 +</p>
22 +<div id="homeopaths_map"></div>
19 19  
20 -{{velocity}}
21 -#set($discard = $services.localization.use('document', 'assets.pagemaker.translations'))
22 -#set($discard = $xwiki.ssx.use('assets.pagemaker.WebHome', {'minify': false}))
23 -#set($discard = $xwiki.jsx.use('assets.pagemaker.WebHome', {'minify': false}))
24 24  
25 -{{html wiki="false" clean="false"}}
26 26  <h2>Add your practice to the map</h2>
27 27  #set($form_start = {
28 28   "id": "homeoworld_form",
... ... @@ -75,6 +75,12 @@
75 75  })
76 76  #createFormElement($country)
77 77  
77 +#*
78 + "data-create-xobj" : "true",
79 + "data-xobj-classname" : "homeopaths.Code.homeopathsClass",
80 + "data-xobj-fieldname" : "country",
81 +*#
82 +
78 78  #set($address = {
79 79   "id" : "address",
80 80   "type" : "address",
... ... @@ -106,4 +106,4 @@
106 106   "use_captcha": "false"
107 107  })
108 108  #createFormEnd($form_end)
109 -#end
114 +
XWiki.JavaScriptExtension[0]
Code
... ... @@ -1,5 +3,3 @@
1 -/* Leaflet interactive maps javascript library, based on OpenStreetMap */
2 -/* ------------------------------------------------------------------- */
3 3   var map = L.map('homeopaths_map').setView([18, 10], 2);
4 4   L.tileLayer('https://tile.openstreetmap.org/{z}/{x}/{y}.png', {
5 5   maxZoom: 19,
... ... @@ -23,7 +23,7 @@
23 23   #end
24 24   #set($address = "${address}${address_item.trim()}${linebreak}")
25 25   #end
26 - #set($info = "<h4><a href='$xwiki.getURL($result_doc.documentReference)'>${stringtool.capitalize($result_doc.getDisplayTitle())}</a></h4><address>${address}</address>")
24 + #set($info = "<h4><a href='$xwiki.getURL($result_doc.documentReference)'>${stringtool.capitalize($result_doc.documentReference.getName())}</a></h4><address>${address}</address>")
27 27   #set($discard = $map.put($info, $result_obj.getProperty("latlong").value))
28 28   #end
29 29   #if($objecttool.allNull($map))