From 3775c53df3a0b5518cf24a2c3656e5650711d706 Mon Sep 17 00:00:00 2001 From: Lance Edgar Date: Sun, 9 Jun 2019 21:34:47 -0500 Subject: [PATCH] Add generic support for "delete w/ simple confirm" in master index template jquery only, for now --- tailbone/templates/master/index.mako | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/tailbone/templates/master/index.mako b/tailbone/templates/master/index.mako index e161fe3c..24238b4a 100644 --- a/tailbone/templates/master/index.mako +++ b/tailbone/templates/master/index.mako @@ -16,12 +16,24 @@ ${parent.extra_javascript()} % if use_buefy: ${h.javascript_link(request.static_url('tailbone:static/js/tailbone.buefy.grid.js') + '?ver={}'.format(tailbone.__version__))} - % endif + % else: + % endif <%def name="context_menu_items()"> @@ -228,4 +241,9 @@ ## no buefy, so do the traditional thing ${grid.render_complete(tools=capture(self.grid_tools).strip(), context_menu=capture(self.context_menu_items).strip())|n} + % if master.deletable and request.has_perm('{}.delete'.format(permission_prefix)) and master.delete_confirm == 'simple': + ${h.form('#', id='delete-object-form')} + ${h.csrf_token(request)} + ${h.end_form()} + % endif % endif