Add initial support for mobile "quick row" feature, for ordering

at least for now, ordering only, but hopefully much more soon...
This commit is contained in:
Lance Edgar 2018-07-12 22:53:29 -05:00
parent aa6e540abd
commit 68bd3047c4
10 changed files with 143 additions and 23 deletions

View file

@ -8,9 +8,9 @@
${h.javascript_link('https://code.jquery.com/jquery-1.12.4.min.js')}
${h.javascript_link('https://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.js')}
${h.javascript_link(request.static_url('tailbone:static/js/jquery.ui.tailbone.mobile.js'))}
${h.javascript_link(request.static_url('tailbone:static/js/tailbone.mobile.js'))}
${h.javascript_link(request.static_url('tailbone:static/js/tailbone.mobile.receiving.js'))}
${h.javascript_link(request.static_url('tailbone:static/js/jquery.ui.tailbone.mobile.js') + '?ver={}'.format(tailbone.__version__))}
${h.javascript_link(request.static_url('tailbone:static/js/tailbone.mobile.js') + '?ver={}'.format(tailbone.__version__))}
${h.javascript_link(request.static_url('tailbone:static/js/tailbone.mobile.receiving.js') + '?ver={}'.format(tailbone.__version__))}
${self.extra_javascript()}
## since jquery mobile will "utterly cache" the first page which is loaded
@ -33,7 +33,7 @@
% endif
${h.stylesheet_link('https://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.css')}
${h.stylesheet_link(request.static_url('tailbone:static/css/mobile.css'))}
${h.stylesheet_link(request.static_url('tailbone:static/css/mobile.css') + '?ver={}'.format(tailbone.__version__))}
% if not request.rattail_config.production():
<style type="text/css">
.ui-page-theme-a { background-image: url(${request.static_url('tailbone:static/img/testing.png')}); }

View file

@ -3,14 +3,6 @@
${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:
% if request.has_perm('{}.edit'.format(permission_prefix)):
% if batch.complete:

View file

@ -12,3 +12,22 @@
<%def name="page_title()">${h.link_to(index_title, index_url)} &raquo; ${instance_title}</%def>
${form.render()|n}
% if master.has_rows:
% if master.mobile_rows_creatable and master.rows_creatable_for(instance):
## TODO: this seems like a poor choice of names? what are we really testing for here?
% if master.mobile_rows_creatable_via_browse:
${h.link_to(add_item_title, url('mobile.{}.create_row'.format(route_prefix), uuid=instance.uuid), class_='ui-btn ui-corner-all')}
% endif
% if master.mobile_rows_quickable:
${h.form(url('mobile.{}.quick_row'.format(route_prefix), uuid=instance.uuid))}
${h.csrf_token(request)}
${h.text('quick_row_entry', placeholder=quick_row_entry_placeholder, autocomplete='off', **{'data-type': 'search', 'data-url': url('mobile.{}.quick_row'.format(route_prefix), uuid=instance.uuid)})}
${h.end_form()}
% endif
% endif
<br />
${grid.render_complete()|n}
% endif

View file

@ -5,7 +5,7 @@
<%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()}
${form.render()|n}
% if master.mobile_rows_editable and instance_editable and request.has_perm('{}.edit_row'.format(permission_prefix)):
${h.link_to("Edit", url('mobile.{}.edit_row'.format(route_prefix), uuid=instance.batch_uuid, row_uuid=instance.uuid), class_='ui-btn')}