Changes for page Homeopaths

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

From version 8.158
edited by Jip-jan Alunkel
on January 25, 18:16
Change comment: Renamed from xwiki:practices.WebHome
To version 10.16
edited by Jip-jan Alunkel
on March 14, 18:58
Change comment: Renamed from xwiki:practices.WebHome

Summary

Details

Page properties
Content
... ... @@ -9,16 +9,19 @@
9 9  {{html wiki="false" clean="false"}}
10 10  <p>
11 11  All about the page "homeopaths". Where is it for?
12 + #set($q = $services.query.xwql("from doc.object(homeopaths.Code.homeopathsClass) as homepath where homepath.doc_owner like '%.jipjanalunkel'").execute())
13 +##.anyChars()
14 +$xcontext.getUserReference().getName()
12 12  </p>
13 13  <div id="homeopaths_map"></div>
14 14  #if(!$isGuest)
15 15   #set($hasPractice = $xwiki.getDocument($xcontext.getUserReference()).getObject('XWiki.XWikiUsers').getProperty('practice').value)
16 16   #if($hasPractice)
17 - #set($q = $services.query.xwql("where doc.space like 'homeopaths.%' and doc.name like :usr"))
18 - #set($r = $q.bindValue('usr', $xcontext.getUserReference().getName()).execute())
20 + #set($q = $services.query.xwql("from doc.object(homeopaths.Code.homeopathsClass) as obj where obj.doc_owner like :usr"))
21 + #set($r = $q.bindValue('usr').literal("%${xcontext.getUserReference().getName()}").query().execute())
19 19   #set($practiceExists = $r.size() > 0)
20 20   #if(!$practiceExists)
21 -<h2>Add your practice to the map</h2>
24 +<h2 id="add_practice">Add your practice to the map</h2>
22 22  #set($form_start = {
23 23   "id": "homeoworld_form",
24 24   "product": "practice",
... ... @@ -28,7 +28,7 @@
28 28  })
29 29  #createFormStart($form_start)
30 30  #set($practice_name = {
31 - "id" : "practice_name",
34 + "id" : "practiceName",
32 32   "type" : "text",
33 33   "required" : "true",
34 34   "label" : "Name of your practice",
... ... @@ -45,6 +45,9 @@
45 45   "data-query-list-header" : "$services.localization.render('pagemaker.line.suggest_negate_list')",
46 46   "data-query-list-contents" : "value",
47 47   "data-create-page" : "true",
51 + "data-create-xobj" : "true",
52 + "data-xobj-classname" : "homeopaths.Code.homeopathsClass",
53 + "data-xobj-fieldname" : "practiceName",
48 48   "help-block" : 'This will be used as the title of your practice page. The first character must be a letter.'
49 49  })
50 50  #createFormElement($practice_name)
... ... @@ -56,7 +56,7 @@
56 56   "aria-label" : "Choose the country",
57 57   "placeholder" : "$services.localization.render('homeopaths.word.country.placeholder')",
58 58   "data-set-space": "true",
59 - "data-space-xobj-classname": "",
65 + "data-space-xobj-classname": "homeopaths.Code.homeopathsCountryClass",
60 60   "data-parent-space": "homeopaths",
61 61   "data-error-response-type" : "use_label_definite_1",
62 62   "data-auto-first-capital" : "true",
... ... @@ -86,10 +86,21 @@
86 86   "data-query-list-editable" : "false",
87 87   "data-create-xobj" : "true",
88 88   "data-xobj-classname" : "homeopaths.Code.homeopathsClass",
89 - "data-xobj-fieldname" : "address",
90 90   "help-block" : 'Input street and number, then select the address of your practice.'
91 91  })
97 +#*
98 + "data-xobj-fieldname" : "address",
99 +*#
92 92  #createFormElement($address)
101 +#set($friend = {
102 + "id" : "friend",
103 + "type" : "hidden",
104 + "value": "$context.getUser()",
105 + "data-create-xobj" : "true",
106 + "data-xobj-classname" : "homeopaths.Code.homeopathsClass",
107 + "data-xobj-fieldname" : "doc_owner"
108 +})
109 +#createFormElement($friend)
93 93  #set($submit = {
94 94   "id" : "create_practice",
95 95   "button-text" : "Add practice",