diff --git a/tailbone/forms/core.py b/tailbone/forms/core.py index e8bc369f..6a4dc21d 100644 --- a/tailbone/forms/core.py +++ b/tailbone/forms/core.py @@ -327,7 +327,7 @@ class Form(object): auto_disable_save = True auto_disable_cancel = True - def __init__(self, fields=None, schema=None, request=None, readonly=False, readonly_fields=[], + def __init__(self, fields=None, schema=None, request=None, mobile=False, readonly=False, readonly_fields=[], model_instance=None, model_class=None, nodes={}, enums={}, labels={}, renderers=None, hidden={}, widgets={}, defaults={}, validators={}, required={}, helptext={}, action_url=None, cancel_url=None): @@ -339,6 +339,7 @@ class Form(object): if self.fields is None and self.schema: self.set_fields([f.name for f in self.schema]) self.request = request + self.mobile = mobile self.readonly = readonly self.readonly_fields = set(readonly_fields or []) self.model_instance = model_instance diff --git a/tailbone/templates/forms/deform.mako b/tailbone/templates/forms/deform.mako index ed7b3928..54652190 100644 --- a/tailbone/templates/forms/deform.mako +++ b/tailbone/templates/forms/deform.mako @@ -80,7 +80,11 @@ ${h.csrf_token(request)} % endif % if getattr(form, 'show_cancel', True): - ${h.link_to("Cancel", form.cancel_url, class_='cancel button{}'.format(' autodisable' if form.auto_disable_cancel else ''))} + % if form.mobile: + ${h.link_to("Cancel", form.cancel_url, class_='ui-btn ui-corner-all')} + % else: + ${h.link_to("Cancel", form.cancel_url, class_='cancel button{}'.format(' autodisable' if form.auto_disable_cancel else ''))} + % endif % endif % endif