Modifiche per il documento Homeopaths

Ultima modifica di Jip-jan Alunkel il marzo 14, 20:13

Dalla versione 8.135
modificato da Jip-jan Alunkel
il dicembre 22, 14:33
Cambia il commento: Renamed from xwiki:practices.WebHome
Alla versione 8.130
modificato da Jip-jan Alunkel
il dicembre 09, 20:17
Cambia il commento: Renamed from xwiki:practices.WebHome

Summary

Details

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