Initial support for mobile ordering
plus various other changes required for that
This commit is contained in:
parent
5afa832684
commit
65c63dad3e
12 changed files with 289 additions and 30 deletions
|
@ -4,6 +4,25 @@
|
|||
${parent.body()}
|
||||
|
||||
% if master.has_rows:
|
||||
% if master.mobile_rows_creatable and not batch.executed and not batch.complete:
|
||||
${h.link_to("Add Item", url('mobile.{}.create_row'.format(route_prefix), uuid=instance.uuid), class_='ui-btn ui-corner-all')}
|
||||
% endif
|
||||
<br />
|
||||
${grid.render_complete()|n}
|
||||
% endif
|
||||
|
||||
% if not batch.executed and request.has_perm('{}.edit'.format(permission_prefix)):
|
||||
% if batch.complete:
|
||||
${h.form(request.route_url('mobile.{}.mark_pending'.format(route_prefix), uuid=batch.uuid))}
|
||||
${h.csrf_token(request)}
|
||||
${h.hidden('mark-pending', value='true')}
|
||||
${h.submit('submit', "Mark Batch as Pending")}
|
||||
${h.end_form()}
|
||||
% else:
|
||||
${h.form(request.route_url('mobile.{}.mark_complete'.format(route_prefix), uuid=batch.uuid))}
|
||||
${h.csrf_token(request)}
|
||||
${h.hidden('mark-complete', value='true')}
|
||||
${h.submit('submit', "Mark Batch as Complete")}
|
||||
${h.end_form()}
|
||||
% endif
|
||||
% endif
|
||||
|
|
4
tailbone/templates/mobile/master/create_row.mako
Normal file
4
tailbone/templates/mobile/master/create_row.mako
Normal file
|
@ -0,0 +1,4 @@
|
|||
## -*- coding: utf-8; -*-
|
||||
<%inherit file="/mobile/master/create.mako" />
|
||||
|
||||
${parent.body()}
|
10
tailbone/templates/mobile/master/edit.mako
Normal file
10
tailbone/templates/mobile/master/edit.mako
Normal file
|
@ -0,0 +1,10 @@
|
|||
## -*- coding: utf-8; -*-
|
||||
<%inherit file="/mobile/base.mako" />
|
||||
|
||||
<%def name="title()">${index_title} » ${instance_title} » Edit</%def>
|
||||
|
||||
<%def name="page_title()">${h.link_to(index_title, index_url)} » ${h.link_to(instance_title, instance_url)} » Edit</%def>
|
||||
|
||||
<div class="form-wrapper">
|
||||
${form.render()|n}
|
||||
</div><!-- form-wrapper -->
|
16
tailbone/templates/mobile/master/edit_row.mako
Normal file
16
tailbone/templates/mobile/master/edit_row.mako
Normal file
|
@ -0,0 +1,16 @@
|
|||
## -*- coding: utf-8; -*-
|
||||
<%inherit file="/mobile/master/edit.mako" />
|
||||
|
||||
<%def name="title()">${index_title} » ${parent_title} » ${instance_title} » Edit</%def>
|
||||
|
||||
<%def name="page_title()">${h.link_to(index_title, index_url)} » ${h.link_to(parent_title, parent_url)} » ${h.link_to(instance_title, instance_url)} » Edit</%def>
|
||||
|
||||
<%def name="buttons()">
|
||||
<br />
|
||||
${h.submit('create', form.update_label)}
|
||||
<a href="${form.cancel_url}" class="ui-btn">Cancel</a>
|
||||
</%def>
|
||||
|
||||
<div class="form-wrapper">
|
||||
${form.render(buttons=capture(self.buttons))|n}
|
||||
</div><!-- form-wrapper -->
|
|
@ -1,4 +1,12 @@
|
|||
## -*- coding: utf-8; -*-
|
||||
<%inherit file="/mobile/master/view.mako" />
|
||||
|
||||
<%def name="title()">${index_title} » ${parent_title} » ${instance_title}</%def>
|
||||
|
||||
<%def name="page_title()">${h.link_to(index_title, index_url)} » ${h.link_to(parent_title, parent_url)} » ${instance_title}</%def>
|
||||
|
||||
${parent.body()}
|
||||
|
||||
% if master.mobile_rows_editable and instance_editable and request.has_perm('{}.edit_row'.format(permission_prefix)):
|
||||
${h.link_to("Edit", url('mobile.{}.edit'.format(row_route_prefix), uuid=instance.uuid), class_='ui-btn')}
|
||||
% endif
|
||||
|
|
22
tailbone/templates/mobile/ordering/create.mako
Normal file
22
tailbone/templates/mobile/ordering/create.mako
Normal file
|
@ -0,0 +1,22 @@
|
|||
## -*- coding: utf-8; -*-
|
||||
<%inherit file="/mobile/base.mako" />
|
||||
|
||||
<%def name="title()">${index_title} » New Batch</%def>
|
||||
|
||||
<%def name="page_title()">${h.link_to(index_title, index_url)} » New Batch</%def>
|
||||
|
||||
${h.form(request.current_route_url(), class_='ui-filterable', name='new-purchasing-batch')}
|
||||
${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>
|
||||
</div>
|
||||
|
||||
<br />
|
||||
${h.submit('submit', "Make Batch")}
|
||||
${h.end_form()}
|
6
tailbone/templates/mobile/ordering/create_row.mako
Normal file
6
tailbone/templates/mobile/ordering/create_row.mako
Normal file
|
@ -0,0 +1,6 @@
|
|||
## -*- coding: utf-8; -*-
|
||||
<%inherit file="/mobile/master/create_row.mako" />
|
||||
|
||||
<%def name="title()">${h.link_to(index_title, index_url)} » ${h.link_to(instance_title, instance_url)} » Add Item</%def>
|
||||
|
||||
${parent.body()}
|
Loading…
Add table
Add a link
Reference in a new issue