Wiki source code of Homeopaths

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

Show last authors
1 {{include reference="assets.pagemaker.macros"/}}
2
3 {{velocity}}
4 #set($discard = $services.localization.use('document', 'homeopaths.Code.translations'))
5 #set($discard = $services.localization.use('document', 'assets.pagemaker.translations'))
6 #set($discard = $xwiki.ssx.use('assets.pagemaker.WebHome', {'minify': false}))
7 #set($discard = $xwiki.jsx.use('assets.pagemaker.WebHome', {'minify': false}))
8
9 {{html wiki="false" clean="false"}}
10 <p>
11 All about the page "homeopaths". Where is it for?
12 </p>
13 <div id="homeopaths_map"></div>
14 #if(!$isGuest)
15 #set($hasPractice = $xwiki.getDocument($xcontext.getUserReference()).getObject('XWiki.XWikiUsers').getProperty('practice').value)
16 #if($hasPractice)
17 #set($q = $services.query.xwql("from doc.object(homeopaths.Code.homeopathsClass) as homepath where homepath.doc_owner like :usr"))
18 #set($usrName = $xwiki.getDocument($xcontext.getUserReference()).getFullName())
19 #set($r = $q.bindValue('usr',"${usrName}").execute())
20 #set($practiceExists = $r.size() > 0)
21 #if(!$practiceExists)
22 <h2 id="add_practice">Add your practice to the map</h2>
23 #set($form_start = {
24 "id": "homeoworld_form",
25 "product": "practice",
26 "method": "post",
27 "url": "",
28 "use_captcha": "false"
29 })
30 #createFormStart($form_start)
31 #set($practice_name = {
32 "id" : "practiceName",
33 "type" : "text",
34 "required" : "true",
35 "label" : "Name of your practice",
36 "aria-label" : "Enter the name of your practice",
37 "placeholder" : "$services.localization.render('homeopaths.wordgroup.practice_name.placeholder')",
38 "data-pattern" : "^[a-zA-ZÀ-ÖÙ-öù-ÿĀ-žḀ-ỿ]+[a-zA-ZÀ-ÖÙ-öù-ÿĀ-žḀ-ỿ0-9- ]*$",
39 "data-error-response-type" : "use_label_definite_1",
40 "data-auto-first-capital" : "true",
41 "data-query-type" : "XWQL",
42 "data-page-name": "$xcontext.getUserReference().getName()",
43 "data-query-reference" : "assets.pagemaker.XWQL.matchTitle",
44 "data-query-scope" : "homeopaths",
45 "data-query-list-type" : "suggest-negate",
46 "data-query-list-header" : "$services.localization.render('pagemaker.line.suggest_negate_list')",
47 "data-query-list-contents" : "value",
48 "data-create-page" : "true",
49 "data-create-xobj" : "true",
50 "data-xobj-classname" : "homeopaths.Code.homeopathsClass",
51 "data-xobj-fieldname" : "practiceName",
52 "help-block" : 'This will be used as the title of your practice page. The first character must be a letter.'
53 })
54 #createFormElement($practice_name)
55 #set($country = {
56 "id" : "country",
57 "type" : "text",
58 "required" : "true",
59 "label" : "Country of practice residence",
60 "aria-label" : "Choose the country",
61 "placeholder" : "$services.localization.render('homeopaths.word.country.placeholder')",
62 "data-set-space": "true",
63 "data-space-xobj-classname": "homeopaths.Code.homeopathsCountryClass",
64 "data-parent-space": "homeopaths",
65 "data-error-response-type" : "use_label_definite_1",
66 "data-auto-first-capital" : "true",
67 "data-query-type" : "JSON",
68 "data-query-reference" : "assets.pagemaker.JSON.countries",
69 "data-query-list-type" : "suggest-select",
70 "data-query-list-header" : "$services.localization.render('pagemaker.line.suggest_select_list')",
71 "data-query-list-contents" : "key",
72 "data-query-list-editable" : "false",
73 "help-block" : 'Input and select the country where your practice resides.'
74 })
75 #createFormElement($country)
76 #set($address = {
77 "id" : "address",
78 "type" : "address",
79 "required" : "true",
80 "label" : "Address",
81 "aria-label" : "Input and select the address of your practice",
82 "placeholder" : "$services.localization.render('homeopaths.multiword.address.placeholder')",
83 "data-error-response-type" : "use_label_definite_1",
84 "data-auto-first-capital" : "true",
85 "data-query-type" : "address",
86 "data-query-reference" : "",
87 "data-query-list-type" : "suggest-select",
88 "data-query-list-header" : "$services.localization.render('pagemaker.line.suggest_select_list')",
89 "data-query-list-contents" : "value/key",
90 "data-query-list-editable" : "false",
91 "data-create-xobj" : "true",
92 "data-xobj-classname" : "homeopaths.Code.homeopathsClass",
93 "help-block" : 'Input street and number, then select the address of your practice.'
94 })
95 #*
96 "data-xobj-fieldname" : "address",
97 *#
98 #createFormElement($address)
99 #set($friend = {
100 "id" : "friend",
101 "type" : "hidden",
102 "value": "$context.getUser()",
103 "data-create-xobj" : "true",
104 "data-xobj-classname" : "homeopaths.Code.homeopathsClass",
105 "data-xobj-fieldname" : "doc_owner"
106 })
107 #createFormElement($friend)
108 #set($submit = {
109 "id" : "create_practice",
110 "button-text" : "Add practice",
111 "help-block" : "Please remind yourself to always anonymize the case."
112 })
113 #createSubmit($submit)
114 #set($form_end = {
115 "use_captcha": "false"
116 })
117 #createFormEnd($form_end)
118 #end
119 #end
120 #end
121 {{/html}}
122 {{/velocity}}