Modifications pour le document Homeopaths

Modifié par Jip-jan Alunkel le mars 14, 20:13

Depuis la version 8.128
modifié par Jip-jan Alunkel
sur décembre 08, 21:14
Commentaire de modification : Renamed from xwiki:practices.WebHome
À la version 8.134
modifié par Jip-jan Alunkel
sur décembre 22, 14:31
Commentaire de modification : Renamed from xwiki:practices.WebHome

Résumé

Détails

Propriétés de la Page
Contenu
... ... @@ -9,19 +9,13 @@
9 9  {{html wiki="false" clean="false"}}
10 10  <p>
11 11  All about homeopaths.
12 -
12 +</p>
13 +<div id="homeopaths_map"></div>
13 13  #set($q = $services.query.xwql("where doc.space like 'homeopaths.%' and doc.name like :usr"))
14 14  #set($r = $q.bindValue('usr', $xcontext.getUserReference().getName()).execute())
16 +#set($practice_exists = $r.size() > 0)
17 +#if($practice_exists != false)
15 15  
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 -
25 25  <h2>Add your practice to the map</h2>
26 26  #set($form_start = {
27 27   "id": "homeoworld_form",
... ... @@ -74,12 +74,6 @@
74 74  })
75 75  #createFormElement($country)
76 76  
77 -#*
78 - "data-create-xobj" : "true",
79 - "data-xobj-classname" : "homeopaths.Code.homeopathsClass",
80 - "data-xobj-fieldname" : "country",
81 -*#
82 -
83 83  #set($address = {
84 84   "id" : "address",
85 85   "type" : "address",
... ... @@ -111,4 +111,4 @@
111 111   "use_captcha": "false"
112 112  })
113 113  #createFormEnd($form_end)
114 -
102 +#end
XWiki.JavaScriptExtension[0]
Code
... ... @@ -1,3 +1,5 @@
1 +/* Leaflet interactive maps javascript library, based on OpenStreetMap */
2 +/* ------------------------------------------------------------------- */
1 1   var map = L.map('homeopaths_map').setView([18, 10], 2);
2 2   L.tileLayer('https://tile.openstreetmap.org/{z}/{x}/{y}.png', {
3 3   maxZoom: 19,
... ... @@ -21,7 +21,7 @@
21 21   #end
22 22   #set($address = "${address}${address_item.trim()}${linebreak}")
23 23   #end
24 - #set($info = "<h4><a href='$xwiki.getURL($result_doc.documentReference)'>${stringtool.capitalize($result_doc.documentReference.getName())}</a></h4><address>${address}</address>")
26 + #set($info = "<h4><a href='$xwiki.getURL($result_doc.documentReference)'>${stringtool.capitalize($result_doc.getDisplayTitle())}</a></h4><address>${address}</address>")
25 25   #set($discard = $map.put($info, $result_obj.getProperty("latlong").value))
26 26   #end
27 27   #if($objecttool.allNull($map))