Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removes mako for datasets grid #4163

Merged
merged 11 commits into from Jun 12, 2017
@@ -83,6 +83,7 @@ window.app = function app( options, bootstrapped ){
'(/)user(/)(:form_id)' : 'show_user_form',
'(/)workflow(/)' : 'show_workflows',
'(/)pages(/)(:action_id)' : 'show_pages',
'(/)datasets(/)(:action_id)' : 'show_datasets',

This comment has been minimized.

Copy link
@dannon

dannon Jun 12, 2017

Member

I went ahead and merged this to keep moving along, but we don't use the :action_id at all in the routing function below, so /datasets/foo/ goes to /datasets/list/ as well, for example.

'(/)workflow/configure_menu(/)' : 'show_configure_menu',
'(/)custom_builds' : 'show_custom_builds'
},
@@ -118,6 +119,10 @@ window.app = function app( options, bootstrapped ){
this.page.display( new UserPreferences.Forms( { form_id: form_id, user_id: Galaxy.params.id } ) );
},

show_datasets : function() {
this.page.display( new GridView( { url_base: Galaxy.root + 'dataset/list', dict_format: true } ) );
},

show_pages : function( action_id ) {
if ( action_id == 'list' ) {
this.page.display( new PageList.View() );
@@ -271,8 +271,8 @@ var Collection = Backbone.Collection.extend({
target : 'galaxy_main'
},{
title : _l('Saved Datasets'),
url : 'dataset/list',
target : 'galaxy_main'
url : 'datasets/list',
target : '_top'
},{
title : _l('Saved Pages'),
url : 'pages/list',
@@ -339,7 +339,8 @@ def url( *args, **kwargs ):
'default_filter_dict' : self.default_filter,
'advanced_search' : self.advanced_search,
'info_text' : self.info_text,
'url' : url(dict())
'url' : url(dict()),
'refresh_frames' : kwargs.get( 'refresh_frames', [] )
}
if current_item:
grid_config['current_item_id'] = current_item.id
@@ -109,6 +109,7 @@ def paste_app_factory( global_conf, **kwargs ):
webapp.add_client_route( '/user/{form_id}' )
webapp.add_client_route( '/workflow' )
webapp.add_client_route( '/pages/{action_id}' )
webapp.add_client_route( '/datasets/{action_id}' )
webapp.add_client_route( '/workflow/configure_menu' )
webapp.add_client_route( '/custom_builds' )

@@ -53,7 +53,6 @@ def get_accepted_filters( self ):
# Grid definition
title = "Saved Datasets"
model_class = model.HistoryDatasetAssociation
template = '/dataset/grid.mako'
default_sort_key = "-update_time"
columns = [
grids.TextColumn( "Name", key="name",
@@ -463,6 +462,7 @@ def __ok_to_edit_metadata( dataset_id ):
return trans.show_error_message( "You do not have permission to edit this dataset's ( id: %s ) information." % str( dataset_id ) )

@web.expose
@web.json
@web.require_login( "see all available datasets" )
def list( self, trans, **kwargs ):
"""List all available datasets"""
@@ -501,9 +501,10 @@ def list( self, trans, **kwargs ):
status, message = trans.webapp.controllers['history']._list_switch( trans, histories )

# Current history changed, refresh history frame; if switching to a dataset, set hda seek.
trans.template_context['refresh_frames'] = ['history']
kwargs['refresh_frames'] = ['history']
if operation == "switch":
hda_ids = [ trans.security.encode_id( hda.id ) for hda in hdas ]
# TODO: Highlighting does not work, has to be revisited
trans.template_context[ 'seek_hda_ids' ] = hda_ids
elif operation == "copy to current history":
#
@@ -517,9 +518,10 @@ def list( self, trans, **kwargs ):
status, message = self._copy_datasets( trans, hda_ids, target_histories )

# Current history changed, refresh history frame.
trans.template_context['refresh_frames'] = ['history']
kwargs['refresh_frames'] = ['history']

# Render the list view
kwargs[ 'dict_format' ] = True
return self.stored_list_grid( trans, status=status, message=message, **kwargs )

@web.expose

Some generated files are not rendered by default. Learn more.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.