Initial support for mobile ordering

plus various other changes required for that
This commit is contained in:
Lance Edgar 2017-08-02 12:08:23 -05:00
parent 5afa832684
commit 65c63dad3e
12 changed files with 289 additions and 30 deletions

View file

@ -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

View file

@ -0,0 +1,4 @@
## -*- coding: utf-8; -*-
<%inherit file="/mobile/master/create.mako" />
${parent.body()}

View file

@ -0,0 +1,10 @@
## -*- coding: utf-8; -*-
<%inherit file="/mobile/base.mako" />
<%def name="title()">${index_title} &raquo; ${instance_title} &raquo; Edit</%def>
<%def name="page_title()">${h.link_to(index_title, index_url)} &raquo; ${h.link_to(instance_title, instance_url)} &raquo; Edit</%def>
<div class="form-wrapper">
${form.render()|n}
</div><!-- form-wrapper -->

View file

@ -0,0 +1,16 @@
## -*- coding: utf-8; -*-
<%inherit file="/mobile/master/edit.mako" />
<%def name="title()">${index_title} &raquo; ${parent_title} &raquo; ${instance_title} &raquo; Edit</%def>
<%def name="page_title()">${h.link_to(index_title, index_url)} &raquo; ${h.link_to(parent_title, parent_url)} &raquo; ${h.link_to(instance_title, instance_url)} &raquo; 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 -->

View file

@ -1,4 +1,12 @@
## -*- coding: utf-8; -*-
<%inherit file="/mobile/master/view.mako" />
<%def name="title()">${index_title} &raquo; ${parent_title} &raquo; ${instance_title}</%def>
<%def name="page_title()">${h.link_to(index_title, index_url)} &raquo; ${h.link_to(parent_title, parent_url)} &raquo; ${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

View file

@ -0,0 +1,22 @@
## -*- coding: utf-8; -*-
<%inherit file="/mobile/base.mako" />
<%def name="title()">${index_title} &raquo; New Batch</%def>
<%def name="page_title()">${h.link_to(index_title, index_url)} &raquo; 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()}

View 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)} &raquo; ${h.link_to(instance_title, instance_url)} &raquo; Add Item</%def>
${parent.body()}