Code source wiki de Homeopaths

Version 10.12 par Jip-jan Alunkel le mars 14, 18:38

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