Changes for page Homeopaths

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

From version 8.137
edited by Jip-jan Alunkel
on December 22, 14:37
Change comment: Renamed from xwiki:practices.WebHome
To version 8.130
edited by Jip-jan Alunkel
on December 09, 20:17
Change comment: Renamed from xwiki:practices.WebHome

Summary

Details

Page properties
Content
... ... @@ -1,8 +4,6 @@
1 -
2 -{{velocity}}
3 -
4 4  {{include reference="assets.pagemaker.macros"/}}
5 5  
3 +{{velocity}}
6 6  #set($discard = $services.localization.use('document', 'homeopaths.Code.translations'))
7 7  #set($discard = $services.localization.use('document', 'assets.pagemaker.translations'))
8 8  #set($discard = $xwiki.ssx.use('assets.pagemaker.WebHome', {'minify': false}))
... ... @@ -11,13 +11,19 @@
11 11  {{html wiki="false" clean="false"}}
12 12  <p>
13 13  All about homeopaths.
14 -</p>
15 -<div id="homeopaths_map"></div>
12 +
16 16  #set($q = $services.query.xwql("where doc.space like 'homeopaths.%' and doc.name like :usr"))
17 17  #set($r = $q.bindValue('usr', $xcontext.getUserReference().getName()).execute())
18 -#set($practice_exists = $r.size() > 0)
19 -#if($practice_exists != false)
20 20  
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>
23 +
24 +
21 21  <h2>Add your practice to the map</h2>
22 22  #set($form_start = {
23 23   "id": "homeoworld_form",
... ... @@ -70,6 +70,12 @@
70 70  })
71 71  #createFormElement($country)
72 72  
77 +#*
78 + "data-create-xobj" : "true",
79 + "data-xobj-classname" : "homeopaths.Code.homeopathsClass",
80 + "data-xobj-fieldname" : "country",
81 +*#
82 +
73 73  #set($address = {
74 74   "id" : "address",
75 75   "type" : "address",
... ... @@ -101,6 +101,4 @@
101 101   "use_captcha": "false"
102 102  })
103 103  #createFormEnd($form_end)
104 -#end
105 -{{/html}}
106 -{{/velocity}}
114 +
XWiki.JavaScriptExtension[0]
Code
... ... @@ -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>")
26 + #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))