[hg] galaxy 3502: Keep the state of displaying / hiding deleted ...
details: http://www.bx.psu.edu/hg/galaxy/rev/34babf71a09f changeset: 3502:34babf71a09f user: Greg Von Kuster <greg@bx.psu.edu> date: Tue Mar 09 16:28:04 2010 -0500 description: Keep the state of displaying / hiding deleted library items whn uploading library datasets. diffstat: lib/galaxy/web/controllers/library_common.py | 7 +++++++ lib/galaxy/web/controllers/tool_runner.py | 1 - templates/base_panels.mako | 5 +++-- templates/library/common/browse_library.mako | 2 +- templates/library/common/common.mako | 3 ++- templates/library/common/upload.mako | 14 +++++++------- 6 files changed, 20 insertions(+), 12 deletions(-) diffs (161 lines): diff -r e4592fc99acc -r 34babf71a09f lib/galaxy/web/controllers/library_common.py --- a/lib/galaxy/web/controllers/library_common.py Tue Mar 09 15:25:23 2010 -0500 +++ b/lib/galaxy/web/controllers/library_common.py Tue Mar 09 16:28:04 2010 -0500 @@ -659,6 +659,7 @@ msg = util.restore_text( params.get( 'msg', '' ) ) messagetype = params.get( 'messagetype', 'done' ) deleted = util.string_as_bool( params.get( 'deleted', False ) ) + show_deleted = util.string_as_bool( params.get( 'show_deleted', False ) ) dbkey = params.get( 'dbkey', '?' ) if isinstance( dbkey, list ): last_used_build = dbkey[0] @@ -705,6 +706,7 @@ folder_id=folder_id, replace_id=replace_id, upload_option=upload_option, + show_deleted=show_deleted, msg=util.sanitize_text( msg ), messagetype='error' ) ) @@ -758,6 +760,7 @@ id=library_id, default_action=default_action, created_ldda_ids=created_ldda_ids, + show_deleted=show_deleted, msg=util.sanitize_text( msg ), messagetype='done' ) ) @@ -770,6 +773,7 @@ cntrller=cntrller, id=library_id, created_ldda_ids=created_ldda_ids, + show_deleted=show_deleted, msg=util.sanitize_text( msg ), messagetype=messagetype ) ) # See if we have any inherited templates, but do not inherit contents. @@ -819,6 +823,7 @@ roles=roles, history=history, widgets=widgets, + show_deleted=show_deleted, msg=msg, messagetype=messagetype ) def upload_dataset( self, trans, cntrller, library_id, folder_id, replace_dataset=None, **kwd ): @@ -834,6 +839,7 @@ dataset_upload_inputs.append( input ) # Library-specific params params = util.Params( kwd ) # is this filetoolparam safe? + show_deleted = util.string_as_bool( params.get( 'show_deleted', False ) ) library_bunch = upload_common.handle_library_params( trans, params, folder_id, replace_dataset ) msg = util.restore_text( params.get( 'msg', '' ) ) messagetype = params.get( 'messagetype', 'done' ) @@ -883,6 +889,7 @@ folder_id=folder_id, replace_id=replace_id, upload_option=upload_option, + show_deleted=show_deleted, msg=util.sanitize_text( msg ), messagetype='error' ) ) json_file_path = upload_common.create_paramfile( trans, uploaded_datasets ) diff -r e4592fc99acc -r 34babf71a09f lib/galaxy/web/controllers/tool_runner.py --- a/lib/galaxy/web/controllers/tool_runner.py Tue Mar 09 15:25:23 2010 -0500 +++ b/lib/galaxy/web/controllers/tool_runner.py Tue Mar 09 16:28:04 2010 -0500 @@ -155,7 +155,6 @@ permissions, in_roles, error, msg = trans.app.security_agent.derive_roles_from_access( trans, library_id, cntrller, library=True, **vars ) if error: return [ 'error', msg ] - permissions = trans.app.security_agent.history_get_default_permissions( trans.history ) def create_dataset( name ): ud = Bunch( name=name, file_type=None, dbkey=None ) if nonfile_params.get( 'folder_id', False ): diff -r e4592fc99acc -r 34babf71a09f templates/base_panels.mako --- a/templates/base_panels.mako Tue Mar 09 15:25:23 2010 -0500 +++ b/templates/base_panels.mako Tue Mar 09 16:28:04 2010 -0500 @@ -131,10 +131,11 @@ $(this).ajaxSubmit( { iframe: true } ); if ( $(this).find("input[name='folder_id']").val() != undefined ) { var library_id = $(this).find("input[name='library_id']").val(); + var show_deleted = $(this).find("input[name='show_deleted']").val(); if ( location.pathname.indexOf( 'admin' ) != -1 ) { - $("iframe#galaxy_main").attr("src","${h.url_for( controller='library_common', action='browse_library' )}?cntrller=library_admin&id=" + library_id + "&created_ldda_ids=" + async_datasets); + $("iframe#galaxy_main").attr("src","${h.url_for( controller='library_common', action='browse_library' )}?cntrller=library_admin&id=" + library_id + "&created_ldda_ids=" + async_datasets + "&show_deleted=" + show_deleted); } else { - $("iframe#galaxy_main").attr("src","${h.url_for( controller='library_common', action='browse_library' )}?cntrller=library&id=" + library_id + "&created_ldda_ids=" + async_datasets); + $("iframe#galaxy_main").attr("src","${h.url_for( controller='library_common', action='browse_library' )}?cntrller=library&id=" + library_id + "&created_ldda_ids=" + async_datasets + "&show_deleted=" + show_deleted); } } else { $("iframe#galaxy_main").attr("src","${h.url_for(controller='tool_runner', action='upload_async_message')}"); diff -r e4592fc99acc -r 34babf71a09f templates/library/common/browse_library.mako --- a/templates/library/common/browse_library.mako Tue Mar 09 15:25:23 2010 -0500 +++ b/templates/library/common/browse_library.mako Tue Mar 09 16:28:04 2010 -0500 @@ -404,7 +404,7 @@ <ul class="manage-table-actions"> %if not library.deleted and ( cntrller in [ 'library_admin', 'requests_admin' ] or can_add ): - <li><a class="action-button" href="${h.url_for( controller='library_common', action='upload_library_dataset', cntrller=cntrller, library_id=trans.security.encode_id( library.id ), folder_id=trans.security.encode_id( library.root_folder.id ) )}"><span>Add datasets</span></a></li> + <li><a class="action-button" href="${h.url_for( controller='library_common', action='upload_library_dataset', cntrller=cntrller, library_id=trans.security.encode_id( library.id ), folder_id=trans.security.encode_id( library.root_folder.id ), use_panels=use_panels, show_deleted=show_deleted )}"><span>Add datasets</span></a></li> <li><a class="action-button" href="${h.url_for( controller='library_common', action='create_folder', cntrller=cntrller, parent_id=trans.security.encode_id( library.root_folder.id ), library_id=trans.security.encode_id( library.id ), use_panels=use_panels, show_deleted=show_deleted )}">Add folder</a></li> %endif </ul> diff -r e4592fc99acc -r 34babf71a09f templates/library/common/common.mako --- a/templates/library/common/common.mako Tue Mar 09 15:25:23 2010 -0500 +++ b/templates/library/common/common.mako Tue Mar 09 16:28:04 2010 -0500 @@ -87,7 +87,7 @@ %endif </%def> -<%def name="render_upload_form( cntrller, upload_option, action, library_id, folder_id, replace_dataset, file_formats, dbkeys, widgets, roles, history )"> +<%def name="render_upload_form( cntrller, upload_option, action, library_id, folder_id, replace_dataset, file_formats, dbkeys, widgets, roles, history, show_deleted )"> <% import os, os.path %> %if upload_option in [ 'upload_file', 'upload_directory', 'upload_paths' ]: <div class="toolForm" id="upload_library_dataset"> @@ -106,6 +106,7 @@ <input type="hidden" name="library_id" value="${library_id}"/> <input type="hidden" name="folder_id" value="${folder_id}"/> <input type="hidden" name="upload_option" value="${upload_option}"/> + <input type="hidden" name="show_deleted" value="${show_deleted}"/> %if replace_dataset not in [ None, 'None' ]: <input type="hidden" name="replace_id" value="${trans.security.encode_id( replace_dataset.id )}"/> <div class="form-row"> diff -r e4592fc99acc -r 34babf71a09f templates/library/common/upload.mako --- a/templates/library/common/upload.mako Tue Mar 09 15:25:23 2010 -0500 +++ b/templates/library/common/upload.mako Tue Mar 09 16:28:04 2010 -0500 @@ -26,26 +26,26 @@ ## Don't allow multiple datasets to be uploaded when replacing a dataset with a new version <a id="upload-librarydataset--popup" class="popup-arrow" style="display: none;">▼</a> <div popupmenu="upload-librarydataset--popup"> - <a class="action-button" href="${h.url_for( controller='library_common', action='upload_library_dataset', cntrller=cntrller,library_id=library_id, folder_id=folder_id, replace_id=replace_id, upload_option='upload_file' )}">Upload files</a> + <a class="action-button" href="${h.url_for( controller='library_common', action='upload_library_dataset', cntrller=cntrller,library_id=library_id, folder_id=folder_id, replace_id=replace_id, upload_option='upload_file', show_deleted=show_deleted )}">Upload files</a> %if cntrller == 'library_admin': %if trans.app.config.library_import_dir and os.path.exists( trans.app.config.library_import_dir ): - <a class="action-button" href="${h.url_for( controller='library_common', action='upload_library_dataset', cntrller=cntrller, library_id=library_id, folder_id=folder_id, replace_id=replace_id, upload_option='upload_directory' )}">Upload directory of files</a> + <a class="action-button" href="${h.url_for( controller='library_common', action='upload_library_dataset', cntrller=cntrller, library_id=library_id, folder_id=folder_id, replace_id=replace_id, upload_option='upload_directory', show_deleted=show_deleted )}">Upload directory of files</a> %endif %if trans.app.config.allow_library_path_paste: - <a class="action-button" href="${h.url_for( controller='library_common', action='upload_library_dataset', cntrller=cntrller, library_id=library_id, folder_id=folder_id, replace_id=replace_id, upload_option='upload_paths' )}">Upload files from filesystem paths</a> + <a class="action-button" href="${h.url_for( controller='library_common', action='upload_library_dataset', cntrller=cntrller, library_id=library_id, folder_id=folder_id, replace_id=replace_id, upload_option='upload_paths', show_deleted=show_deleted )}">Upload files from filesystem paths</a> %endif %elif cntrller == 'library': %if trans.app.config.user_library_import_dir and os.path.exists( os.path.join( trans.app.config.user_library_import_dir, trans.user.email ) ): - <a class="action-button" href="${h.url_for( controller='library_common', action='upload_library_dataset', cntrller=cntrller, library_id=library_id, folder_id=folder_id, replace_id=replace_id, upload_option='upload_directory' )}">Upload directory of files</a> + <a class="action-button" href="${h.url_for( controller='library_common', action='upload_library_dataset', cntrller=cntrller, library_id=library_id, folder_id=folder_id, replace_id=replace_id, upload_option='upload_directory', show_deleted=show_deleted )}">Upload directory of files</a> %endif %endif - <a class="action-button" href="${h.url_for( controller='library_common', action='upload_library_dataset', cntrller=cntrller, library_id=library_id, folder_id=folder_id, replace_id=replace_id, upload_option='import_from_history' )}">Import datasets from your current history</a> + <a class="action-button" href="${h.url_for( controller='library_common', action='upload_library_dataset', cntrller=cntrller, library_id=library_id, folder_id=folder_id, replace_id=replace_id, upload_option='import_from_history', show_deleted=show_deleted )}">Import datasets from your current history</a> </div> %endif <br/><br/> <ul class="manage-table-actions"> <li> - <a class="action-button" href="${h.url_for( controller='library_common', action='browse_library', cntrller=cntrller, id=library_id )}"><span>Browse this data library</span></a> + <a class="action-button" href="${h.url_for( controller='library_common', action='browse_library', cntrller=cntrller, id=library_id, show_deleted=show_deleted )}"><span>Browse this data library</span></a> </li> </ul> @@ -53,4 +53,4 @@ ${render_msg( msg, messagetype )} %endif -${render_upload_form( cntrller, upload_option, action, library_id, folder_id, replace_dataset, file_formats, dbkeys, widgets, roles, history )} +${render_upload_form( cntrller, upload_option, action, library_id, folder_id, replace_dataset, file_formats, dbkeys, widgets, roles, history, show_deleted )}
participants (1)
-
Greg Von Kuster