Changes for page Homeopaths

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

From version 8.155
edited by Jip-jan Alunkel
on January 25, 17:53
Change comment: Renamed from xwiki:practices.WebHome
To version 10.13
edited by Jip-jan Alunkel
on March 14, 18:39
Change comment: Renamed from xwiki:practices.WebHome

Summary

Details

Page properties
Content
... ... @@ -6,31 +6,21 @@
6 6  #set($discard = $xwiki.ssx.use('assets.pagemaker.WebHome', {'minify': false}))
7 7  #set($discard = $xwiki.jsx.use('assets.pagemaker.WebHome', {'minify': false}))
8 8  
9 -#set($bladibla = "blbballbla.blbadafblabla//self")
10 -#set($index = $bladibla.indexOf("//self"))
11 -#if($index > -1)
12 - self
13 - #set($value = $bladibla.substring(0, $index))
14 -#else
15 - not self
16 - #set($value = $bladibla)
17 -#end
18 -
19 -$value
20 -
21 21  {{html wiki="false" clean="false"}}
22 22  <p>
23 -All about homeopaths.
11 +All about the page "homeopaths". Where is it for?
12 + #set($q = $services.query.xwql("from doc.object(homeopaths.Code.homeopathsClass) as obj").execute())
13 +$q
24 24  </p>
25 25  <div id="homeopaths_map"></div>
26 26  #if(!$isGuest)
27 27   #set($hasPractice = $xwiki.getDocument($xcontext.getUserReference()).getObject('XWiki.XWikiUsers').getProperty('practice').value)
28 28   #if($hasPractice)
29 - #set($q = $services.query.xwql("where doc.space like 'homeopaths.%' and doc.name like :usr"))
19 + #set($q = $services.query.xwql("from doc.object(homeopaths.Code.homeopathsClass) as obj where obj.doc_owner like :usr"))
30 30   #set($r = $q.bindValue('usr', $xcontext.getUserReference().getName()).execute())
31 31   #set($practiceExists = $r.size() > 0)
32 32   #if(!$practiceExists)
33 -<h2>Add your practice to the map</h2>
23 +<h2 id="add_practice">Add your practice to the map</h2>
34 34  #set($form_start = {
35 35   "id": "homeoworld_form",
36 36   "product": "practice",
... ... @@ -40,7 +40,7 @@
40 40  })
41 41  #createFormStart($form_start)
42 42  #set($practice_name = {
43 - "id" : "practice_name",
33 + "id" : "practiceName",
44 44   "type" : "text",
45 45   "required" : "true",
46 46   "label" : "Name of your practice",
... ... @@ -57,6 +57,9 @@
57 57   "data-query-list-header" : "$services.localization.render('pagemaker.line.suggest_negate_list')",
58 58   "data-query-list-contents" : "value",
59 59   "data-create-page" : "true",
50 + "data-create-xobj" : "true",
51 + "data-xobj-classname" : "homeopaths.Code.homeopathsClass",
52 + "data-xobj-fieldname" : "practiceName",
60 60   "help-block" : 'This will be used as the title of your practice page. The first character must be a letter.'
61 61  })
62 62  #createFormElement($practice_name)
... ... @@ -68,7 +68,7 @@
68 68   "aria-label" : "Choose the country",
69 69   "placeholder" : "$services.localization.render('homeopaths.word.country.placeholder')",
70 70   "data-set-space": "true",
71 - "data-space-xobj-classname": "",
64 + "data-space-xobj-classname": "homeopaths.Code.homeopathsCountryClass",
72 72   "data-parent-space": "homeopaths",
73 73   "data-error-response-type" : "use_label_definite_1",
74 74   "data-auto-first-capital" : "true",
... ... @@ -98,10 +98,21 @@
98 98   "data-query-list-editable" : "false",
99 99   "data-create-xobj" : "true",
100 100   "data-xobj-classname" : "homeopaths.Code.homeopathsClass",
101 - "data-xobj-fieldname" : "address",
102 102   "help-block" : 'Input street and number, then select the address of your practice.'
103 103  })
96 +#*
97 + "data-xobj-fieldname" : "address",
98 +*#
104 104  #createFormElement($address)
100 +#set($friend = {
101 + "id" : "friend",
102 + "type" : "hidden",
103 + "value": "$context.getUser()",
104 + "data-create-xobj" : "true",
105 + "data-xobj-classname" : "homeopaths.Code.homeopathsClass",
106 + "data-xobj-fieldname" : "doc_owner"
107 +})
108 +#createFormElement($friend)
105 105  #set($submit = {
106 106   "id" : "create_practice",
107 107   "button-text" : "Add practice",