details: http://www.bx.psu.edu/hg/galaxy/rev/c280939fd48d changeset: 3414:c280939fd48d user: jeremy goecks <jeremy.goecks@emory.edu> date: Thu Feb 18 17:04:43 2010 -0500 description: Make page 'View' option use same URL as shared/accessible/published page does so that relative URLs behave the same in both contexts. This change addresses the issue raised by the temporarily broken hyperlink on the Bushman page. diffstat: lib/galaxy/web/controllers/page.py | 2 +- lib/galaxy/web/framework/helpers/grids.py | 5 +++++ 2 files changed, 6 insertions(+), 1 deletions(-) diffs (27 lines): diff -r bbff5050cfd2 -r c280939fd48d lib/galaxy/web/controllers/page.py --- a/lib/galaxy/web/controllers/page.py Thu Feb 18 11:50:19 2010 -0500 +++ b/lib/galaxy/web/controllers/page.py Thu Feb 18 17:04:43 2010 -0500 @@ -44,7 +44,7 @@ grids.GridAction( "Add new page", dict( action='create' ) ) ] operations = [ - grids.GridOperation( "View", allow_multiple=False, url_args=dict( action='display') ), + grids.DisplayByUsernameAndSlugGridOperation( "View", allow_multiple=False ), grids.GridOperation( "Edit name/id", allow_multiple=False, url_args=dict( action='edit') ), grids.GridOperation( "Edit content", allow_multiple=False, url_args=dict( action='edit_content') ), grids.GridOperation( "Share or Publish", allow_multiple=False, condition=( lambda item: not item.deleted ), async_compatible=False ), diff -r bbff5050cfd2 -r c280939fd48d lib/galaxy/web/framework/helpers/grids.py --- a/lib/galaxy/web/framework/helpers/grids.py Thu Feb 18 11:50:19 2010 -0500 +++ b/lib/galaxy/web/framework/helpers/grids.py Thu Feb 18 17:04:43 2010 -0500 @@ -541,6 +541,11 @@ return self.condition( item ) else: return True + +class DisplayByUsernameAndSlugGridOperation( GridOperation ): + """ Operation to display an item by username and slug. """ + def get_url_args( self, item ): + return { 'action' : 'display_by_username_and_slug', 'username' : item.user.username, 'slug' : item.slug } class GridAction( object ): def __init__( self, label=None, url_args=None ):