[hg] galaxy 3747: lims: workflow selectbox in the samples page f...
details: http://www.bx.psu.edu/hg/galaxy/rev/e72342f71adc changeset: 3747:e72342f71adc user: rc date: Thu May 06 10:43:13 2010 -0400 description: lims: workflow selectbox in the samples page fixed diffstat: lib/galaxy/web/controllers/requests_admin.py | 34 ++++++++++++++-------------- templates/admin/requests/show_request.mako | 11 +++++++- templates/requests/show_request.mako | 11 +++++++- 3 files changed, 35 insertions(+), 21 deletions(-) diffs (100 lines): diff -r e3d164679f80 -r e72342f71adc lib/galaxy/web/controllers/requests_admin.py --- a/lib/galaxy/web/controllers/requests_admin.py Thu May 06 10:08:57 2010 -0400 +++ b/lib/galaxy/web/controllers/requests_admin.py Thu May 06 10:43:13 2010 -0400 @@ -1773,23 +1773,23 @@ message=message, status=status) -# def __sample_datasets(self, trans, **kwd): -# samples = trans.sa_session.query( trans.app.model.Sample ).all() -# for s in samples: -# if s.dataset_files: -# newdf = [] -# for df in s.dataset_files: -# if type(s.dataset_files[0]) == type([1,2]): -# filepath = df[0] -# status = df[1] -# newdf.append(dict(filepath=filepath, -# status=status, -# name=filepath.split('/')[-1], -# error_msg='', -# size='Unknown')) -# s.dataset_files = newdf -# trans.sa_session.add( s ) -# trans.sa_session.flush() + def __sample_datasets(self, trans, **kwd): + samples = trans.sa_session.query( trans.app.model.Sample ).all() + for s in samples: + if s.dataset_files: + newdf = [] + for df in s.dataset_files: + if type(s.dataset_files[0]) == type([1,2]): + filepath = df[0] + status = df[1] + newdf.append(dict(filepath=filepath, + status=status, + name=filepath.split('/')[-1], + error_msg='', + size='Unknown')) + s.dataset_files = newdf + trans.sa_session.add( s ) + trans.sa_session.flush() # ## #### Request Type Stuff ################################################### diff -r e3d164679f80 -r e72342f71adc templates/admin/requests/show_request.mako --- a/templates/admin/requests/show_request.mako Thu May 06 10:08:57 2010 -0400 +++ b/templates/admin/requests/show_request.mako Thu May 06 10:43:13 2010 -0400 @@ -292,6 +292,11 @@ </select> %elif field['type'] == 'WorkflowField': <select name="sample_${index}_field_${field_index}"> + %if str(sample_values[field_index]) == 'none': + <option value="none" selected>Select one</option> + %else: + <option value="none">Select one</option> + %endif %for option_index, option in enumerate(request.user.stored_workflows): %if not option.deleted: %if str(option.id) == str(sample_values[field_index]): @@ -320,8 +325,10 @@ <td> %if sample_values[field_index]: %if field['type'] == 'WorkflowField': - <% workflow = trans.sa_session.query( trans.app.model.StoredWorkflow ).get( int(sample_values[field_index]) ) %> - <a href="${h.url_for( controller='workflow', action='run', id=trans.security.encode_id(workflow.id) )}">${workflow.name}</a> + %if str(sample_values[field_index]) != 'none': + <% workflow = trans.sa_session.query( trans.app.model.StoredWorkflow ).get( int(sample_values[field_index]) ) %> + <a href="${h.url_for( controller='workflow', action='run', id=trans.security.encode_id(workflow.id) )}">${workflow.name}</a> + %endif %else: ${sample_values[field_index]} %endif diff -r e3d164679f80 -r e72342f71adc templates/requests/show_request.mako --- a/templates/requests/show_request.mako Thu May 06 10:08:57 2010 -0400 +++ b/templates/requests/show_request.mako Thu May 06 10:43:13 2010 -0400 @@ -214,6 +214,11 @@ </select> %elif field['type'] == 'WorkflowField': <select name="sample_${index}_field_${field_index}"> + %if str(sample_values[field_index]) == 'none': + <option value="none" selected>Select one</option> + %else: + <option value="none">Select one</option> + %endif %for option_index, option in enumerate(request.user.stored_workflows): %if not option.deleted: %if str(option.id) == str(sample_values[field_index]): @@ -242,8 +247,10 @@ <td> %if sample_values[field_index]: %if field['type'] == 'WorkflowField': - <% workflow = trans.sa_session.query( trans.app.model.StoredWorkflow ).get( int(sample_values[field_index]) ) %> - <a href="${h.url_for( controller='workflow', action='run', id=trans.security.encode_id(workflow.id) )}">${workflow.name}</a> + %if str(sample_values[field_index]) != 'none': + <% workflow = trans.sa_session.query( trans.app.model.StoredWorkflow ).get( int(sample_values[field_index]) ) %> + <a href="${h.url_for( controller='workflow', action='run', id=trans.security.encode_id(workflow.id) )}">${workflow.name}</a> + %endif %else: ${sample_values[field_index]} %endif
participants (1)
-
Nate Coraor