commit/galaxy-central: jgoecks: Add support for global operations to grid framework. Thanks Brad Chapman. Fixes #387
1 new changeset in galaxy-central: http://bitbucket.org/galaxy/galaxy-central/changeset/dc8216f1fbfd/ changeset: dc8216f1fbfd user: jgoecks date: 2011-06-16 15:39:09 summary: Add support for global operations to grid framework. Thanks Brad Chapman. Fixes #387 affected #: 2 files (836 bytes) --- a/lib/galaxy/web/framework/helpers/grids.py Wed Jun 15 17:36:38 2011 -0400 +++ b/lib/galaxy/web/framework/helpers/grids.py Thu Jun 16 09:39:09 2011 -0400 @@ -702,7 +702,8 @@ class GridOperation( object ): def __init__( self, label, key=None, condition=None, allow_multiple=True, allow_popup=True, - target=None, url_args=None, async_compatible=False, confirm=None ): + target=None, url_args=None, async_compatible=False, confirm=None, + global_operation=None ): self.label = label self.key = key self.allow_multiple = allow_multiple @@ -713,6 +714,11 @@ self.async_compatible = async_compatible # if 'confirm' is set, then ask before completing the operation self.confirm = confirm + # specify a general operation that acts on the full grid + # this should be a function returning a dictionary with parameters + # to pass to the URL, similar to GridColumn links: + # global_operation=(lambda: dict(operation="download") + self.global_operation = global_operation def get_url_args( self, item ): if self.url_args: temp = dict( self.url_args ) --- a/templates/grid_base.mako Wed Jun 15 17:36:38 2011 -0400 +++ b/templates/grid_base.mako Thu Jun 16 09:39:09 2011 -0400 @@ -1013,5 +1013,20 @@ </td></tr> %endif + %if len([o for o in grid.operations if o.global_operation]) > 0: + <tr> + <td colspan="100"> + %for operation in grid.operations: + %if operation.global_operation: + <% + link = operation.global_operation() + href = url( **link ) + %> + <a class="action-button" href="${href}">${operation.label}</a> + %endif + %endfor + </td> + </tr> + %endif </%def> Repository URL: https://bitbucket.org/galaxy/galaxy-central/ -- This is a commit notification from bitbucket.org. You are receiving this because you have the service enabled, addressing the recipient of this email.
participants (1)
-
Bitbucket