1 new changeset in galaxy-central: http://bitbucket.org/galaxy/galaxy-central/changeset/d2db43017281/ changeset: r4997:d2db43017281 user: jgoecks date: 2011-02-04 20:49:23 summary: Trackster history dataset selection: show history name, show and order by hid in display. affected #: 4 files (400 bytes) --- a/lib/galaxy/web/controllers/tracks.py Fri Feb 04 14:29:23 2011 -0500 +++ b/lib/galaxy/web/controllers/tracks.py Fri Feb 04 14:49:23 2011 -0500 @@ -106,23 +106,29 @@ available_tracks = None title = "Add Datasets" template = "tracks/history_datasets_select_grid.mako" - async_template = "/page/select_items_grid_async.mako" model_class = model.HistoryDatasetAssociation default_filter = { "deleted" : "False" , "shared" : "All" } - default_sort_key = "name" + default_sort_key = "-hid" use_async = True use_paging = False columns = [ + grids.GridColumn( "Id", key="hid" ), grids.TextColumn( "Name", key="name", model_class=model.HistoryDatasetAssociation ), grids.TextColumn( "Filetype", key="extension", model_class=model.HistoryDatasetAssociation ), HistoryColumn( "History", key="history", visible=False ), DbKeyColumn( "Dbkey", key="dbkey", model_class=model.HistoryDatasetAssociation, visible=True, sortable=False ) ] columns.append( - grids.MulticolFilterColumn( "Search", cols_to_filter=[ columns[0], columns[1] ], + grids.MulticolFilterColumn( "Search name and filetype", cols_to_filter=[ columns[1], columns[2] ], key="free-text-search", visible=False, filterable="standard" ) ) - + + def get_current_item( self, trans, **kwargs ): + """ + Current item for grid is the history being queried. This is a bit + of hack since current_item typically means the current item in the grid. + """ + return model.History.get( trans.security.decode_id( kwargs[ 'f-history' ] ) ) def build_initial_query( self, trans, **kwargs ): return trans.sa_session.query( self.model_class ).join( model.History.table ).join( model.Dataset.table ) def apply_query_filter( self, trans, query, **kwargs ): @@ -144,13 +150,9 @@ use_async = True use_paging = False columns = [ - grids.TextColumn( "Title", key="title", model_class=model.Visualization ), + grids.TextColumn( "Title", key="title", model_class=model.Visualization, filterable="standard" ), grids.TextColumn( "Dbkey", key="dbkey", model_class=model.Visualization ) ] - columns.append( - grids.MulticolFilterColumn( "Search", cols_to_filter=[ columns[0] ], - key="free-text-search", visible=False, filterable="standard" ) - ) def build_initial_query( self, trans, **kwargs ): return trans.sa_session.query( self.model_class ) --- a/lib/galaxy/web/framework/helpers/grids.py Fri Feb 04 14:29:23 2011 -0500 +++ b/lib/galaxy/web/framework/helpers/grids.py Fri Feb 04 14:49:23 2011 -0500 @@ -271,7 +271,7 @@ message = message, use_panels=self.use_panels, webapp=webapp, - show_item_checkboxes = kwargs.get( "show_item_checkboxes", False ), + show_item_checkboxes = ( kwargs.get( 'show_item_checkboxes', '' ) in ['True', 'true'] ), # Pass back kwargs so that grid template can set and use args without # grid explicitly having to pass them. kwargs=kwargs ) --- a/templates/grid_base.mako Fri Feb 04 14:29:23 2011 -0500 +++ b/templates/grid_base.mako Fri Feb 04 14:49:23 2011 -0500 @@ -262,6 +262,9 @@ // Add sort argument to URL args. url_args['sort'] = "${sort_key}"; + // Add show_item_checkboxes argument to URL args. + url_args['show_item_checkboxes'] = ("${context.get('show_item_checkboxes', False)}" === "True"); + // Add async keyword to URL args. url_args['async'] = true; --- a/templates/tracks/history_datasets_select_grid.mako Fri Feb 04 14:29:23 2011 -0500 +++ b/templates/tracks/history_datasets_select_grid.mako Fri Feb 04 14:49:23 2011 -0500 @@ -11,6 +11,5 @@ %> ## Use class 'label' to piggyback on URL functionality in parent template. <a class="label" href="${h.url_for( **url_dict )}">Back to histories</a> - <br /><br /> - ${parent.title()} + <h2>History '${grid.get_current_item( trans, **kwargs ).name}'</h2></%def> \ No newline at end of file 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.