Add make_status_renderer()
to MasterView
batches aren't the only table/view where a status code/text combo may be in use
This commit is contained in:
parent
871ea84f96
commit
ed0a1f2740
2 changed files with 18 additions and 11 deletions
|
@ -419,17 +419,6 @@ class BatchMasterView(MasterView):
|
|||
f.remove_fields('executed',
|
||||
'executed_by')
|
||||
|
||||
def make_status_renderer(self, enum):
|
||||
def render_status(batch, field):
|
||||
value = batch.status_code
|
||||
if value is None:
|
||||
return ""
|
||||
status_code_text = enum.get(value, six.text_type(value))
|
||||
if batch.status_text:
|
||||
return HTML.tag('span', title=batch.status_text, c=status_code_text)
|
||||
return status_code_text
|
||||
return render_status
|
||||
|
||||
def render_complete(self, batch, field):
|
||||
permission_prefix = self.get_permission_prefix()
|
||||
use_buefy = self.get_use_buefy()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue