Allow customization of row 'view' action url

This commit is contained in:
Lance Edgar 2021-08-23 14:25:08 -05:00
parent ac133ce830
commit a881b310bc

View file

@ -490,9 +490,8 @@ class MasterView(View):
# view action
if self.rows_viewable:
view = lambda r, i: self.get_row_action_url('view', r)
icon = 'eye' if use_buefy else 'zoomin'
actions.append(self.make_action('view', icon=icon, url=view))
actions.append(self.make_action('view', icon=icon, url=self.row_view_action_url))
# edit action
if self.rows_editable and self.has_perm('edit_row'):
@ -1344,6 +1343,9 @@ class MasterView(View):
"""
return True
def row_view_action_url(self, row, i):
return self.get_row_action_url('view', row)
def row_edit_action_url(self, row, i):
if self.row_editable(row):
return self.get_row_action_url('edit', row)