[hg] galaxy 2998: Fixed a bug in the view requesttype page.
details: http://www.bx.psu.edu/hg/galaxy/rev/e2420f742a0a changeset: 2998:e2420f742a0a user: rc date: Tue Nov 10 12:35:00 2009 -0500 description: Fixed a bug in the view requesttype page. Now barcodes are visible in the request details page itself. diffstat: lib/galaxy/web/controllers/requests_admin.py | 12 ++++++------ templates/admin/requests/show_request.mako | 8 ++++---- templates/admin/requests/view_request_type.mako | 2 +- test/functional/test_forms_and_requests.py | 5 +++-- 4 files changed, 14 insertions(+), 13 deletions(-) diffs (112 lines): diff -r ee382d1c63b7 -r e2420f742a0a lib/galaxy/web/controllers/requests_admin.py --- a/lib/galaxy/web/controllers/requests_admin.py Tue Nov 10 11:20:04 2009 -0500 +++ b/lib/galaxy/web/controllers/requests_admin.py Tue Nov 10 12:35:00 2009 -0500 @@ -1034,10 +1034,11 @@ event = trans.app.model.SampleEvent(s, new_state, 'Bar code added to this sample') event.flush() return trans.response.send_redirect( web.url_for( controller='requests_admin', - action='bar_codes', - request_id=request.id, - msg='Bar codes have been saved for this request', - messagetype='done')) + action='list', + operation='show_request', + id=trans.security.encode_id(request.id), + message='Bar codes have been saved for this request', + status='done')) def __set_request_state(self, request): # check if all the samples of the current request are in the final state @@ -1183,11 +1184,10 @@ messagetype='done') ) elif params.get('view', False): rt = trans.sa_session.query( trans.app.model.RequestType ).get( int( util.restore_text( params.id ) ) ) - ss_list = trans.sa_session.query( trans.app.model.SampleState ).filter( trans.app.model.SampleState.table.c.request_type_id == rt.id ) return trans.fill_template( '/admin/requests/view_request_type.mako', request_type=rt, forms=get_all_forms( trans ), - states_list=ss_list, + states_list=rt.states, deleted=False, show_deleted=False, msg=msg, diff -r ee382d1c63b7 -r e2420f742a0a templates/admin/requests/show_request.mako --- a/templates/admin/requests/show_request.mako Tue Nov 10 11:20:04 2009 -0500 +++ b/templates/admin/requests/show_request.mako Tue Nov 10 12:35:00 2009 -0500 @@ -1,12 +1,10 @@ <%inherit file="/base.mako"/> <%namespace file="/message.mako" import="render_msg" /> - %if msg: ${render_msg( msg, messagetype )} %endif - <div class="grid-header"> <h2>Sequencing Request "${request.name}"</h2> </div> @@ -44,6 +42,8 @@ </td> <td> </td> + <td> + </td> %else: <td> ${sample_name} @@ -80,11 +80,10 @@ ${sample.name} </td> %if grid_index == 0: + <td>${sample.bar_code}</td> <td> %if sample.request.unsubmitted(): Unsubmitted - %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 @@ -150,6 +149,7 @@ <th>No.</th> <th>Sample Name</th> %if grid_index == 0: + <th>Barcode</th> <th>State</th> %endif %for index, field in fields_dict.items(): diff -r ee382d1c63b7 -r e2420f742a0a templates/admin/requests/view_request_type.mako --- a/templates/admin/requests/view_request_type.mako Tue Nov 10 11:20:04 2009 -0500 +++ b/templates/admin/requests/view_request_type.mako Tue Nov 10 12:35:00 2009 -0500 @@ -36,7 +36,7 @@ <label> Possible states </label> - %for element_count, state in enumerate(states_list.all()): + %for element_count, state in enumerate(states_list): <div class="form-row"> <label>${1+element_count}. ${state.name}</label> ${state.desc} diff -r ee382d1c63b7 -r e2420f742a0a test/functional/test_forms_and_requests.py --- a/test/functional/test_forms_and_requests.py Tue Nov 10 11:20:04 2009 -0500 +++ b/test/functional/test_forms_and_requests.py Tue Nov 10 12:35:00 2009 -0500 @@ -245,7 +245,7 @@ self.check_page_for_string( request_one.name ) assert request_one.state is not request_one.states.COMPLETE, "The state of the request '%s' should be set to '%s'" \ % ( request_one.name, request_one.states.COMPLETE ) - def test_40_admin_create_request_on_behalf_of_regular_user( self ): + def test_040_admin_create_request_on_behalf_of_regular_user( self ): """Testing creating and submitting a request as an admin on behalf of a regular user""" self.logout() self.login( email='test@bx.psu.edu' ) @@ -288,7 +288,8 @@ 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 ): + def test_045_reject_request( self ): + '''Testing rejecting a request''' self.logout() self.login( email='test@bx.psu.edu' ) self.reject_request( request_two.id, request_two.name )
participants (1)
-
Greg Von Kuster