galaxy-dev
Threads by month
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
November 2009
- 26 participants
- 233 discussions
Hi all,
I incorporated *NGS: QC and manipulation* tool tracks to my galaxy server.
But I have been failing to run those tools in my local instance. From the
error message I found that few of the file/script are missing in the tool
directory.
Here is the list of tools shows error message while running:
Quality format converter ('fastq_quality_converter' command not found)
Compute quality statistics ('fastx_quality_stats' command not found)
Draw quality score boxplot ('fastq_quality_boxplot_graph.sh' not found)
Draw nucleotides distribution chart
('fastx_nucleotide_distribution_graph.sh' not found)
In the Galaxy-central source repository I am not finding such a file/script
associated with these tools (
http://bitbucket.org/galaxy/galaxy-central/src/tip/tools/fastx_toolkit/) In
the main galaxy server these tools are working perfectly.
Please let me know if I did any mistake from these observations.
Many thanks,
Vipin T S
2
1
09 Nov '09
details: http://www.bx.psu.edu/hg/galaxy/rev/9f485a539bfb
changeset: 2995:9f485a539bfb
user: Greg Von Kuster <greg(a)bx.psu.edu>
date: Mon Nov 09 23:00:55 2009 -0500
description:
Incorporate latest grid features into managing users, groups and roles from the admin view.
diffstat:
lib/galaxy/web/controllers/admin.py | 436 +++++++++++++++-----
templates/admin/dataset_security/deleted_groups.mako | 101 ----
templates/admin/dataset_security/deleted_roles.mako | 103 ----
templates/admin/dataset_security/group.mako | 83 ---
templates/admin/dataset_security/group/grid.mako | 1 +
templates/admin/dataset_security/group/group.mako | 83 +++
templates/admin/dataset_security/group/group_create.mako | 87 ++++
templates/admin/dataset_security/group/group_rename.mako | 34 +
templates/admin/dataset_security/group_create.mako | 87 ----
templates/admin/dataset_security/group_rename.mako | 34 -
templates/admin/dataset_security/groups.mako | 107 -----
templates/admin/dataset_security/role.mako | 117 -----
templates/admin/dataset_security/role/grid.mako | 1 +
templates/admin/dataset_security/role/role.mako | 117 +++++
templates/admin/dataset_security/role/role_create.mako | 94 ++++
templates/admin/dataset_security/role/role_rename.mako | 41 +
templates/admin/dataset_security/role_create.mako | 94 ----
templates/admin/dataset_security/role_rename.mako | 41 -
templates/admin/dataset_security/roles.mako | 109 -----
templates/admin/user/grid.mako | 225 +----------
templates/grid_base.mako | 11 +-
test/base/twilltestcase.py | 32 +-
test/functional/test_history_functions.py | 4 +-
test/functional/test_security_and_libraries.py | 102 ++--
tool_conf.xml.main | 52 ++-
25 files changed, 914 insertions(+), 1282 deletions(-)
diffs (2900 lines):
diff -r 1a438bb4dac2 -r 9f485a539bfb lib/galaxy/web/controllers/admin.py
--- a/lib/galaxy/web/controllers/admin.py Mon Nov 09 16:55:52 2009 -0500
+++ b/lib/galaxy/web/controllers/admin.py Mon Nov 09 23:00:55 2009 -0500
@@ -2,20 +2,31 @@
from datetime import datetime, timedelta
from galaxy import util, datatypes
from galaxy.web.base.controller import *
+from galaxy.util.odict import odict
from galaxy.model.orm import *
from galaxy.web.framework.helpers import time_ago, iff, grids
import logging
log = logging.getLogger( __name__ )
+# States for passing messages
+SUCCESS, INFO, WARNING, ERROR = "done", "info", "warning", "error"
+
class UserListGrid( grids.Grid ):
- class EmailColumn( grids.GridColumn ):
+ class EmailColumn( grids.TextColumn ):
def get_value( self, trans, grid, user ):
return user.email
- class UserNameColumn( grids.GridColumn ):
+ class UserNameColumn( grids.TextColumn ):
def get_value( self, trans, grid, user ):
if user.username:
return user.username
return 'not set'
+ class StatusColumn( grids.GridColumn ):
+ def get_value( self, trans, grid, user ):
+ if user.purged:
+ return "purged"
+ elif user.deleted:
+ return "deleted"
+ return ""
class GroupsColumn( grids.GridColumn ):
def get_value( self, trans, grid, user ):
if user.groups:
@@ -36,56 +47,242 @@
if user.galaxy_sessions:
return self.format( user.galaxy_sessions[ 0 ].update_time )
return 'never'
+ class DeletedColumn( grids.GridColumn ):
+ def get_accepted_filters( self ):
+ """ Returns a list of accepted filters for this column. """
+ accepted_filter_labels_and_vals = { "active" : "False", "deleted" : "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
+
# Grid definition
title = "Users"
model_class = model.User
template='/admin/user/grid.mako'
+ default_sort_key = "email"
columns = [
- EmailColumn( "Email", link=( lambda item: dict( operation="information", id=item.id ) ), attach_popup=True ),
- UserNameColumn( "User Name", attach_popup=False ),
+ EmailColumn( "Email",
+ key="email",
+ model_class=model.User,
+ link=( lambda item: dict( operation="information", id=item.id ) ),
+ attach_popup=True,
+ filterable="advanced" ),
+ UserNameColumn( "User Name",
+ key="username",
+ model_class=model.User,
+ attach_popup=False,
+ filterable="advanced" ),
GroupsColumn( "Groups", attach_popup=False ),
RolesColumn( "Roles", attach_popup=False ),
ExternalColumn( "External", attach_popup=False ),
LastLoginColumn( "Last Login", format=time_ago ),
- # Valid for filtering but invisible
- grids.GridColumn( "Deleted", key="deleted", visible=False )
+ StatusColumn( "Status", attach_popup=False ),
+ # Columns that are valid for filtering but are not visible.
+ DeletedColumn( "Deleted", key="deleted", visible=False, filterable="advanced" )
+ ]
+ columns.append( grids.MulticolFilterColumn( "Search",
+ cols_to_filter=[ columns[0], columns[1] ],
+ key="free-text-search",
+ visible=False,
+ filterable="standard" ) )
+ global_actions = [
+ grids.GridAction( "Create new user", dict( controller='admin', action='users', operation='create' ) )
]
operations = [
grids.GridOperation( "Manage Roles & Groups", condition=( lambda item: not item.deleted ), allow_multiple=False )
-
]
#TODO: enhance to account for trans.app.config.allow_user_deletion here so that we can eliminate these operations if
# the setting is False
operations.append( grids.GridOperation( "Reset Password", condition=( lambda item: not item.deleted ), allow_multiple=True, allow_popup=False ) )
operations.append( grids.GridOperation( "Delete", condition=( lambda item: not item.deleted ), allow_multiple=True ) )
- operations.append( grids.GridOperation( "Undelete", condition=( lambda item: item.deleted ), allow_multiple=True ) )
- operations.append( grids.GridOperation( "Purge", condition=( lambda item: item.deleted ), allow_multiple=True ) )
+ operations.append( grids.GridOperation( "Undelete", condition=( lambda item: item.deleted and not item.purged ), allow_multiple=True ) )
+ operations.append( grids.GridOperation( "Purge", condition=( lambda item: item.deleted and not item.purged ), allow_multiple=True ) )
+ standard_filters = [
+ grids.GridColumnFilter( "Active", args=dict( deleted=False ) ),
+ grids.GridColumnFilter( "Deleted", args=dict( deleted=True, purged=False ) ),
+ grids.GridColumnFilter( "Purged", args=dict( purged=True ) ),
+ grids.GridColumnFilter( "All", args=dict( deleted='All' ) )
+ ]
+ default_filter = dict( email="All", username="All", deleted="False", purged="False" )
+ num_rows_per_page = 50
+ preserve_state = False
+ use_paging = True
+ def get_current_item( self, trans ):
+ return trans.user
+ def build_initial_query( self, session ):
+ return session.query( self.model_class )
+
+class RoleListGrid( grids.Grid ):
+ class NameColumn( grids.TextColumn ):
+ def get_value( self, trans, grid, role ):
+ return role.name
+ class DescriptionColumn( grids.TextColumn ):
+ def get_value( self, trans, grid, role ):
+ if role.description:
+ return role.description
+ return ''
+ class TypeColumn( grids.TextColumn ):
+ def get_value( self, trans, grid, role ):
+ return role.type
+ class StatusColumn( grids.GridColumn ):
+ def get_value( self, trans, grid, role ):
+ if role.deleted:
+ return "deleted"
+ return ""
+ class DeletedColumn( grids.GridColumn ):
+ def get_accepted_filters( self ):
+ """ Returns a list of accepted filters for this column. """
+ accepted_filter_labels_and_vals = { "active" : "False", "deleted" : "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 GroupsColumn( grids.GridColumn ):
+ def get_value( self, trans, grid, role ):
+ if role.groups:
+ return len( role.groups )
+ return 0
+ class UsersColumn( grids.GridColumn ):
+ def get_value( self, trans, grid, role ):
+ if role.users:
+ return len( role.users )
+ return 0
+
+ # Grid definition
+ title = "Roles"
+ model_class = model.Role
+ template='/admin/dataset_security/role/grid.mako'
+ default_sort_key = "name"
+ columns = [
+ NameColumn( "Name",
+ key="name",
+ link=( lambda item: dict( controller="admin", action="role", id=item.id ) ),
+ model_class=model.Role,
+ attach_popup=True,
+ filterable="advanced" ),
+ DescriptionColumn( "Description",
+ key='description',
+ model_class=model.Role,
+ attach_popup=False,
+ filterable="advanced" ),
+ TypeColumn( "Type",
+ key='type',
+ model_class=model.Role,
+ attach_popup=False,
+ filterable="advanced" ),
+ GroupsColumn( "Groups", attach_popup=False ),
+ UsersColumn( "Users", attach_popup=False ),
+ StatusColumn( "Status", attach_popup=False ),
+ # Columns that are valid for filtering but are not visible.
+ DeletedColumn( "Deleted", key="deleted", visible=False, filterable="advanced" )
+ ]
+ columns.append( grids.MulticolFilterColumn( "Search",
+ cols_to_filter=[ columns[0], columns[1], columns[2] ],
+ key="free-text-search",
+ visible=False,
+ filterable="standard" ) )
+ global_actions = [
+ grids.GridAction( "Add new role", dict( controller='admin', action='roles', operation='create' ) )
+ ]
+ operations = [ grids.GridOperation( "Delete", condition=( lambda item: not item.deleted ), allow_multiple=True ),
+ grids.GridOperation( "Undelete", condition=( lambda item: item.deleted ), allow_multiple=True ),
+ grids.GridOperation( "Purge", condition=( lambda item: item.deleted ), allow_multiple=True ) ]
standard_filters = [
grids.GridColumnFilter( "Active", args=dict( deleted=False ) ),
grids.GridColumnFilter( "Deleted", args=dict( deleted=True ) ),
grids.GridColumnFilter( "All", args=dict( deleted='All' ) )
]
- default_filter = dict( deleted=False )
+ default_filter = dict( name="All", deleted="False", description="All", type="All" )
+ num_rows_per_page = 50
+ preserve_state = False
+ use_paging = True
def get_current_item( self, trans ):
- return trans.user
+ return None
def build_initial_query( self, session ):
return session.query( self.model_class )
def apply_default_filter( self, trans, query, **kwargs ):
- email_filter = kwargs.get( "email_filter", None )
- if email_filter:
- if email_filter == 'all':
- return query
- else:
- return query.filter( or_( trans.app.model.User.table.c.email.like( '%s' % email_filter.lower() + '%' ),
- trans.app.model.User.table.c.email.like( '%s' % email_filter.upper() + '%' ) ) )
- elif query.count() > 200:
- return query.filter( or_( trans.app.model.User.table.c.email.like( 'A%' ),
- trans.app.model.User.table.c.email.like( 'a%' ) ) )
- return query
+ return query.filter( model.Role.type != model.Role.types.PRIVATE )
+
+class GroupListGrid( grids.Grid ):
+ class NameColumn( grids.TextColumn ):
+ def get_value( self, trans, grid, group ):
+ return group.name
+ class StatusColumn( grids.GridColumn ):
+ def get_value( self, trans, grid, group ):
+ if group.deleted:
+ return "deleted"
+ return ""
+ class DeletedColumn( grids.GridColumn ):
+ def get_accepted_filters( self ):
+ """ Returns a list of accepted filters for this column. """
+ accepted_filter_labels_and_vals = { "active" : "False", "deleted" : "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 RolesColumn( grids.GridColumn ):
+ def get_value( self, trans, grid, group ):
+ if group.roles:
+ return len( group.roles )
+ return 0
+ class UsersColumn( grids.GridColumn ):
+ def get_value( self, trans, grid, group ):
+ if group.members:
+ return len( group.members )
+ return 0
+
+ # Grid definition
+ title = "Groups"
+ model_class = model.Group
+ template='/admin/dataset_security/group/grid.mako'
+ default_sort_key = "name"
+ columns = [
+ NameColumn( "Name",
+ key="name",
+ link=( lambda item: dict( controller="admin", action="group", id=item.id ) ),
+ model_class=model.Group,
+ attach_popup=True,
+ filterable="advanced" ),
+ UsersColumn( "Users", attach_popup=False ),
+ RolesColumn( "Roles", attach_popup=False ),
+ StatusColumn( "Status", attach_popup=False ),
+ # Columns that are valid for filtering but are not visible.
+ DeletedColumn( "Deleted", key="deleted", visible=False, filterable="advanced" )
+ ]
+ columns.append( grids.MulticolFilterColumn( "Search",
+ cols_to_filter=[ columns[0], columns[1], columns[2] ],
+ key="free-text-search",
+ visible=False,
+ filterable="standard" ) )
+ global_actions = [
+ grids.GridAction( "Add new group", dict( controller='admin', action='groups', operation='create' ) )
+ ]
+ operations = [ grids.GridOperation( "Delete", condition=( lambda item: not item.deleted ), allow_multiple=True ),
+ grids.GridOperation( "Undelete", condition=( lambda item: item.deleted ), allow_multiple=True ),
+ grids.GridOperation( "Purge", condition=( lambda item: item.deleted ), allow_multiple=True ) ]
+ standard_filters = [
+ grids.GridColumnFilter( "Active", args=dict( deleted=False ) ),
+ grids.GridColumnFilter( "Deleted", args=dict( deleted=True ) ),
+ grids.GridColumnFilter( "All", args=dict( deleted='All' ) )
+ ]
+ default_filter = dict( name="All", deleted="False" )
+ num_rows_per_page = 50
+ preserve_state = False
+ use_paging = True
+ def get_current_item( self, trans ):
+ return None
+ def build_initial_query( self, session ):
+ return session.query( self.model_class )
class Admin( BaseController ):
user_list_grid = UserListGrid()
+ role_list_grid = RoleListGrid()
+ group_list_grid = GroupListGrid()
@web.expose
@web.require_admin
@@ -117,17 +314,23 @@
# Galaxy Role Stuff
@web.expose
@web.require_admin
- def roles( self, trans, **kwd ):
- params = util.Params( kwd )
- msg = util.restore_text( params.get( 'msg', '' ) )
- messagetype = params.get( 'messagetype', 'done' )
- roles = trans.sa_session.query( trans.app.model.Role ).filter( and_( trans.app.model.Role.table.c.deleted==False,
- trans.app.model.Role.table.c.type != trans.app.model.Role.types.PRIVATE ) ) \
- .order_by( trans.app.model.Role.table.c.name )
- return trans.fill_template( '/admin/dataset_security/roles.mako',
- roles=roles,
- msg=msg,
- messagetype=messagetype )
+ def roles( self, trans, **kwargs ):
+ if 'operation' in kwargs:
+ operation = kwargs['operation'].lower()
+ if operation == "roles":
+ return self.role( trans, **kwargs )
+ if operation == "create":
+ return self.create_role( trans, **kwargs )
+ if operation == "delete":
+ return self.mark_role_deleted( trans, **kwargs )
+ if operation == "undelete":
+ return self.undelete_role( trans, **kwargs )
+ if operation == "purge":
+ return self.purge_role( trans, **kwargs )
+ if operation == "manage users & groups":
+ return self.role( trans, **kwargs )
+ # Render the list view
+ return self.role_list_grid( trans, **kwargs )
@web.expose
@web.require_admin
def create_role( self, trans, **kwd ):
@@ -164,7 +367,7 @@
( group.name, role.name, len( in_users ), len( in_groups ) )
else:
msg = "Role '%s' has been created with %d associated users and %d associated groups" % ( role.name, len( in_users ), len( in_groups ) )
- trans.response.send_redirect( web.url_for( controller='admin', action='roles', msg=util.sanitize_text( msg ), messagetype='done' ) )
+ trans.response.send_redirect( web.url_for( controller='admin', action='roles', message=util.sanitize_text( msg ), status='done' ) )
trans.response.send_redirect( web.url_for( controller='admin', action='create_role', msg=util.sanitize_text( msg ), messagetype='error' ) )
out_users = []
for user in trans.sa_session.query( trans.app.model.User ) \
@@ -176,7 +379,7 @@
.filter( trans.app.model.Group.table.c.deleted==False ) \
.order_by( trans.app.model.Group.table.c.name ):
out_groups.append( ( group.id, group.name ) )
- return trans.fill_template( '/admin/dataset_security/role_create.mako',
+ return trans.fill_template( '/admin/dataset_security/role/role_create.mako',
in_users=[],
out_users=out_users,
in_groups=[],
@@ -189,7 +392,7 @@
params = util.Params( kwd )
msg = util.restore_text( params.get( 'msg', '' ) )
messagetype = params.get( 'messagetype', 'done' )
- role = trans.sa_session.query( trans.app.model.Role ).get( int( params.role_id ) )
+ role = get_role( trans, params.id )
if params.get( 'role_members_edit_button', False ):
in_users = [ trans.sa_session.query( trans.app.model.User ).get( x ) for x in util.listify( params.in_users ) ]
for ura in role.users:
@@ -210,7 +413,7 @@
trans.app.security_agent.set_entity_role_associations( roles=[ role ], users=in_users, groups=in_groups )
trans.sa_session.refresh( role )
msg = "Role '%s' has been updated with %d associated users and %d associated groups" % ( role.name, len( in_users ), len( in_groups ) )
- trans.response.send_redirect( web.url_for( action='roles', msg=util.sanitize_text( msg ), messagetype=messagetype ) )
+ trans.response.send_redirect( web.url_for( action='roles', message=util.sanitize_text( msg ), status=messagetype ) )
elif params.get( 'rename', False ):
if params.rename == 'submitted':
old_name = role.name
@@ -218,17 +421,17 @@
new_description = util.restore_text( params.description )
if not new_name:
msg = 'Enter a valid name'
- return trans.fill_template( '/admin/dataset_security/role_rename.mako', role=role, msg=msg, messagetype='error' )
+ return trans.fill_template( '/admin/dataset_security/role/role_rename.mako', role=role, msg=msg, messagetype='error' )
elif trans.sa_session.query( trans.app.model.Role ).filter( trans.app.model.Role.table.c.name==new_name ).first():
msg = 'A role with that name already exists'
- return trans.fill_template( '/admin/dataset_security/role_rename.mako', role=role, msg=msg, messagetype='error' )
+ return trans.fill_template( '/admin/dataset_security/role/role_rename.mako', role=role, msg=msg, messagetype='error' )
else:
role.name = new_name
role.description = new_description
role.flush()
msg = "Role '%s' has been renamed to '%s'" % ( old_name, new_name )
- return trans.response.send_redirect( web.url_for( action='roles', msg=util.sanitize_text( msg ), messagetype='done' ) )
- return trans.fill_template( '/admin/dataset_security/role_rename.mako', role=role, msg=msg, messagetype=messagetype )
+ return trans.response.send_redirect( web.url_for( action='roles', message=util.sanitize_text( msg ), status='done' ) )
+ return trans.fill_template( '/admin/dataset_security/role/role_rename.mako', role=role, msg=msg, messagetype=messagetype )
in_users = []
out_users = []
in_groups = []
@@ -273,7 +476,7 @@
library_dataset_actions[ library ][ folder_path ].append( dp.action )
except:
library_dataset_actions[ library ][ folder_path ] = [ dp.action ]
- return trans.fill_template( '/admin/dataset_security/role.mako',
+ return trans.fill_template( '/admin/dataset_security/role/role.mako',
role=role,
in_users=in_users,
out_users=out_users,
@@ -286,33 +489,20 @@
@web.require_admin
def mark_role_deleted( self, trans, **kwd ):
params = util.Params( kwd )
- role = trans.sa_session.query( trans.app.model.Role ).get( int( params.role_id ) )
+ role = get_role( trans, params.id )
role.deleted = True
role.flush()
- msg = "Role '%s' has been marked as deleted." % role.name
- trans.response.send_redirect( web.url_for( action='roles', msg=util.sanitize_text( msg ), messagetype='done' ) )
- @web.expose
- @web.require_admin
- def deleted_roles( self, trans, **kwd ):
- params = util.Params( kwd )
- msg = util.restore_text( params.get( 'msg', '' ) )
- messagetype = params.get( 'messagetype', 'done' )
- roles = trans.sa_session.query( trans.app.model.Role ) \
- .filter( trans.app.model.Role.table.c.deleted==True ) \
- .order_by( trans.app.model.Role.table.c.name )
- return trans.fill_template( '/admin/dataset_security/deleted_roles.mako',
- roles=roles,
- msg=msg,
- messagetype=messagetype )
+ message = "Role '%s' has been marked as deleted." % role.name
+ trans.response.send_redirect( web.url_for( action='roles', message=util.sanitize_text( message ), status='done' ) )
@web.expose
@web.require_admin
def undelete_role( self, trans, **kwd ):
params = util.Params( kwd )
- role = trans.sa_session.query( trans.app.model.Role ).get( int( params.role_id ) )
+ role = get_role( trans, params.id )
role.deleted = False
role.flush()
- msg = "Role '%s' has been marked as not deleted." % role.name
- trans.response.send_redirect( web.url_for( action='roles', msg=util.sanitize_text( msg ), messagetype='done' ) )
+ message = "Role '%s' has been marked as not deleted." % role.name
+ trans.response.send_redirect( web.url_for( action='roles', message=util.sanitize_text( message ), status='done' ) )
@web.expose
@web.require_admin
def purge_role( self, trans, **kwd ):
@@ -324,11 +514,10 @@
# - GroupRoleAssociations where role_id == Role.id
# - DatasetPermissionss where role_id == Role.id
params = util.Params( kwd )
- role = trans.sa_session.query( trans.app.model.Role ).get( int( params.role_id ) )
+ role = get_role( trans, params.id )
if not role.deleted:
- # We should never reach here, but just in case there is a bug somewhere...
- msg = "Role '%s' has not been deleted, so it cannot be purged." % role.name
- trans.response.send_redirect( web.url_for( action='roles', msg=util.sanitize_text( msg ), messagetype='error' ) )
+ message = "Role '%s' has not been deleted, so it cannot be purged." % role.name
+ trans.response.send_redirect( web.url_for( action='roles', message=util.sanitize_text( message ), status='error' ) )
# Delete UserRoleAssociations
for ura in role.users:
user = trans.sa_session.query( trans.app.model.User ).get( ura.user_id )
@@ -353,54 +542,60 @@
for dp in role.dataset_actions:
trans.sa_session.delete( dp )
dp.flush()
- msg = "The following have been purged from the database for role '%s': " % role.name
- msg += "DefaultUserPermissions, DefaultHistoryPermissions, UserRoleAssociations, GroupRoleAssociations, DatasetPermissionss."
- trans.response.send_redirect( web.url_for( action='deleted_roles', msg=util.sanitize_text( msg ), messagetype='done' ) )
+ message = "The following have been purged from the database for role '%s': " % role.name
+ message += "DefaultUserPermissions, DefaultHistoryPermissions, UserRoleAssociations, GroupRoleAssociations, DatasetPermissionss."
+ trans.response.send_redirect( web.url_for( action='roles', message=util.sanitize_text( message ), status='done' ) )
# Galaxy Group Stuff
@web.expose
@web.require_admin
- def groups( self, trans, **kwd ):
- params = util.Params( kwd )
- msg = util.restore_text( params.get( 'msg', '' ) )
- messagetype = params.get( 'messagetype', 'done' )
- groups = trans.sa_session.query( trans.app.model.Group ) \
- .filter( trans.app.model.Group.table.c.deleted==False ) \
- .order_by( trans.app.model.Group.table.c.name )
- return trans.fill_template( '/admin/dataset_security/groups.mako',
- groups=groups,
- msg=msg,
- messagetype=messagetype )
+ def groups( self, trans, **kwargs ):
+ if 'operation' in kwargs:
+ operation = kwargs['operation'].lower()
+ if operation == "groups":
+ return self.group( trans, **kwargs )
+ if operation == "create":
+ return self.create_group( trans, **kwargs )
+ if operation == "delete":
+ return self.mark_group_deleted( trans, **kwargs )
+ if operation == "undelete":
+ return self.undelete_group( trans, **kwargs )
+ if operation == "purge":
+ return self.purge_group( trans, **kwargs )
+ if operation == "manage users & roles":
+ return self.group( trans, **kwargs )
+ # Render the list view
+ return self.group_list_grid( trans, **kwargs )
@web.expose
@web.require_admin
def group( self, trans, **kwd ):
params = util.Params( kwd )
msg = util.restore_text( params.get( 'msg', '' ) )
messagetype = params.get( 'messagetype', 'done' )
- group = trans.sa_session.query( trans.app.model.Group ).get( int( params.group_id ) )
+ group = get_group( trans, params.id )
if params.get( 'group_roles_users_edit_button', False ):
in_roles = [ trans.sa_session.query( trans.app.model.Role ).get( x ) for x in util.listify( params.in_roles ) ]
in_users = [ trans.sa_session.query( trans.app.model.User ).get( x ) for x in util.listify( params.in_users ) ]
trans.app.security_agent.set_entity_group_associations( groups=[ group ], roles=in_roles, users=in_users )
trans.sa_session.refresh( group )
msg += "Group '%s' has been updated with %d associated roles and %d associated users" % ( group.name, len( in_roles ), len( in_users ) )
- trans.response.send_redirect( web.url_for( action='groups', msg=util.sanitize_text( msg ), messagetype=messagetype ) )
+ trans.response.send_redirect( web.url_for( action='groups', message=util.sanitize_text( msg ), status=messagetype ) )
if params.get( 'rename', False ):
if params.rename == 'submitted':
old_name = group.name
new_name = util.restore_text( params.name )
if not new_name:
msg = 'Enter a valid name'
- return trans.fill_template( '/admin/dataset_security/group_rename.mako', group=group, msg=msg, messagetype='error' )
+ return trans.fill_template( '/admin/dataset_security/group/group_rename.mako', group=group, msg=msg, messagetype='error' )
elif trans.sa_session.query( trans.app.model.Group ).filter( trans.app.model.Group.table.c.name==new_name ).first():
msg = 'A group with that name already exists'
- return trans.fill_template( '/admin/dataset_security/group_rename.mako', group=group, msg=msg, messagetype='error' )
+ return trans.fill_template( '/admin/dataset_security/group/group_rename.mako', group=group, msg=msg, messagetype='error' )
else:
group.name = new_name
group.flush()
msg = "Group '%s' has been renamed to '%s'" % ( old_name, new_name )
return trans.response.send_redirect( web.url_for( action='groups', msg=util.sanitize_text( msg ), messagetype='done' ) )
- return trans.fill_template( '/admin/dataset_security/group_rename.mako', group=group, msg=msg, messagetype=messagetype )
+ return trans.fill_template( '/admin/dataset_security/group/group_rename.mako', group=group, msg=msg, messagetype=messagetype )
in_roles = []
out_roles = []
in_users = []
@@ -420,7 +615,7 @@
else:
out_users.append( ( user.id, user.email ) )
msg += 'Group %s is currently associated with %d roles and %d users' % ( group.name, len( in_roles ), len( in_users ) )
- return trans.fill_template( '/admin/dataset_security/group.mako',
+ return trans.fill_template( '/admin/dataset_security/group/group.mako',
group=group,
in_roles=in_roles,
out_roles=out_roles,
@@ -455,7 +650,7 @@
gra = trans.app.model.GroupRoleAssociation( group, role )
gra.flush()
msg = "Group '%s' has been created with %d associated users and %d associated roles" % ( name, len( in_users ), len( in_roles ) )
- trans.response.send_redirect( web.url_for( controller='admin', action='groups', msg=util.sanitize_text( msg ), messagetype='done' ) )
+ trans.response.send_redirect( web.url_for( controller='admin', action='groups', message=util.sanitize_text( msg ), status='done' ) )
trans.response.send_redirect( web.url_for( controller='admin', action='create_group', msg=util.sanitize_text( msg ), messagetype='error' ) )
out_users = []
for user in trans.sa_session.query( trans.app.model.User ) \
@@ -467,7 +662,7 @@
.filter( trans.app.model.Role.table.c.deleted==False ) \
.order_by( trans.app.model.Role.table.c.name ):
out_roles.append( ( role.id, role.name ) )
- return trans.fill_template( '/admin/dataset_security/group_create.mako',
+ return trans.fill_template( '/admin/dataset_security/group/group_create.mako',
in_users=[],
out_users=out_users,
in_roles=[],
@@ -478,44 +673,31 @@
@web.require_admin
def mark_group_deleted( self, trans, **kwd ):
params = util.Params( kwd )
- group = trans.sa_session.query( trans.app.model.Group ).get( int( params.group_id ) )
+ group = get_group( trans, params.id )
group.deleted = True
group.flush()
msg = "Group '%s' has been marked as deleted." % group.name
- trans.response.send_redirect( web.url_for( action='groups', msg=util.sanitize_text( msg ), messagetype='done' ) )
- @web.expose
- @web.require_admin
- def deleted_groups( self, trans, **kwd ):
- params = util.Params( kwd )
- msg = util.restore_text( params.get( 'msg', '' ) )
- messagetype = params.get( 'messagetype', 'done' )
- groups = trans.sa_session.query( trans.app.model.Group ) \
- .filter( trans.app.model.Group.table.c.deleted==True ) \
- .order_by( trans.app.model.Group.table.c.name )
- return trans.fill_template( '/admin/dataset_security/deleted_groups.mako',
- groups=groups,
- msg=msg,
- messagetype=messagetype )
+ trans.response.send_redirect( web.url_for( action='groups', message=util.sanitize_text( msg ), status='done' ) )
@web.expose
@web.require_admin
def undelete_group( self, trans, **kwd ):
params = util.Params( kwd )
- group = trans.sa_session.query( trans.app.model.Group ).get( int( params.group_id ) )
+ group = get_group( trans, params.id )
group.deleted = False
group.flush()
msg = "Group '%s' has been marked as not deleted." % group.name
- trans.response.send_redirect( web.url_for( action='groups', msg=util.sanitize_text( msg ), messagetype='done' ) )
+ trans.response.send_redirect( web.url_for( action='groups', message=util.sanitize_text( msg ), status='done' ) )
@web.expose
@web.require_admin
def purge_group( self, trans, **kwd ):
# This method should only be called for a Group that has previously been deleted.
# Purging a deleted Group simply deletes all UserGroupAssociations and GroupRoleAssociations.
params = util.Params( kwd )
- group = trans.sa_session.query( trans.app.model.Group ).get( int( params.group_id ) )
+ group = get_group( trans, params.id )
if not group.deleted:
# We should never reach here, but just in case there is a bug somewhere...
msg = "Group '%s' has not been deleted, so it cannot be purged." % group.name
- trans.response.send_redirect( web.url_for( action='groups', msg=util.sanitize_text( msg ), messagetype='error' ) )
+ trans.response.send_redirect( web.url_for( action='groups', message=util.sanitize_text( msg ), status='error' ) )
# Delete UserGroupAssociations
for uga in group.users:
trans.sa_session.delete( uga )
@@ -525,8 +707,8 @@
trans.sa_session.delete( gra )
gra.flush()
# Delete the Group
- msg = "The following have been purged from the database for group '%s': UserGroupAssociations, GroupRoleAssociations." % group.name
- trans.response.send_redirect( web.url_for( action='deleted_groups', msg=util.sanitize_text( msg ), messagetype='done' ) )
+ message = "The following have been purged from the database for group '%s': UserGroupAssociations, GroupRoleAssociations." % group.name
+ trans.response.send_redirect( web.url_for( action='groups', message=util.sanitize_text( message ), status='done' ) )
# Galaxy User Stuff
@web.expose
@@ -645,11 +827,12 @@
message = "No user ids received for deleting"
trans.response.send_redirect( web.url_for( action='users', message=message, status='error' ) )
ids = util.listify( id )
+ message = "Deleted %d users: " % len( ids )
for user_id in ids:
user = get_user( trans, user_id )
user.deleted = True
user.flush()
- message = "Deleted %d users" % len( ids )
+ message += " %s " % user.email
trans.response.send_redirect( web.url_for( action='users', message=util.sanitize_text( message ), status='done' ) )
@web.expose
@web.require_admin
@@ -660,13 +843,15 @@
trans.response.send_redirect( web.url_for( action='users', message=message, status='error' ) )
ids = util.listify( id )
count = 0
+ undeleted_users = ""
for user_id in ids:
user = get_user( trans, user_id )
if user.deleted:
user.deleted = False
user.flush()
count += 1
- message = "Undeleted %d users" % count
+ undeleted_users += " %s" % user.email
+ message = "Undeleted %d users: %s" % ( count, undeleted_users )
trans.response.send_redirect( web.url_for( action='users',
message=util.sanitize_text( message ),
status='done' ) )
@@ -691,6 +876,7 @@
message=util.sanitize_text( message ),
status='error' ) )
ids = util.listify( id )
+ message = "Purged %d users: " % len( ids )
for user_id in ids:
user = get_user( trans, user_id )
if not user.deleted:
@@ -726,7 +912,7 @@
# Purge the user
user.purged = True
user.flush()
- message = "Purged %d users" % len( ids )
+ message += "%s " % user.email
trans.response.send_redirect( web.url_for( controller='admin',
action='users',
message=util.sanitize_text( message ),
@@ -750,6 +936,8 @@
return self.create_new_user( trans, **kwargs )
if operation == "information":
return self.user_info( trans, **kwargs )
+ if operation == "manage roles & groups":
+ return self.user( trans, **kwargs )
# Render the list view
return self.user_list_grid( trans, **kwargs )
@web.expose
@@ -774,6 +962,14 @@
admin_view=True, **kwd ) )
@web.expose
@web.require_admin
+ def name_autocomplete_data( self, trans, q=None, limit=None, timestamp=None ):
+ """Return autocomplete data for user emails"""
+ ac_data = ""
+ for user in trans.sa_session.query( User ).filter_by( deleted=False ).filter( func.lower( User.email ).like( q.lower() + "%" ) ):
+ ac_data = ac_data + user.email + "\n"
+ return ac_data
+ @web.expose
+ @web.require_admin
def user( self, trans, **kwd ):
user_id = kwd.get( 'id', None )
message = ''
@@ -932,5 +1128,21 @@
id = trans.security.decode_id( id )
user = trans.sa_session.query( model.User ).get( id )
if not user:
- err+msg( "User not found" )
+ return trans.show_error_message( "User not found for id (%s)" % str( id ) )
return user
+def get_role( trans, id ):
+ """Get a Role from the database by id."""
+ # Load user from database
+ id = trans.security.decode_id( id )
+ role = trans.sa_session.query( model.Role ).get( id )
+ if not role:
+ return trans.show_error_message( "Role not found for id (%s)" % str( id ) )
+ return role
+def get_group( trans, id ):
+ """Get a Group from the database by id."""
+ # Load user from database
+ id = trans.security.decode_id( id )
+ group = trans.sa_session.query( model.Group ).get( id )
+ if not group:
+ return trans.show_error_message( "Group not found for id (%s)" % str( id ) )
+ return group
diff -r 1a438bb4dac2 -r 9f485a539bfb templates/admin/dataset_security/deleted_groups.mako
--- a/templates/admin/dataset_security/deleted_groups.mako Mon Nov 09 16:55:52 2009 -0500
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,101 +0,0 @@
-<%inherit file="/base.mako"/>
-<%namespace file="/message.mako" import="render_msg" />
-
-## Render a row
-<%def name="render_row( group, ctr, anchored, curr_anchor )">
- %if ctr % 2 == 1:
- <tr class="odd_row">
- %else:
- <tr>
- %endif
- <td>
- ${group.name}
- <a id="group-${group.id}-popup" class="popup-arrow" style="display: none;">▼</a>
- <div popupmenu="group-${group.id}-popup">
- <a class="action-button" href="${h.url_for( action='undelete_group', group_id=group.id )}">Undelete</a>
- <a class="action-button" href="${h.url_for( action='purge_group', group_id=group.id )}">Purge</a>
- </div>
- </td>
- <td>
- ${len( group.members )}
- </td>
- <td>
- ${len( group.roles )}
- %if not anchored:
- <a name="${curr_anchor}"></a>
- <div style="float: right;"><a href="#TOP">top</a></div>
- %endif
- </td>
- </tr>
-</%def>
-
-<a name="TOP"><h2>Deleted Groups</h2></a>
-
-%if msg:
- ${render_msg( msg, messagetype )}
-%endif
-
-## TODO: make this a grid
-
-%if not groups:
- There are no deleted Galaxy groups
-%else:
- <table class="manage-table colored" border="0" cellspacing="0" cellpadding="0" width="100%">
- <%
- render_quick_find = groups.count() > 200
- ctr = 0
- %>
- %if render_quick_find:
- <%
- anchors = ['A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z']
- anchor_loc = 0
- anchored = False
- curr_anchor = 'A'
- %>
- <tr style="background: #EEE">
- <td colspan="3" style="text-align: center; border-bottom: 1px solid #D8B365">
- Jump to letter:
- %for a in anchors:
- | <a href="#${a}">${a}</a>
- %endfor
- </td>
- </tr>
- %endif
- <tr class="header">
- <td>Name</td>
- <td>Users</td>
- <td>Roles</td>
- </tr>
- %for ctr, group in enumerate( groups ):
- %if render_quick_find and not group.name.upper().startswith( curr_anchor ):
- <% anchored = False %>
- %endif
- %if render_quick_find and group.name.upper().startswith( curr_anchor ):
- %if not anchored:
- ${render_row( group, ctr, anchored, curr_anchor )}
- <% anchored = True %>
- %else:
- ${render_row( group, ctr, anchored, curr_anchor )}
- %endif
- %elif render_quick_find:
- %for anchor in anchors[ anchor_loc: ]:
- %if group.name.upper().startswith( anchor ):
- %if not anchored:
- <% curr_anchor = anchor %>
- ${render_row( group, ctr, anchored, curr_anchor )}
- <% anchored = True %>
- %else:
- ${render_row( group, ctr, anchored, curr_anchor )}
- %endif
- <%
- anchor_loc = anchors.index( anchor )
- break
- %>
- %endif
- %endfor
- %else:
- ${render_row( group, ctr, True, '' )}
- %endif
- %endfor
- </table>
-%endif
diff -r 1a438bb4dac2 -r 9f485a539bfb templates/admin/dataset_security/deleted_roles.mako
--- a/templates/admin/dataset_security/deleted_roles.mako Mon Nov 09 16:55:52 2009 -0500
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,103 +0,0 @@
-<%inherit file="/base.mako"/>
-<%namespace file="/message.mako" import="render_msg" />
-
-## Render a row
-<%def name="render_row( role, ctr, anchored, curr_anchor )">
- %if ctr % 2 == 1:
- <tr class="odd_row">
- %else:
- <tr>
- %endif
- <td>
- ${role.name}
- <a id="role-${role.id}-popup" class="popup-arrow" style="display: none;">▼</a>
- <div popupmenu="role-${role.id}-popup">
- <a class="action-button" href="${h.url_for( action='undelete_role', role_id=role.id )}">Undelete</a>
- <a class="action-button" href="${h.url_for( action='purge_role', role_id=role.id )}">Purge</a>
- </div>
- </td>
- <td>${role.description}</td>
- <td>${role.type}</td>
- <td>
- ${len( role.users )}
- </td>
- <td>
- ${len( role.groups )}
- %if not anchored:
- <a name="${curr_anchor}"></a>
- <div style="float: right;"><a href="#TOP">top</a></div>
- %endif
- </td>
- </tr>
-</%def>
-
-<a name="TOP"><h2>Deleted Roles</h2></a>
-
-%if msg:
- ${render_msg( msg, messagetype )}
-%endif
-
-%if not roles:
- There are no deleted Galaxy roles
-%else:
- <table class="manage-table colored" border="0" cellspacing="0" cellpadding="0" width="100%">
- <%
- render_quick_find = roles.count() > 200
- ctr = 0
- %>
- %if render_quick_find:
- <%
- anchors = ['A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z']
- anchor_loc = 0
- anchored = False
- curr_anchor = 'A'
- %>
- <tr style="background: #EEE">
- <td colspan="3" style="text-align: center; border-bottom: 1px solid #D8B365">
- Jump to letter:
- %for a in anchors:
- | <a href="#${a}">${a}</a>
- %endfor
- </td>
- </tr>
- %endif
- <tr class="header">
- <td>Name</td>
- <td>Description</td>
- <td>Type</td>
- <td>Users</td>
- <td>Groups</td>
- </tr>
- %for ctr, role in enumerate( roles ):
- %if render_quick_find and not role.name.upper().startswith( curr_anchor ):
- <% anchored = False %>
- %endif
- %if render_quick_find and role.name.upper().startswith( curr_anchor ):
- %if not anchored:
- ${render_row( role, ctr, anchored, curr_anchor )}
- <% anchored = True %>
- %else:
- ${render_row( role, ctr, anchored, curr_anchor )}
- %endif
- %elif render_quick_find:
- %for anchor in anchors[ anchor_loc: ]:
- %if role.name.upper().startswith( anchor ):
- %if not anchored:
- <% curr_anchor = anchor %>
- ${render_row( role, ctr, anchored, curr_anchor )}
- <% anchored = True %>
- %else:
- ${render_row( role, ctr, anchored, curr_anchor )}
- %endif
- <%
- anchor_loc = anchors.index( anchor )
- break
- %>
- %endif
- %endfor
- %else:
- ${render_row( role, ctr, True, '' )}
- %endif
- %endfor
- </table>
-%endif
diff -r 1a438bb4dac2 -r 9f485a539bfb templates/admin/dataset_security/group.mako
--- a/templates/admin/dataset_security/group.mako Mon Nov 09 16:55:52 2009 -0500
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,83 +0,0 @@
-<%inherit file="/base.mako"/>
-<%namespace file="/message.mako" import="render_msg" />
-
-<%def name="javascripts()">
- ${parent.javascripts()}
- <script type="text/javascript">
- $(function(){
- $("input:text:first").focus();
- })
- </script>
-</%def>
-
-<%def name="render_select( name, options )">
- <select name="${name}" id="${name}" style="min-width: 250px; height: 150px;" multiple>
- %for option in options:
- <option value="${option[0]}">${option[1]}</option>
- %endfor
- </select>
-</%def>
-
-<script type="text/javascript">
-$().ready(function() {
- $('#roles_add_button').click(function() {
- return !$('#out_roles option:selected').remove().appendTo('#in_roles');
- });
- $('#roles_remove_button').click(function() {
- return !$('#in_roles option:selected').remove().appendTo('#out_roles');
- });
- $('#users_add_button').click(function() {
- return !$('#out_users option:selected').remove().appendTo('#in_users');
- });
- $('#users_remove_button').click(function() {
- return !$('#in_users option:selected').remove().appendTo('#out_users');
- });
- $('form#associate_group_role_user').submit(function() {
- $('#in_roles option').each(function(i) {
- $(this).attr("selected", "selected");
- });
- $('#in_users option').each(function(i) {
- $(this).attr("selected", "selected");
- });
- });
-});
-</script>
-
-%if msg:
- ${render_msg( msg, messagetype )}
-%endif
-
-<div class="toolForm">
- <div class="toolFormTitle">Group '${group.name}'</div>
- <div class="toolFormBody">
- <form name="associate_group_role_user" id="associate_group_role_user" action="${h.url_for( action='group', group_id=group.id )}" method="post" >
- <div class="form-row">
- <div style="float: left; margin-right: 10px;">
- <label>Roles associated with '${group.name}'</label>
- ${render_select( "in_roles", in_roles )}<br/>
- <input type="submit" id="roles_remove_button" value=">>"/>
- </div>
- <div>
- <label>Roles not associated with '${group.name}'</label>
- ${render_select( "out_roles", out_roles )}<br/>
- <input type="submit" id="roles_add_button" value="<<"/>
- </div>
- </div>
- <div class="form-row">
- <div style="float: left; margin-right: 10px;">
- <label>Users associated with '${group.name}'</label>
- ${render_select( "in_users", in_users )}<br/>
- <input type="submit" id="users_remove_button" value=">>"/>
- </div>
- <div>
- <label>Users not associated with '${group.name}'</label>
- ${render_select( "out_users", out_users )}<br/>
- <input type="submit" id="users_add_button" value="<<"/>
- </div>
- </div>
- <div class="form-row">
- <input type="submit" name="group_roles_users_edit_button" value="Save"/>
- </div>
- </form>
- </div>
-</div>
diff -r 1a438bb4dac2 -r 9f485a539bfb templates/admin/dataset_security/group/grid.mako
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/templates/admin/dataset_security/group/grid.mako Mon Nov 09 23:00:55 2009 -0500
@@ -0,0 +1,1 @@
+<%inherit file="/grid_base.mako"/>
diff -r 1a438bb4dac2 -r 9f485a539bfb templates/admin/dataset_security/group/group.mako
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/templates/admin/dataset_security/group/group.mako Mon Nov 09 23:00:55 2009 -0500
@@ -0,0 +1,83 @@
+<%inherit file="/base.mako"/>
+<%namespace file="/message.mako" import="render_msg" />
+
+<%def name="javascripts()">
+ ${parent.javascripts()}
+ <script type="text/javascript">
+ $(function(){
+ $("input:text:first").focus();
+ })
+ </script>
+</%def>
+
+<%def name="render_select( name, options )">
+ <select name="${name}" id="${name}" style="min-width: 250px; height: 150px;" multiple>
+ %for option in options:
+ <option value="${option[0]}">${option[1]}</option>
+ %endfor
+ </select>
+</%def>
+
+<script type="text/javascript">
+$().ready(function() {
+ $('#roles_add_button').click(function() {
+ return !$('#out_roles option:selected').remove().appendTo('#in_roles');
+ });
+ $('#roles_remove_button').click(function() {
+ return !$('#in_roles option:selected').remove().appendTo('#out_roles');
+ });
+ $('#users_add_button').click(function() {
+ return !$('#out_users option:selected').remove().appendTo('#in_users');
+ });
+ $('#users_remove_button').click(function() {
+ return !$('#in_users option:selected').remove().appendTo('#out_users');
+ });
+ $('form#associate_group_role_user').submit(function() {
+ $('#in_roles option').each(function(i) {
+ $(this).attr("selected", "selected");
+ });
+ $('#in_users option').each(function(i) {
+ $(this).attr("selected", "selected");
+ });
+ });
+});
+</script>
+
+%if msg:
+ ${render_msg( msg, messagetype )}
+%endif
+
+<div class="toolForm">
+ <div class="toolFormTitle">Group '${group.name}'</div>
+ <div class="toolFormBody">
+ <form name="associate_group_role_user" id="associate_group_role_user" action="${h.url_for( action='group', group_id=group.id )}" method="post" >
+ <div class="form-row">
+ <div style="float: left; margin-right: 10px;">
+ <label>Roles associated with '${group.name}'</label>
+ ${render_select( "in_roles", in_roles )}<br/>
+ <input type="submit" id="roles_remove_button" value=">>"/>
+ </div>
+ <div>
+ <label>Roles not associated with '${group.name}'</label>
+ ${render_select( "out_roles", out_roles )}<br/>
+ <input type="submit" id="roles_add_button" value="<<"/>
+ </div>
+ </div>
+ <div class="form-row">
+ <div style="float: left; margin-right: 10px;">
+ <label>Users associated with '${group.name}'</label>
+ ${render_select( "in_users", in_users )}<br/>
+ <input type="submit" id="users_remove_button" value=">>"/>
+ </div>
+ <div>
+ <label>Users not associated with '${group.name}'</label>
+ ${render_select( "out_users", out_users )}<br/>
+ <input type="submit" id="users_add_button" value="<<"/>
+ </div>
+ </div>
+ <div class="form-row">
+ <input type="submit" name="group_roles_users_edit_button" value="Save"/>
+ </div>
+ </form>
+ </div>
+</div>
diff -r 1a438bb4dac2 -r 9f485a539bfb templates/admin/dataset_security/group/group_create.mako
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/templates/admin/dataset_security/group/group_create.mako Mon Nov 09 23:00:55 2009 -0500
@@ -0,0 +1,87 @@
+<%inherit file="/base.mako"/>
+<%namespace file="/message.mako" import="render_msg" />
+
+<%def name="javascripts()">
+ ${parent.javascripts()}
+ <script type="text/javascript">
+ $(function(){
+ $("input:text:first").focus();
+ })
+ </script>
+</%def>
+
+<%def name="render_select( name, options )">
+ <select name="${name}" id="${name}" style="min-width: 250px; height: 150px;" multiple>
+ %for option in options:
+ <option value="${option[0]}">${option[1]}</option>
+ %endfor
+ </select>
+</%def>
+
+<script type="text/javascript">
+$().ready(function() {
+ $('#roles_add_button').click(function() {
+ return !$('#out_roles option:selected').remove().appendTo('#in_roles');
+ });
+ $('#roles_remove_button').click(function() {
+ return !$('#in_roles option:selected').remove().appendTo('#out_roles');
+ });
+ $('#users_add_button').click(function() {
+ return !$('#out_users option:selected').remove().appendTo('#in_users');
+ });
+ $('#users_remove_button').click(function() {
+ return !$('#in_users option:selected').remove().appendTo('#out_users');
+ });
+ $('form#associate_group_role_user').submit(function() {
+ $('#in_roles option').each(function(i) {
+ $(this).attr("selected", "selected");
+ });
+ $('#in_users option').each(function(i) {
+ $(this).attr("selected", "selected");
+ });
+ });
+});
+</script>
+
+%if msg:
+ ${render_msg( msg, messagetype )}
+%endif
+
+<div class="toolForm">
+ <div class="toolFormTitle">Create Group</div>
+ <div class="toolFormBody">
+ <form name="associate_group_role_user" id="associate_group_role_user" action="${h.url_for( action='create_group' )}" method="post" >
+ <div class="form-row">
+ <label>Name:</label>
+ <input name="name" type="textfield" value="" size=40"/>
+ </div>
+ <div class="form-row">
+ <div style="float: left; margin-right: 10px;">
+ <label>Roles associated with new group</label>
+ ${render_select( "in_roles", in_roles )}<br/>
+ <input type="submit" id="roles_remove_button" value=">>"/>
+ </div>
+ <div>
+ <label>Roles not associated with new group</label>
+ ${render_select( "out_roles", out_roles )}<br/>
+ <input type="submit" id="roles_add_button" value="<<"/>
+ </div>
+ </div>
+ <div class="form-row">
+ <div style="float: left; margin-right: 10px;">
+ <label>Users associated with new group</label>
+ ${render_select( "in_users", in_users )}<br/>
+ <input type="submit" id="users_remove_button" value=">>"/>
+ </div>
+ <div>
+ <label>Users not associated with new group</label>
+ ${render_select( "out_users", out_users )}<br/>
+ <input type="submit" id="users_add_button" value="<<"/>
+ </div>
+ </div>
+ <div class="form-row">
+ <input type="submit" name="create_group_button" value="Save"/>
+ </div>
+ </form>
+ </div>
+</div>
diff -r 1a438bb4dac2 -r 9f485a539bfb templates/admin/dataset_security/group/group_rename.mako
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/templates/admin/dataset_security/group/group_rename.mako Mon Nov 09 23:00:55 2009 -0500
@@ -0,0 +1,34 @@
+<%inherit file="/base.mako"/>
+<%namespace file="/message.mako" import="render_msg" />
+
+%if msg:
+ ${render_msg( msg, messagetype )}
+%endif
+
+<div class="toolForm">
+ <div class="toolFormTitle">Change group name</div>
+ <div class="toolFormBody">
+ <form name="library" action="${h.url_for( controller='admin', action='group' )}" method="post" >
+ <div class="form-row">
+ <label>Name:</label>
+ <div style="float: left; width: 250px; margin-right: 10px;">
+ <input type="text" name="name" value="${group.name}" size="40"/>
+ </div>
+ <div style="clear: both"></div>
+ </div>
+ <div class="form-row">
+ <div style="float: left; width: 250px; margin-right: 10px;">
+ <input type="hidden" name="rename" value="submitted"/>
+ </div>
+ <div style="clear: both"></div>
+ </div>
+ <div class="form-row">
+ <div style="float: left; width: 250px; margin-right: 10px;">
+ <input type="hidden" name="id" value="${ trans.security.encode_id( group.id )}"/>
+ </div>
+ <div style="clear: both"></div>
+ </div>
+ <input type="submit" name="rename_group_button" value="Save"/>
+ </form>
+ </div>
+</div>
diff -r 1a438bb4dac2 -r 9f485a539bfb templates/admin/dataset_security/group_create.mako
--- a/templates/admin/dataset_security/group_create.mako Mon Nov 09 16:55:52 2009 -0500
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,87 +0,0 @@
-<%inherit file="/base.mako"/>
-<%namespace file="/message.mako" import="render_msg" />
-
-<%def name="javascripts()">
- ${parent.javascripts()}
- <script type="text/javascript">
- $(function(){
- $("input:text:first").focus();
- })
- </script>
-</%def>
-
-<%def name="render_select( name, options )">
- <select name="${name}" id="${name}" style="min-width: 250px; height: 150px;" multiple>
- %for option in options:
- <option value="${option[0]}">${option[1]}</option>
- %endfor
- </select>
-</%def>
-
-<script type="text/javascript">
-$().ready(function() {
- $('#roles_add_button').click(function() {
- return !$('#out_roles option:selected').remove().appendTo('#in_roles');
- });
- $('#roles_remove_button').click(function() {
- return !$('#in_roles option:selected').remove().appendTo('#out_roles');
- });
- $('#users_add_button').click(function() {
- return !$('#out_users option:selected').remove().appendTo('#in_users');
- });
- $('#users_remove_button').click(function() {
- return !$('#in_users option:selected').remove().appendTo('#out_users');
- });
- $('form#associate_group_role_user').submit(function() {
- $('#in_roles option').each(function(i) {
- $(this).attr("selected", "selected");
- });
- $('#in_users option').each(function(i) {
- $(this).attr("selected", "selected");
- });
- });
-});
-</script>
-
-%if msg:
- ${render_msg( msg, messagetype )}
-%endif
-
-<div class="toolForm">
- <div class="toolFormTitle">Create Group</div>
- <div class="toolFormBody">
- <form name="associate_group_role_user" id="associate_group_role_user" action="${h.url_for( action='create_group' )}" method="post" >
- <div class="form-row">
- <label>Name:</label>
- <input name="name" type="textfield" value="" size=40"/>
- </div>
- <div class="form-row">
- <div style="float: left; margin-right: 10px;">
- <label>Roles associated with new group</label>
- ${render_select( "in_roles", in_roles )}<br/>
- <input type="submit" id="roles_remove_button" value=">>"/>
- </div>
- <div>
- <label>Roles not associated with new group</label>
- ${render_select( "out_roles", out_roles )}<br/>
- <input type="submit" id="roles_add_button" value="<<"/>
- </div>
- </div>
- <div class="form-row">
- <div style="float: left; margin-right: 10px;">
- <label>Users associated with new group</label>
- ${render_select( "in_users", in_users )}<br/>
- <input type="submit" id="users_remove_button" value=">>"/>
- </div>
- <div>
- <label>Users not associated with new group</label>
- ${render_select( "out_users", out_users )}<br/>
- <input type="submit" id="users_add_button" value="<<"/>
- </div>
- </div>
- <div class="form-row">
- <input type="submit" name="create_group_button" value="Save"/>
- </div>
- </form>
- </div>
-</div>
diff -r 1a438bb4dac2 -r 9f485a539bfb templates/admin/dataset_security/group_rename.mako
--- a/templates/admin/dataset_security/group_rename.mako Mon Nov 09 16:55:52 2009 -0500
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,34 +0,0 @@
-<%inherit file="/base.mako"/>
-<%namespace file="/message.mako" import="render_msg" />
-
-%if msg:
- ${render_msg( msg, messagetype )}
-%endif
-
-<div class="toolForm">
- <div class="toolFormTitle">Change group name</div>
- <div class="toolFormBody">
- <form name="library" action="${h.url_for( controller='admin', action='group' )}" method="post" >
- <div class="form-row">
- <label>Name:</label>
- <div style="float: left; width: 250px; margin-right: 10px;">
- <input type="text" name="name" value="${group.name}" size="40"/>
- </div>
- <div style="clear: both"></div>
- </div>
- <div class="form-row">
- <div style="float: left; width: 250px; margin-right: 10px;">
- <input type="hidden" name="rename" value="submitted"/>
- </div>
- <div style="clear: both"></div>
- </div>
- <div class="form-row">
- <div style="float: left; width: 250px; margin-right: 10px;">
- <input type="hidden" name="group_id" value="${group.id}"/>
- </div>
- <div style="clear: both"></div>
- </div>
- <input type="submit" name="rename_group_button" value="Save"/>
- </form>
- </div>
-</div>
diff -r 1a438bb4dac2 -r 9f485a539bfb templates/admin/dataset_security/groups.mako
--- a/templates/admin/dataset_security/groups.mako Mon Nov 09 16:55:52 2009 -0500
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,107 +0,0 @@
-<%inherit file="/base.mako"/>
-<%namespace file="/message.mako" import="render_msg" />
-
-## Render a row
-<%def name="render_row( group, ctr, anchored, curr_anchor )">
- %if ctr % 2 == 1:
- <tr class="odd_row">
- %else:
- <tr>
- %endif
- <td>
- <a href="${h.url_for( controller='admin', action='group', group_id=group.id )}">${group.name}</a>
- <a id="group-${group.id}-popup" class="popup-arrow" style="display: none;">▼</a>
- <div popupmenu="group-${group.id}-popup">
- <a class="action-button" href="${h.url_for( controller='admin', action='group', rename=True, group_id=group.id )}">Rename this group</a>
- <a class="action-button" href="${h.url_for( controller='admin', action='group', group_id=group.id )}">Change associated users and roles</a>
- <a class="action-button" href="${h.url_for( controller='admin', action='mark_group_deleted', group_id=group.id )}">Mark group deleted</a>
- </div>
- </td>
- <td>
- ${len( group.members )}
- </td>
- <td>
- ${len( group.roles )}
- %if not anchored:
- <a name="${curr_anchor}"></a>
- <div style="float: right;"><a href="#TOP">top</a></div>
- %endif
- </td>
- </tr>
-</%def>
-
-<a name="TOP"><h2>Groups</h2></a>
-
-<ul class="manage-table-actions">
- <li><a class="action-button" href="${h.url_for( controller='admin', action='create_group' )}">Create a new group</a></li>
- <li><a class="action-button" href="${h.url_for( controller='admin', action='deleted_groups' )}">Manage deleted groups</a></li>
-</ul>
-
-%if msg:
- ${render_msg( msg, messagetype )}
-%endif
-
-## TODO: make this a grid
-
-%if not groups:
- There are no Galaxy groups
-%else:
- <table class="manage-table colored" border="0" cellspacing="0" cellpadding="0" width="100%">
- <%
- render_quick_find = groups.count() > 200
- ctr = 0
- %>
- %if render_quick_find:
- <%
- anchors = ['A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z']
- anchor_loc = 0
- anchored = False
- curr_anchor = 'A'
- %>
- <tr style="background: #EEE">
- <td colspan="3" style="border-bottom: 1px solid #D8B365; text-align: center;">
- Jump to letter:
- %for a in anchors:
- | <a href="#${a}">${a}</a>
- %endfor
- </td>
- </tr>
- %endif
- <tr class="header">
- <td>Name</td>
- <td>Users</td>
- <td>Roles</td>
- </tr>
- %for ctr, group in enumerate( groups ):
- %if render_quick_find and not group.name.upper().startswith( curr_anchor ):
- <% anchored = False %>
- %endif
- %if render_quick_find and group.name.upper().startswith( curr_anchor ):
- %if not anchored:
- ${render_row( group, ctr, anchored, curr_anchor )}
- <% anchored = True %>
- %else:
- ${render_row( group, ctr, anchored, curr_anchor )}
- %endif
- %elif render_quick_find:
- %for anchor in anchors[ anchor_loc: ]:
- %if group.name.upper().startswith( anchor ):
- %if not anchored:
- <% curr_anchor = anchor %>
- ${render_row( group, ctr, anchored, curr_anchor )}
- <% anchored = True %>
- %else:
- ${render_row( group, ctr, anchored, curr_anchor )}
- %endif
- <%
- anchor_loc = anchors.index( anchor )
- break
- %>
- %endif
- %endfor
- %else:
- ${render_row( group, ctr, True, '' )}
- %endif
- %endfor
- </table>
-%endif
diff -r 1a438bb4dac2 -r 9f485a539bfb templates/admin/dataset_security/role.mako
--- a/templates/admin/dataset_security/role.mako Mon Nov 09 16:55:52 2009 -0500
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,117 +0,0 @@
-<%inherit file="/base.mako"/>
-<%namespace file="/message.mako" import="render_msg" />
-
-<%def name="javascripts()">
- ${parent.javascripts()}
- <script type="text/javascript">
- $(function(){
- $("input:text:first").focus();
- })
- </script>
-</%def>
-
-<%def name="render_select( name, options )">
- <select name="${name}" id="${name}" style="min-width: 250px; height: 150px;" multiple>
- %for option in options:
- <option value="${option[0]}">${option[1]}</option>
- %endfor
- </select>
-</%def>
-
-<script type="text/javascript">
-$().ready(function() {
- $('#users_add_button').click(function() {
- return !$('#out_users option:selected').remove().appendTo('#in_users');
- });
- $('#users_remove_button').click(function() {
- return !$('#in_users option:selected').remove().appendTo('#out_users');
- });
- $('#groups_add_button').click(function() {
- return !$('#out_groups option:selected').remove().appendTo('#in_groups');
- });
- $('#groups_remove_button').click(function() {
- return !$('#in_groups option:selected').remove().appendTo('#out_groups');
- });
- $('form#associate_role_user_group').submit(function() {
- $('#in_users option').each(function(i) {
- $(this).attr("selected", "selected");
- });
- $('#in_groups option').each(function(i) {
- $(this).attr("selected", "selected");
- });
- });
-});
-</script>
-
-%if msg:
- ${render_msg( msg, messagetype )}
-%endif
-
-<div class="toolForm">
- <div class="toolFormTitle">Role '${role.name}'</div>
- <div class="toolFormBody">
- <form name="associate_role_user_group" id="associate_role_user_group" action="${h.url_for( action='role', role_id=role.id )}" method="post" >
- <div class="form-row">
- <div style="float: left; margin-right: 10px;">
- <label>Users associated with '${role.name}'</label>
- ${render_select( "in_users", in_users )}<br/>
- <input type="submit" id="users_remove_button" value=">>"/>
- </div>
- <div>
- <label>Users not associated with '${role.name}'</label>
- ${render_select( "out_users", out_users )}<br/>
- <input type="submit" id="users_add_button" value="<<"/>
- </div>
- </div>
- <div class="form-row">
- <div style="float: left; margin-right: 10px;">
- <label>Groups associated with '${role.name}'</label>
- ${render_select( "in_groups", in_groups )}<br/>
- <input type="submit" id="groups_remove_button" value=">>"/>
- </div>
- <div>
- <label>Groups not associated with '${role.name}'</label>
- ${render_select( "out_groups", out_groups )}<br/>
- <input type="submit" id="groups_add_button" value="<<"/>
- </div>
- </div>
- <div class="form-row">
- <input type="submit" name="role_members_edit_button" value="Save"/>
- </div>
- </form>
- </div>
-</div>
-<br clear="left"/>
-<br/>
-%if len( library_dataset_actions ) > 0:
- <h3>Data library datasets associated with role '${role.name}'</h3>
- <table class="manage-table colored" border="0" cellspacing="0" cellpadding="0" width="100%">
- <tr>
- <td>
- <ul>
- %for ctr, library, in enumerate( library_dataset_actions.keys() ):
- <li>
- <img src="${h.url_for( '/static/images/silk/book_open.png' )}" class="rowIcon"/>
- ${library.name}
- <ul>
- %for folder_path, permissions in library_dataset_actions[ library ].items():
- <li>
- <img src="/static/images/silk/folder_page.png" class="rowIcon"/>
- ${folder_path}
- <ul>
- % for permission in permissions:
- <ul>
- <li>${permission}</li>
- </ul>
- %endfor
- </ul>
- </li>
- %endfor
- </ul>
- </li>
- %endfor
- </ul>
- </td>
- </tr>
- </table>
-%endif
diff -r 1a438bb4dac2 -r 9f485a539bfb templates/admin/dataset_security/role/grid.mako
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/templates/admin/dataset_security/role/grid.mako Mon Nov 09 23:00:55 2009 -0500
@@ -0,0 +1,1 @@
+<%inherit file="/grid_base.mako"/>
diff -r 1a438bb4dac2 -r 9f485a539bfb templates/admin/dataset_security/role/role.mako
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/templates/admin/dataset_security/role/role.mako Mon Nov 09 23:00:55 2009 -0500
@@ -0,0 +1,117 @@
+<%inherit file="/base.mako"/>
+<%namespace file="/message.mako" import="render_msg" />
+
+<%def name="javascripts()">
+ ${parent.javascripts()}
+ <script type="text/javascript">
+ $(function(){
+ $("input:text:first").focus();
+ })
+ </script>
+</%def>
+
+<%def name="render_select( name, options )">
+ <select name="${name}" id="${name}" style="min-width: 250px; height: 150px;" multiple>
+ %for option in options:
+ <option value="${option[0]}">${option[1]}</option>
+ %endfor
+ </select>
+</%def>
+
+<script type="text/javascript">
+$().ready(function() {
+ $('#users_add_button').click(function() {
+ return !$('#out_users option:selected').remove().appendTo('#in_users');
+ });
+ $('#users_remove_button').click(function() {
+ return !$('#in_users option:selected').remove().appendTo('#out_users');
+ });
+ $('#groups_add_button').click(function() {
+ return !$('#out_groups option:selected').remove().appendTo('#in_groups');
+ });
+ $('#groups_remove_button').click(function() {
+ return !$('#in_groups option:selected').remove().appendTo('#out_groups');
+ });
+ $('form#associate_role_user_group').submit(function() {
+ $('#in_users option').each(function(i) {
+ $(this).attr("selected", "selected");
+ });
+ $('#in_groups option').each(function(i) {
+ $(this).attr("selected", "selected");
+ });
+ });
+});
+</script>
+
+%if msg:
+ ${render_msg( msg, messagetype )}
+%endif
+
+<div class="toolForm">
+ <div class="toolFormTitle">Role '${role.name}'</div>
+ <div class="toolFormBody">
+ <form name="associate_role_user_group" id="associate_role_user_group" action="${h.url_for( action='role', role_id=role.id )}" method="post" >
+ <div class="form-row">
+ <div style="float: left; margin-right: 10px;">
+ <label>Users associated with '${role.name}'</label>
+ ${render_select( "in_users", in_users )}<br/>
+ <input type="submit" id="users_remove_button" value=">>"/>
+ </div>
+ <div>
+ <label>Users not associated with '${role.name}'</label>
+ ${render_select( "out_users", out_users )}<br/>
+ <input type="submit" id="users_add_button" value="<<"/>
+ </div>
+ </div>
+ <div class="form-row">
+ <div style="float: left; margin-right: 10px;">
+ <label>Groups associated with '${role.name}'</label>
+ ${render_select( "in_groups", in_groups )}<br/>
+ <input type="submit" id="groups_remove_button" value=">>"/>
+ </div>
+ <div>
+ <label>Groups not associated with '${role.name}'</label>
+ ${render_select( "out_groups", out_groups )}<br/>
+ <input type="submit" id="groups_add_button" value="<<"/>
+ </div>
+ </div>
+ <div class="form-row">
+ <input type="submit" name="role_members_edit_button" value="Save"/>
+ </div>
+ </form>
+ </div>
+</div>
+<br clear="left"/>
+<br/>
+%if len( library_dataset_actions ) > 0:
+ <h3>Data library datasets associated with role '${role.name}'</h3>
+ <table class="manage-table colored" border="0" cellspacing="0" cellpadding="0" width="100%">
+ <tr>
+ <td>
+ <ul>
+ %for ctr, library, in enumerate( library_dataset_actions.keys() ):
+ <li>
+ <img src="${h.url_for( '/static/images/silk/book_open.png' )}" class="rowIcon"/>
+ ${library.name}
+ <ul>
+ %for folder_path, permissions in library_dataset_actions[ library ].items():
+ <li>
+ <img src="/static/images/silk/folder_page.png" class="rowIcon"/>
+ ${folder_path}
+ <ul>
+ % for permission in permissions:
+ <ul>
+ <li>${permission}</li>
+ </ul>
+ %endfor
+ </ul>
+ </li>
+ %endfor
+ </ul>
+ </li>
+ %endfor
+ </ul>
+ </td>
+ </tr>
+ </table>
+%endif
diff -r 1a438bb4dac2 -r 9f485a539bfb templates/admin/dataset_security/role/role_create.mako
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/templates/admin/dataset_security/role/role_create.mako Mon Nov 09 23:00:55 2009 -0500
@@ -0,0 +1,94 @@
+<%inherit file="/base.mako"/>
+<%namespace file="/message.mako" import="render_msg" />
+
+<%def name="javascripts()">
+ ${parent.javascripts()}
+ <script type="text/javascript">
+ $(function(){
+ $("input:text:first").focus();
+ })
+ </script>
+</%def>
+
+<%def name="render_select( name, options )">
+ <select name="${name}" id="${name}" style="min-width: 250px; height: 150px;" multiple>
+ %for option in options:
+ <option value="${option[0]}">${option[1]}</option>
+ %endfor
+ </select>
+</%def>
+
+<script type="text/javascript">
+$().ready(function() {
+ $('#groups_add_button').click(function() {
+ return !$('#out_groups option:selected').remove().appendTo('#in_groups');
+ });
+ $('#groups_remove_button').click(function() {
+ return !$('#in_groups option:selected').remove().appendTo('#out_groups');
+ });
+ $('#users_add_button').click(function() {
+ return !$('#out_users option:selected').remove().appendTo('#in_users');
+ });
+ $('#users_remove_button').click(function() {
+ return !$('#in_users option:selected').remove().appendTo('#out_users');
+ });
+ $('form#associate_role_group_user').submit(function() {
+ $('#in_groups option').each(function(i) {
+ $(this).attr("selected", "selected");
+ });
+ $('#in_users option').each(function(i) {
+ $(this).attr("selected", "selected");
+ });
+ });
+});
+</script>
+
+%if msg:
+ ${render_msg( msg, messagetype )}
+%endif
+
+<div class="toolForm">
+ <div class="toolFormTitle">Create Role</div>
+ <div class="toolFormBody">
+ <form name="associate_role_group_user" id="associate_role_group_user" action="${h.url_for( action='create_role' )}" method="post" >
+ <div class="form-row">
+ <label>Name:</label>
+ <input name="name" type="textfield" value="" size=40"/>
+ </div>
+ <div class="form-row">
+ <label>Description:</label>
+ <input name="description" type="textfield" value="" size=40"/>
+ </div>
+ <div class="form-row">
+ <div style="float: left; margin-right: 10px;">
+ <label>Groups associated with new role</label>
+ ${render_select( "in_groups", in_groups )}<br/>
+ <input type="submit" id="groups_remove_button" value=">>"/>
+ </div>
+ <div>
+ <label>Groups not associated with new role</label>
+ ${render_select( "out_groups", out_groups )}<br/>
+ <input type="submit" id="groups_add_button" value="<<"/>
+ </div>
+ </div>
+ <div class="form-row">
+ <div style="float: left; margin-right: 10px;">
+ <label>Users associated with new role</label>
+ ${render_select( "in_users", in_users )}<br/>
+ <input type="submit" id="users_remove_button" value=">>"/>
+ </div>
+ <div>
+ <label>Users not associated with new role</label>
+ ${render_select( "out_users", out_users )}<br/>
+ <input type="submit" id="users_add_button" value="<<"/>
+ </div>
+ </div>
+ <div class="form-row">
+ <input type="checkbox" name="create_group_for_role" value="yes" />Create a new group of the same name for this role
+ </div>
+ <div class="form-row">
+ <input type="submit" name="create_role_button" value="Save"/>
+ </div>
+ </form>
+ </div>
+</div>
diff -r 1a438bb4dac2 -r 9f485a539bfb templates/admin/dataset_security/role/role_rename.mako
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/templates/admin/dataset_security/role/role_rename.mako Mon Nov 09 23:00:55 2009 -0500
@@ -0,0 +1,41 @@
+<%inherit file="/base.mako"/>
+<%namespace file="/message.mako" import="render_msg" />
+
+%if msg:
+ ${render_msg( msg, messagetype )}
+%endif
+
+<div class="toolForm">
+ <div class="toolFormTitle">Change role name and description</div>
+ <div class="toolFormBody">
+ <form name="library" action="${h.url_for( controller='admin', action='role' )}" method="post" >
+ <div class="form-row">
+ <label>Name:</label>
+ <div style="float: left; width: 250px; margin-right: 10px;">
+ <input type="text" name="name" value="${role.name}" size="40"/>
+ </div>
+ <div style="clear: both"></div>
+ </div>
+ <div class="form-row">
+ <label>Description:</label>
+ <div style="float: left; width: 250px; margin-right: 10px;">
+ <input name="description" type="textfield" value="${role.description}" size=40"/>
+ </div>
+ <div style="clear: both"></div>
+ </div>
+ <div class="form-row">
+ <div style="float: left; width: 250px; margin-right: 10px;">
+ <input type="hidden" name="rename" value="submitted"/>
+ </div>
+ <div style="clear: both"></div>
+ </div>
+ <div class="form-row">
+ <div style="float: left; width: 250px; margin-right: 10px;">
+ <input type="hidden" name="id" value="${trans.security.encode_id( role.id )}"/>
+ </div>
+ <div style="clear: both"></div>
+ </div>
+ <input type="submit" name="rename_role_button" value="Save"/>
+ </form>
+ </div>
+</div>
diff -r 1a438bb4dac2 -r 9f485a539bfb templates/admin/dataset_security/role_create.mako
--- a/templates/admin/dataset_security/role_create.mako Mon Nov 09 16:55:52 2009 -0500
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,94 +0,0 @@
-<%inherit file="/base.mako"/>
-<%namespace file="/message.mako" import="render_msg" />
-
-<%def name="javascripts()">
- ${parent.javascripts()}
- <script type="text/javascript">
- $(function(){
- $("input:text:first").focus();
- })
- </script>
-</%def>
-
-<%def name="render_select( name, options )">
- <select name="${name}" id="${name}" style="min-width: 250px; height: 150px;" multiple>
- %for option in options:
- <option value="${option[0]}">${option[1]}</option>
- %endfor
- </select>
-</%def>
-
-<script type="text/javascript">
-$().ready(function() {
- $('#groups_add_button').click(function() {
- return !$('#out_groups option:selected').remove().appendTo('#in_groups');
- });
- $('#groups_remove_button').click(function() {
- return !$('#in_groups option:selected').remove().appendTo('#out_groups');
- });
- $('#users_add_button').click(function() {
- return !$('#out_users option:selected').remove().appendTo('#in_users');
- });
- $('#users_remove_button').click(function() {
- return !$('#in_users option:selected').remove().appendTo('#out_users');
- });
- $('form#associate_role_group_user').submit(function() {
- $('#in_groups option').each(function(i) {
- $(this).attr("selected", "selected");
- });
- $('#in_users option').each(function(i) {
- $(this).attr("selected", "selected");
- });
- });
-});
-</script>
-
-%if msg:
- ${render_msg( msg, messagetype )}
-%endif
-
-<div class="toolForm">
- <div class="toolFormTitle">Create Role</div>
- <div class="toolFormBody">
- <form name="associate_role_group_user" id="associate_role_group_user" action="${h.url_for( action='create_role' )}" method="post" >
- <div class="form-row">
- <label>Name:</label>
- <input name="name" type="textfield" value="" size=40"/>
- </div>
- <div class="form-row">
- <label>Description:</label>
- <input name="description" type="textfield" value="" size=40"/>
- </div>
- <div class="form-row">
- <div style="float: left; margin-right: 10px;">
- <label>Groups associated with new role</label>
- ${render_select( "in_groups", in_groups )}<br/>
- <input type="submit" id="groups_remove_button" value=">>"/>
- </div>
- <div>
- <label>Groups not associated with new role</label>
- ${render_select( "out_groups", out_groups )}<br/>
- <input type="submit" id="groups_add_button" value="<<"/>
- </div>
- </div>
- <div class="form-row">
- <div style="float: left; margin-right: 10px;">
- <label>Users associated with new role</label>
- ${render_select( "in_users", in_users )}<br/>
- <input type="submit" id="users_remove_button" value=">>"/>
- </div>
- <div>
- <label>Users not associated with new role</label>
- ${render_select( "out_users", out_users )}<br/>
- <input type="submit" id="users_add_button" value="<<"/>
- </div>
- </div>
- <div class="form-row">
- <input type="checkbox" name="create_group_for_role" value="yes" />Create a new group of the same name for this role
- </div>
- <div class="form-row">
- <input type="submit" name="create_role_button" value="Save"/>
- </div>
- </form>
- </div>
-</div>
diff -r 1a438bb4dac2 -r 9f485a539bfb templates/admin/dataset_security/role_rename.mako
--- a/templates/admin/dataset_security/role_rename.mako Mon Nov 09 16:55:52 2009 -0500
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,41 +0,0 @@
-<%inherit file="/base.mako"/>
-<%namespace file="/message.mako" import="render_msg" />
-
-%if msg:
- ${render_msg( msg, messagetype )}
-%endif
-
-<div class="toolForm">
- <div class="toolFormTitle">Change role name and description</div>
- <div class="toolFormBody">
- <form name="library" action="${h.url_for( controller='admin', action='role' )}" method="post" >
- <div class="form-row">
- <label>Name:</label>
- <div style="float: left; width: 250px; margin-right: 10px;">
- <input type="text" name="name" value="${role.name}" size="40"/>
- </div>
- <div style="clear: both"></div>
- </div>
- <div class="form-row">
- <label>Description:</label>
- <div style="float: left; width: 250px; margin-right: 10px;">
- <input name="description" type="textfield" value="${role.description}" size=40"/>
- </div>
- <div style="clear: both"></div>
- </div>
- <div class="form-row">
- <div style="float: left; width: 250px; margin-right: 10px;">
- <input type="hidden" name="rename" value="submitted"/>
- </div>
- <div style="clear: both"></div>
- </div>
- <div class="form-row">
- <div style="float: left; width: 250px; margin-right: 10px;">
- <input type="hidden" name="role_id" value="${role.id}"/>
- </div>
- <div style="clear: both"></div>
- </div>
- <input type="submit" name="rename_role_button" value="Save"/>
- </form>
- </div>
-</div>
diff -r 1a438bb4dac2 -r 9f485a539bfb templates/admin/dataset_security/roles.mako
--- a/templates/admin/dataset_security/roles.mako Mon Nov 09 16:55:52 2009 -0500
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,109 +0,0 @@
-<%inherit file="/base.mako"/>
-<%namespace file="/message.mako" import="render_msg" />
-
-## Render a row
-<%def name="render_row( role, ctr, anchored, curr_anchor )">
- %if ctr % 2 == 1:
- <tr class="odd_row">
- %else:
- <tr>
- %endif
- <td>
- <a href="${h.url_for( controller='admin', action='role', role_id=role.id )}">${role.name}</a>
- <a id="role-${role.id}-popup" class="popup-arrow" style="display: none;">▼</a>
- <div popupmenu="role-${role.id}-popup">
- <a class="action-button" href="${h.url_for( controller='admin', action='role', rename=True, role_id=role.id )}">Rename this role</a>
- <a class="action-button" href="${h.url_for( controller='admin', action='role', role_id=role.id )}">Change associated users and groups</a>
- <a class="action-button" href="${h.url_for( controller='admin', action='mark_role_deleted', role_id=role.id )}">Mark role deleted</a>
- </div>
- </td>
- <td>${role.description}</td>
- <td>${role.type}</td>
- <td>
- ${len( role.users )}
- </td>
- <td>
- ${len( role.groups )}
- %if not anchored:
- <a name="${curr_anchor}"></a>
- <div style="float: right;"><a href="#TOP">top</a></div>
- %endif
- </td>
- </tr>
-</%def>
-
-<a name="TOP"><h2>Roles</h2></a>
-
-<ul class="manage-table-actions">
- <li><a class="action-button" href="${h.url_for( controller='admin', action='create_role' )}">Create a new role</a></li>
- <li><a class="action-button" href="${h.url_for( controller='admin', action='deleted_roles' )}">Manage deleted roles</a></li>
-</ul>
-
-%if msg:
- ${render_msg( msg, messagetype )}
-%endif
-
-%if not roles:
- There are no non-private Galaxy roles
-%else:
- <table class="manage-table colored" border="0" cellspacing="0" cellpadding="0" width="100%">
- <%
- render_quick_find = roles.count() > 200
- ctr = 0
- %>
- %if render_quick_find:
- <%
- anchors = ['A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z']
- anchor_loc = 0
- anchored = False
- curr_anchor = 'A'
- %>
- <tr style="background: #EEE">
- <td colspan="4" style="text-align: center; border-bottom: 1px solid #D8B365">
- Jump to letter:
- %for a in anchors:
- | <a href="#${a}">${a}</a>
- %endfor
- </td>
- </tr>
- %endif
- <tr class="header">
- <td>Name</td>
- <td>Description</td>
- <td>Type</td>
- <td>Users</td>
- <td>Groups</td>
- </tr>
- %for ctr, role in enumerate( roles ):
- %if render_quick_find and not role.name.upper().startswith( curr_anchor ):
- <% anchored = False %>
- %endif
- %if render_quick_find and role.name.upper().startswith( curr_anchor ):
- %if not anchored:
- ${render_row( role, ctr, anchored, curr_anchor )}
- <% anchored = True %>
- %else:
- ${render_row( role, ctr, anchored, curr_anchor )}
- %endif
- %elif render_quick_find:
- %for anchor in anchors[ anchor_loc: ]:
- %if role.name.upper().startswith( anchor ):
- %if not anchored:
- <% curr_anchor = anchor %>
- ${render_row( role, ctr, anchored, curr_anchor )}
- <% anchored = True %>
- %else:
- ${render_row( role, ctr, anchored, curr_anchor )}
- %endif
- <%
- anchor_loc = anchors.index( anchor )
- break
- %>
- %endif
- %endfor
- %else:
- ${render_row( role, ctr, True, '' )}
- %endif
- %endfor
- </table>
-%endif
diff -r 1a438bb4dac2 -r 9f485a539bfb templates/admin/user/grid.mako
--- a/templates/admin/user/grid.mako Mon Nov 09 16:55:52 2009 -0500
+++ b/templates/admin/user/grid.mako Mon Nov 09 23:00:55 2009 -0500
@@ -1,224 +1,1 @@
-<%inherit file="/base.mako"/>
-<%def name="title()">${grid.title}</%def>
-<% from galaxy import util %>
-
-%if message:
- <p>
- <div class="${message_type}message transient-message">${util.restore_text( message )}</div>
- <div style="clear: both"></div>
- </p>
-%endif
-
-<%def name="javascripts()">
- ${parent.javascripts()}
- ${h.js("jquery.autocomplete", "autocomplete_tagging" )}
- <script type="text/javascript">
- ## TODO: generalize and move into galaxy.base.js
- $(document).ready(function() {
- $(".grid").each( function() {
- var grid = this;
- var checkboxes = $(this).find("input.grid-row-select-checkbox");
- var update = $(this).find( "span.grid-selected-count" );
- $(checkboxes).each( function() {
- $(this).change( function() {
- var n = $(checkboxes).filter("[checked]").size();
- update.text( n );
- });
- })
- });
- });
- ## Can this be moved into base.mako?
- %if refresh_frames:
- %if 'masthead' in refresh_frames:
- ## Refresh masthead == user changes (backward compatibility)
- if ( parent.user_changed ) {
- %if trans.user:
- parent.user_changed( "${trans.user.email}", ${int( app.config.is_admin_user( trans.user ) )} );
- %else:
- parent.user_changed( null, false );
- %endif
- }
- %endif
- %if 'history' in refresh_frames:
- if ( parent.frames && parent.frames.galaxy_history ) {
- parent.frames.galaxy_history.location.href="${h.url_for( controller='root', action='history')}";
- if ( parent.force_right_panel ) {
- parent.force_right_panel( 'show' );
- }
- }
- %endif
- %if 'tools' in refresh_frames:
- if ( parent.frames && parent.frames.galaxy_tools ) {
- parent.frames.galaxy_tools.location.href="${h.url_for( controller='root', action='tool_menu')}";
- if ( parent.force_left_panel ) {
- parent.force_left_panel( 'show' );
- }
- }
- %endif
- %endif
- </script>
-</%def>
-
-<%def name="stylesheets()">
- ${h.css( "base", "autocomplete_tagging" )}
- <style>
- ## Not generic to all grids -- move to base?
- .count-box {
- min-width: 1.1em;
- padding: 5px;
- border-width: 1px;
- border-style: solid;
- text-align: center;
- display: inline-block;
- }
- </style>
-</%def>
-
-%if grid.standard_filters:
- <div class="grid-header">
- <h2>${grid.title}</h2>
- <span class="title">Filter:</span>
- %for i, filter in enumerate( grid.standard_filters ):
- %if i > 0:
- <span>|</span>
- %endif
- <span class="filter"><a href="${url( filter.get_url_args() )}">${filter.label}</a></span>
- %endfor
- </div>
-%endif
-
-<ul class="manage-table-actions">
- <li><a class="action-button" href="${h.url_for( controller='admin', action='users', operation='create' )}">Create a new user</a></li>
-</ul>
-
-%if query.count() == 0:
- No users were returned for the current query. Click the Show all users button or a letter below.
-%endif:
-<%
- letters = ['A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z']
-%>
-<div class="toolFormBody">
- <div class="form-row">
- <a class="action-button" href="${h.url_for( controller='admin', action='users', email_filter='all' )}"><span>Show all users</span></a>
- <div class="toolParamHelp" style="clear: both;">
- Default behavior is displaying only users whose email begins with 'a' if there are more than 200 total users
- </div>
- </div>
- <div class="form-row">
- <label>Show only users whose email starts with:</label>
- %for letter in letters:
- | <a href="${h.url_for( controller='admin', action='users', email_filter=letter )}">${letter}</a>
- %endfor
- <div style="clear: both"></div>
- </div>
- <form name="user_actions" action="${url()}" method="post">
- <table class="grid">
- <thead>
- <tr>
- <th></th>
- %for column in grid.columns:
- %if column.visible:
- <%
- href = ""
- extra = ""
- if column.sortable:
- if sort_key == column.key:
- if sort_order == "asc":
- href = url( sort=( "-" + column.key ) )
- extra = "↓"
- else:
- href = url( sort=( column.key ) )
- extra = "↑"
- else:
- href = url( sort=column.key )
- %>
- <th\
- %if column.ncells > 1:
- colspan="${column.ncells}"
- %endif
- >
- %if href:
- <a href="${href}">${column.label}</a>
- %else:
- ${column.label}
- %endif
- <span>${extra}</span>
- </th>
- %endif
- %endfor
- <th></th>
- </tr>
- </thead>
- <tbody>
- %for i, item in enumerate( query ):
- <tr \
- %if current_item == item:
- class="current" \
- %endif
- >
- ## Item selection column
- <td style="width: 1.5em;">
- <input type="checkbox" name="id" value=${trans.security.encode_id( item.id )} class="grid-row-select-checkbox" />
- </td>
- ## Data columns
- %for column in grid.columns:
- %if column.visible:
- <%
- # Link
- link = column.get_link( trans, grid, item )
- if link:
- href = url( **link )
- else:
- href = None
- # Value (coerced to list so we can loop)
- value = column.get_value( trans, grid, item )
- if column.ncells == 1:
- value = [ value ]
- %>
- %for cellnum, v in enumerate( value ):
- <%
- # Attach popup menu?
- if column.attach_popup and cellnum == 0:
- extra = '<a id="grid-%d-popup" class="arrow" style="display: none;"><span>▼</span></a>' % i
- else:
- extra = ""
- %>
- %if href:
- <td><div class="menubutton split" style="float: left;"><a class="label" href="${href}">${v}${extra}</a> </td>
- %else:
- <td >${v}${extra}</td>
- %endif
- %endfor
- %endif
- %endfor
- ## Actions column
- <td>
- <div popupmenu="grid-${i}-popup">
- %for operation in grid.operations:
- %if operation.allowed( item ) and operation.allow_popup:
- <a class="action-button" href="${url( operation=operation.label, id=item.id )}">${operation.label}</a>
- %endif
- %endfor
- </div>
- </td>
- </tr>
- %endfor
- </tbody>
- %if grid.operations:
- <tfoot>
- <tr>
- <td></td>
- <td colspan="100">
- For <span class="grid-selected-count"></span> selected users:
- %for operation in grid.operations:
- %if operation.allow_multiple:
- <input type="submit" name="operation" value="${operation.label}" class="action-button">
- %endif
- %endfor
- </td>
- </tr>
- </tfoot>
- %endif
- </table>
- </form>
-</div>
+<%inherit file="/grid_base.mako"/>
diff -r 1a438bb4dac2 -r 9f485a539bfb templates/grid_base.mako
--- a/templates/grid_base.mako Mon Nov 09 16:55:52 2009 -0500
+++ b/templates/grid_base.mako Mon Nov 09 23:00:55 2009 -0500
@@ -1,5 +1,6 @@
<%!
- from galaxy.model import History, HistoryDatasetAssociation
+ from galaxy.model import History, HistoryDatasetAssociation, User, Role, Group
+ import galaxy.util
def inherit(context):
if context.get('use_panels'):
return '/base_panels.mako'
@@ -11,7 +12,7 @@
## Render the grid's basic elements. Each of these elements can be subclassed.
%if message:
<p>
- <div class="${message_type}message transient-message">${message}</div>
+ <div class="${message_type}message transient-message">${util.restore_text( message )}</div>
<div style="clear: both"></div>
</p>
%endif
@@ -303,6 +304,12 @@
items_plural = "histories"
elif grid.model_class == HistoryDatasetAssociation:
items_plural = "datasets"
+ elif grid.model_class == User:
+ items_plural = "users"
+ elif grid.model_class == Role:
+ items_plural = "roles"
+ elif grid.model_class == Group:
+ items_plural = "groups"
%>
%if num_pages > 1:
<tr>
diff -r 1a438bb4dac2 -r 9f485a539bfb test/base/twilltestcase.py
--- a/test/base/twilltestcase.py Mon Nov 09 16:55:52 2009 -0500
+++ b/test/base/twilltestcase.py Mon Nov 09 23:00:55 2009 -0500
@@ -672,7 +672,8 @@
self.check_page_for_string( "The user information has been updated with the changes." )
for value in info_values:
self.check_page_for_string( value )
- def user_set_default_permissions( self, permissions_out=[], permissions_in=[], role_id=2 ): # role.id = 2 is Private Role for test2(a)bx.psu.edu
+ def user_set_default_permissions( self, permissions_out=[], permissions_in=[], role_id='2' ):
+ # role.id = 2 is Private Role for test2(a)bx.psu.edu
# NOTE: Twill has a bug that requires the ~/user/permissions page to contain at least 1 option value
# in each select list or twill throws an exception, which is: ParseError: OPTION outside of SELECT
# Due to this bug, we'll bypass visiting the page, and simply pass the permissions on to the
@@ -921,6 +922,7 @@
# Tests associated with users
def create_new_account_as_admin( self, email='test4(a)bx.psu.edu', password='testuser' ):
"""Create a new account for another user"""
+ # TODO: fix this so that it uses the form rather than the following URL.
self.home()
self.visit_url( "%s/user/create?admin_view=True&email=%s&password=%s&confirm=%s&create_user_button=Submit&subscribe=False" \
% ( self.url, email, password, password ) )
@@ -983,7 +985,13 @@
self.home()
# Tests associated with roles
- def create_role( self, name='Role One', description="This is Role One", in_user_ids=[], in_group_ids=[], create_group_for_role='no', private_role='' ):
+ def create_role( self,
+ name='Role One',
+ description="This is Role One",
+ in_user_ids=[],
+ in_group_ids=[],
+ create_group_for_role='no',
+ private_role='' ):
"""Create a new role"""
url = "%s/admin/create_role?create_role_button=Save&name=%s&description=%s" % ( self.url, name.replace( ' ', '+' ), description.replace( ' ', '+' ) )
if in_user_ids:
@@ -1017,7 +1025,7 @@
def rename_role( self, role_id, name='Role One Renamed', description='This is Role One Re-described' ):
"""Rename a role"""
self.home()
- self.visit_url( "%s/admin/role?rename=True&role_id=%s" % ( self.url, role_id ) )
+ self.visit_url( "%s/admin/role?rename=True&id=%s" % ( self.url, role_id ) )
self.check_page_for_string( 'Change role name and description' )
tc.fv( "1", "name", name )
tc.fv( "1", "description", description )
@@ -1026,28 +1034,28 @@
def mark_role_deleted( self, role_id, role_name ):
"""Mark a role as deleted"""
self.home()
- self.visit_url( "%s/admin/mark_role_deleted?role_id=%s" % ( self.url, role_id ) )
+ self.visit_url( "%s/admin/roles?operation=delete&id=%s" % ( self.url, role_id ) )
check_str = "Role '%s' has been marked as deleted" % role_name
self.check_page_for_string( check_str )
self.home()
def undelete_role( self, role_id, role_name ):
"""Undelete an existing role"""
self.home()
- self.visit_url( "%s/admin/undelete_role?role_id=%s" % ( self.url, role_id ) )
+ self.visit_url( "%s/admin/roles?operation=undelete&id=%s" % ( self.url, role_id ) )
check_str = "Role '%s' has been marked as not deleted" % role_name
self.check_page_for_string( check_str )
self.home()
def purge_role( self, role_id, role_name ):
"""Purge an existing role"""
self.home()
- self.visit_url( "%s/admin/purge_role?role_id=%s" % ( self.url, role_id ) )
+ self.visit_url( "%s/admin/roles?operation=purge&id=%s" % ( self.url, role_id ) )
check_str = "The following have been purged from the database for role '%s': " % role_name
check_str += "DefaultUserPermissions, DefaultHistoryPermissions, UserRoleAssociations, GroupRoleAssociations, DatasetPermissionss."
self.check_page_for_string( check_str )
self.home()
def associate_users_and_groups_with_role( self, role_id, role_name, user_ids=[], group_ids=[] ):
self.home()
- url = "%s/admin/role?role_id=%s&role_members_edit_button=Save" % ( self.url, role_id )
+ url = "%s/admin/role?id=%s&role_members_edit_button=Save" % ( self.url, role_id )
if user_ids:
url += "&in_users=%s" % ','.join( user_ids )
if group_ids:
@@ -1076,14 +1084,14 @@
def rename_group( self, group_id, name='Group One Renamed' ):
"""Rename a group"""
self.home()
- self.visit_url( "%s/admin/group?rename=True&group_id=%s" % ( self.url, group_id ) )
+ self.visit_url( "%s/admin/group?rename=True&id=%s" % ( self.url, group_id ) )
self.check_page_for_string( 'Change group name' )
tc.fv( "1", "name", name )
tc.submit( "rename_group_button" )
self.home()
def associate_users_and_roles_with_group( self, group_id, group_name, user_ids=[], role_ids=[] ):
self.home()
- url = "%s/admin/group?group_id=%s&group_roles_users_edit_button=Save" % ( self.url, group_id )
+ url = "%s/admin/group?id=%s&group_roles_users_edit_button=Save" % ( self.url, group_id )
if user_ids:
url += "&in_users=%s" % ','.join( user_ids )
if role_ids:
@@ -1095,21 +1103,21 @@
def mark_group_deleted( self, group_id, group_name ):
"""Mark a group as deleted"""
self.home()
- self.visit_url( "%s/admin/mark_group_deleted?group_id=%s" % ( self.url, group_id ) )
+ self.visit_url( "%s/admin/groups?operation=delete&id=%s" % ( self.url, group_id ) )
check_str = "Group '%s' has been marked as deleted" % group_name
self.check_page_for_string( check_str )
self.home()
def undelete_group( self, group_id, group_name ):
"""Undelete an existing group"""
self.home()
- self.visit_url( "%s/admin/undelete_group?group_id=%s" % ( self.url, group_id ) )
+ self.visit_url( "%s/admin/groups?operation=undelete&id=%s" % ( self.url, group_id ) )
check_str = "Group '%s' has been marked as not deleted" % group_name
self.check_page_for_string( check_str )
self.home()
def purge_group( self, group_id, group_name ):
"""Purge an existing group"""
self.home()
- self.visit_url( "%s/admin/purge_group?group_id=%s" % ( self.url, group_id ) )
+ self.visit_url( "%s/admin/groups?operation=purge&id=%s" % ( self.url, group_id ) )
check_str = "The following have been purged from the database for group '%s': UserGroupAssociations, GroupRoleAssociations." % group_name
self.check_page_for_string( check_str )
self.home()
diff -r 1a438bb4dac2 -r 9f485a539bfb test/functional/test_history_functions.py
--- a/test/functional/test_history_functions.py Mon Nov 09 16:55:52 2009 -0500
+++ b/test/functional/test_history_functions.py Mon Nov 09 23:00:55 2009 -0500
@@ -780,8 +780,8 @@
self.delete_history( id=self.security.encode_id( history4.id ) )
self.delete_history( id=self.security.encode_id( history5.id ) )
# Eliminate Sharing role for: test(a)bx.psu.edu, test2(a)bx.psu.edu
- self.mark_role_deleted( str( sharing_role.id ), sharing_role.name )
- self.purge_role( str( sharing_role.id ), sharing_role.name )
+ self.mark_role_deleted( self.security.encode_id( sharing_role.id ), sharing_role.name )
+ self.purge_role( self.security.encode_id( sharing_role.id ), sharing_role.name )
# Manually delete the sharing role from the database
sa_session.refresh( sharing_role )
sa_session.delete( sharing_role )
diff -r 1a438bb4dac2 -r 9f485a539bfb test/functional/test_security_and_libraries.py
--- a/test/functional/test_security_and_libraries.py Mon Nov 09 16:55:52 2009 -0500
+++ b/test/functional/test_security_and_libraries.py Mon Nov 09 23:00:55 2009 -0500
@@ -327,8 +327,12 @@
name = 'Role One'
description = "This is Role Ones description"
user_ids=[ str( admin_user.id ), str( regular_user1.id ), str( regular_user3.id ) ]
- self.create_role( name=name, description=description, in_user_ids=user_ids, in_group_ids=[],
- create_group_for_role='yes', private_role=admin_user.email )
+ self.create_role( name=name,
+ description=description,
+ in_user_ids=user_ids,
+ in_group_ids=[],
+ create_group_for_role='yes',
+ private_role=admin_user.email )
# Get the role object for later tests
global role_one
role_one = sa_session.query( galaxy.model.Role ).filter( galaxy.model.Role.table.c.name==name ).first()
@@ -352,13 +356,13 @@
# Rename the role
rename = "Role One's been Renamed"
redescription="This is Role One's Re-described"
- self.rename_role( str( role_one.id ), name=rename, description=redescription )
+ self.rename_role( self.security.encode_id( role_one.id ), name=rename, description=redescription )
self.home()
self.visit_page( 'admin/roles' )
self.check_page_for_string( rename )
self.check_page_for_string( redescription )
# Reset the role back to the original name and description
- self.rename_role( str( role_one.id ), name=name, description=description )
+ self.rename_role( self.security.encode_id( role_one.id ), name=name, description=description )
def test_050_create_group( self ):
"""Testing creating new group with 3 members and 1 associated role, then renaming it"""
name = "Group One's Name"
@@ -384,12 +388,12 @@
% ( len( group_one.roles ), group_one.id, len( role_ids ) ) )
# Rename the group
rename = "Group One's been Renamed"
- self.rename_group( str( group_one.id ), name=rename, )
+ self.rename_group( self.security.encode_id( group_one.id ), name=rename, )
self.home()
self.visit_page( 'admin/groups' )
self.check_page_for_string( rename )
# Reset the group back to the original name
- self.rename_group( str( group_one.id ), name=name )
+ self.rename_group( self.security.encode_id( group_one.id ), name=name )
def test_055_add_members_and_role_to_group( self ):
"""Testing editing user membership and role associations of an existing group"""
name = 'Group Two'
@@ -405,10 +409,12 @@
if group_two.roles:
raise AssertionError( '%d GroupRoleAssociations were created for group id %d when it was created ( should have been 0 )' \
% ( len( group_two.roles ), group_two.id ) )
- group_two_id = str( group_two.id )
user_ids = [ str( regular_user1.id ) ]
role_ids = [ str( role_one.id ) ]
- self.associate_users_and_roles_with_group( group_two.id, group_two.name, user_ids=user_ids, role_ids=role_ids )
+ self.associate_users_and_roles_with_group( self.security.encode_id( group_two.id ),
+ group_two.name,
+ user_ids=user_ids,
+ role_ids=role_ids )
def test_060_create_role_with_user_and_group_associations( self ):
"""Testing creating a role with user and group associations"""
# NOTE: To get this to work with twill, all select lists on the ~/admin/role page must contain at least
@@ -421,7 +427,11 @@
group_ids=[ str( group_two.id ) ]
private_role=admin_user.email
# Create the role
- self.create_role( name=name, description=description, in_user_ids=user_ids, in_group_ids=group_ids, private_role=private_role )
+ self.create_role( name=name,
+ description=description,
+ in_user_ids=user_ids,
+ in_group_ids=group_ids,
+ private_role=private_role )
# Get the role object for later tests
global role_two
role_two = sa_session.query( galaxy.model.Role ).filter( galaxy.model.Role.table.c.name==name ).first()
@@ -451,7 +461,11 @@
user_ids=[]
group_ids=[]
private_role=admin_user.email
- self.create_role( name=name, description=description, in_user_ids=user_ids, in_group_ids=group_ids, private_role=private_role )
+ self.create_role( name=name,
+ description=description,
+ in_user_ids=user_ids,
+ in_group_ids=group_ids,
+ private_role=private_role )
# Get the role object for later tests
global role_three
role_three = sa_session.query( galaxy.model.Role ).filter( galaxy.model.Role.table.c.name==name ).first()
@@ -466,8 +480,11 @@
for uga in admin_user.groups:
group_ids.append( str( uga.group_id ) )
check_str = "User '%s' has been updated with %d associated roles and %d associated groups" % ( admin_user.email, len( role_ids ), len( group_ids ) )
- self.associate_roles_and_groups_with_user( self.security.encode_id( admin_user.id ), str( admin_user.email ),
- in_role_ids=role_ids, in_group_ids=group_ids, check_str=check_str )
+ self.associate_roles_and_groups_with_user( self.security.encode_id( admin_user.id ),
+ str( admin_user.email ),
+ in_role_ids=role_ids,
+ in_group_ids=group_ids,
+ check_str=check_str )
sa_session.refresh( admin_user )
# admin_user should now be associated with 4 roles: private, role_one, role_two, role_three
if len( admin_user.roles ) != 4:
@@ -1374,7 +1391,7 @@
self.home()
self.visit_url( '%s/admin/groups' % self.url )
self.check_page_for_string( group_two.name )
- self.mark_group_deleted( str( group_two.id ), group_two.name )
+ self.mark_group_deleted( self.security.encode_id( group_two.id ), group_two.name )
sa_session.refresh( group_two )
if not group_two.deleted:
raise AssertionError( '%s was not correctly marked as deleted.' % group_two.name )
@@ -1386,7 +1403,7 @@
def test_175_undelete_group( self ):
"""Testing undeleting a deleted group"""
# Logged in as admin_user
- self.undelete_group( str( group_two.id ), group_two.name )
+ self.undelete_group( self.security.encode_id( group_two.id ), group_two.name )
sa_session.refresh( group_two )
if group_two.deleted:
raise AssertionError( '%s was not correctly marked as not deleted.' % group_two.name )
@@ -1396,7 +1413,7 @@
self.home()
self.visit_url( '%s/admin/roles' % self.url )
self.check_page_for_string( role_two.name )
- self.mark_role_deleted( str( role_two.id ), role_two.name )
+ self.mark_role_deleted( self.security.encode_id( role_two.id ), role_two.name )
sa_session.refresh( role_two )
if not role_two.deleted:
raise AssertionError( '%s was not correctly marked as deleted.' % role_two.name )
@@ -1408,7 +1425,7 @@
def test_185_undelete_role( self ):
"""Testing undeleting a deleted role"""
# Logged in as admin_user
- self.undelete_role( str( role_two.id ), role_two.name )
+ self.undelete_role( self.security.encode_id( role_two.id ), role_two.name )
def test_190_mark_dataset_deleted( self ):
"""Testing marking a library dataset as deleted"""
# Logged in as admin_user
@@ -1541,59 +1558,57 @@
def test_235_purge_group( self ):
"""Testing purging a group"""
# Logged in as admin_user
- group_id = str( group_two.id )
- self.mark_group_deleted( group_id, group_two.name )
- self.purge_group( group_id, group_two.name )
+ self.mark_group_deleted( self.security.encode_id( group_two.id ), group_two.name )
+ self.purge_group( self.security.encode_id( group_two.id ), group_two.name )
# Make sure there are no UserGroupAssociations
uga = sa_session.query( galaxy.model.UserGroupAssociation ) \
- .filter( galaxy.model.UserGroupAssociation.table.c.group_id == group_id ) \
+ .filter( galaxy.model.UserGroupAssociation.table.c.group_id == group_two.id ) \
.first()
if uga:
- raise AssertionError( "Purging the group did not delete the UserGroupAssociations for group_id '%s'" % group_id )
+ raise AssertionError( "Purging the group did not delete the UserGroupAssociations for group_id '%s'" % group_two.id )
# Make sure there are no GroupRoleAssociations
gra = sa_session.query( galaxy.model.GroupRoleAssociation ) \
- .filter( galaxy.model.GroupRoleAssociation.table.c.group_id == group_id ) \
+ .filter( galaxy.model.GroupRoleAssociation.table.c.group_id == group_two.id ) \
.first()
if gra:
- raise AssertionError( "Purging the group did not delete the GroupRoleAssociations for group_id '%s'" % group_id )
+ raise AssertionError( "Purging the group did not delete the GroupRoleAssociations for group_id '%s'" % group_two.id )
# Undelete the group for later test runs
- self.undelete_group( group_id, group_two.name )
+ self.undelete_group( self.security.encode_id( group_two.id ), group_two.name )
def test_240_purge_role( self ):
"""Testing purging a role"""
# Logged in as admin_user
- role_id = str( role_two.id )
- self.mark_role_deleted( role_id, role_two.name )
- self.purge_role( role_id, role_two.name )
+ self.mark_role_deleted( self.security.encode_id( role_two.id ), role_two.name )
+ self.purge_role( self.security.encode_id( role_two.id ), role_two.name )
# Make sure there are no UserRoleAssociations
uras = sa_session.query( galaxy.model.UserRoleAssociation ) \
- .filter( galaxy.model.UserRoleAssociation.table.c.role_id == role_id ) \
+ .filter( galaxy.model.UserRoleAssociation.table.c.role_id == role_two.id ) \
.all()
if uras:
- raise AssertionError( "Purging the role did not delete the UserRoleAssociations for role_id '%s'" % role_id )
+ raise AssertionError( "Purging the role did not delete the UserRoleAssociations for role_id '%s'" % role_two.id )
# Make sure there are no DefaultUserPermissions associated with the Role
dups = sa_session.query( galaxy.model.DefaultUserPermissions ) \
- .filter( galaxy.model.DefaultUserPermissions.table.c.role_id == role_id ) \
+ .filter( galaxy.model.DefaultUserPermissions.table.c.role_id == role_two.id ) \
.all()
if dups:
- raise AssertionError( "Purging the role did not delete the DefaultUserPermissions for role_id '%s'" % role_id )
+ raise AssertionError( "Purging the role did not delete the DefaultUserPermissions for role_id '%s'" % role_two.id )
# Make sure there are no DefaultHistoryPermissions associated with the Role
dhps = sa_session.query( galaxy.model.DefaultHistoryPermissions ) \
- .filter( galaxy.model.DefaultHistoryPermissions.table.c.role_id == role_id ) \
+ .filter( galaxy.model.DefaultHistoryPermissions.table.c.role_id == role_two.id ) \
.all()
if dhps:
- raise AssertionError( "Purging the role did not delete the DefaultHistoryPermissions for role_id '%s'" % role_id )
+ raise AssertionError( "Purging the role did not delete the DefaultHistoryPermissions for role_id '%s'" % role_two.id )
# Make sure there are no GroupRoleAssociations
gra = sa_session.query( galaxy.model.GroupRoleAssociation ) \
- .filter( galaxy.model.GroupRoleAssociation.table.c.role_id == role_id ) \
+ .filter( galaxy.model.GroupRoleAssociation.table.c.role_id == role_two.id ) \
.first()
if gra:
- raise AssertionError( "Purging the role did not delete the GroupRoleAssociations for role_id '%s'" % role_id )
+ raise AssertionError( "Purging the role did not delete the GroupRoleAssociations for role_id '%s'" % role_two.id )
# Make sure there are no DatasetPermissionss
dp = sa_session.query( galaxy.model.DatasetPermissions ) \
- .filter( galaxy.model.DatasetPermissions.table.c.role_id == role_id ) \
+ .filter( galaxy.model.DatasetPermissions.table.c.role_id == role_two.id ) \
.first()
if dp:
- raise AssertionError( "Purging the role did not delete the DatasetPermissionss for role_id '%s'" % role_id )
+ raise AssertionError( "Purging the role did not delete the DatasetPermissionss for role_id '%s'" % role_two.id )
def test_245_manually_unpurge_role( self ):
"""Testing manually un-purging a role"""
# Logged in as admin_user
@@ -1601,7 +1616,7 @@
# TODO: If we decide to implement the GUI feature for un-purging a role, replace this with a method call
role_two.purged = False
role_two.flush()
- self.undelete_role( str( role_two.id ), role_two.name )
+ self.undelete_role( self.security.encode_id( role_two.id ), role_two.name )
def test_250_purge_library( self ):
"""Testing purging a library"""
# Logged in as admin_user
@@ -1815,8 +1830,8 @@
# Eliminate all non-private roles
##################
for role in [ role_one, role_two, role_three ]:
- self.mark_role_deleted( str( role.id ), role.name )
- self.purge_role( str( role.id ), role.name )
+ self.mark_role_deleted( self.security.encode_id( role.id ), role.name )
+ self.purge_role( self.security.encode_id( role.id ), role.name )
# Manually delete the role from the database
sa_session.refresh( role )
sa_session.delete( role )
@@ -1825,8 +1840,8 @@
# Eliminate all groups
##################
for group in [ group_zero, group_one, group_two ]:
- self.mark_group_deleted( str( group.id ), group.name )
- self.purge_group( str( group.id ), group.name )
+ self.mark_group_deleted( self.security.encode_id( group.id ), group.name )
+ self.purge_group( self.security.encode_id( group.id ), group.name )
# Manually delete the group from the database
sa_session.refresh( group )
sa_session.delete( group )
@@ -1846,7 +1861,6 @@
# Change DefaultHistoryPermissions for regular_user1 back to the default
permissions_in = [ 'DATASET_MANAGE_PERMISSIONS' ]
permissions_out = [ 'DATASET_ACCESS' ]
- role_id = str( regular_user1_private_role.id )
- self.user_set_default_permissions( permissions_in=permissions_in, permissions_out=permissions_out, role_id=role_id )
+ self.user_set_default_permissions( permissions_in=permissions_in, permissions_out=permissions_out, role_id=str( regular_user1_private_role.id ) )
self.logout()
self.login( email=admin_user.email )
diff -r 1a438bb4dac2 -r 9f485a539bfb tool_conf.xml.main
--- a/tool_conf.xml.main Mon Nov 09 16:55:52 2009 -0500
+++ b/tool_conf.xml.main Mon Nov 09 23:00:55 2009 -0500
@@ -8,6 +8,7 @@
<tool file="data_source/biomart.xml" />
<tool file="data_source/gramene_mart.xml" />
<tool file="data_source/flymine.xml" />
+ <tool file="data_source/eupathdb.xml" />
<tool file="data_source/encode_db.xml" />
<tool file="data_source/epigraph_import.xml" />
</section>
@@ -27,6 +28,7 @@
<tool file="filters/catWrapper.xml" />
<tool file="filters/condense_characters.xml" />
<tool file="filters/convert_characters.xml" />
+ <tool file="filters/mergeCols.xml" />
<tool file="filters/CreateInterval.xml" />
<tool file="filters/cutWrapper.xml" />
<tool file="filters/changeCase.xml" />
@@ -34,15 +36,17 @@
<tool file="filters/remove_beginning.xml" />
<tool file="filters/headWrapper.xml" />
<tool file="filters/tailWrapper.xml" />
+ <tool file="filters/trimmer.xml" />
</section>
<section name="Convert Formats" id="convert">
<tool file="filters/bed2gff.xml" />
<tool file="fasta_tools/fasta_to_tabular.xml" />
<tool file="filters/gff2bed.xml" />
<tool file="maf/maf_to_bed.xml" />
- <tool file="maf/maf_to_interval.xml" />
+ <tool file="maf/maf_to_interval.xml" />
<tool file="maf/maf_to_fasta.xml" />
<tool file="fasta_tools/tabular_to_fasta.xml" />
+ <tool file="fastx_toolkit/fastq_to_fasta.xml" />
</section>
<section name="FASTA manipulation" id="fasta_manipulation">
<tool file="fasta_tools/fasta_compute_length.xml" />
@@ -50,6 +54,9 @@
<tool file="fasta_tools/fasta_concatenate_by_species.xml" />
<tool file="fasta_tools/fasta_to_tabular.xml" />
<tool file="fasta_tools/tabular_to_fasta.xml" />
+ <tool file="fastx_toolkit/fasta_formatter.xml" />
+ <tool file="fastx_toolkit/fasta_nucleotide_changer.xml" />
+ <tool file="fastx_toolkit/fastx_collapser.xml" />
</section>
<section name="Filter and Sort" id="filter">
<tool file="stats/filtering.xml" />
@@ -80,9 +87,7 @@
<tool file="maf/maf_limit_size.xml"/>
<tool file="maf/maf_by_block_number.xml"/>
<tool file="maf/maf_filter.xml"/>
- <!--
<tool file="maf/maf_reverse_complement.xml"/>
- -->
</section>
<section name="Get Genomic Scores" id="scores">
<tool file="stats/wiggle_to_simple.xml" />
@@ -90,7 +95,7 @@
<tool file="extract/phastOdds/phastOdds_tool.xml" />
</section>
<section name="Operate on Genomic Intervals" id="bxops">
- <tool file="new_operations/intersect.xml" />
+ <tool file="new_operations/intersect.xml" />
<tool file="new_operations/subtract.xml" />
<tool file="new_operations/merge.xml" />
<tool file="new_operations/concat.xml" />
@@ -147,12 +152,6 @@
<tool file="taxonomy/lca.xml" />
<tool file="taxonomy/poisson2test.xml" />
</section>
- <section name="Short Read Analysis" id="short_read_analysis">
- <tool file="metag_tools/short_reads_figure_score.xml" />
- <tool file="metag_tools/short_reads_trim_seq.xml" />
- <tool file="metag_tools/megablast_wrapper.xml" />
- <tool file="metag_tools/megablast_xml_parser.xml" />
- </section>
<section name="EMBOSS" id="EMBOSSLite">
<tool file="emboss_5/emboss_antigenic.xml" />
<tool file="emboss_5/emboss_backtranseq.xml" />
@@ -262,4 +261,37 @@
<tool file="emboss_5/emboss_wordcount.xml" />
<tool file="emboss_5/emboss_wordmatch.xml" />
</section>
+ <label text="NGS Toolbox Beta" id="ngs" />
+ <section name="NGS: QC and manipulation" id="cshl_library_information">
+ <label text="Generic FASTQ data" id="fastq" />
+ <tool file="next_gen_conversion/fastq_gen_conv.xml" />
+ <tool file="fastx_toolkit/fastq_quality_converter.xml" />
+ <tool file="fastx_toolkit/fastx_quality_statistics.xml" />
+ <tool file="fastx_toolkit/fastq_quality_boxplot.xml" />
+ <tool file="fastx_toolkit/fastx_nucleotides_distribution.xml" />
+ <tool file="metag_tools/split_paired_reads.xml" />
+ <label text="Roche-454 data" id="454" />
+ <tool file="metag_tools/short_reads_figure_score.xml" />
+ <tool file="metag_tools/short_reads_trim_seq.xml" />
+ <label text="AB-SOLiD data" id="solid" />
+ <tool file="next_gen_conversion/solid_to_fastq.xml" />
+ <tool file="solid_tools/solid_qual_stats.xml" />
+ <tool file="solid_tools/solid_qual_boxplot.xml" />
+ </section>
+ <section name="NGS: Mapping" id="solexa_tools">
+ <tool file="sr_mapping/bowtie_wrapper.xml" />
+ <tool file="sr_mapping/bwa_wrapper.xml" />
+ <!-- <tool file="sr_mapping/lastz_wrapper.xml" /> -->
+ <tool file="metag_tools/megablast_wrapper.xml" />
+ <tool file="metag_tools/megablast_xml_parser.xml" />
+ </section>
+ <section name="NGS: SAM Tools" id="samtools">
+ <tool file="samtools/sam_bitwise_flag_filter.xml" />
+ <tool file="samtools/sam2interval.xml" />
+ <tool file="samtools/sam_to_bam.xml" />
+ <tool file="samtools/sam_merge.xml" />
+ <tool file="samtools/sam_pileup.xml" />
+ <tool file="samtools/pileup_parser.xml" />
+ <tool file="samtools/pileup_interval.xml" />
+ </section>
</toolbox>
1
0
09 Nov '09
details: http://www.bx.psu.edu/hg/galaxy/rev/1a438bb4dac2
changeset: 2994:1a438bb4dac2
user: jeremy goecks <jeremy.goecks(a)emory.edu>
date: Mon Nov 09 16:55:52 2009 -0500
description:
Make pages grid compatible with new grid framework.
diffstat:
lib/galaxy/web/controllers/page.py | 118 ++++-----------------------------------
templates/grid_base.mako | 2 +-
templates/grid_common.mako | 2 +-
3 files changed, 15 insertions(+), 107 deletions(-)
diffs (171 lines):
diff -r 50c64a663d24 -r 1a438bb4dac2 lib/galaxy/web/controllers/page.py
--- a/lib/galaxy/web/controllers/page.py Mon Nov 09 16:40:59 2009 -0500
+++ b/lib/galaxy/web/controllers/page.py Mon Nov 09 16:55:52 2009 -0500
@@ -33,9 +33,9 @@
model_class = model.Page
default_sort_key = "-create_time"
columns = [
- grids.GridColumn( "Title", key="title", attach_popup=True ),
+ grids.TextColumn( "Title", key="title", model_class=model.Page, attach_popup=True, filterable="standard" ),
PublicURLColumn( "Public URL" ),
- grids.GridColumn( "Published", key="published", format=format_bool ),
+ grids.GridColumn( "Published", key="published", format=format_bool, filterable="advanced" ),
grids.GridColumn( "Created", key="create_time", format=time_ago ),
grids.GridColumn( "Last Updated", key="update_time", format=time_ago ),
]
@@ -68,120 +68,28 @@
]
def apply_default_filter( self, trans, query, **kwargs ):
return query.filter_by( deleted=False, published=True )
-
-# Custom column types
-class NameColumn( grids.GridColumn ):
- def __init( self, key, link, attach_popup, filterable ):
- grids.GridColumn.__init__(self, key, link, attach_popup)
- def get_value( self, trans, grid, history ):
+
+class NameColumn( grids.TextColumn ):
+ def get_value(self, trans, grid, history):
return history.get_display_name()
-
- def filter( self, db_session, query, column_filter ):
- """ Modify query to filter histories by name. """
- if column_filter == "All":
- pass
- elif column_filter:
- query = query.filter( func.lower( History.name ).like( "%" + column_filter.lower() + "%" ) )
- return query
- def get_accepted_filters( self ):
- """ Returns a list of accepted filters for this column. """
- accepted_filter_labels_and_vals = odict()
- accepted_filter_labels_and_vals["FREETEXT"] = "FREETEXT"
- accepted_filters = []
- for label, val in accepted_filter_labels_and_vals.iteritems():
- args = { self.key: val }
- accepted_filters.append( grids.GridColumnFilter( label, args) )
- return accepted_filters
-
-class TagsColumn( grids.GridColumn ):
- def __init__( self, col_name, key, filterable ):
- grids.GridColumn.__init__(self, col_name, key=key, filterable=filterable)
- # Tags cannot be sorted.
- self.sortable = False
- self.tag_elt_id_gen = 0
- def get_value( self, trans, grid, history ):
- self.tag_elt_id_gen += 1
- elt_id="tagging-elt" + str( self.tag_elt_id_gen )
- div_elt = "<div id=%s></div>" % elt_id
- return div_elt + trans.fill_template( "/tagging_common.mako", trans=trans, tagged_item=history,
- elt_id = elt_id, in_form="true", input_size="20", tag_click_fn="add_tag_to_grid_filter" )
- def filter( self, db_session, query, column_filter ):
- """ Modify query to filter histories by tag. """
- if column_filter == "All":
- pass
- elif column_filter:
- # Parse filter to extract multiple tags.
- tag_handler = TagHandler()
- raw_tags = tag_handler.parse_tags( column_filter.encode("utf-8") )
- for name, value in raw_tags.items():
- if name:
- # Search for tag names.
- query = query.filter( History.tags.any( func.lower( model.HistoryTagAssociation.user_tname ).like( "%" + name.lower() + "%" ) ) )
- if value:
- # Search for tag values.
- query = query.filter( History.tags.any( func.lower( model.HistoryTagAssociation.user_value ).like( "%" + value.lower() + "%" ) ) )
- return query
- def get_accepted_filters( self ):
- """ Returns a list of accepted filters for this column. """
- accepted_filter_labels_and_vals = odict()
- accepted_filter_labels_and_vals["FREETEXT"] = "FREETEXT"
- accepted_filters = []
- for label, val in accepted_filter_labels_and_vals.iteritems():
- args = { self.key: val }
- accepted_filters.append( grids.GridColumnFilter( label, args) )
- return accepted_filters
-
-class FreeTextSearchColumn( grids.GridColumn ):
- def filter( self, db_session, query, column_filter ):
- """ Modify query to search tags and history names. """
- if column_filter == "All":
- pass
- elif column_filter:
- # Build tags filter.
- tag_handler = TagHandler()
- raw_tags = tag_handler.parse_tags( column_filter.encode("utf-8") )
- tags_filter = None
- for name, value in raw_tags.items():
- if name:
- # Search for tag names.
- tags_filter = History.tags.any( func.lower( model.HistoryTagAssociation.user_tname ).like( "%" + name.lower() + "%" ) )
- if value:
- # Search for tag values.
- tags_filter = and_( tags_filter, func.lower( History.tags.any( model.HistoryTagAssociation.user_value ).like( "%" + value.lower() + "%" ) ) )
-
- # Build history name filter.
- history_name_filter = func.lower( History.name ).like( "%" + column_filter.lower() + "%" )
-
- # Apply filters to query.
- if tags_filter:
- query = query.filter( or_( tags_filter, history_name_filter ) )
- else:
- query = query.filter( history_name_filter )
- return query
- def get_accepted_filters( self ):
- """ Returns a list of accepted filters for this column. """
- accepted_filter_labels_and_vals = odict()
- accepted_filter_labels_and_vals["FREETEXT"] = "FREETEXT"
- accepted_filters = []
- for label, val in accepted_filter_labels_and_vals.iteritems():
- args = { self.key: val }
- accepted_filters.append( grids.GridColumnFilter( label, args) )
- return accepted_filters
class HistorySelectionGrid( grids.Grid ):
# Grid definition.
- template='/page/history_selection_grid.mako'
title = "Saved Histories"
model_class = model.History
default_sort_key = "-update_time"
columns = [
- NameColumn( "Name", key="name", filterable=True ),
- TagsColumn( "Tags", key="tags", filterable=True),
+ NameColumn( "Name", key="name", model_class=model.History, filterable="advanced" ),
+ grids.TagsColumn( "Tags", "tags", model.History, model.HistoryTagAssociation, filterable="advanced"),
grids.GridColumn( "Last Updated", key="update_time", format=time_ago ),
- # Columns that are valid for filtering but are not visible.
- FreeTextSearchColumn( "Search", key="free-text-search", visible=False ) # Not filterable because it's the default search.
]
+ columns.append(
+ grids.MulticolFilterColumn(
+ "Search",
+ cols_to_filter=[ columns[0], columns[1] ],
+ key="free-text-search", visible=False, filterable="standard" )
+ )
class PageController( BaseController ):
diff -r 50c64a663d24 -r 1a438bb4dac2 templates/grid_base.mako
--- a/templates/grid_base.mako Mon Nov 09 16:40:59 2009 -0500
+++ b/templates/grid_base.mako Mon Nov 09 16:55:52 2009 -0500
@@ -286,7 +286,7 @@
if operation.target:
target = "target='" + operation.target + "'"
%>
- <a class="action-button" ${target} href="${url( operation=operation.label, id=item.id )}">${operation.label}</a>
+ <a class="action-button" ${target} href="${ url( **operation.get_url_args( item ) ) }">${operation.label}</a>
%endif
%endfor
</div>
diff -r 50c64a663d24 -r 1a438bb4dac2 templates/grid_common.mako
--- a/templates/grid_common.mako Mon Nov 09 16:40:59 2009 -0500
+++ b/templates/grid_common.mako Mon Nov 09 16:55:52 2009 -0500
@@ -60,7 +60,7 @@
%if i > 0:
<span>|</span>
%endif
- %if cur_filter_dict[column.key] == filter.args[column.key]:
+ %if column.key in cur_filter_dict and column.key in filter.args and cur_filter_dict[column.key] == filter.args[column.key]:
<span class="filter" style="font-style: italic">${filter.label}</span>
%else:
<span class="filter"><a href="${url( filter.get_url_args() )}">${filter.label}</a></span>
1
0
09 Nov '09
details: http://www.bx.psu.edu/hg/galaxy/rev/a2dee187b2b6
changeset: 2990:a2dee187b2b6
user: rc
date: Mon Nov 09 16:15:52 2009 -0500
description:
Fixed a checkbox bug in request & user_info
Resolved bitbucket issue 221: now there is a reject option for an admin to move a request to an unsubmitted state
diffstat:
lib/galaxy/model/__init__.py | 6 +-
lib/galaxy/web/controllers/admin.py | 3 +-
lib/galaxy/web/controllers/requests.py | 6 +-
lib/galaxy/web/controllers/requests_admin.py | 32 ++++++++++-
lib/galaxy/web/controllers/user.py | 42 +++++++++++---
lib/galaxy/web/form_builder.py | 8 ++
templates/admin/requests/show_request.mako | 13 +++-
templates/requests/show_request.mako | 2 +-
templates/user/address.mako | 80 --------------------------
templates/user/info.mako | 46 ++++++++------
test/base/twilltestcase.py | 4 +
test/functional/test_forms_and_requests.py | 12 ++++
test/functional/test_user_info.py | 29 ++++++---
13 files changed, 154 insertions(+), 129 deletions(-)
diffs (579 lines):
diff -r 1612a5f4ed62 -r a2dee187b2b6 lib/galaxy/model/__init__.py
--- a/lib/galaxy/model/__init__.py Mon Nov 09 15:50:12 2009 -0500
+++ b/lib/galaxy/model/__init__.py Mon Nov 09 16:15:52 2009 -0500
@@ -1170,7 +1170,7 @@
else:
field_widget.add_option( option, option )
elif field[ 'type' ] == 'CheckboxField':
- field_widget.checked = value
+ field_widget.set_checked( value )
if field[ 'required' ] == 'required':
req = 'Required'
else:
@@ -1231,7 +1231,9 @@
self.values = form_values
self.bar_code = bar_code
def current_state(self):
- return self.events[0].state
+ if self.events:
+ return self.events[0].state
+ return None
class SampleState( object ):
def __init__(self, name=None, desc=None, request_type=None):
diff -r 1612a5f4ed62 -r a2dee187b2b6 lib/galaxy/web/controllers/admin.py
--- a/lib/galaxy/web/controllers/admin.py Mon Nov 09 15:50:12 2009 -0500
+++ b/lib/galaxy/web/controllers/admin.py Mon Nov 09 16:15:52 2009 -0500
@@ -760,7 +760,6 @@
information, public username, reset password & other user information
obtained during registration
'''
- print 'KWD', kwd
user_id = kwd.get( 'id', None )
if not user_id:
message += "Invalid user id (%s) received" % str( user_id )
@@ -772,7 +771,7 @@
return trans.response.send_redirect( web.url_for( controller='user',
action='show_info',
user_id=user.id,
- admin_view=True ) )
+ admin_view=True, **kwd ) )
@web.expose
@web.require_admin
def user( self, trans, **kwd ):
diff -r 1612a5f4ed62 -r a2dee187b2b6 lib/galaxy/web/controllers/requests.py
--- a/lib/galaxy/web/controllers/requests.py Mon Nov 09 15:50:12 2009 -0500
+++ b/lib/galaxy/web/controllers/requests.py Mon Nov 09 16:15:52 2009 -0500
@@ -85,7 +85,7 @@
return self.__show_request(trans, id, kwargs.get('add_sample', False))
elif operation == "submit":
id = trans.security.decode_id(kwargs['id'])
- return self.__submit(trans, id)
+ return self.__submit_request(trans, id)
elif operation == "delete":
id = trans.security.decode_id(kwargs['id'])
return self.__delete_request(trans, id)
@@ -642,6 +642,8 @@
values.append('')
else:
values.append(int(value))
+ elif field['type'] == 'CheckboxField':
+ values.append(CheckboxField.is_checked( params.get('field_%i' % index, '') ))
else:
values.append(util.restore_text(params.get('field_%i' % index, '')))
form_values = trans.app.model.FormValues(request_type.request_form, values)
@@ -799,7 +801,7 @@
status='done',
message='The request <b>%s</b> has been undeleted.' % request.name,
**kwd) )
- def __submit(self, trans, id):
+ def __submit_request(self, trans, id):
try:
request = trans.sa_session.query( trans.app.model.Request ).get( id )
except:
diff -r 1612a5f4ed62 -r a2dee187b2b6 lib/galaxy/web/controllers/requests_admin.py
--- a/lib/galaxy/web/controllers/requests_admin.py Mon Nov 09 15:50:12 2009 -0500
+++ b/lib/galaxy/web/controllers/requests_admin.py Mon Nov 09 16:15:52 2009 -0500
@@ -37,6 +37,7 @@
operations = [
grids.GridOperation( "Submit", allow_multiple=False, condition=( lambda item: not item.deleted and item.unsubmitted() and item.samples ) ),
grids.GridOperation( "Edit", allow_multiple=False, condition=( lambda item: not item.deleted ) ),
+ grids.GridOperation( "Reject", allow_multiple=False, condition=( lambda item: not item.deleted and item.submitted() ) ),
grids.GridOperation( "Delete", allow_multiple=False, condition=( lambda item: not item.deleted and item.unsubmitted() ) ),
grids.GridOperation( "Undelete", condition=( lambda item: item.deleted ) ),
]
@@ -94,7 +95,7 @@
return self.__show_request(trans, id, status, message)
elif operation == "submit":
id = trans.security.decode_id(kwargs['id'])
- return self.__submit(trans, id)
+ return self.__submit_request(trans, id)
elif operation == "edit":
id = trans.security.decode_id(kwargs['id'])
return self.__edit_request(trans, id)
@@ -104,6 +105,9 @@
elif operation == "undelete":
id = trans.security.decode_id(kwargs['id'])
return self.__undelete_request(trans, id)
+ elif operation == "reject":
+ id = trans.security.decode_id(kwargs['id'])
+ return self.__reject_request(trans, id)
if 'show_filter' in kwargs.keys():
if kwargs['show_filter'] == 'All':
self.request_grid.default_filter = {}
@@ -226,7 +230,7 @@
status='done',
message='The request <b>%s</b> has been undeleted.' % request.name,
**kwd) )
- def __submit(self, trans, id):
+ def __submit_request(self, trans, id):
try:
request = trans.sa_session.query( trans.app.model.Request ).get( id )
except:
@@ -582,6 +586,8 @@
values.append('')
else:
values.append(int(value))
+ elif field['type'] == 'CheckboxField':
+ values.append(CheckboxField.is_checked( params.get('field_%i' % index, '') ))
else:
values.append(util.restore_text(params.get('field_%i' % index, '')))
form_values = trans.app.model.FormValues(request_type.request_form, values)
@@ -690,6 +696,28 @@
action='list',
show_filter=trans.app.model.Request.states.SUBMITTED,
**kwd) )
+ def __reject_request(self, trans, id):
+ try:
+ request = trans.sa_session.query( trans.app.model.Request ).get( id )
+ except:
+ msg = "Invalid request ID"
+ log.warn( msg )
+ return trans.response.send_redirect( web.url_for( controller='requests_admin',
+ action='list',
+ status='error',
+ message=msg,
+ **kwd) )
+ # change request's submitted field
+ request.state = request.states.UNSUBMITTED
+ request.flush()
+ kwd = {}
+ kwd['id'] = trans.security.encode_id(request.id)
+ kwd['status'] = 'done'
+ kwd['message'] = 'The request <b>%s</b> is now unsubmitted.' % request.name
+ return trans.response.send_redirect( web.url_for( controller='requests_admin',
+ action='list',
+ show_filter=trans.app.model.Request.states.UNSUBMITTED,
+ **kwd) )
def __update_samples(self, request, **kwd):
'''
This method retrieves all the user entered sample information and
diff -r 1612a5f4ed62 -r a2dee187b2b6 lib/galaxy/web/controllers/user.py
--- a/lib/galaxy/web/controllers/user.py Mon Nov 09 15:50:12 2009 -0500
+++ b/lib/galaxy/web/controllers/user.py Mon Nov 09 16:15:52 2009 -0500
@@ -168,7 +168,7 @@
username = util.restore_text( params.get('username', '') )
password = util.restore_text( params.get('password', '') )
confirm = util.restore_text( params.get('confirm', '') )
- subscribe = params.get('subscribe', False)
+ subscribe = CheckboxField.is_checked( params.get('subscribe', '') )
admin_view = params.get('admin_view', 'False')
msg = util.restore_text( params.get( 'msg', '' ) )
messagetype = params.get( 'messagetype', 'done' )
@@ -241,10 +241,10 @@
# get all the user information forms
user_info_forms = get_all_forms( trans, filter=dict(deleted=False),
form_type=trans.app.model.FormDefinition.types.USER_INFO )
- # if there are no user forms available then there is nothing to save
- if not len( user_info_forms ):
- return
if new_user:
+ # if there are no user forms available then there is nothing to save
+ if not len( user_info_forms ):
+ return
user_info_type = params.get( 'user_info_select', 'none' )
try:
user_info_form = trans.sa_session.query( trans.app.model.FormDefinition ).get(int(user_info_type))
@@ -254,7 +254,25 @@
msg='Invalid user information form id',
messagetype='error') )
else:
- user_info_form = user.values.form_definition
+ if user.values:
+ user_info_form = user.values.form_definition
+ else:
+ # user was created before any of the user_info forms were created
+ if len(user_info_forms) > 1:
+ # when there are multiple user_info forms and the user or admin
+ # can change the user_info form
+ user_info_type = params.get( 'user_info_select', 'none' )
+ try:
+ user_info_form = trans.sa_session.query( trans.app.model.FormDefinition ).get(int(user_info_type))
+ except:
+ return trans.response.send_redirect( web.url_for( controller='user',
+ action=action,
+ msg='Invalid user information form id',
+ messagetype='error') )
+ else:
+ # when there is only one user_info form then there is no way
+ # to change the user_info form
+ user_info_form = user_info_forms[0]
values = []
for index, field in enumerate(user_info_form.fields):
if field['type'] == 'AddressField':
@@ -278,13 +296,17 @@
values.append('')
else:
values.append(int(value))
+ elif field['type'] == 'CheckboxField':
+ values.append(CheckboxField.is_checked( params.get('field_%i' % index, '') ))
else:
values.append(util.restore_text(params.get('field_%i' % index, '')))
- if new_user:
+ if new_user or not user.values:
+ # new user or existing
form_values = trans.app.model.FormValues(user_info_form, values)
form_values.flush()
user.values = form_values
- else: # editing the user info of an existing user
+ elif user.values:
+ # editing the user info of an existing user with existing user info
user.values.content = values
user.values.flush()
user.flush()
@@ -340,7 +362,7 @@
if user.values:
selected_user_form_id = user.values.form_definition.id
else:
- selected_user_form_id = 'none'
+ selected_user_form_id = params.get( 'user_info_select', 'none' )
else:
selected_user_form_id = params.get( 'user_info_select', 'none' )
# when there are more than one user information forms then show a select box
@@ -428,10 +450,12 @@
addresses = [address for address in user.addresses if address.deleted]
else:
addresses = [address for address in user.addresses if not address.deleted]
+ user_info_forms = get_all_forms( trans, filter=dict(deleted=False),
+ form_type=trans.app.model.FormDefinition.types.USER_INFO )
return trans.fill_template( '/user/info.mako', user=user, admin_view=admin_view,
user_info_select=user_info_select,
user_info_form=user_info_form, widgets=widgets,
- login_info=login_info,
+ login_info=login_info, user_info_forms=user_info_forms,
addresses=addresses, show_filter=show_filter,
msg=msg, messagetype=messagetype)
@web.expose
diff -r 1612a5f4ed62 -r a2dee187b2b6 lib/galaxy/web/form_builder.py
--- a/lib/galaxy/web/form_builder.py Mon Nov 09 15:50:12 2009 -0500
+++ b/lib/galaxy/web/form_builder.py Mon Nov 09 16:15:52 2009 -0500
@@ -118,6 +118,14 @@
return True
else:
return False
+ def set_checked(self, value):
+ if type(value) == type('a'):
+ if value.lower() in [ "yes", "true", "on" ]:
+ self.checked = True
+ else:
+ self.checked = False
+ else:
+ self.checked = value
class FileField(BaseField):
"""
diff -r 1612a5f4ed62 -r a2dee187b2b6 templates/admin/requests/show_request.mako
--- a/templates/admin/requests/show_request.mako Mon Nov 09 15:50:12 2009 -0500
+++ b/templates/admin/requests/show_request.mako Mon Nov 09 16:15:52 2009 -0500
@@ -14,16 +14,23 @@
<ul class="manage-table-actions">
%if request.unsubmitted() and request.samples:
<li>
- <a class="action-button" confirm="More samples cannot be added to this request once it is submitted. Click OK to submit." href="${h.url_for( controller='requests_admin', action='submit_request', id=request.id)}">
+ <a class="action-button" confirm="More samples cannot be added to this request once it is submitted. Click OK to submit." href="${h.url_for( controller='requests_admin', action='list', operation='Submit', id=trans.security.encode_id(request.id) )}">
<span>Submit request</span></a>
</li>
%endif
+ %if request.submitted():
+ <li>
+ <a class="action-button" href="${h.url_for( controller='requests_admin', action='list', operation='Reject', id=trans.security.encode_id(request.id))}">
+ <span>Reject request</span></a>
+ </li>
+ %endif
%if request.submitted() and request.samples:
<li>
<a class="action-button" href="${h.url_for( controller='requests_admin', action='bar_codes', request_id=request.id)}">
<span>Bar codes</span></a>
</li>
%endif
+
</ul>
@@ -76,7 +83,9 @@
<td>
%if sample.request.unsubmitted():
Unsubmitted
- %else:
+ %elif not sample.current_state():
+ New
+ %else:
<a href="${h.url_for( controller='requests_admin', action='show_events', sample_id=sample.id)}">${sample.current_state().name}</a>
%endif
</td>
diff -r 1612a5f4ed62 -r a2dee187b2b6 templates/requests/show_request.mako
--- a/templates/requests/show_request.mako Mon Nov 09 15:50:12 2009 -0500
+++ b/templates/requests/show_request.mako Mon Nov 09 16:15:52 2009 -0500
@@ -14,7 +14,7 @@
<ul class="manage-table-actions">
%if request.unsubmitted() and request.samples:
<li>
- <a class="action-button" confirm="More samples cannot be added to this request once it is submitted. Click OK to submit." href="${h.url_for( controller='requests', action='submit_request', id=request.id)}">
+ <a class="action-button" confirm="More samples cannot be added to this request once it is submitted. Click OK to submit." href="${h.url_for( controller='requests', action='list', operation='Submit', id=trans.security.encode_id(request.id) )}">
<span>Submit request</span></a>
</li>
%endif
diff -r 1612a5f4ed62 -r a2dee187b2b6 templates/user/address.mako
--- a/templates/user/address.mako Mon Nov 09 15:50:12 2009 -0500
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,80 +0,0 @@
-<%inherit file="/base.mako"/>
-<%namespace file="/message.mako" import="render_msg" />
-
-
-%if msg:
- ${render_msg( msg, messagetype )}
-%endif
-
-<h2>Manage Addresses</h2>
-<ul class="manage-table-actions">
- <li>
- <a class="action-button" href="${h.url_for( controller='user', action='new_address')}">
- <span>Add a new address</span></a>
- <a class="action-button" href="${h.url_for( controller='user', action='index')}">
- <span>User preferences</span></a>
- </li>
-</ul>
-%if not trans.user.addresses:
- There are no addresses
-%else:
-<div class="grid-header">
- ##<span class="title">Filter:</span>
- %for i, filter in enumerate( ['Active', 'Deleted', 'All'] ):
- %if i > 0:
- <span>|</span>
- %endif
- %if show_filter == filter:
- <span class="filter"><a href="${h.url_for( controller='user', action='manage_addresses', show_filter=filter )}"><b>${filter}</b></a></span>
- %else:
- <span class="filter"><a href="${h.url_for( controller='user', action='manage_addresses', show_filter=filter )}">${filter}</a></span>
- %endif
- %endfor
-</div>
-
-
-%if not addresses:
- <label>There are no addresses</label>
-%else:
- <div class="toolForm">
- <div class="toolFormBody">
- <% trans.sa_session.refresh( trans.user ) %>
- <table class="grid">
- <tbody>
- %for index, address in enumerate(addresses):
- <tr class="libraryRow libraryOrFolderRow" id="libraryRow">
- <td>
- <div class="form-row">
- <label>${address.desc}</label>
- ${address.get_html()}
- </div>
- <div class="form-row">
- <ul class="manage-table-actions">
- <li>
- %if not address.deleted:
- <a class="action-button" href="${h.url_for( controller='user', action='edit_address', address_id=address.id,
- short_desc=address.desc,
- name=address.name, institution=address.institution,
- address1=address.address, city=address.city,
- state=address.state, postal_code=address.postal_code,
- country=address.country, phone=address.phone)}">
- <span>Edit</span></a>
- <a class="action-button" href="${h.url_for( controller='user', action='delete_address', address_id=address.id)}">
- <span>Delete</span></a>
- %else:
- <a class="action-button" href="${h.url_for( controller='user', action='undelete_address', address_id=address.id)}">
- <span>Undelete</span></a>
- %endif
-
- </li>
- </ul>
- </div>
- </td>
- </tr>
- %endfor
- </tbody>
- </table>
- %endif
- </div>
- </div>
-%endif
\ No newline at end of file
diff -r 1612a5f4ed62 -r a2dee187b2b6 templates/user/info.mako
--- a/templates/user/info.mako Mon Nov 09 15:50:12 2009 -0500
+++ b/templates/user/info.mako Mon Nov 09 16:15:52 2009 -0500
@@ -76,28 +76,34 @@
<input type="submit" name="change_password_button" value="Save">
</div>
</form>
- %if user.values:
- <form name="user_info" id="user_info" action="${h.url_for( controller='user', action='edit_info', user_id=user.id, admin_view=admin_view )}" method="post" >
- <div class="toolFormTitle">User information</div>
- %if user_info_form:
- %for field in widgets:
- <div class="form-row">
- <label>${field['label']}</label>
- ${field['widget'].get_html()}
- <div class="toolParamHelp" style="clear: both;">
- ${field['helptext']}
- </div>
- <div style="clear: both"></div>
- </div>
- %endfor
- %if not user_info_select:
- <input type="hidden" name="user_info_select" value="${user_info_form.id}"/>
- %endif
- %endif
+ %if user.values or user_info_forms:
+ <form name="user_info" id="user_info" action="${h.url_for( controller='user', action='edit_info', user_id=user.id, admin_view=admin_view )}" method="post" >
+ <div class="toolFormTitle">User information</div>
+ %if user_info_select:
<div class="form-row">
- <input type="submit" name="edit_user_info_button" value="Save">
+ <label>User type</label>
+ ${user_info_select.get_html()}
</div>
- </form>
+ %endif
+
+ %for field in widgets:
+ <div class="form-row">
+ <label>${field['label']}</label>
+ ${field['widget'].get_html()}
+ <div class="toolParamHelp" style="clear: both;">
+ ${field['helptext']}
+ </div>
+ <div style="clear: both"></div>
+ </div>
+ %endfor
+ %if not user_info_select:
+ <input type="hidden" name="user_info_select" value="${user_info_form.id}"/>
+ %endif
+
+ <div class="form-row">
+ <input type="submit" name="edit_user_info_button" value="Save">
+ </div>
+ </form>
%endif
<form name="user_info" id="user_info" action="${h.url_for( controller='user', action='new_address', user_id=user.id, admin_view=admin_view )}" method="post" >
<div class="toolFormTitle">User Addresses</div>
diff -r 1612a5f4ed62 -r a2dee187b2b6 test/base/twilltestcase.py
--- a/test/base/twilltestcase.py Mon Nov 09 15:50:12 2009 -0500
+++ b/test/base/twilltestcase.py Mon Nov 09 16:15:52 2009 -0500
@@ -1265,6 +1265,10 @@
self.home()
self.visit_url( "%s/requests/submit_request?id=%i" % ( self.url, request_id ))
self.check_page_for_string( 'The request <b>%s</b> has been submitted.' % request_name )
+ def reject_request( self, request_id, request_name ):
+ self.home()
+ self.visit_url( "%s/requests_admin/list?operation=Reject&id=%s" % ( self.url, self.security.encode_id( request_id ) ))
+ self.check_page_for_string( 'The request <b>%s</b> is now unsubmitted.' % request_name )
def add_bar_codes( self, request_id, request_name, bar_codes ):
self.home()
self.visit_url( "%s/requests_admin/bar_codes?request_id=%i" % (self.url, request_id) )
diff -r 1612a5f4ed62 -r a2dee187b2b6 test/functional/test_forms_and_requests.py
--- a/test/functional/test_forms_and_requests.py Mon Nov 09 15:50:12 2009 -0500
+++ b/test/functional/test_forms_and_requests.py Mon Nov 09 16:15:52 2009 -0500
@@ -288,3 +288,15 @@
self.visit_url( '%s/requests_admin/list?show_filter=All' % self.url )
self.check_page_for_string( request_one.name )
self.check_page_for_string( request_two.name )
+ def test_45_reject_request( self ):
+ self.logout()
+ self.login( email='test(a)bx.psu.edu' )
+ self.reject_request( request_two.id, request_two.name )
+ sa_session.refresh( request_two )
+ # check if the request is showing in the 'unsubmitted' filter
+ self.home()
+ self.visit_url( '%s/requests_admin/list?show_filter=Unsubmitted' % self.url )
+ self.check_page_for_string( request_two.name )
+ # check if the request's state is now set to 'submitted'
+ assert request_two.state is not request_two.states.UNSUBMITTED, "The state of the request '%s' should be set to '%s'" \
+ % ( request_two.name, request_two.states.UNSUBMITTED )
diff -r 1612a5f4ed62 -r a2dee187b2b6 test/functional/test_user_info.py
--- a/test/functional/test_user_info.py Mon Nov 09 15:50:12 2009 -0500
+++ b/test/functional/test_user_info.py Mon Nov 09 16:15:52 2009 -0500
@@ -43,6 +43,10 @@
dict(name='Name of Organization',
desc='',
type='TextField',
+ required='optional'),
+ dict(name='Contact for feedback',
+ desc='',
+ type='CheckboxField',
required='optional')]
form_one = get_latest_form(form_one_name)
self.form_add_field(form_one.id, form_one.name, form_one.desc, form_one.type, field_index=len(form_one.fields), fields=fields)
@@ -65,6 +69,10 @@
dict(name='Name of Organization',
desc='',
type='TextField',
+ required='optional'),
+ dict(name='Contact for feedback',
+ desc='',
+ type='CheckboxField',
required='optional')]
form_two = get_latest_form(form_two_name)
self.form_add_field(form_two.id, form_two.name, form_two.desc, form_two.type, field_index=len(form_one.fields), fields=fields)
@@ -75,7 +83,7 @@
self.logout()
# user a new user with 'Student' user info form
form_one = get_latest_form(form_one_name)
- user_info_values=['Educational', 'Penn State']
+ user_info_values=['Educational', 'Penn State', True]
self.create_user_with_info( 'test11(a)bx.psu.edu', 'testuser', 'test11',
user_info_forms='multiple',
user_info_form_id=form_one.id,
@@ -83,8 +91,9 @@
self.home()
self.visit_page( "user/show_info" )
self.check_page_for_string( "Manage User Information" )
- for value in user_info_values:
- self.check_page_for_string( value )
+ self.check_page_for_string( user_info_values[0] )
+ self.check_page_for_string( user_info_values[1] )
+ self.check_page_for_string( '<input type="checkbox" name="field_2" value="true" checked>' )
def test_010_user_reqistration_single_user_info_forms( self ):
''' Testing user registration with a single user info form '''
# lets delete the 'Researcher' user info form
@@ -98,7 +107,7 @@
self.logout()
# user a new user with 'Student' user info form
form_one = get_latest_form(form_one_name)
- user_info_values=['Educational', 'Penn State']
+ user_info_values=['Educational', 'Penn State', True]
self.create_user_with_info( 'test12(a)bx.psu.edu', 'testuser', 'test12',
user_info_forms='single',
user_info_form_id=form_one.id,
@@ -106,8 +115,9 @@
self.home()
self.visit_page( "user/show_info" )
self.check_page_for_string( "Manage User Information" )
- for value in user_info_values:
- self.check_page_for_string( value )
+ self.check_page_for_string( user_info_values[0] )
+ self.check_page_for_string( user_info_values[1] )
+ self.check_page_for_string( '<input type="checkbox" name="field_2" value="true" checked>' )
def test_015_edit_user_info( self ):
"""Testing editing user info as a regular user"""
self.logout()
@@ -122,7 +132,7 @@
self.logout()
self.login( 'test(a)bx.psu.edu' )
form_one = get_latest_form(form_one_name)
- user_info_values=['Educational', 'Penn State']
+ user_info_values=['Educational', 'Penn State', True]
self.create_user_with_info( 'test13(a)bx.psu.edu', 'testuser', 'test13',
user_info_forms='single',
user_info_form_id=form_one.id,
@@ -136,8 +146,9 @@
self.visit_page( page )
self.check_page_for_string( 'Manage User Information' )
self.check_page_for_string( 'test13(a)bx.psu.edu' )
- for value in user_info_values:
- self.check_page_for_string( value )
+ self.check_page_for_string( user_info_values[0] )
+ self.check_page_for_string( user_info_values[1] )
+ self.check_page_for_string( '<input type="checkbox" name="field_2" value="true" checked>' )
# lets delete the 'Student' user info form
self.login( 'test(a)bx.psu.edu' )
form_one_latest = get_latest_form(form_one_name)
1
0
details: http://www.bx.psu.edu/hg/galaxy/rev/4e1101dc2f25
changeset: 2991:4e1101dc2f25
user: Nate Coraor <nate(a)bx.psu.edu>
date: Mon Nov 09 16:18:39 2009 -0500
description:
remove unused MyghtyUtils egg
diffstat:
eggs.ini | 3 ---
1 files changed, 0 insertions(+), 3 deletions(-)
diffs (27 lines):
diff -r a2dee187b2b6 -r 4e1101dc2f25 eggs.ini
--- a/eggs.ini Mon Nov 09 16:15:52 2009 -0500
+++ b/eggs.ini Mon Nov 09 16:18:39 2009 -0500
@@ -35,7 +35,6 @@
lrucache = 0.2
;lsprof - james
Mako = 0.2.5
-MyghtyUtils = 0.52
nose = 0.11.1
NoseHTML = 0.3
Paste = 1.5.1
@@ -60,7 +59,6 @@
pysqlite = _3.5.4_static
MySQL_python = _5.0.67_static
python_lzo = _static
-flup = .dev_r2311
bx_python = _dev_r4bf1f32e6b76
GeneTrack = _dev_raa786e9fc131d998e532a1aef39d108850c9e93d
; nose = .dev_r7156749efc58
@@ -86,7 +84,6 @@
GeneTrack = http://github.com/ialbert/genetrack-central/tarball/aa786e9fc131d998e532a1a…
lrucache = http://evan.prodromou.name/lrucache/lrucache-0.2.tar.gz
Mako = http://www.makotemplates.org/downloads/Mako-0.2.5.tar.gz
-MyghtyUtils = http://cheeseshop.python.org/packages/source/M/MyghtyUtils/MyghtyUtils-0.52…
nose = http://pypi.python.org/packages/source/n/nose/nose-0.11.1.tar.gz
NoseHTML = http://bitbucket.org/james_taylor/nosehtml/get/c46a54d569ae.bz2
Paste = http://cheeseshop.python.org/packages/source/P/Paste/Paste-1.5.1.tar.gz
1
0
09 Nov '09
details: http://www.bx.psu.edu/hg/galaxy/rev/50c64a663d24
changeset: 2993:50c64a663d24
user: rc
date: Mon Nov 09 16:40:59 2009 -0500
description:
Fixed some functional tests related to the previous commit
diffstat:
test/base/twilltestcase.py | 6 +++++-
test/functional/test_forms_and_requests.py | 2 +-
2 files changed, 6 insertions(+), 2 deletions(-)
diffs (28 lines):
diff -r 8f47f31eb196 -r 50c64a663d24 test/base/twilltestcase.py
--- a/test/base/twilltestcase.py Mon Nov 09 16:29:27 2009 -0500
+++ b/test/base/twilltestcase.py Mon Nov 09 16:40:59 2009 -0500
@@ -1263,7 +1263,11 @@
self.check_page_for_string( field_value )
def submit_request( self, request_id, request_name ):
self.home()
- self.visit_url( "%s/requests/submit_request?id=%i" % ( self.url, request_id ))
+ self.visit_url( "%s/requests/list?operation=Submit&id=%s" % ( self.url, self.security.encode_id( request_id ) ))
+ self.check_page_for_string( 'The request <b>%s</b> has been submitted.' % request_name )
+ def submit_request_as_admin( self, request_id, request_name ):
+ self.home()
+ self.visit_url( "%s/requests_admin/list?operation=Submit&id=%s" % ( self.url, self.security.encode_id( request_id ) ))
self.check_page_for_string( 'The request <b>%s</b> has been submitted.' % request_name )
def reject_request( self, request_id, request_name ):
self.home()
diff -r 8f47f31eb196 -r 50c64a663d24 test/functional/test_forms_and_requests.py
--- a/test/functional/test_forms_and_requests.py Mon Nov 09 16:29:27 2009 -0500
+++ b/test/functional/test_forms_and_requests.py Mon Nov 09 16:40:59 2009 -0500
@@ -274,7 +274,7 @@
# add samples to this request
self.add_samples( request_two.id, request_two.name, samples )
# submit the request
- self.submit_request( request_two.id, request_two.name )
+ self.submit_request_as_admin( request_two.id, request_two.name )
sa_session.refresh( request_two )
# check if the request is showing in the 'submitted' filter
self.home()
1
0
details: http://www.bx.psu.edu/hg/galaxy/rev/8f47f31eb196
changeset: 2992:8f47f31eb196
user: rc
date: Mon Nov 09 16:29:27 2009 -0500
description:
code cleanup.. removed unused methods
diffstat:
lib/galaxy/web/controllers/requests.py | 39 -------------------
lib/galaxy/web/controllers/requests_admin.py | 38 -------------------
2 files changed, 0 insertions(+), 77 deletions(-)
diffs (97 lines):
diff -r 4e1101dc2f25 -r 8f47f31eb196 lib/galaxy/web/controllers/requests.py
--- a/lib/galaxy/web/controllers/requests.py Mon Nov 09 16:18:39 2009 -0500
+++ b/lib/galaxy/web/controllers/requests.py Mon Nov 09 16:29:27 2009 -0500
@@ -838,45 +838,6 @@
**kwd) )
@web.expose
@web.require_login( "create/submit sequencing requests" )
- def submit_request(self, trans, **kwd):
- params = util.Params( kwd )
- try:
- id = int(params.get('id', False))
- request = trans.sa_session.query( trans.app.model.Request ).get( id )
- except:
- msg = "Invalid request ID"
- log.warn( msg )
- return trans.response.send_redirect( web.url_for( controller='requests',
- action='list',
- status='error',
- message=msg,
- **kwd) )
- msg = self.__validate(trans, request)
- if msg:
- return trans.response.send_redirect( web.url_for( controller='requests',
- action='edit',
- messagetype = 'error',
- msg=msg,
- request_id=request.id,
- show='True') )
- # get the new state
- new_state = request.type.states[0]
- for s in request.samples:
- event = trans.app.model.SampleEvent(s, new_state, 'Samples submitted to the system')
- event.flush()
- # change request's submitted field
- request.state = request.states.SUBMITTED
- request.flush()
- kwd['id'] = trans.security.encode_id(request.id)
- kwd['status'] = 'done'
- kwd['message'] = 'The request <b>%s</b> has been submitted.' % request.name
- return trans.response.send_redirect( web.url_for( controller='requests',
- action='list',
- show_filter=trans.app.model.Request.states.SUBMITTED,
- **kwd) )
-
- @web.expose
- @web.require_login( "create/submit sequencing requests" )
def show_events(self, trans, **kwd):
params = util.Params( kwd )
try:
diff -r 4e1101dc2f25 -r 8f47f31eb196 lib/galaxy/web/controllers/requests_admin.py
--- a/lib/galaxy/web/controllers/requests_admin.py Mon Nov 09 16:18:39 2009 -0500
+++ b/lib/galaxy/web/controllers/requests_admin.py Mon Nov 09 16:29:27 2009 -0500
@@ -658,44 +658,6 @@
**new_kwd) )
elif params.get('refresh', False) == 'true':
return self.__edit_request(trans, request.id, **kwd)
- @web.expose
- @web.require_admin
- def submit_request(self, trans, **kwd):
- params = util.Params( kwd )
- try:
- id = int(params.get('id', False))
- request = trans.sa_session.query( trans.app.model.Request ).get( id )
- except:
- msg = "Invalid request ID"
- log.warn( msg )
- return trans.response.send_redirect( web.url_for( controller='requests_admin',
- action='list',
- status='error',
- message=msg,
- **kwd) )
- msg = self.__validate(trans, request)
- if msg:
- return trans.response.send_redirect( web.url_for( controller='requests_admin',
- action='edit',
- messagetype='error',
- msg=msg,
- request_id=request.id,
- show='True') )
- # get the new state
- new_state = request.type.states[0]
- for s in request.samples:
- event = trans.app.model.SampleEvent(s, new_state, 'Samples submitted to the system')
- event.flush()
- # change request's submitted field
- request.state = request.states.SUBMITTED
- request.flush()
- kwd['id'] = trans.security.encode_id(request.id)
- kwd['status'] = 'done'
- kwd['message'] = 'The request <b>%s</b> has been submitted.' % request.name
- return trans.response.send_redirect( web.url_for( controller='requests_admin',
- action='list',
- show_filter=trans.app.model.Request.states.SUBMITTED,
- **kwd) )
def __reject_request(self, trans, id):
try:
request = trans.sa_session.query( trans.app.model.Request ).get( id )
1
0
details: http://www.bx.psu.edu/hg/galaxy/rev/4576ebdab5c9
changeset: 2986:4576ebdab5c9
user: jeremy goecks <jeremy.goecks(a)emory.edu>
date: Mon Nov 09 14:49:44 2009 -0500
description:
Removing unused files.
diffstat:
templates/grid.mako | 232 ----------------------------------------------
templates/my_data.mako | 13 --
2 files changed, 0 insertions(+), 245 deletions(-)
diffs (253 lines):
diff -r cc3e5d4538db -r 4576ebdab5c9 templates/grid.mako
--- a/templates/grid.mako Mon Nov 09 14:07:16 2009 -0500
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,232 +0,0 @@
-<%!
-def inherit(context):
- if context.get('use_panels'):
- return '/base_panels.mako'
- else:
- return '/base.mako'
-%>
-<%inherit file="${inherit(context)}"/>
-
-<%def name="title()">${grid.title}</%def>
-
-%if message:
- <p>
- <div class="${message_type}message transient-message">${message}</div>
- <div style="clear: both"></div>
- </p>
-%endif
-
-<%def name="javascripts()">
- ${parent.javascripts()}
- <script type="text/javascript">
- ## TODO: generalize and move into galaxy.base.js
- $(document).ready(function() {
- $(".grid").each( function() {
- var grid = this;
- var checkboxes = $(this).find("input.grid-row-select-checkbox");
- var update = $(this).find( "span.grid-selected-count" );
- $(checkboxes).each( function() {
- $(this).change( function() {
- var n = $(checkboxes).filter("[checked]").size();
- update.text( n );
- });
- })
- });
- });
- ## Can this be moved into base.mako?
- %if refresh_frames:
- %if 'masthead' in refresh_frames:
- ## Refresh masthead == user changes (backward compatibility)
- if ( parent.user_changed ) {
- %if trans.user:
- parent.user_changed( "${trans.user.email}", ${int( app.config.is_admin_user( trans.user ) )} );
- %else:
- parent.user_changed( null, false );
- %endif
- }
- %endif
- %if 'history' in refresh_frames:
- if ( parent.frames && parent.frames.galaxy_history ) {
- parent.frames.galaxy_history.location.href="${h.url_for( controller='root', action='history')}";
- if ( parent.force_right_panel ) {
- parent.force_right_panel( 'show' );
- }
- }
- %endif
- %if 'tools' in refresh_frames:
- if ( parent.frames && parent.frames.galaxy_tools ) {
- parent.frames.galaxy_tools.location.href="${h.url_for( controller='root', action='tool_menu')}";
- if ( parent.force_left_panel ) {
- parent.force_left_panel( 'show' );
- }
- }
- %endif
- %endif
- </script>
-</%def>
-
-<%def name="stylesheets()">
- <link href="${h.url_for('/static/style/base.css')}" rel="stylesheet" type="text/css" />
- <style>
- ## Not generic to all grids -- move to base?
- .count-box {
- min-width: 1.1em;
- padding: 5px;
- border-width: 1px;
- border-style: solid;
- text-align: center;
- display: inline-block;
- }
- </style>
-</%def>
-
-<div class="grid-header">
- <h2>${grid.title}</h2>
-
- %if grid.global_actions:
- <ul class="manage-table-actions">
- %for action in grid.global_actions:
- <li>
- <a class="action-button" href="${h.url_for( **action.url_args )}">${action.label}</a>
- </li>
- %endfor
- </ul>
- %endif
-
- %if grid.standard_filters:
- <span class="title">Filter:</span>
- %for i, filter in enumerate( grid.standard_filters ):
- %if i > 0:
- <span>|</span>
- %endif
- <span class="filter"><a href="${url( filter.get_url_args() )}">${filter.label}</a></span>
- %endfor
- %endif
-</div>
-
-<form action="${url()}" method="post" >
- <table class="grid">
- <thead>
- <tr>
- %if grid.has_multiple_item_operations:
- <th></th>
- %endif
- %for column in grid.columns:
- %if column.visible:
- <%
- href = ""
- extra = ""
- if column.sortable:
- if sort_key == column.key:
- if sort_order == "asc":
- href = url( sort=( "-" + column.key ) )
- extra = "↓"
- else:
- href = url( sort=( column.key ) )
- extra = "↑"
- else:
- href = url( sort=column.key )
- %>
- <th\
- %if column.ncells > 1:
- colspan="${column.ncells}"
- %endif
- >
- %if href:
- <a href="${href}">${column.label}</a>
- %else:
- ${column.label}
- %endif
- <span>${extra}</span>
- </th>
- %endif
- %endfor
- <th></th>
- </tr>
- </thead>
- <tbody>
- %for i, item in enumerate( query ):
- <tr \
- %if current_item == item:
- class="current" \
- %endif
- >
- ## Item selection column
- %if grid.has_multiple_item_operations:
- <td style="width: 1.5em;">
- <input type="checkbox" name="id" value=${trans.security.encode_id( item.id )} class="grid-row-select-checkbox" />
- </td>
- %endif
- ## Data columns
- %for column in grid.columns:
- %if column.visible:
- <%
- # Link
- link = column.get_link( trans, grid, item )
- if link:
- href = url( **link )
- else:
- href = None
- # Value (coerced to list so we can loop)
- value = column.get_value( trans, grid, item )
- if column.ncells == 1:
- value = [ value ]
- %>
- %for cellnum, v in enumerate( value ):
- <%
- # Attach popup menu?
- if column.attach_popup and cellnum == 0:
- extra = '<a id="grid-%d-popup" class="arrow" style="display: none;"><span>▼</span></a>' % i
- else:
- extra = ""
- # Button class
- if href and extra:
- cls = "menubutton split"
- elif extra:
- cls = "menubutton"
- else:
- cls = ""
- %>
- %if href:
- <td><div class="${cls}"><a class="label" href="${href}">${v|h}${extra}</a></div></td>
- %else:
- <td><div class="${cls}">${v}${extra}</div></td>
- %endif
- %endfor
- %endif
- %endfor
- ## Actions column
- <td>
- <div popupmenu="grid-${i}-popup">
- %for operation in grid.operations:
- %if operation.allowed( item ):
- <%
- target = ""
- if operation.target:
- target = "target='" + operation.target + "'"
- %>
- <a class="action-button" ${target} href="${url( **operation.get_url_args( item ) )}">${operation.label}</a>
- %endif
- %endfor
- </div>
- </td>
- </tr>
- %endfor
- </tbody>
- %if grid.has_multiple_item_operations:
- <tfoot>
- <tr>
- <td></td>
- <td colspan="100">
- For <span class="grid-selected-count"></span> selected items:
- %for operation in grid.operations:
- %if operation.allow_multiple:
- <input type="submit" name="operation" value="${operation.label}" class="action-button">
- %endif
- %endfor
- </td>
- </tr>
- </tfoot>
- %endif
- </table>
-</form>
diff -r cc3e5d4538db -r 4576ebdab5c9 templates/my_data.mako
--- a/templates/my_data.mako Mon Nov 09 14:07:16 2009 -0500
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,13 +0,0 @@
-<%inherit file="/base.mako"/>
-
-<%def name="stylesheets()">
- ${h.css( "base" )}
-</%def>
-
-<h2>Available Galaxy Data</h2>
-
-<ul>
- <li><a href='${h.url_for( controller='history', action='list' )}'>Histories</li>
- <li><a href='${h.url_for( controller='dataset', action='list' )}'>Datasets</li>
-</ul>
-
1
0
09 Nov '09
details: http://www.bx.psu.edu/hg/galaxy/rev/62adea4325d7
changeset: 2988:62adea4325d7
user: dan
date: Mon Nov 09 15:33:38 2009 -0500
description:
Fix error message displayed when setting metadata_externally.
e.g:
Exception exceptions.TypeError: TypeError('<galaxy.datatypes.metadata.MetadataTempFile object at 0x40d9a10> is not JSON serializable',) in <bound method MutableAttrInstanceState._cleanup of <sqlalchemy.orm.state.MutableAttrInstanceState object at 0x40d99d0>> ignored
diffstat:
scripts/set_metadata.py | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diffs (26 lines):
diff -r ef0b9956f7d7 -r 62adea4325d7 scripts/set_metadata.py
--- a/scripts/set_metadata.py Mon Nov 09 14:56:21 2009 -0500
+++ b/scripts/set_metadata.py Mon Nov 09 15:33:38 2009 -0500
@@ -8,6 +8,7 @@
import logging
logging.basicConfig()
+log = logging.getLogger( __name__ )
import os, sys, cPickle
assert sys.version_info[:2] >= ( 2, 4 )
@@ -24,6 +25,7 @@
galaxy.model.Job() #this looks REAL stupid, but it is REQUIRED in order for SA to insert parameters into the classes defined by the mappers --> it appears that instantiating ANY mapper'ed class would suffice here
galaxy.datatypes.metadata.DATABASE_CONNECTION_AVAILABLE = False #Let metadata know that there is no database connection, and to just assume object ids are valid
from galaxy.util import stringify_dictionary_keys
+from sqlalchemy.orm import clear_mappers
def __main__():
file_path = sys.argv.pop( 1 )
@@ -48,5 +50,6 @@
simplejson.dump( ( True, 'Metadata has been set successfully' ), open( filename_results_code, 'wb+' ) ) #setting metadata has suceeded
except Exception, e:
simplejson.dump( ( False, str( e ) ), open( filename_results_code, 'wb+' ) ) #setting metadata has failed somehow
+ clear_mappers()
__main__()
1
0
details: http://www.bx.psu.edu/hg/galaxy/rev/ef0b9956f7d7
changeset: 2987:ef0b9956f7d7
user: jeremy goecks <jeremy.goecks(a)emory.edu>
date: Mon Nov 09 14:56:21 2009 -0500
description:
Bug fix.
diffstat:
templates/grid_base.mako | 20 ++++++++++----------
1 files changed, 10 insertions(+), 10 deletions(-)
diffs (44 lines):
diff -r 4576ebdab5c9 -r ef0b9956f7d7 templates/grid_base.mako
--- a/templates/grid_base.mako Mon Nov 09 14:49:44 2009 -0500
+++ b/templates/grid_base.mako Mon Nov 09 14:56:21 2009 -0500
@@ -296,6 +296,14 @@
</tbody>
<tfoot>
## Row for navigating among pages.
+ <%
+ # Mapping between item class and plural term for item.
+ items_plural = "items"
+ if grid.model_class == History:
+ items_plural = "histories"
+ elif grid.model_class == HistoryDatasetAssociation:
+ items_plural = "datasets"
+ %>
%if num_pages > 1:
<tr>
<td></td>
@@ -328,7 +336,7 @@
</select>
## Show all link.
<% args = { "page" : "all" } %>
- <span>| <a href="${url( args )}">Show all histories on one page</a></span>
+ <span>| <a href="${url( args )}">Show all ${items_plural} on one page</a></span>
</td>
</tr>
%endif
@@ -336,15 +344,7 @@
## Grid operations.
<td></td>
<td colspan="100">
- <%
- # Mapping between item class and plural term for item.
- plural = "items"
- if grid.model_class == History:
- plural = "histories"
- elif grid.model_class == HistoryDatasetAssociation:
- plural = "datasets"
- %>
- For <span class="grid-selected-count"></span> selected ${plural}:
+ For <span class="grid-selected-count"></span> selected ${items_plural}:
%for operation in grid.operations:
%if operation.allow_multiple:
<input type="submit" name="operation" value="${operation.label}" class="action-button">
1
0