1 | <html xmlns="http://www.w3.org/1999/xhtml" |
---|
2 | xmlns:tal="http://xml.zope.org/namespaces/tal" |
---|
3 | xmlns:metal="http://xml.zope.org/namespaces/metal" |
---|
4 | xmlns:i18n="http://xml.zope.org/namespaces/i18n" |
---|
5 | i18n:domain="plone"> |
---|
6 | <head><title></title></head> |
---|
7 | <body> |
---|
8 | |
---|
9 | <!-- Copyright Widgets --> |
---|
10 | |
---|
11 | <metal:view_macro define-macro="view" |
---|
12 | tal:define="vocab python:field.Vocabulary(here); |
---|
13 | value python:accessor(); |
---|
14 | display python:here.displayValue(vocab, value)" |
---|
15 | tal:replace="structure display" /> |
---|
16 | |
---|
17 | <metal:define define-macro="edit"> |
---|
18 | |
---|
19 | <metal:use use-macro="field_macro | here/widgets/field/macros/edit"> |
---|
20 | |
---|
21 | <metal:fill fill-slot="widget_body" |
---|
22 | tal:define="vocab python:field.Vocabulary(here); |
---|
23 | vlen python:len(vocab); |
---|
24 | format python:widget.format"> |
---|
25 | |
---|
26 | <tal:onlyChoice condition="python:vlen==1"> |
---|
27 | |
---|
28 | <p tal:content="structure python:vocab.getMsgId(vocab[0])">PLACEHOLDER</p> |
---|
29 | <input type="hidden" |
---|
30 | tal:define="tabindex tabindex/next" |
---|
31 | tal:attributes="value python:vocab[0]; |
---|
32 | name fieldName; |
---|
33 | id string:${fieldName}_${tabindex};"/> |
---|
34 | |
---|
35 | </tal:onlyChoice> |
---|
36 | |
---|
37 | <tal:shortVocab condition="python:(vlen>1)"> |
---|
38 | <!-- Radio when the vocab is short < 4 --> |
---|
39 | <tal:radios repeat="item vocab"> |
---|
40 | <input class="noborder" |
---|
41 | tabindex="" |
---|
42 | type="radio" |
---|
43 | tal:define="tabindex tabindex/next" |
---|
44 | tal:attributes="name fieldName; |
---|
45 | id string:${fieldName}_${tabindex}; |
---|
46 | checked python:here.checkSelected(item, value); |
---|
47 | value item; |
---|
48 | tabindex tabindex;" |
---|
49 | /> |
---|
50 | <label tal:content="structure python:vocab.getMsgId(item)" |
---|
51 | i18n:translate="" |
---|
52 | tal:attributes="for string:${fieldName}_${tabindex/pos}" /> |
---|
53 | <br /> |
---|
54 | </tal:radios> |
---|
55 | </tal:shortVocab> |
---|
56 | </metal:fill> |
---|
57 | </metal:use> |
---|
58 | </metal:define> |
---|
59 | |
---|
60 | |
---|
61 | <div metal:define-macro="search"> |
---|
62 | <div metal:use-macro="here/widgets/lines/macros/edit"> |
---|
63 | </div> |
---|
64 | </div> |
---|
65 | |
---|
66 | <div metal:define-macro="hidden"> |
---|
67 | <input type="hidden" |
---|
68 | name="" |
---|
69 | value="" |
---|
70 | tabindex="#" |
---|
71 | tal:attributes="name string:${fieldName}:lines; |
---|
72 | value python:'\n'.join(value); |
---|
73 | tabindex tabindex/next;" /> |
---|
74 | |
---|
75 | </div> |
---|
76 | |
---|
77 | |
---|
78 | </body> |
---|
79 | |
---|
80 | </html> |
---|
81 | |
---|