commit/galaxy-central: greg: Make the DeletedColumn in the Repositories grid a subclass so that the Advanced search labels clarify the status of the filtered repositories.
1 new commit in galaxy-central: https://bitbucket.org/galaxy/galaxy-central/changeset/04290e284245/ changeset: 04290e284245 user: greg date: 2012-10-08 16:30:43 summary: Make the DeletedColumn in the Repositories grid a subclass so that the Advanced search labels clarify the status of the filtered repositories. affected #: 1 file diff -r 685a17af92dfd6a2e3d7e3c9a3a4b119c78a6f96 -r 04290e2842452d00b9a1e62a1fb54b8acfc0826f lib/galaxy/webapps/community/controllers/repository.py --- a/lib/galaxy/webapps/community/controllers/repository.py +++ b/lib/galaxy/webapps/community/controllers/repository.py @@ -40,8 +40,6 @@ viewable_repositories += 1 return viewable_repositories return 0 - - # Grid definition title = "Categories" model_class = model.Category template='/webapps/community/category/grid.mako' @@ -148,6 +146,15 @@ if column_filter == "All": return query return query.filter( model.Category.name == column_filter ) + class DeletedColumn( grids.DeletedColumn ): + def get_accepted_filters( self ): + """ Returns a list of accepted filters for this column. """ + accepted_filter_labels_and_vals = { "Active" : "False", "Deactivated or uninstalled" : "True", "All": "All" } + accepted_filters = [] + for label, val in accepted_filter_labels_and_vals.items(): + args = { self.key: val } + accepted_filters.append( grids.GridColumnFilter( label, args) ) + return accepted_filters class UserColumn( grids.TextColumn ): def get_value( self, trans, grid, repository ): if repository.user: @@ -200,10 +207,10 @@ model_class=model.Category, key="Category.name", visible=False ), - grids.DeletedColumn( "Deleted", - key="deleted", - visible=False, - filterable="advanced" ) + DeletedColumn( "Status", + key="deleted", + visible=False, + filterable="advanced" ) ] columns.append( grids.MulticolFilterColumn( "Search repository name, description", cols_to_filter=[ columns[0], columns[1] ], @@ -2182,7 +2189,10 @@ cntrller = params.get( 'cntrller', 'repository' ) repository = get_repository( trans, id ) repository_metadata = get_repository_metadata_by_changeset_revision( trans, trans.security.encode_id( repository.id ), changeset_revision ) - metadata = repository_metadata.metadata + if repository_metadata: + metadata = repository_metadata.metadata + else: + metadata = None if metadata and 'readme' in metadata: readme_file = str( metadata[ 'readme' ] ) repo_files_dir = repository.repo_path 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