Wiki broncode van Homeopaths

Version 10.46 by Jip-jan Alunkel on maart 14, 19:33

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