6
6
<metal:form-picker define-macro="form-picker">
7
7
<tal:input replace="structure view/inputField" />
9
<tal:search_results condition="not: view/hasValidInput">
10
<select tal:condition="view/matches">
9
<tal:search_results condition="not: view/hasValidInput"
10
define="suggestion_id string:${view/name}-suggestions">
11
<select tal:condition="view/matches"
12
tal:attributes="id string:${suggestion_id}">
13
<option value="">Did you mean...</option>
12
15
tal:repeat="match view/matches"
13
16
tal:attributes="value match/token;
14
selected python:path('match/token') == path('view/formToken');
15
onclick string:this.form['${view/name}'].value = this.value"
16
tal:content="string:${match/token}: ${match/title}"
17
selected python:path('match/token') == path('view/formToken');"
18
tal:content="string:${match/title} (${match/token})"
21
<script type="text/javascript" tal:content="string:
22
LPS.use('node', 'lp.app.picker', function(Y) {
23
var text_input = Y.DOM.byId('${view/name}');
24
var select_menu = Y.DOM.byId('${suggestion_id}');
25
Y.lp.app.picker.connect_select_menu(
26
select_menu, text_input);
19
29
</tal:search_results>
21
31
<tal:chooseLink replace="structure view/chooseLink" />