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:
parent
aa6e540abd
commit
68bd3047c4
10 changed files with 143 additions and 23 deletions
|
@ -149,6 +149,12 @@ class BatchMasterView(MasterView):
|
|||
kwargs['handler'] = self.handler
|
||||
kwargs['execute_title'] = self.get_execute_title(batch)
|
||||
kwargs['execute_enabled'] = self.instance_executable(batch)
|
||||
if kwargs['mobile']:
|
||||
if self.mobile_rows_creatable:
|
||||
kwargs.setdefault('add_item_title', "Add Item")
|
||||
if self.mobile_rows_quickable:
|
||||
kwargs.setdefault('quick_row_entry_placeholder', "Enter {}".format(
|
||||
self.rattail_config.product_key_title()))
|
||||
if kwargs['execute_enabled']:
|
||||
url = self.get_action_url('execute', batch)
|
||||
kwargs['execute_form'] = self.make_execute_form(batch, action_url=url)
|
||||
|
@ -475,9 +481,14 @@ class BatchMasterView(MasterView):
|
|||
|
||||
def rows_creatable_for(self, batch):
|
||||
"""
|
||||
Only allow creating new rows on a batch if it hasn't yet been executed.
|
||||
Only allow creating new rows on a batch if it hasn't yet been executed
|
||||
or marked complete.
|
||||
"""
|
||||
return not batch.executed
|
||||
if batch.executed:
|
||||
return False
|
||||
if batch.complete:
|
||||
return False
|
||||
return True
|
||||
|
||||
def configure_row_grid(self, g):
|
||||
super(BatchMasterView, self).configure_row_grid(g)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue