Allow vendor field to be dropdown, for mobile ordering/receiving

based on config.  useful for apps which have very few vendors
This commit is contained in:
Lance Edgar 2019-02-19 21:11:49 -06:00
parent 19080924d5
commit 145e7f5529
5 changed files with 68 additions and 17 deletions

View file

@ -9,12 +9,21 @@ ${h.form(request.current_route_url(), class_='ui-filterable', name='new-purchasi
${h.csrf_token(request)}
<div class="field-wrapper vendor">
<div class="field autocomplete" data-url="${url('vendors.autocomplete')}">
${h.hidden('vendor')}
${h.text('new-purchasing-batch-vendor-text', placeholder="Vendor name", autocomplete='off', data_type='search')}
<ul data-role="listview" data-inset="true" data-filter="true" data-input="#new-purchasing-batch-vendor-text"></ul>
<button type="button" style="display: none;">Change Vendor</button>
</div>
% if vendor_use_autocomplete:
<div class="field autocomplete" data-url="${url('vendors.autocomplete')}">
${h.hidden('vendor')}
${h.text('new-purchasing-batch-vendor-text', placeholder="Vendor name", autocomplete='off', data_type='search')}
<ul data-role="listview" data-inset="true" data-filter="true" data-input="#new-purchasing-batch-vendor-text"></ul>
<button type="button" style="display: none;">Change Vendor</button>
</div>
% else:
<div class="field-row">
<label for="vendor">Vendor</label>
<div class="field">
${h.select('vendor', None, vendor_options)}
</div>
</div>
% endif
</div>
<br />

View file

@ -10,14 +10,23 @@ ${h.csrf_token(request)}
% if phase == 1:
<div class="field-wrapper vendor">
<div class="field autocomplete" data-url="${url('vendors.autocomplete')}">
${h.hidden('vendor')}
${h.text('new-receiving-batch-vendor-text', placeholder="Vendor name", autocomplete='off', **{'data-type': 'search'})}
<ul data-role="listview" data-inset="true" data-filter="true" data-input="#new-receiving-batch-vendor-text"></ul>
<button type="button" style="display: none;">Change Vendor</button>
</div>
</div>
% if vendor_use_autocomplete:
<div class="field-wrapper vendor">
<div class="field autocomplete" data-url="${url('vendors.autocomplete')}">
${h.hidden('vendor')}
${h.text('new-receiving-batch-vendor-text', placeholder="Vendor name", autocomplete='off', **{'data-type': 'search'})}
<ul data-role="listview" data-inset="true" data-filter="true" data-input="#new-receiving-batch-vendor-text"></ul>
<button type="button" style="display: none;">Change Vendor</button>
</div>
</div>
% else:
<div class="field-row">
<label for="vendor">Vendor</label>
<div class="field">
${h.select('vendor', None, vendor_options)}
</div>
</div>
% endif
<br />