From 59fe324872602dd31702a6677e2bf09d3f83678b Mon Sep 17 00:00:00 2001 From: Lance Edgar Date: Tue, 14 Jan 2025 11:28:12 -0600 Subject: [PATCH] fix: add optional `target` attr for GridAction --- src/wuttaweb/grids/base.py | 6 ++++++ src/wuttaweb/templates/grids/vue_template.mako | 3 +++ 2 files changed, 9 insertions(+) diff --git a/src/wuttaweb/grids/base.py b/src/wuttaweb/grids/base.py index fb797a4..e65a22e 100644 --- a/src/wuttaweb/grids/base.py +++ b/src/wuttaweb/grids/base.py @@ -2280,6 +2280,10 @@ class GridAction: See also :meth:`get_url()`. + .. attribute:: target + + Optional ``target`` attribute for the ```` tag. + .. attribute:: icon Name of icon to be shown for the action link. @@ -2297,6 +2301,7 @@ class GridAction: key, label=None, url=None, + target=None, icon=None, link_class=None, ): @@ -2305,6 +2310,7 @@ class GridAction: self.app = self.config.get_app() self.key = key self.url = url + self.target = target self.label = label or self.app.make_title(key) self.icon = icon or key self.link_class = link_class or '' diff --git a/src/wuttaweb/templates/grids/vue_template.mako b/src/wuttaweb/templates/grids/vue_template.mako index 746a939..ac0a2a9 100644 --- a/src/wuttaweb/templates/grids/vue_template.mako +++ b/src/wuttaweb/templates/grids/vue_template.mako @@ -180,6 +180,9 @@ % for action in grid.actions: ${action.render_icon_and_label()}