galaxy-commits
Threads by month
- ----- 2026 -----
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 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
- 15302 discussions
commit/galaxy-central: dan: Specify the third argument for HdaImplicitMatch.
by commits-noreply@bitbucket.org 03 Dec '14
by commits-noreply@bitbucket.org 03 Dec '14
03 Dec '14
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/3808622909a6/
Changeset: 3808622909a6
Branch: next-stable
User: dan
Date: 2014-12-03 17:17:25+00:00
Summary: Specify the third argument for HdaImplicitMatch.
Affected #: 1 file
diff -r 172f91ec31ef89d0f0eaa162bab5cfdf90866c22 -r 3808622909a6bb561c46d2ff5a5675f1da589c8b lib/galaxy/tools/parameters/dataset_matcher.py
--- a/lib/galaxy/tools/parameters/dataset_matcher.py
+++ b/lib/galaxy/tools/parameters/dataset_matcher.py
@@ -53,11 +53,12 @@
return False
target_ext, converted_dataset = hda.find_conversion_destination( formats )
if target_ext:
+ original_hda = hda
if converted_dataset:
hda = converted_dataset
if check_security and not self.__can_access_dataset( hda.dataset ):
return False
- rval = HdaImplicitMatch( hda, target_ext )
+ rval = HdaImplicitMatch( hda, target_ext, original_hda )
else:
return False
if self.filter( hda ):
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0
commit/galaxy-central: martenson: Merged in martenson/galaxy-central-marten/mako_escape_requests (pull request #579)
by commits-noreply@bitbucket.org 03 Dec '14
by commits-noreply@bitbucket.org 03 Dec '14
03 Dec '14
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/172f91ec31ef/
Changeset: 172f91ec31ef
Branch: next-stable
User: martenson
Date: 2014-12-03 17:01:23+00:00
Summary: Merged in martenson/galaxy-central-marten/mako_escape_requests (pull request #579)
[next-stable] escaping of the templates in the 'requests' and 'forms' sections
Affected #: 18 files
diff -r 13d43b327511d46e836398fa09330722acccd419 -r 172f91ec31ef89d0f0eaa162bab5cfdf90866c22 templates/admin/forms/create_form.mako
--- a/templates/admin/forms/create_form.mako
+++ b/templates/admin/forms/create_form.mako
@@ -9,7 +9,7 @@
<div class="toolFormTitle">Create a new form definition</div>
%for label, input in inputs:
<div class="form-row">
- <label>${label}</label>
+ <label>${label | h}</label>
${input.get_html()}
<div style="clear: both"></div></div>
diff -r 13d43b327511d46e836398fa09330722acccd419 -r 172f91ec31ef89d0f0eaa162bab5cfdf90866c22 templates/admin/forms/edit_form_definition.mako
--- a/templates/admin/forms/edit_form_definition.mako
+++ b/templates/admin/forms/edit_form_definition.mako
@@ -96,14 +96,14 @@
<form id="edit_form_definition" name="edit_form_definition" action="${h.url_for( controller='forms', action='edit_form_definition', id=trans.security.encode_id( form_definition.current.id ) )}" method="post" ><div class="toolForm">
- <div class="toolFormTitle">Edit form definition "${form_definition.name}" (${form_definition.type})</div>
+ <div class="toolFormTitle">Edit form definition "${form_definition.name | h}" (${form_definition.type | h})</div>
%if response_redirect:
<input type="hidden" name="response_redirect" value="${response_redirect}" size="40" />
%endif
%for label, input in form_details:
<div class="form-row">
%if label != 'Type':
- <label>${label}</label>
+ <label>${label | h}</label>
%endif
<div style="float: left; width: 250px; margin-right: 10px;">
${input.get_html()}
diff -r 13d43b327511d46e836398fa09330722acccd419 -r 172f91ec31ef89d0f0eaa162bab5cfdf90866c22 templates/admin/request_type/common.mako
--- a/templates/admin/request_type/common.mako
+++ b/templates/admin/request_type/common.mako
@@ -2,7 +2,7 @@
<div class="repeat-group-item"><div class="form-row"><label>${1+element_count}. State name:</label>
- <input type="text" name="state_name_${element_count}" value="${state_name}" size="40"/>
+ <input type="text" name="state_name_${element_count}" value="${state_name | h}" size="40"/>
## Do not show remove button for the first state
%if element_count > 0:
<input type="submit" name="remove_state_button" value="Remove state ${1+element_count}"/>
@@ -10,7 +10,7 @@
</div><div class="form-row"><label>Description:</label>
- <input type="text" name="state_desc_${element_count}" value="${state_desc}" size="40"/>
+ <input type="text" name="state_desc_${element_count}" value="${state_desc | h}" size="40"/><div class="toolParamHelp" style="clear: both;">
optional
</div>
diff -r 13d43b327511d46e836398fa09330722acccd419 -r 172f91ec31ef89d0f0eaa162bab5cfdf90866c22 templates/admin/request_type/create_request_type.mako
--- a/templates/admin/request_type/create_request_type.mako
+++ b/templates/admin/request_type/create_request_type.mako
@@ -23,7 +23,7 @@
<div class="toolFormTitle">Create a new request type</div>
%for rt_info in rt_info_widgets:
<div class="form-row">
- <label>${rt_info['label']}</label>
+ <label>${rt_info['label'] | h}</label><div style="float: left; width: 250px; margin-right: 10px;">
${rt_info['widget'].get_html()}
</div>
diff -r 13d43b327511d46e836398fa09330722acccd419 -r 172f91ec31ef89d0f0eaa162bab5cfdf90866c22 templates/admin/request_type/edit_request_type.mako
--- a/templates/admin/request_type/edit_request_type.mako
+++ b/templates/admin/request_type/edit_request_type.mako
@@ -32,26 +32,26 @@
<form name="edit_request_type" action="${h.url_for( controller='request_type', action='edit_request_type', id=trans.security.encode_id( request_type.id ) )}" method="post" ><div class="toolForm">
- <div class="toolFormTitle">"Edit ${request_type.name}" request type</div>
+ <div class="toolFormTitle">"Edit ${request_type.name | h}" request type</div><div class="form-row"><label>Name:</label>
- <input type="text" name="name" value="${request_type.name}" size="40"/>
+ <input type="text" name="name" value="${request_type.name | }" size="40"/><div style="clear: both"></div></div><div class="form-row"><label>Description:</label>
- <input type="text" name="desc" value="${request_type.desc}" size="40"/>
+ <input type="text" name="desc" value="${request_type.desc | h}" size="40"/><div style="clear: both"></div></div><div class="form-row"><label>Sequencing request form definition:</label>
- <a href="${h.url_for( controller='request_type', action='view_form_definition', id=trans.security.encode_id( request_type.request_form_id ) )}">${request_type.request_form.name}</a>
+ <a href="${h.url_for( controller='request_type', action='view_form_definition', id=trans.security.encode_id( request_type.request_form_id ) )}">${request_type.request_form.name | h}</a>
## Hidden field needed by the __save_request_type() method
<input type="hidden" name="request_form_id" value="${trans.security.encode_id( request_type.request_form_id )}" size="40"/></div><div class="form-row"><label>Sample form definition:</label>
- <a href="${h.url_for( controller='request_type', action='view_form_definition', id=trans.security.encode_id( request_type.sample_form_id ) )}">${request_type.sample_form.name}</a>
+ <a href="${h.url_for( controller='request_type', action='view_form_definition', id=trans.security.encode_id( request_type.sample_form_id ) )}">${request_type.sample_form.name | h}</a>
## Hidden field needed by the __save_request_type() method
<input type="hidden" name="sample_form_id" value="${trans.security.encode_id( request_type.sample_form_id )}" size="40"/></div>
@@ -63,11 +63,11 @@
<div class="repeat-group-item"><div class="form-row"><label>${1+element_count}. State name:</label>
- <input type="text" name="state_name_${trans.security.encode_id( state.id )}" value="${state.name}" size="40"/>
+ <input type="text" name="state_name_${trans.security.encode_id( state.id )}" value="${state.name | h}" size="40"/></div><div class="form-row"><label>Description:</label>
- <input type="text" name="state_desc_${trans.security.encode_id( state.id )}" value="${state.desc}" size="40"/>
+ <input type="text" name="state_desc_${trans.security.encode_id( state.id )}" value="${state.desc | h}" size="40"/><div class="toolParamHelp" style="clear: both;">
optional
</div>
diff -r 13d43b327511d46e836398fa09330722acccd419 -r 172f91ec31ef89d0f0eaa162bab5cfdf90866c22 templates/admin/request_type/request_type_permissions.mako
--- a/templates/admin/request_type/request_type_permissions.mako
+++ b/templates/admin/request_type/request_type_permissions.mako
@@ -48,7 +48,7 @@
%endif
<div class="toolForm">
- <div class="toolFormTitle">Manage access permissions on request type "${request_type.name}"</div>
+ <div class="toolFormTitle">Manage access permissions on request type "${request_type.name | h}"</div><div class="toolFormBody"><form name="request_type_permissions" id="request_type_permissions" action="${h.url_for( controller='request_type', action='request_type_permissions', id=trans.security.encode_id( request_type.id ) )}" method="post"><div class="form-row">
@@ -65,13 +65,13 @@
in_roles.add( a.role )
out_roles = filter( lambda x: x not in in_roles, all_roles )
%>
- ${action.description}<br/><br/>
+ ${action.description | h}<br/><br/><div style="width: 100%; white-space: nowrap;"><div style="float: left; width: 50%;">
Roles associated:<br/><select name="${action_key}_in" id="${action_key}_in_select" class="in_select" style="max-width: 98%; width: 98%; height: 150px; font-size: 100%;" multiple>
%for role in in_roles:
- <option value="${role.id}">${role.name}</option>
+ <option value="${role.id}">${role.name | h}</option>
%endfor
</select><br/><div style="width: 98%; text-align: right"><input type="submit" id="${action_key}_remove_button" class="role_remove_button" value=">>"/></div>
@@ -80,7 +80,7 @@
Roles not associated:<br/><select name="${action_key}_out" id="${action_key}_out_select" style="max-width: 98%; width: 98%; height: 150px; font-size: 100%;" multiple>
%for role in out_roles:
- <option value="${role.id}">${role.name}</option>
+ <option value="${role.id}">${role.name | h}</option>
%endfor
</select><br/><input type="submit" id="${action_key}_add_button" class="role_add_button" value="<<"/>
diff -r 13d43b327511d46e836398fa09330722acccd419 -r 172f91ec31ef89d0f0eaa162bab5cfdf90866c22 templates/admin/request_type/view_request_type.mako
--- a/templates/admin/request_type/view_request_type.mako
+++ b/templates/admin/request_type/view_request_type.mako
@@ -30,24 +30,24 @@
%endif
<div class="toolForm">
- <div class="toolFormTitle">"${request_type.name}" request type</div>
+ <div class="toolFormTitle">"${request_type.name | h}" request type</div><div class="form-row"><label>Name:</label>
- ${request_type.name}
+ ${request_type.name | h}
<div style="clear: both"></div></div><div class="form-row"><label>Description:</label>
- ${request_type.desc}
+ ${request_type.desc | h}
<div style="clear: both"></div></div><div class="form-row"><label>Sequencing request form definition:</label>
- <a href="${h.url_for( controller='request_type', action='view_form_definition', id=trans.security.encode_id( request_type.request_form_id ) )}">${request_type.request_form.name}</a>
+ <a href="${h.url_for( controller='request_type', action='view_form_definition', id=trans.security.encode_id( request_type.request_form_id ) )}">${request_type.request_form.name | h}</a></div><div class="form-row"><label>Sample form definition:</label>
- <a href="${h.url_for( controller='request_type', action='view_form_definition', id=trans.security.encode_id( request_type.sample_form_id ) )}">${request_type.sample_form.name}</a>
+ <a href="${h.url_for( controller='request_type', action='view_form_definition', id=trans.security.encode_id( request_type.sample_form_id ) )}">${request_type.sample_form.name | h}</a></div></div><p/>
@@ -55,8 +55,8 @@
<div class="toolFormTitle">Sample states defined for this request type</div>
%for state in request_type.states:
<div class="form-row">
- <label>${state.name}</label>
- ${state.desc}
+ <label>${state.name | h}</label>
+ ${state.desc | h}
</div><div style="clear: both"></div>
%endfor
@@ -67,8 +67,8 @@
%if request_type.external_services:
%for index, external_service in enumerate( request_type.external_services ):
<div class="form-row">
- <label><a href="${h.url_for( controller='external_service', action='view_external_service', id=trans.security.encode_id( external_service.id ) )}">${external_service.name}</a></label>
- ${external_service.get_external_service_type( trans ).name}
+ <label><a href="${h.url_for( controller='external_service', action='view_external_service', id=trans.security.encode_id( external_service.id ) )}">${external_service.name | h}</a></label>
+ ${external_service.get_external_service_type( trans ).name | h}
</div>
%endfor
%else:
diff -r 13d43b327511d46e836398fa09330722acccd419 -r 172f91ec31ef89d0f0eaa162bab5cfdf90866c22 templates/admin/requests/reject.mako
--- a/templates/admin/requests/reject.mako
+++ b/templates/admin/requests/reject.mako
@@ -15,7 +15,7 @@
</ul><div class="toolForm">
- <div class="toolFormTitle">Reject sequencing request "${request.name}"</div>
+ <div class="toolFormTitle">Reject sequencing request "${request.name | h}"</div><form name="event" action="${h.url_for( controller='requests_admin', action='reject_request', id=trans.security.encode_id( request.id ) )}" method="post" ><div class="form-row">
Rejecting this request will move the request state to <b>Rejected</b>.
diff -r 13d43b327511d46e836398fa09330722acccd419 -r 172f91ec31ef89d0f0eaa162bab5cfdf90866c22 templates/admin/requests/rename_datasets.mako
--- a/templates/admin/requests/rename_datasets.mako
+++ b/templates/admin/requests/rename_datasets.mako
@@ -3,7 +3,7 @@
<% from galaxy.webapps.galaxy.controllers.requests_admin import build_rename_datasets_for_sample_select_field %>
-<h3>Rename datasets for Sample "${sample.name}"</h3>
+<h3>Rename datasets for Sample "${sample.name | h}"</h3><ul class="manage-table-actions"><li><a class="action-button" href="${h.url_for( controller='requests_admin', action='manage_datasets', sample_id=trans.security.encode_id( sample.id ) )}">Browse datasets</a></li>
@@ -35,7 +35,7 @@
${rename_datasets_for_sample_select_field.get_html()}
</td><td>
- <input type="text" name="new_name_${trans.security.encode_id( sample_dataset.id ) }" value="${sample_dataset.name}" size="100"/>
+ <input type="text" name="new_name_${trans.security.encode_id( sample_dataset.id ) }" value="${sample_dataset.name | h}" size="100"/></td><td>${sample_dataset.file_path}</td></tr>
diff -r 13d43b327511d46e836398fa09330722acccd419 -r 172f91ec31ef89d0f0eaa162bab5cfdf90866c22 templates/admin/requests/view_sample_dataset.mako
--- a/templates/admin/requests/view_sample_dataset.mako
+++ b/templates/admin/requests/view_sample_dataset.mako
@@ -21,19 +21,19 @@
</ul><div class="toolForm">
- <div class="toolFormTitle">"${sample.name}" Dataset</div>
+ <div class="toolFormTitle">"${sample.name | h}" Dataset</div><div class="toolFormBody"><div class="form-row"><label>Name:</label><div style="float: left; width: 250px; margin-right: 10px;">
- ${sample_dataset.name}
+ ${sample_dataset.name | h}
</div><div style="clear: both"></div></div><div class="form-row"><label>External service:</label><div style="float: left; width: 250px; margin-right: 10px;">
- ${sample_dataset.external_service.name} (${sample_dataset.external_service.get_external_service_type( trans ).name})
+ ${sample_dataset.external_service.name | h} (${sample_dataset.external_service.get_external_service_type( trans ).name | h})
</div><div style="clear: both"></div></div>
diff -r 13d43b327511d46e836398fa09330722acccd419 -r 172f91ec31ef89d0f0eaa162bab5cfdf90866c22 templates/webapps/galaxy/requests/common/common.mako
--- a/templates/webapps/galaxy/requests/common/common.mako
+++ b/templates/webapps/galaxy/requests/common/common.mako
@@ -257,18 +257,18 @@
<td valign="top"><input type="checkbox" name=select_sample_${sample.id} id="sample_checkbox" value="true" ${checked_str}/><input type="hidden" name=select_sample_${sample.id} id="sample_checkbox" value="true"/></td>
%endif
<td valign="top">
- <input type="text" name="sample_${sample_widget_index}_name" value="${sample_widget['name']}" size="10"/>
+ <input type="text" name="sample_${sample_widget_index}_name" value="${sample_widget['name'] | h}" size="10"/><div class="toolParamHelp" style="clear: both;">
- <i>${' (required)' }</i>
+ <i>(required)</i></div></td>
%if display_bar_code:
<td valign="top">
%if is_admin and is_submitted:
- <input type="text" name="sample_${sample_widget_index}_bar_code" value="${sample_widget['bar_code']}" size="10"/>
+ <input type="text" name="sample_${sample_widget_index}_bar_code" value="${sample_widget['bar_code'] | h}" size="10"/>
%else:
- ${sample_widget['bar_code']}
- <input type="hidden" name="sample_${sample_widget_index}_bar_code" value="${sample_widget['bar_code']}"/>
+ ${sample_widget['bar_code'] | h}
+ <input type="hidden" name="sample_${sample_widget_index}_bar_code" value="${sample_widget['bar_code'] | h}"/>
%endif
</td>
%endif
@@ -416,7 +416,7 @@
transferred_dataset_files = []
%><div style="float: left; margin-left: 2px;" class="menubutton split popup" id="sample-${sample.id}-popup">
- <a class="view-info" href="${h.url_for( controller='requests_common', action='view_sample', cntrller=cntrller, id=trans.security.encode_id( sample.id ) )}">${sample.name}</a>
+ <a class="view-info" href="${h.url_for( controller='requests_common', action='view_sample', cntrller=cntrller, id=trans.security.encode_id( sample.id ) )}">${sample.name | h}</a></div><div popupmenu="sample-${sample.id}-popup">
%if can_select_datasets:
@@ -439,11 +439,11 @@
%endif
</div>
%else:
- ${sample_widget_name}
+ ${sample_widget_name | h}
%endif
</td>
%if display_bar_code:
- <td>${sample_widget_bar_code}</td>
+ <td>${sample_widget_bar_code | h}</td>
%endif
%if is_unsubmitted:
<td>Unsubmitted</td>
@@ -451,12 +451,12 @@
<td><a id="sampleState-${sample.id}" href="${h.url_for( controller='requests_common', action='view_sample_history', cntrller=cntrller, sample_id=trans.security.encode_id( sample.id ) )}">${render_sample_state( sample )}</a></td>
%endif
%if sample_widget_library and library_cntrller is not None:
- <td><a href="${h.url_for( controller='library_common', action='browse_library', cntrller=library_cntrller, id=trans.security.encode_id( sample_widget_library.id ) )}">${sample_widget_library.name}</a></td>
+ <td><a href="${h.url_for( controller='library_common', action='browse_library', cntrller=library_cntrller, id=trans.security.encode_id( sample_widget_library.id ) )}">${sample_widget_library.name | h}</a></td>
%else:
<td></td>
%endif
%if sample_widget_folder:
- <td>${sample_widget_folder.name}</td>
+ <td>${sample_widget_folder.name | h}</td>
%else:
<td></td>
%endif
@@ -464,11 +464,11 @@
%if trans.user == sample_widget_history.user:
<td><a target='_parent' href="${h.url_for( controller='history', action='list', operation="Switch", id=trans.security.encode_id(sample_widget_history.id), use_panels=False )}">
- ${sample_widget_history.name}
+ ${sample_widget_history.name | h}
</a></td>
%else:
- <td>${sample_widget_history.name}</td>
+ <td>${sample_widget_history.name | h}</td>
%endif
%else:
<td></td>
@@ -477,11 +477,11 @@
%if trans.user == sample_widget_workflow.stored_workflow.user:
<td><a target='_parent' href="${h.url_for( controller='workflow', action='editor', id=trans.security.encode_id(sample_widget_workflow.stored_workflow.id) )}">
- ${sample_widget_workflow.name}
+ ${sample_widget_workflow.name | h}
</a></td>
%else:
- <td>${sample_widget_workflow.name}</td>
+ <td>${sample_widget_workflow.name | h}</td>
%endif
%else:
<td></td>
@@ -519,7 +519,7 @@
<%def name="render_sample_form( index, sample_name, sample_values, fields_dict, display_only )"><tr>
- <td>${sample_name}</td>
+ <td>${sample_name | h}</td>
%for field_index, field in fields_dict.items():
<%
field_type = field[ 'type' ]
@@ -532,17 +532,17 @@
%if field_type == 'WorkflowField':
%if str( field_value ) != 'none':
<% workflow = trans.sa_session.query( trans.app.model.StoredWorkflow ).get( int( field_value ) ) %>
- <a href="${h.url_for( controller='workflow', action='run', id=trans.security.encode_id( workflow.id ) )}">${workflow.name}</a>
+ <a href="${h.url_for( controller='workflow', action='run', id=trans.security.encode_id( workflow.id ) )}">${workflow.name | h}</a>
%endif
%else:
- ${field_value}
+ ${field_value | h}
%endif
%else:
<i>None</i>
%endif
%else:
%if field_type == 'TextField':
- <input type="text" name="sample_${index}_field_${field_index}" value="${field_value}" size="7"/>
+ <input type="text" name="sample_${index}_field_${field_index}" value="${field_value | h}" size="7"/>
%elif field_type == 'SelectField':
<select name="sample_${index}_field_${field_index}" last_selected_value="2">
%for option_index, option in enumerate(field[ 'selectlist' ]):
@@ -695,7 +695,7 @@
%if is_admin:
<span class="expandLink dataset-${dataset}-click"><span class="rowIcon"></span><div style="float: left; margin-left: 2px;" class="menubutton split popup" id="dataset-${dataset.id}-popup">
- <a class="dataset-${encoded_id}-click" href="${h.url_for( controller='requests_admin', action='manage_datasets', operation='view', id=trans.security.encode_id( dataset.id ) )}">${dataset.name}</a>
+ <a class="dataset-${encoded_id}-click" href="${h.url_for( controller='requests_admin', action='manage_datasets', operation='view', id=trans.security.encode_id( dataset.id ) )}">${dataset.name | h}</a></div></span><div popupmenu="dataset-${dataset.id}-popup">
@@ -704,12 +704,12 @@
%endif
</div>
%else:
- ${dataset.name}
+ ${dataset.name | h}
%endif
</td><td>${dataset.size}</td>
- <td><a href="${h.url_for( controller='library_common', action='browse_library', cntrller=cntrller, id=trans.security.encode_id( sample.library.id ) )}">${dataset.sample.library.name}</a></td>
- <td>${dataset.sample.folder.name}</td>
+ <td><a href="${h.url_for( controller='library_common', action='browse_library', cntrller=cntrller, id=trans.security.encode_id( sample.library.id ) )}">${dataset.sample.library.name | h}</a></td>
+ <td>${dataset.sample.folder.name | h}</td><td id="datasetTransferStatus-${encoded_id}">${dataset.status}</td></tr>
%endfor
@@ -723,7 +723,7 @@
<%def name="render_samples_messages( request, is_admin=False, is_submitted=False, message=None, status=None)">
%if request.is_rejected:
<div class='errormessage'>
- ${request.last_comment}
+ ${request.last_comment | h}
</div><br/>
%endif
%if is_admin and is_submitted and request.samples_without_library_destinations:
diff -r 13d43b327511d46e836398fa09330722acccd419 -r 172f91ec31ef89d0f0eaa162bab5cfdf90866c22 templates/webapps/galaxy/requests/common/create_request.mako
--- a/templates/webapps/galaxy/requests/common/create_request.mako
+++ b/templates/webapps/galaxy/requests/common/create_request.mako
@@ -23,7 +23,7 @@
<div class="toolForm"><div class="toolFormTitle">Create a new sequencing request</div>
%if len( request_type_select_field.options ) < 1:
- There are no request types available for ${trans.user.email} to create sequencing requests.
+ There are no request types available for ${trans.user.email | h} to create sequencing requests.
%else:
<div class="toolFormBody"><form name="create_request" id="create_request" action="${h.url_for( controller='requests_common', action='create_request', cntrller=cntrller )}" method="post" >
diff -r 13d43b327511d46e836398fa09330722acccd419 -r 172f91ec31ef89d0f0eaa162bab5cfdf90866c22 templates/webapps/galaxy/requests/common/edit_basic_request_info.mako
--- a/templates/webapps/galaxy/requests/common/edit_basic_request_info.mako
+++ b/templates/webapps/galaxy/requests/common/edit_basic_request_info.mako
@@ -31,7 +31,7 @@
%endif
<div class="toolForm">
- <div class="toolFormTitle">Edit sequencing request "${request.name}"</div>
+ <div class="toolFormTitle">Edit sequencing request "${request.name | h}"</div><div class="toolFormBody"><form name="edit_basic_request_info" id="edit_basic_request_info" action="${h.url_for( controller='requests_common', action='edit_basic_request_info', cntrller=cntrller, id=trans.security.encode_id( request.id ) )}" method="post" >
%for i, field in enumerate( widgets ):
@@ -70,11 +70,11 @@
%><div class="form-row"><label>Send to:</label>
- <input type="checkbox" name="email_address" value="true" ${email_address}>${request.user.email} (sequencing request owner)<input type="hidden" name="email_address" value="true">
+ <input type="checkbox" name="email_address" value="true" ${email_address}>${request.user.email | h} (sequencing request owner)<input type="hidden" name="email_address" value="true"></div><div class="form-row"><label>Additional email addresses:</label>
- <textarea name="additional_email_addresses" rows="3" cols="40">${emails}</textarea>
+ <textarea name="additional_email_addresses" rows="3" cols="40">${emails | h}</textarea><div class="toolParamHelp" style="clear: both;">
Enter one email address per line
</div>
diff -r 13d43b327511d46e836398fa09330722acccd419 -r 172f91ec31ef89d0f0eaa162bab5cfdf90866c22 templates/webapps/galaxy/requests/common/find_samples.mako
--- a/templates/webapps/galaxy/requests/common/find_samples.mako
+++ b/templates/webapps/galaxy/requests/common/find_samples.mako
@@ -72,7 +72,7 @@
%if samples:
%for sample in samples:
<div class="form-row">
- Sample: <b>${sample.name}</b> | Barcode: ${sample.bar_code}<br/>
+ Sample: <b>${sample.name | h}</b> | Barcode: ${sample.bar_code | h}<br/>
%if sample.request.is_new or not sample.state:
State: Unsubmitted<br/>
%else:
@@ -85,10 +85,10 @@
%>
Datasets: <a href="${h.url_for( controller='requests_common', action='view_sample_datasets', cntrller=cntrller, external_service_id=trans.security.encode_id( external_service.id ), sample_id=trans.security.encode_id( sample.id ) )}">${len( sample.datasets )}</a><br/>
%if is_admin:
- <i>User: ${sample.request.user.email}</i>
+ <i>User: ${sample.request.user.email | h}</i>
%endif
<div class="toolParamHelp" style="clear: both;">
- <a href="${h.url_for( controller='requests_common', action='view_request', cntrller=cntrller, id=trans.security.encode_id( sample.request.id ) )}">Sequencing request: ${sample.request.name} | Type: ${sample.request.type.name} | State: ${sample.request.state}</a>
+ <a href="${h.url_for( controller='requests_common', action='view_request', cntrller=cntrller, id=trans.security.encode_id( sample.request.id ) )}">Sequencing request: ${sample.request.name | h} | Type: ${sample.request.type.name} | State: ${sample.request.state}</a></div></div><br/>
diff -r 13d43b327511d46e836398fa09330722acccd419 -r 172f91ec31ef89d0f0eaa162bab5cfdf90866c22 templates/webapps/galaxy/requests/common/view_request.mako
--- a/templates/webapps/galaxy/requests/common/view_request.mako
+++ b/templates/webapps/galaxy/requests/common/view_request.mako
@@ -58,7 +58,7 @@
${render_samples_messages(request, is_admin, is_submitted, message, status)}
<div class="toolForm">
- <div class="toolFormTitle">Sequencing request "${request.name}"</div>
+ <div class="toolFormTitle">Sequencing request "${request.name | h}"</div><div class="toolFormBody"><div class="form-row"><label>Current state:</label>
@@ -67,12 +67,12 @@
</div><div class="form-row"><label>Description:</label>
- ${request.desc}
+ ${request.desc | h}
<div style="clear: both"></div></div><div class="form-row"><label>User:</label>
- ${request.user.email}
+ ${request.user.email | h}
<div style="clear: both"></div></div><div class="form-row">
@@ -94,7 +94,7 @@
%><div class="form-row"><label>${field_label}:</label>
- ${field_value}
+ ${field_value | h}
</div><div style="clear: both"></div>
%endfor
@@ -116,7 +116,7 @@
else:
emails = ''
%>
- ${emails}
+ ${emails | h}
<div style="clear: both"></div></div><div class="form-row">
diff -r 13d43b327511d46e836398fa09330722acccd419 -r 172f91ec31ef89d0f0eaa162bab5cfdf90866c22 templates/webapps/galaxy/requests/common/view_request_history.mako
--- a/templates/webapps/galaxy/requests/common/view_request_history.mako
+++ b/templates/webapps/galaxy/requests/common/view_request_history.mako
@@ -36,7 +36,7 @@
${render_msg( message, status )}
%endif
-<h3>History of sequencing request "${request.name}"</h3>
+<h3>History of sequencing request "${request.name | h}"</h3><div class="toolForm"><table class="grid">
@@ -52,7 +52,7 @@
<tr><td><b>${event.state}</b></td><td>${time_ago( event.update_time )}</td>
- <td>${event.comment}</td>
+ <td>${event.comment | h}</td></tr>
%endfor
</tbody>
diff -r 13d43b327511d46e836398fa09330722acccd419 -r 172f91ec31ef89d0f0eaa162bab5cfdf90866c22 templates/webapps/galaxy/requests/common/view_sample.mako
--- a/templates/webapps/galaxy/requests/common/view_sample.mako
+++ b/templates/webapps/galaxy/requests/common/view_sample.mako
@@ -6,7 +6,7 @@
%if external_service:
<p><div class="toolForm">
- <div class="toolFormTitle">Available External Service Actions for ${sample.name} at ${external_service.name}</div>
+ <div class="toolFormTitle">Available External Service Actions for ${sample.name | h} at ${external_service.name | h}</div><div class="toolFormBody"><div class="toolMenu">
%for item in external_service.actions:
@@ -25,7 +25,7 @@
<div class="form-row"><div class="toolSectionList"><div class="toolSectionTitle">
- <span>${external_service_group.label}</span>
+ <span>${external_service_group.label | h}</span></div><div class="toolSectionBody"><div class="toolSectionBg">
@@ -54,7 +54,7 @@
target = 'galaxy_main'
%><div class="toolTitle">
- <a href="${external_service_action.get_action_access_link( trans )}" target="${target}">${external_service_action.label}</a>
+ <a href="${external_service_action.get_action_access_link( trans )}" target="${target}">${external_service_action.label | h}</a></div></%def>
@@ -75,38 +75,38 @@
%endif
<div class="toolForm">
- <div class="toolFormTitle">Sample "${sample.name}"</div>
+ <div class="toolFormTitle">Sample "${sample.name | h}"</div><div class="toolFormBody"><div class="form-row"><label>Name:</label>
- ${sample.name}
+ ${sample.name | h}
<div style="clear: both"></div></div><div class="form-row"><label>Description:</label>
- ${sample.desc}
+ ${sample.desc | h}
<div style="clear: both"></div></div><div class="form-row"><label>Barcode:</label>
- ${sample.bar_code}
+ ${sample.bar_code | h}
<div style="clear: both"></div></div>
%if sample.library:
<div class="form-row"><label>Library:</label>
- ${sample.library.name}
+ ${sample.library.name | h}
<div style="clear: both"></div></div><div class="form-row"><label>Folder:</label>
- ${sample.folder.name}
+ ${sample.folder.name | h}
<div style="clear: both"></div></div>
%endif
<div class="form-row"><label>Request:</label>
- ${sample.request.name}
+ ${sample.request.name | h}
<div style="clear: both"></div></div></div>
diff -r 13d43b327511d46e836398fa09330722acccd419 -r 172f91ec31ef89d0f0eaa162bab5cfdf90866c22 templates/webapps/galaxy/requests/common/view_sample_history.mako
--- a/templates/webapps/galaxy/requests/common/view_sample_history.mako
+++ b/templates/webapps/galaxy/requests/common/view_sample_history.mako
@@ -12,7 +12,7 @@
${render_msg( message, status )}
%endif
-<h3>History of sample "${sample.name}"</h3>
+<h3>History of sample "${sample.name | h}"</h3><div class="toolForm"><table class="grid">
@@ -27,10 +27,10 @@
<tbody>
%for event in sample.events:
<tr>
- <td><b>${event.state.name}</b></td>
- <td>${event.state.desc}</td>
+ <td><b>${event.state.name | h}</b></td>
+ <td>${event.state.desc | h}</td><td>${time_ago( event.update_time )}</td>
- <td>${event.comment}</td>
+ <td>${event.comment | h}</td></tr>
%endfor
</tbody>
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0
2 new commits in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/795336f22d8b/
Changeset: 795336f22d8b
Branch: mako_escape_requests
User: martenson
Date: 2014-12-01 22:38:24+00:00
Summary: none of the requests & forms controllers used escaping so I escaped the variables exclusively in the templates
Affected #: 18 files
diff -r 1034c973ec1d2ce424f711d750ecc6de582d02aa -r 795336f22d8b94b86256b1d4738ee1bf24e18b57 templates/admin/forms/create_form.mako
--- a/templates/admin/forms/create_form.mako
+++ b/templates/admin/forms/create_form.mako
@@ -9,7 +9,7 @@
<div class="toolFormTitle">Create a new form definition</div>
%for label, input in inputs:
<div class="form-row">
- <label>${label}</label>
+ <label>${label | h}</label>
${input.get_html()}
<div style="clear: both"></div></div>
diff -r 1034c973ec1d2ce424f711d750ecc6de582d02aa -r 795336f22d8b94b86256b1d4738ee1bf24e18b57 templates/admin/forms/edit_form_definition.mako
--- a/templates/admin/forms/edit_form_definition.mako
+++ b/templates/admin/forms/edit_form_definition.mako
@@ -96,14 +96,14 @@
<form id="edit_form_definition" name="edit_form_definition" action="${h.url_for( controller='forms', action='edit_form_definition', id=trans.security.encode_id( form_definition.current.id ) )}" method="post" ><div class="toolForm">
- <div class="toolFormTitle">Edit form definition "${form_definition.name}" (${form_definition.type})</div>
+ <div class="toolFormTitle">Edit form definition "${form_definition.name | h}" (${form_definition.type | h})</div>
%if response_redirect:
<input type="hidden" name="response_redirect" value="${response_redirect}" size="40" />
%endif
%for label, input in form_details:
<div class="form-row">
%if label != 'Type':
- <label>${label}</label>
+ <label>${label | h}</label>
%endif
<div style="float: left; width: 250px; margin-right: 10px;">
${input.get_html()}
diff -r 1034c973ec1d2ce424f711d750ecc6de582d02aa -r 795336f22d8b94b86256b1d4738ee1bf24e18b57 templates/admin/request_type/common.mako
--- a/templates/admin/request_type/common.mako
+++ b/templates/admin/request_type/common.mako
@@ -2,7 +2,7 @@
<div class="repeat-group-item"><div class="form-row"><label>${1+element_count}. State name:</label>
- <input type="text" name="state_name_${element_count}" value="${state_name}" size="40"/>
+ <input type="text" name="state_name_${element_count}" value="${state_name | h}" size="40"/>
## Do not show remove button for the first state
%if element_count > 0:
<input type="submit" name="remove_state_button" value="Remove state ${1+element_count}"/>
@@ -10,7 +10,7 @@
</div><div class="form-row"><label>Description:</label>
- <input type="text" name="state_desc_${element_count}" value="${state_desc}" size="40"/>
+ <input type="text" name="state_desc_${element_count}" value="${state_desc | h}" size="40"/><div class="toolParamHelp" style="clear: both;">
optional
</div>
diff -r 1034c973ec1d2ce424f711d750ecc6de582d02aa -r 795336f22d8b94b86256b1d4738ee1bf24e18b57 templates/admin/request_type/create_request_type.mako
--- a/templates/admin/request_type/create_request_type.mako
+++ b/templates/admin/request_type/create_request_type.mako
@@ -23,7 +23,7 @@
<div class="toolFormTitle">Create a new request type</div>
%for rt_info in rt_info_widgets:
<div class="form-row">
- <label>${rt_info['label']}</label>
+ <label>${rt_info['label'] | h}</label><div style="float: left; width: 250px; margin-right: 10px;">
${rt_info['widget'].get_html()}
</div>
diff -r 1034c973ec1d2ce424f711d750ecc6de582d02aa -r 795336f22d8b94b86256b1d4738ee1bf24e18b57 templates/admin/request_type/edit_request_type.mako
--- a/templates/admin/request_type/edit_request_type.mako
+++ b/templates/admin/request_type/edit_request_type.mako
@@ -32,26 +32,26 @@
<form name="edit_request_type" action="${h.url_for( controller='request_type', action='edit_request_type', id=trans.security.encode_id( request_type.id ) )}" method="post" ><div class="toolForm">
- <div class="toolFormTitle">"Edit ${request_type.name}" request type</div>
+ <div class="toolFormTitle">"Edit ${request_type.name | h}" request type</div><div class="form-row"><label>Name:</label>
- <input type="text" name="name" value="${request_type.name}" size="40"/>
+ <input type="text" name="name" value="${request_type.name | }" size="40"/><div style="clear: both"></div></div><div class="form-row"><label>Description:</label>
- <input type="text" name="desc" value="${request_type.desc}" size="40"/>
+ <input type="text" name="desc" value="${request_type.desc | h}" size="40"/><div style="clear: both"></div></div><div class="form-row"><label>Sequencing request form definition:</label>
- <a href="${h.url_for( controller='request_type', action='view_form_definition', id=trans.security.encode_id( request_type.request_form_id ) )}">${request_type.request_form.name}</a>
+ <a href="${h.url_for( controller='request_type', action='view_form_definition', id=trans.security.encode_id( request_type.request_form_id ) )}">${request_type.request_form.name | h}</a>
## Hidden field needed by the __save_request_type() method
<input type="hidden" name="request_form_id" value="${trans.security.encode_id( request_type.request_form_id )}" size="40"/></div><div class="form-row"><label>Sample form definition:</label>
- <a href="${h.url_for( controller='request_type', action='view_form_definition', id=trans.security.encode_id( request_type.sample_form_id ) )}">${request_type.sample_form.name}</a>
+ <a href="${h.url_for( controller='request_type', action='view_form_definition', id=trans.security.encode_id( request_type.sample_form_id ) )}">${request_type.sample_form.name | h}</a>
## Hidden field needed by the __save_request_type() method
<input type="hidden" name="sample_form_id" value="${trans.security.encode_id( request_type.sample_form_id )}" size="40"/></div>
@@ -63,11 +63,11 @@
<div class="repeat-group-item"><div class="form-row"><label>${1+element_count}. State name:</label>
- <input type="text" name="state_name_${trans.security.encode_id( state.id )}" value="${state.name}" size="40"/>
+ <input type="text" name="state_name_${trans.security.encode_id( state.id )}" value="${state.name | h}" size="40"/></div><div class="form-row"><label>Description:</label>
- <input type="text" name="state_desc_${trans.security.encode_id( state.id )}" value="${state.desc}" size="40"/>
+ <input type="text" name="state_desc_${trans.security.encode_id( state.id )}" value="${state.desc | h}" size="40"/><div class="toolParamHelp" style="clear: both;">
optional
</div>
diff -r 1034c973ec1d2ce424f711d750ecc6de582d02aa -r 795336f22d8b94b86256b1d4738ee1bf24e18b57 templates/admin/request_type/request_type_permissions.mako
--- a/templates/admin/request_type/request_type_permissions.mako
+++ b/templates/admin/request_type/request_type_permissions.mako
@@ -48,7 +48,7 @@
%endif
<div class="toolForm">
- <div class="toolFormTitle">Manage access permissions on request type "${request_type.name}"</div>
+ <div class="toolFormTitle">Manage access permissions on request type "${request_type.name | h}"</div><div class="toolFormBody"><form name="request_type_permissions" id="request_type_permissions" action="${h.url_for( controller='request_type', action='request_type_permissions', id=trans.security.encode_id( request_type.id ) )}" method="post"><div class="form-row">
@@ -65,13 +65,13 @@
in_roles.add( a.role )
out_roles = filter( lambda x: x not in in_roles, all_roles )
%>
- ${action.description}<br/><br/>
+ ${action.description | h}<br/><br/><div style="width: 100%; white-space: nowrap;"><div style="float: left; width: 50%;">
Roles associated:<br/><select name="${action_key}_in" id="${action_key}_in_select" class="in_select" style="max-width: 98%; width: 98%; height: 150px; font-size: 100%;" multiple>
%for role in in_roles:
- <option value="${role.id}">${role.name}</option>
+ <option value="${role.id}">${role.name | h}</option>
%endfor
</select><br/><div style="width: 98%; text-align: right"><input type="submit" id="${action_key}_remove_button" class="role_remove_button" value=">>"/></div>
@@ -80,7 +80,7 @@
Roles not associated:<br/><select name="${action_key}_out" id="${action_key}_out_select" style="max-width: 98%; width: 98%; height: 150px; font-size: 100%;" multiple>
%for role in out_roles:
- <option value="${role.id}">${role.name}</option>
+ <option value="${role.id}">${role.name | h}</option>
%endfor
</select><br/><input type="submit" id="${action_key}_add_button" class="role_add_button" value="<<"/>
diff -r 1034c973ec1d2ce424f711d750ecc6de582d02aa -r 795336f22d8b94b86256b1d4738ee1bf24e18b57 templates/admin/request_type/view_request_type.mako
--- a/templates/admin/request_type/view_request_type.mako
+++ b/templates/admin/request_type/view_request_type.mako
@@ -30,24 +30,24 @@
%endif
<div class="toolForm">
- <div class="toolFormTitle">"${request_type.name}" request type</div>
+ <div class="toolFormTitle">"${request_type.name | h}" request type</div><div class="form-row"><label>Name:</label>
- ${request_type.name}
+ ${request_type.name | h}
<div style="clear: both"></div></div><div class="form-row"><label>Description:</label>
- ${request_type.desc}
+ ${request_type.desc | h}
<div style="clear: both"></div></div><div class="form-row"><label>Sequencing request form definition:</label>
- <a href="${h.url_for( controller='request_type', action='view_form_definition', id=trans.security.encode_id( request_type.request_form_id ) )}">${request_type.request_form.name}</a>
+ <a href="${h.url_for( controller='request_type', action='view_form_definition', id=trans.security.encode_id( request_type.request_form_id ) )}">${request_type.request_form.name | h}</a></div><div class="form-row"><label>Sample form definition:</label>
- <a href="${h.url_for( controller='request_type', action='view_form_definition', id=trans.security.encode_id( request_type.sample_form_id ) )}">${request_type.sample_form.name}</a>
+ <a href="${h.url_for( controller='request_type', action='view_form_definition', id=trans.security.encode_id( request_type.sample_form_id ) )}">${request_type.sample_form.name | h}</a></div></div><p/>
@@ -55,8 +55,8 @@
<div class="toolFormTitle">Sample states defined for this request type</div>
%for state in request_type.states:
<div class="form-row">
- <label>${state.name}</label>
- ${state.desc}
+ <label>${state.name | h}</label>
+ ${state.desc | h}
</div><div style="clear: both"></div>
%endfor
@@ -67,8 +67,8 @@
%if request_type.external_services:
%for index, external_service in enumerate( request_type.external_services ):
<div class="form-row">
- <label><a href="${h.url_for( controller='external_service', action='view_external_service', id=trans.security.encode_id( external_service.id ) )}">${external_service.name}</a></label>
- ${external_service.get_external_service_type( trans ).name}
+ <label><a href="${h.url_for( controller='external_service', action='view_external_service', id=trans.security.encode_id( external_service.id ) )}">${external_service.name | h}</a></label>
+ ${external_service.get_external_service_type( trans ).name | h}
</div>
%endfor
%else:
diff -r 1034c973ec1d2ce424f711d750ecc6de582d02aa -r 795336f22d8b94b86256b1d4738ee1bf24e18b57 templates/admin/requests/reject.mako
--- a/templates/admin/requests/reject.mako
+++ b/templates/admin/requests/reject.mako
@@ -15,7 +15,7 @@
</ul><div class="toolForm">
- <div class="toolFormTitle">Reject sequencing request "${request.name}"</div>
+ <div class="toolFormTitle">Reject sequencing request "${request.name | h}"</div><form name="event" action="${h.url_for( controller='requests_admin', action='reject_request', id=trans.security.encode_id( request.id ) )}" method="post" ><div class="form-row">
Rejecting this request will move the request state to <b>Rejected</b>.
diff -r 1034c973ec1d2ce424f711d750ecc6de582d02aa -r 795336f22d8b94b86256b1d4738ee1bf24e18b57 templates/admin/requests/rename_datasets.mako
--- a/templates/admin/requests/rename_datasets.mako
+++ b/templates/admin/requests/rename_datasets.mako
@@ -3,7 +3,7 @@
<% from galaxy.webapps.galaxy.controllers.requests_admin import build_rename_datasets_for_sample_select_field %>
-<h3>Rename datasets for Sample "${sample.name}"</h3>
+<h3>Rename datasets for Sample "${sample.name | h}"</h3><ul class="manage-table-actions"><li><a class="action-button" href="${h.url_for( controller='requests_admin', action='manage_datasets', sample_id=trans.security.encode_id( sample.id ) )}">Browse datasets</a></li>
@@ -35,7 +35,7 @@
${rename_datasets_for_sample_select_field.get_html()}
</td><td>
- <input type="text" name="new_name_${trans.security.encode_id( sample_dataset.id ) }" value="${sample_dataset.name}" size="100"/>
+ <input type="text" name="new_name_${trans.security.encode_id( sample_dataset.id ) }" value="${sample_dataset.name | h}" size="100"/></td><td>${sample_dataset.file_path}</td></tr>
diff -r 1034c973ec1d2ce424f711d750ecc6de582d02aa -r 795336f22d8b94b86256b1d4738ee1bf24e18b57 templates/admin/requests/view_sample_dataset.mako
--- a/templates/admin/requests/view_sample_dataset.mako
+++ b/templates/admin/requests/view_sample_dataset.mako
@@ -21,19 +21,19 @@
</ul><div class="toolForm">
- <div class="toolFormTitle">"${sample.name}" Dataset</div>
+ <div class="toolFormTitle">"${sample.name | h}" Dataset</div><div class="toolFormBody"><div class="form-row"><label>Name:</label><div style="float: left; width: 250px; margin-right: 10px;">
- ${sample_dataset.name}
+ ${sample_dataset.name | h}
</div><div style="clear: both"></div></div><div class="form-row"><label>External service:</label><div style="float: left; width: 250px; margin-right: 10px;">
- ${sample_dataset.external_service.name} (${sample_dataset.external_service.get_external_service_type( trans ).name})
+ ${sample_dataset.external_service.name | h} (${sample_dataset.external_service.get_external_service_type( trans ).name | h})
</div><div style="clear: both"></div></div>
diff -r 1034c973ec1d2ce424f711d750ecc6de582d02aa -r 795336f22d8b94b86256b1d4738ee1bf24e18b57 templates/webapps/galaxy/requests/common/common.mako
--- a/templates/webapps/galaxy/requests/common/common.mako
+++ b/templates/webapps/galaxy/requests/common/common.mako
@@ -257,18 +257,18 @@
<td valign="top"><input type="checkbox" name=select_sample_${sample.id} id="sample_checkbox" value="true" ${checked_str}/><input type="hidden" name=select_sample_${sample.id} id="sample_checkbox" value="true"/></td>
%endif
<td valign="top">
- <input type="text" name="sample_${sample_widget_index}_name" value="${sample_widget['name']}" size="10"/>
+ <input type="text" name="sample_${sample_widget_index}_name" value="${sample_widget['name'] | h}" size="10"/><div class="toolParamHelp" style="clear: both;">
- <i>${' (required)' }</i>
+ <i>(required)</i></div></td>
%if display_bar_code:
<td valign="top">
%if is_admin and is_submitted:
- <input type="text" name="sample_${sample_widget_index}_bar_code" value="${sample_widget['bar_code']}" size="10"/>
+ <input type="text" name="sample_${sample_widget_index}_bar_code" value="${sample_widget['bar_code'] | h}" size="10"/>
%else:
- ${sample_widget['bar_code']}
- <input type="hidden" name="sample_${sample_widget_index}_bar_code" value="${sample_widget['bar_code']}"/>
+ ${sample_widget['bar_code'] | h}
+ <input type="hidden" name="sample_${sample_widget_index}_bar_code" value="${sample_widget['bar_code'] | h}"/>
%endif
</td>
%endif
@@ -416,7 +416,7 @@
transferred_dataset_files = []
%><div style="float: left; margin-left: 2px;" class="menubutton split popup" id="sample-${sample.id}-popup">
- <a class="view-info" href="${h.url_for( controller='requests_common', action='view_sample', cntrller=cntrller, id=trans.security.encode_id( sample.id ) )}">${sample.name}</a>
+ <a class="view-info" href="${h.url_for( controller='requests_common', action='view_sample', cntrller=cntrller, id=trans.security.encode_id( sample.id ) )}">${sample.name | h}</a></div><div popupmenu="sample-${sample.id}-popup">
%if can_select_datasets:
@@ -439,11 +439,11 @@
%endif
</div>
%else:
- ${sample_widget_name}
+ ${sample_widget_name | h}
%endif
</td>
%if display_bar_code:
- <td>${sample_widget_bar_code}</td>
+ <td>${sample_widget_bar_code | h}</td>
%endif
%if is_unsubmitted:
<td>Unsubmitted</td>
@@ -451,12 +451,12 @@
<td><a id="sampleState-${sample.id}" href="${h.url_for( controller='requests_common', action='view_sample_history', cntrller=cntrller, sample_id=trans.security.encode_id( sample.id ) )}">${render_sample_state( sample )}</a></td>
%endif
%if sample_widget_library and library_cntrller is not None:
- <td><a href="${h.url_for( controller='library_common', action='browse_library', cntrller=library_cntrller, id=trans.security.encode_id( sample_widget_library.id ) )}">${sample_widget_library.name}</a></td>
+ <td><a href="${h.url_for( controller='library_common', action='browse_library', cntrller=library_cntrller, id=trans.security.encode_id( sample_widget_library.id ) )}">${sample_widget_library.name | h}</a></td>
%else:
<td></td>
%endif
%if sample_widget_folder:
- <td>${sample_widget_folder.name}</td>
+ <td>${sample_widget_folder.name | h}</td>
%else:
<td></td>
%endif
@@ -464,11 +464,11 @@
%if trans.user == sample_widget_history.user:
<td><a target='_parent' href="${h.url_for( controller='history', action='list', operation="Switch", id=trans.security.encode_id(sample_widget_history.id), use_panels=False )}">
- ${sample_widget_history.name}
+ ${sample_widget_history.name | h}
</a></td>
%else:
- <td>${sample_widget_history.name}</td>
+ <td>${sample_widget_history.name | h}</td>
%endif
%else:
<td></td>
@@ -477,11 +477,11 @@
%if trans.user == sample_widget_workflow.stored_workflow.user:
<td><a target='_parent' href="${h.url_for( controller='workflow', action='editor', id=trans.security.encode_id(sample_widget_workflow.stored_workflow.id) )}">
- ${sample_widget_workflow.name}
+ ${sample_widget_workflow.name | h}
</a></td>
%else:
- <td>${sample_widget_workflow.name}</td>
+ <td>${sample_widget_workflow.name | h}</td>
%endif
%else:
<td></td>
@@ -519,7 +519,7 @@
<%def name="render_sample_form( index, sample_name, sample_values, fields_dict, display_only )"><tr>
- <td>${sample_name}</td>
+ <td>${sample_name | h}</td>
%for field_index, field in fields_dict.items():
<%
field_type = field[ 'type' ]
@@ -532,17 +532,17 @@
%if field_type == 'WorkflowField':
%if str( field_value ) != 'none':
<% workflow = trans.sa_session.query( trans.app.model.StoredWorkflow ).get( int( field_value ) ) %>
- <a href="${h.url_for( controller='workflow', action='run', id=trans.security.encode_id( workflow.id ) )}">${workflow.name}</a>
+ <a href="${h.url_for( controller='workflow', action='run', id=trans.security.encode_id( workflow.id ) )}">${workflow.name | h}</a>
%endif
%else:
- ${field_value}
+ ${field_value | h}
%endif
%else:
<i>None</i>
%endif
%else:
%if field_type == 'TextField':
- <input type="text" name="sample_${index}_field_${field_index}" value="${field_value}" size="7"/>
+ <input type="text" name="sample_${index}_field_${field_index}" value="${field_value | h}" size="7"/>
%elif field_type == 'SelectField':
<select name="sample_${index}_field_${field_index}" last_selected_value="2">
%for option_index, option in enumerate(field[ 'selectlist' ]):
@@ -695,7 +695,7 @@
%if is_admin:
<span class="expandLink dataset-${dataset}-click"><span class="rowIcon"></span><div style="float: left; margin-left: 2px;" class="menubutton split popup" id="dataset-${dataset.id}-popup">
- <a class="dataset-${encoded_id}-click" href="${h.url_for( controller='requests_admin', action='manage_datasets', operation='view', id=trans.security.encode_id( dataset.id ) )}">${dataset.name}</a>
+ <a class="dataset-${encoded_id}-click" href="${h.url_for( controller='requests_admin', action='manage_datasets', operation='view', id=trans.security.encode_id( dataset.id ) )}">${dataset.name | h}</a></div></span><div popupmenu="dataset-${dataset.id}-popup">
@@ -704,12 +704,12 @@
%endif
</div>
%else:
- ${dataset.name}
+ ${dataset.name | h}
%endif
</td><td>${dataset.size}</td>
- <td><a href="${h.url_for( controller='library_common', action='browse_library', cntrller=cntrller, id=trans.security.encode_id( sample.library.id ) )}">${dataset.sample.library.name}</a></td>
- <td>${dataset.sample.folder.name}</td>
+ <td><a href="${h.url_for( controller='library_common', action='browse_library', cntrller=cntrller, id=trans.security.encode_id( sample.library.id ) )}">${dataset.sample.library.name | h}</a></td>
+ <td>${dataset.sample.folder.name | h}</td><td id="datasetTransferStatus-${encoded_id}">${dataset.status}</td></tr>
%endfor
@@ -723,7 +723,7 @@
<%def name="render_samples_messages( request, is_admin=False, is_submitted=False, message=None, status=None)">
%if request.is_rejected:
<div class='errormessage'>
- ${request.last_comment}
+ ${request.last_comment | h}
</div><br/>
%endif
%if is_admin and is_submitted and request.samples_without_library_destinations:
diff -r 1034c973ec1d2ce424f711d750ecc6de582d02aa -r 795336f22d8b94b86256b1d4738ee1bf24e18b57 templates/webapps/galaxy/requests/common/create_request.mako
--- a/templates/webapps/galaxy/requests/common/create_request.mako
+++ b/templates/webapps/galaxy/requests/common/create_request.mako
@@ -23,7 +23,7 @@
<div class="toolForm"><div class="toolFormTitle">Create a new sequencing request</div>
%if len( request_type_select_field.options ) < 1:
- There are no request types available for ${trans.user.email} to create sequencing requests.
+ There are no request types available for ${trans.user.email | h} to create sequencing requests.
%else:
<div class="toolFormBody"><form name="create_request" id="create_request" action="${h.url_for( controller='requests_common', action='create_request', cntrller=cntrller )}" method="post" >
diff -r 1034c973ec1d2ce424f711d750ecc6de582d02aa -r 795336f22d8b94b86256b1d4738ee1bf24e18b57 templates/webapps/galaxy/requests/common/edit_basic_request_info.mako
--- a/templates/webapps/galaxy/requests/common/edit_basic_request_info.mako
+++ b/templates/webapps/galaxy/requests/common/edit_basic_request_info.mako
@@ -31,7 +31,7 @@
%endif
<div class="toolForm">
- <div class="toolFormTitle">Edit sequencing request "${request.name}"</div>
+ <div class="toolFormTitle">Edit sequencing request "${request.name | h}"</div><div class="toolFormBody"><form name="edit_basic_request_info" id="edit_basic_request_info" action="${h.url_for( controller='requests_common', action='edit_basic_request_info', cntrller=cntrller, id=trans.security.encode_id( request.id ) )}" method="post" >
%for i, field in enumerate( widgets ):
@@ -70,11 +70,11 @@
%><div class="form-row"><label>Send to:</label>
- <input type="checkbox" name="email_address" value="true" ${email_address}>${request.user.email} (sequencing request owner)<input type="hidden" name="email_address" value="true">
+ <input type="checkbox" name="email_address" value="true" ${email_address}>${request.user.email | h} (sequencing request owner)<input type="hidden" name="email_address" value="true"></div><div class="form-row"><label>Additional email addresses:</label>
- <textarea name="additional_email_addresses" rows="3" cols="40">${emails}</textarea>
+ <textarea name="additional_email_addresses" rows="3" cols="40">${emails | h}</textarea><div class="toolParamHelp" style="clear: both;">
Enter one email address per line
</div>
diff -r 1034c973ec1d2ce424f711d750ecc6de582d02aa -r 795336f22d8b94b86256b1d4738ee1bf24e18b57 templates/webapps/galaxy/requests/common/find_samples.mako
--- a/templates/webapps/galaxy/requests/common/find_samples.mako
+++ b/templates/webapps/galaxy/requests/common/find_samples.mako
@@ -72,7 +72,7 @@
%if samples:
%for sample in samples:
<div class="form-row">
- Sample: <b>${sample.name}</b> | Barcode: ${sample.bar_code}<br/>
+ Sample: <b>${sample.name | h}</b> | Barcode: ${sample.bar_code | h}<br/>
%if sample.request.is_new or not sample.state:
State: Unsubmitted<br/>
%else:
@@ -85,10 +85,10 @@
%>
Datasets: <a href="${h.url_for( controller='requests_common', action='view_sample_datasets', cntrller=cntrller, external_service_id=trans.security.encode_id( external_service.id ), sample_id=trans.security.encode_id( sample.id ) )}">${len( sample.datasets )}</a><br/>
%if is_admin:
- <i>User: ${sample.request.user.email}</i>
+ <i>User: ${sample.request.user.email | h}</i>
%endif
<div class="toolParamHelp" style="clear: both;">
- <a href="${h.url_for( controller='requests_common', action='view_request', cntrller=cntrller, id=trans.security.encode_id( sample.request.id ) )}">Sequencing request: ${sample.request.name} | Type: ${sample.request.type.name} | State: ${sample.request.state}</a>
+ <a href="${h.url_for( controller='requests_common', action='view_request', cntrller=cntrller, id=trans.security.encode_id( sample.request.id ) )}">Sequencing request: ${sample.request.name | h} | Type: ${sample.request.type.name} | State: ${sample.request.state}</a></div></div><br/>
diff -r 1034c973ec1d2ce424f711d750ecc6de582d02aa -r 795336f22d8b94b86256b1d4738ee1bf24e18b57 templates/webapps/galaxy/requests/common/view_request.mako
--- a/templates/webapps/galaxy/requests/common/view_request.mako
+++ b/templates/webapps/galaxy/requests/common/view_request.mako
@@ -58,7 +58,7 @@
${render_samples_messages(request, is_admin, is_submitted, message, status)}
<div class="toolForm">
- <div class="toolFormTitle">Sequencing request "${request.name}"</div>
+ <div class="toolFormTitle">Sequencing request "${request.name | h}"</div><div class="toolFormBody"><div class="form-row"><label>Current state:</label>
@@ -67,12 +67,12 @@
</div><div class="form-row"><label>Description:</label>
- ${request.desc}
+ ${request.desc | h}
<div style="clear: both"></div></div><div class="form-row"><label>User:</label>
- ${request.user.email}
+ ${request.user.email | h}
<div style="clear: both"></div></div><div class="form-row">
@@ -94,7 +94,7 @@
%><div class="form-row"><label>${field_label}:</label>
- ${field_value}
+ ${field_value | h}
</div><div style="clear: both"></div>
%endfor
@@ -116,7 +116,7 @@
else:
emails = ''
%>
- ${emails}
+ ${emails | h}
<div style="clear: both"></div></div><div class="form-row">
diff -r 1034c973ec1d2ce424f711d750ecc6de582d02aa -r 795336f22d8b94b86256b1d4738ee1bf24e18b57 templates/webapps/galaxy/requests/common/view_request_history.mako
--- a/templates/webapps/galaxy/requests/common/view_request_history.mako
+++ b/templates/webapps/galaxy/requests/common/view_request_history.mako
@@ -36,7 +36,7 @@
${render_msg( message, status )}
%endif
-<h3>History of sequencing request "${request.name}"</h3>
+<h3>History of sequencing request "${request.name | h}"</h3><div class="toolForm"><table class="grid">
@@ -52,7 +52,7 @@
<tr><td><b>${event.state}</b></td><td>${time_ago( event.update_time )}</td>
- <td>${event.comment}</td>
+ <td>${event.comment | h}</td></tr>
%endfor
</tbody>
diff -r 1034c973ec1d2ce424f711d750ecc6de582d02aa -r 795336f22d8b94b86256b1d4738ee1bf24e18b57 templates/webapps/galaxy/requests/common/view_sample.mako
--- a/templates/webapps/galaxy/requests/common/view_sample.mako
+++ b/templates/webapps/galaxy/requests/common/view_sample.mako
@@ -6,7 +6,7 @@
%if external_service:
<p><div class="toolForm">
- <div class="toolFormTitle">Available External Service Actions for ${sample.name} at ${external_service.name}</div>
+ <div class="toolFormTitle">Available External Service Actions for ${sample.name | h} at ${external_service.name | h}</div><div class="toolFormBody"><div class="toolMenu">
%for item in external_service.actions:
@@ -25,7 +25,7 @@
<div class="form-row"><div class="toolSectionList"><div class="toolSectionTitle">
- <span>${external_service_group.label}</span>
+ <span>${external_service_group.label | h}</span></div><div class="toolSectionBody"><div class="toolSectionBg">
@@ -54,7 +54,7 @@
target = 'galaxy_main'
%><div class="toolTitle">
- <a href="${external_service_action.get_action_access_link( trans )}" target="${target}">${external_service_action.label}</a>
+ <a href="${external_service_action.get_action_access_link( trans )}" target="${target}">${external_service_action.label | h}</a></div></%def>
@@ -75,38 +75,38 @@
%endif
<div class="toolForm">
- <div class="toolFormTitle">Sample "${sample.name}"</div>
+ <div class="toolFormTitle">Sample "${sample.name | h}"</div><div class="toolFormBody"><div class="form-row"><label>Name:</label>
- ${sample.name}
+ ${sample.name | h}
<div style="clear: both"></div></div><div class="form-row"><label>Description:</label>
- ${sample.desc}
+ ${sample.desc | h}
<div style="clear: both"></div></div><div class="form-row"><label>Barcode:</label>
- ${sample.bar_code}
+ ${sample.bar_code | h}
<div style="clear: both"></div></div>
%if sample.library:
<div class="form-row"><label>Library:</label>
- ${sample.library.name}
+ ${sample.library.name | h}
<div style="clear: both"></div></div><div class="form-row"><label>Folder:</label>
- ${sample.folder.name}
+ ${sample.folder.name | h}
<div style="clear: both"></div></div>
%endif
<div class="form-row"><label>Request:</label>
- ${sample.request.name}
+ ${sample.request.name | h}
<div style="clear: both"></div></div></div>
diff -r 1034c973ec1d2ce424f711d750ecc6de582d02aa -r 795336f22d8b94b86256b1d4738ee1bf24e18b57 templates/webapps/galaxy/requests/common/view_sample_history.mako
--- a/templates/webapps/galaxy/requests/common/view_sample_history.mako
+++ b/templates/webapps/galaxy/requests/common/view_sample_history.mako
@@ -12,7 +12,7 @@
${render_msg( message, status )}
%endif
-<h3>History of sample "${sample.name}"</h3>
+<h3>History of sample "${sample.name | h}"</h3><div class="toolForm"><table class="grid">
@@ -27,10 +27,10 @@
<tbody>
%for event in sample.events:
<tr>
- <td><b>${event.state.name}</b></td>
- <td>${event.state.desc}</td>
+ <td><b>${event.state.name | h}</b></td>
+ <td>${event.state.desc | h}</td><td>${time_ago( event.update_time )}</td>
- <td>${event.comment}</td>
+ <td>${event.comment | h}</td></tr>
%endfor
</tbody>
https://bitbucket.org/galaxy/galaxy-central/commits/172f91ec31ef/
Changeset: 172f91ec31ef
Branch: next-stable
User: martenson
Date: 2014-12-03 17:01:23+00:00
Summary: Merged in martenson/galaxy-central-marten/mako_escape_requests (pull request #579)
[next-stable] escaping of the templates in the 'requests' and 'forms' sections
Affected #: 18 files
diff -r 13d43b327511d46e836398fa09330722acccd419 -r 172f91ec31ef89d0f0eaa162bab5cfdf90866c22 templates/admin/forms/create_form.mako
--- a/templates/admin/forms/create_form.mako
+++ b/templates/admin/forms/create_form.mako
@@ -9,7 +9,7 @@
<div class="toolFormTitle">Create a new form definition</div>
%for label, input in inputs:
<div class="form-row">
- <label>${label}</label>
+ <label>${label | h}</label>
${input.get_html()}
<div style="clear: both"></div></div>
diff -r 13d43b327511d46e836398fa09330722acccd419 -r 172f91ec31ef89d0f0eaa162bab5cfdf90866c22 templates/admin/forms/edit_form_definition.mako
--- a/templates/admin/forms/edit_form_definition.mako
+++ b/templates/admin/forms/edit_form_definition.mako
@@ -96,14 +96,14 @@
<form id="edit_form_definition" name="edit_form_definition" action="${h.url_for( controller='forms', action='edit_form_definition', id=trans.security.encode_id( form_definition.current.id ) )}" method="post" ><div class="toolForm">
- <div class="toolFormTitle">Edit form definition "${form_definition.name}" (${form_definition.type})</div>
+ <div class="toolFormTitle">Edit form definition "${form_definition.name | h}" (${form_definition.type | h})</div>
%if response_redirect:
<input type="hidden" name="response_redirect" value="${response_redirect}" size="40" />
%endif
%for label, input in form_details:
<div class="form-row">
%if label != 'Type':
- <label>${label}</label>
+ <label>${label | h}</label>
%endif
<div style="float: left; width: 250px; margin-right: 10px;">
${input.get_html()}
diff -r 13d43b327511d46e836398fa09330722acccd419 -r 172f91ec31ef89d0f0eaa162bab5cfdf90866c22 templates/admin/request_type/common.mako
--- a/templates/admin/request_type/common.mako
+++ b/templates/admin/request_type/common.mako
@@ -2,7 +2,7 @@
<div class="repeat-group-item"><div class="form-row"><label>${1+element_count}. State name:</label>
- <input type="text" name="state_name_${element_count}" value="${state_name}" size="40"/>
+ <input type="text" name="state_name_${element_count}" value="${state_name | h}" size="40"/>
## Do not show remove button for the first state
%if element_count > 0:
<input type="submit" name="remove_state_button" value="Remove state ${1+element_count}"/>
@@ -10,7 +10,7 @@
</div><div class="form-row"><label>Description:</label>
- <input type="text" name="state_desc_${element_count}" value="${state_desc}" size="40"/>
+ <input type="text" name="state_desc_${element_count}" value="${state_desc | h}" size="40"/><div class="toolParamHelp" style="clear: both;">
optional
</div>
diff -r 13d43b327511d46e836398fa09330722acccd419 -r 172f91ec31ef89d0f0eaa162bab5cfdf90866c22 templates/admin/request_type/create_request_type.mako
--- a/templates/admin/request_type/create_request_type.mako
+++ b/templates/admin/request_type/create_request_type.mako
@@ -23,7 +23,7 @@
<div class="toolFormTitle">Create a new request type</div>
%for rt_info in rt_info_widgets:
<div class="form-row">
- <label>${rt_info['label']}</label>
+ <label>${rt_info['label'] | h}</label><div style="float: left; width: 250px; margin-right: 10px;">
${rt_info['widget'].get_html()}
</div>
diff -r 13d43b327511d46e836398fa09330722acccd419 -r 172f91ec31ef89d0f0eaa162bab5cfdf90866c22 templates/admin/request_type/edit_request_type.mako
--- a/templates/admin/request_type/edit_request_type.mako
+++ b/templates/admin/request_type/edit_request_type.mako
@@ -32,26 +32,26 @@
<form name="edit_request_type" action="${h.url_for( controller='request_type', action='edit_request_type', id=trans.security.encode_id( request_type.id ) )}" method="post" ><div class="toolForm">
- <div class="toolFormTitle">"Edit ${request_type.name}" request type</div>
+ <div class="toolFormTitle">"Edit ${request_type.name | h}" request type</div><div class="form-row"><label>Name:</label>
- <input type="text" name="name" value="${request_type.name}" size="40"/>
+ <input type="text" name="name" value="${request_type.name | }" size="40"/><div style="clear: both"></div></div><div class="form-row"><label>Description:</label>
- <input type="text" name="desc" value="${request_type.desc}" size="40"/>
+ <input type="text" name="desc" value="${request_type.desc | h}" size="40"/><div style="clear: both"></div></div><div class="form-row"><label>Sequencing request form definition:</label>
- <a href="${h.url_for( controller='request_type', action='view_form_definition', id=trans.security.encode_id( request_type.request_form_id ) )}">${request_type.request_form.name}</a>
+ <a href="${h.url_for( controller='request_type', action='view_form_definition', id=trans.security.encode_id( request_type.request_form_id ) )}">${request_type.request_form.name | h}</a>
## Hidden field needed by the __save_request_type() method
<input type="hidden" name="request_form_id" value="${trans.security.encode_id( request_type.request_form_id )}" size="40"/></div><div class="form-row"><label>Sample form definition:</label>
- <a href="${h.url_for( controller='request_type', action='view_form_definition', id=trans.security.encode_id( request_type.sample_form_id ) )}">${request_type.sample_form.name}</a>
+ <a href="${h.url_for( controller='request_type', action='view_form_definition', id=trans.security.encode_id( request_type.sample_form_id ) )}">${request_type.sample_form.name | h}</a>
## Hidden field needed by the __save_request_type() method
<input type="hidden" name="sample_form_id" value="${trans.security.encode_id( request_type.sample_form_id )}" size="40"/></div>
@@ -63,11 +63,11 @@
<div class="repeat-group-item"><div class="form-row"><label>${1+element_count}. State name:</label>
- <input type="text" name="state_name_${trans.security.encode_id( state.id )}" value="${state.name}" size="40"/>
+ <input type="text" name="state_name_${trans.security.encode_id( state.id )}" value="${state.name | h}" size="40"/></div><div class="form-row"><label>Description:</label>
- <input type="text" name="state_desc_${trans.security.encode_id( state.id )}" value="${state.desc}" size="40"/>
+ <input type="text" name="state_desc_${trans.security.encode_id( state.id )}" value="${state.desc | h}" size="40"/><div class="toolParamHelp" style="clear: both;">
optional
</div>
diff -r 13d43b327511d46e836398fa09330722acccd419 -r 172f91ec31ef89d0f0eaa162bab5cfdf90866c22 templates/admin/request_type/request_type_permissions.mako
--- a/templates/admin/request_type/request_type_permissions.mako
+++ b/templates/admin/request_type/request_type_permissions.mako
@@ -48,7 +48,7 @@
%endif
<div class="toolForm">
- <div class="toolFormTitle">Manage access permissions on request type "${request_type.name}"</div>
+ <div class="toolFormTitle">Manage access permissions on request type "${request_type.name | h}"</div><div class="toolFormBody"><form name="request_type_permissions" id="request_type_permissions" action="${h.url_for( controller='request_type', action='request_type_permissions', id=trans.security.encode_id( request_type.id ) )}" method="post"><div class="form-row">
@@ -65,13 +65,13 @@
in_roles.add( a.role )
out_roles = filter( lambda x: x not in in_roles, all_roles )
%>
- ${action.description}<br/><br/>
+ ${action.description | h}<br/><br/><div style="width: 100%; white-space: nowrap;"><div style="float: left; width: 50%;">
Roles associated:<br/><select name="${action_key}_in" id="${action_key}_in_select" class="in_select" style="max-width: 98%; width: 98%; height: 150px; font-size: 100%;" multiple>
%for role in in_roles:
- <option value="${role.id}">${role.name}</option>
+ <option value="${role.id}">${role.name | h}</option>
%endfor
</select><br/><div style="width: 98%; text-align: right"><input type="submit" id="${action_key}_remove_button" class="role_remove_button" value=">>"/></div>
@@ -80,7 +80,7 @@
Roles not associated:<br/><select name="${action_key}_out" id="${action_key}_out_select" style="max-width: 98%; width: 98%; height: 150px; font-size: 100%;" multiple>
%for role in out_roles:
- <option value="${role.id}">${role.name}</option>
+ <option value="${role.id}">${role.name | h}</option>
%endfor
</select><br/><input type="submit" id="${action_key}_add_button" class="role_add_button" value="<<"/>
diff -r 13d43b327511d46e836398fa09330722acccd419 -r 172f91ec31ef89d0f0eaa162bab5cfdf90866c22 templates/admin/request_type/view_request_type.mako
--- a/templates/admin/request_type/view_request_type.mako
+++ b/templates/admin/request_type/view_request_type.mako
@@ -30,24 +30,24 @@
%endif
<div class="toolForm">
- <div class="toolFormTitle">"${request_type.name}" request type</div>
+ <div class="toolFormTitle">"${request_type.name | h}" request type</div><div class="form-row"><label>Name:</label>
- ${request_type.name}
+ ${request_type.name | h}
<div style="clear: both"></div></div><div class="form-row"><label>Description:</label>
- ${request_type.desc}
+ ${request_type.desc | h}
<div style="clear: both"></div></div><div class="form-row"><label>Sequencing request form definition:</label>
- <a href="${h.url_for( controller='request_type', action='view_form_definition', id=trans.security.encode_id( request_type.request_form_id ) )}">${request_type.request_form.name}</a>
+ <a href="${h.url_for( controller='request_type', action='view_form_definition', id=trans.security.encode_id( request_type.request_form_id ) )}">${request_type.request_form.name | h}</a></div><div class="form-row"><label>Sample form definition:</label>
- <a href="${h.url_for( controller='request_type', action='view_form_definition', id=trans.security.encode_id( request_type.sample_form_id ) )}">${request_type.sample_form.name}</a>
+ <a href="${h.url_for( controller='request_type', action='view_form_definition', id=trans.security.encode_id( request_type.sample_form_id ) )}">${request_type.sample_form.name | h}</a></div></div><p/>
@@ -55,8 +55,8 @@
<div class="toolFormTitle">Sample states defined for this request type</div>
%for state in request_type.states:
<div class="form-row">
- <label>${state.name}</label>
- ${state.desc}
+ <label>${state.name | h}</label>
+ ${state.desc | h}
</div><div style="clear: both"></div>
%endfor
@@ -67,8 +67,8 @@
%if request_type.external_services:
%for index, external_service in enumerate( request_type.external_services ):
<div class="form-row">
- <label><a href="${h.url_for( controller='external_service', action='view_external_service', id=trans.security.encode_id( external_service.id ) )}">${external_service.name}</a></label>
- ${external_service.get_external_service_type( trans ).name}
+ <label><a href="${h.url_for( controller='external_service', action='view_external_service', id=trans.security.encode_id( external_service.id ) )}">${external_service.name | h}</a></label>
+ ${external_service.get_external_service_type( trans ).name | h}
</div>
%endfor
%else:
diff -r 13d43b327511d46e836398fa09330722acccd419 -r 172f91ec31ef89d0f0eaa162bab5cfdf90866c22 templates/admin/requests/reject.mako
--- a/templates/admin/requests/reject.mako
+++ b/templates/admin/requests/reject.mako
@@ -15,7 +15,7 @@
</ul><div class="toolForm">
- <div class="toolFormTitle">Reject sequencing request "${request.name}"</div>
+ <div class="toolFormTitle">Reject sequencing request "${request.name | h}"</div><form name="event" action="${h.url_for( controller='requests_admin', action='reject_request', id=trans.security.encode_id( request.id ) )}" method="post" ><div class="form-row">
Rejecting this request will move the request state to <b>Rejected</b>.
diff -r 13d43b327511d46e836398fa09330722acccd419 -r 172f91ec31ef89d0f0eaa162bab5cfdf90866c22 templates/admin/requests/rename_datasets.mako
--- a/templates/admin/requests/rename_datasets.mako
+++ b/templates/admin/requests/rename_datasets.mako
@@ -3,7 +3,7 @@
<% from galaxy.webapps.galaxy.controllers.requests_admin import build_rename_datasets_for_sample_select_field %>
-<h3>Rename datasets for Sample "${sample.name}"</h3>
+<h3>Rename datasets for Sample "${sample.name | h}"</h3><ul class="manage-table-actions"><li><a class="action-button" href="${h.url_for( controller='requests_admin', action='manage_datasets', sample_id=trans.security.encode_id( sample.id ) )}">Browse datasets</a></li>
@@ -35,7 +35,7 @@
${rename_datasets_for_sample_select_field.get_html()}
</td><td>
- <input type="text" name="new_name_${trans.security.encode_id( sample_dataset.id ) }" value="${sample_dataset.name}" size="100"/>
+ <input type="text" name="new_name_${trans.security.encode_id( sample_dataset.id ) }" value="${sample_dataset.name | h}" size="100"/></td><td>${sample_dataset.file_path}</td></tr>
diff -r 13d43b327511d46e836398fa09330722acccd419 -r 172f91ec31ef89d0f0eaa162bab5cfdf90866c22 templates/admin/requests/view_sample_dataset.mako
--- a/templates/admin/requests/view_sample_dataset.mako
+++ b/templates/admin/requests/view_sample_dataset.mako
@@ -21,19 +21,19 @@
</ul><div class="toolForm">
- <div class="toolFormTitle">"${sample.name}" Dataset</div>
+ <div class="toolFormTitle">"${sample.name | h}" Dataset</div><div class="toolFormBody"><div class="form-row"><label>Name:</label><div style="float: left; width: 250px; margin-right: 10px;">
- ${sample_dataset.name}
+ ${sample_dataset.name | h}
</div><div style="clear: both"></div></div><div class="form-row"><label>External service:</label><div style="float: left; width: 250px; margin-right: 10px;">
- ${sample_dataset.external_service.name} (${sample_dataset.external_service.get_external_service_type( trans ).name})
+ ${sample_dataset.external_service.name | h} (${sample_dataset.external_service.get_external_service_type( trans ).name | h})
</div><div style="clear: both"></div></div>
diff -r 13d43b327511d46e836398fa09330722acccd419 -r 172f91ec31ef89d0f0eaa162bab5cfdf90866c22 templates/webapps/galaxy/requests/common/common.mako
--- a/templates/webapps/galaxy/requests/common/common.mako
+++ b/templates/webapps/galaxy/requests/common/common.mako
@@ -257,18 +257,18 @@
<td valign="top"><input type="checkbox" name=select_sample_${sample.id} id="sample_checkbox" value="true" ${checked_str}/><input type="hidden" name=select_sample_${sample.id} id="sample_checkbox" value="true"/></td>
%endif
<td valign="top">
- <input type="text" name="sample_${sample_widget_index}_name" value="${sample_widget['name']}" size="10"/>
+ <input type="text" name="sample_${sample_widget_index}_name" value="${sample_widget['name'] | h}" size="10"/><div class="toolParamHelp" style="clear: both;">
- <i>${' (required)' }</i>
+ <i>(required)</i></div></td>
%if display_bar_code:
<td valign="top">
%if is_admin and is_submitted:
- <input type="text" name="sample_${sample_widget_index}_bar_code" value="${sample_widget['bar_code']}" size="10"/>
+ <input type="text" name="sample_${sample_widget_index}_bar_code" value="${sample_widget['bar_code'] | h}" size="10"/>
%else:
- ${sample_widget['bar_code']}
- <input type="hidden" name="sample_${sample_widget_index}_bar_code" value="${sample_widget['bar_code']}"/>
+ ${sample_widget['bar_code'] | h}
+ <input type="hidden" name="sample_${sample_widget_index}_bar_code" value="${sample_widget['bar_code'] | h}"/>
%endif
</td>
%endif
@@ -416,7 +416,7 @@
transferred_dataset_files = []
%><div style="float: left; margin-left: 2px;" class="menubutton split popup" id="sample-${sample.id}-popup">
- <a class="view-info" href="${h.url_for( controller='requests_common', action='view_sample', cntrller=cntrller, id=trans.security.encode_id( sample.id ) )}">${sample.name}</a>
+ <a class="view-info" href="${h.url_for( controller='requests_common', action='view_sample', cntrller=cntrller, id=trans.security.encode_id( sample.id ) )}">${sample.name | h}</a></div><div popupmenu="sample-${sample.id}-popup">
%if can_select_datasets:
@@ -439,11 +439,11 @@
%endif
</div>
%else:
- ${sample_widget_name}
+ ${sample_widget_name | h}
%endif
</td>
%if display_bar_code:
- <td>${sample_widget_bar_code}</td>
+ <td>${sample_widget_bar_code | h}</td>
%endif
%if is_unsubmitted:
<td>Unsubmitted</td>
@@ -451,12 +451,12 @@
<td><a id="sampleState-${sample.id}" href="${h.url_for( controller='requests_common', action='view_sample_history', cntrller=cntrller, sample_id=trans.security.encode_id( sample.id ) )}">${render_sample_state( sample )}</a></td>
%endif
%if sample_widget_library and library_cntrller is not None:
- <td><a href="${h.url_for( controller='library_common', action='browse_library', cntrller=library_cntrller, id=trans.security.encode_id( sample_widget_library.id ) )}">${sample_widget_library.name}</a></td>
+ <td><a href="${h.url_for( controller='library_common', action='browse_library', cntrller=library_cntrller, id=trans.security.encode_id( sample_widget_library.id ) )}">${sample_widget_library.name | h}</a></td>
%else:
<td></td>
%endif
%if sample_widget_folder:
- <td>${sample_widget_folder.name}</td>
+ <td>${sample_widget_folder.name | h}</td>
%else:
<td></td>
%endif
@@ -464,11 +464,11 @@
%if trans.user == sample_widget_history.user:
<td><a target='_parent' href="${h.url_for( controller='history', action='list', operation="Switch", id=trans.security.encode_id(sample_widget_history.id), use_panels=False )}">
- ${sample_widget_history.name}
+ ${sample_widget_history.name | h}
</a></td>
%else:
- <td>${sample_widget_history.name}</td>
+ <td>${sample_widget_history.name | h}</td>
%endif
%else:
<td></td>
@@ -477,11 +477,11 @@
%if trans.user == sample_widget_workflow.stored_workflow.user:
<td><a target='_parent' href="${h.url_for( controller='workflow', action='editor', id=trans.security.encode_id(sample_widget_workflow.stored_workflow.id) )}">
- ${sample_widget_workflow.name}
+ ${sample_widget_workflow.name | h}
</a></td>
%else:
- <td>${sample_widget_workflow.name}</td>
+ <td>${sample_widget_workflow.name | h}</td>
%endif
%else:
<td></td>
@@ -519,7 +519,7 @@
<%def name="render_sample_form( index, sample_name, sample_values, fields_dict, display_only )"><tr>
- <td>${sample_name}</td>
+ <td>${sample_name | h}</td>
%for field_index, field in fields_dict.items():
<%
field_type = field[ 'type' ]
@@ -532,17 +532,17 @@
%if field_type == 'WorkflowField':
%if str( field_value ) != 'none':
<% workflow = trans.sa_session.query( trans.app.model.StoredWorkflow ).get( int( field_value ) ) %>
- <a href="${h.url_for( controller='workflow', action='run', id=trans.security.encode_id( workflow.id ) )}">${workflow.name}</a>
+ <a href="${h.url_for( controller='workflow', action='run', id=trans.security.encode_id( workflow.id ) )}">${workflow.name | h}</a>
%endif
%else:
- ${field_value}
+ ${field_value | h}
%endif
%else:
<i>None</i>
%endif
%else:
%if field_type == 'TextField':
- <input type="text" name="sample_${index}_field_${field_index}" value="${field_value}" size="7"/>
+ <input type="text" name="sample_${index}_field_${field_index}" value="${field_value | h}" size="7"/>
%elif field_type == 'SelectField':
<select name="sample_${index}_field_${field_index}" last_selected_value="2">
%for option_index, option in enumerate(field[ 'selectlist' ]):
@@ -695,7 +695,7 @@
%if is_admin:
<span class="expandLink dataset-${dataset}-click"><span class="rowIcon"></span><div style="float: left; margin-left: 2px;" class="menubutton split popup" id="dataset-${dataset.id}-popup">
- <a class="dataset-${encoded_id}-click" href="${h.url_for( controller='requests_admin', action='manage_datasets', operation='view', id=trans.security.encode_id( dataset.id ) )}">${dataset.name}</a>
+ <a class="dataset-${encoded_id}-click" href="${h.url_for( controller='requests_admin', action='manage_datasets', operation='view', id=trans.security.encode_id( dataset.id ) )}">${dataset.name | h}</a></div></span><div popupmenu="dataset-${dataset.id}-popup">
@@ -704,12 +704,12 @@
%endif
</div>
%else:
- ${dataset.name}
+ ${dataset.name | h}
%endif
</td><td>${dataset.size}</td>
- <td><a href="${h.url_for( controller='library_common', action='browse_library', cntrller=cntrller, id=trans.security.encode_id( sample.library.id ) )}">${dataset.sample.library.name}</a></td>
- <td>${dataset.sample.folder.name}</td>
+ <td><a href="${h.url_for( controller='library_common', action='browse_library', cntrller=cntrller, id=trans.security.encode_id( sample.library.id ) )}">${dataset.sample.library.name | h}</a></td>
+ <td>${dataset.sample.folder.name | h}</td><td id="datasetTransferStatus-${encoded_id}">${dataset.status}</td></tr>
%endfor
@@ -723,7 +723,7 @@
<%def name="render_samples_messages( request, is_admin=False, is_submitted=False, message=None, status=None)">
%if request.is_rejected:
<div class='errormessage'>
- ${request.last_comment}
+ ${request.last_comment | h}
</div><br/>
%endif
%if is_admin and is_submitted and request.samples_without_library_destinations:
diff -r 13d43b327511d46e836398fa09330722acccd419 -r 172f91ec31ef89d0f0eaa162bab5cfdf90866c22 templates/webapps/galaxy/requests/common/create_request.mako
--- a/templates/webapps/galaxy/requests/common/create_request.mako
+++ b/templates/webapps/galaxy/requests/common/create_request.mako
@@ -23,7 +23,7 @@
<div class="toolForm"><div class="toolFormTitle">Create a new sequencing request</div>
%if len( request_type_select_field.options ) < 1:
- There are no request types available for ${trans.user.email} to create sequencing requests.
+ There are no request types available for ${trans.user.email | h} to create sequencing requests.
%else:
<div class="toolFormBody"><form name="create_request" id="create_request" action="${h.url_for( controller='requests_common', action='create_request', cntrller=cntrller )}" method="post" >
diff -r 13d43b327511d46e836398fa09330722acccd419 -r 172f91ec31ef89d0f0eaa162bab5cfdf90866c22 templates/webapps/galaxy/requests/common/edit_basic_request_info.mako
--- a/templates/webapps/galaxy/requests/common/edit_basic_request_info.mako
+++ b/templates/webapps/galaxy/requests/common/edit_basic_request_info.mako
@@ -31,7 +31,7 @@
%endif
<div class="toolForm">
- <div class="toolFormTitle">Edit sequencing request "${request.name}"</div>
+ <div class="toolFormTitle">Edit sequencing request "${request.name | h}"</div><div class="toolFormBody"><form name="edit_basic_request_info" id="edit_basic_request_info" action="${h.url_for( controller='requests_common', action='edit_basic_request_info', cntrller=cntrller, id=trans.security.encode_id( request.id ) )}" method="post" >
%for i, field in enumerate( widgets ):
@@ -70,11 +70,11 @@
%><div class="form-row"><label>Send to:</label>
- <input type="checkbox" name="email_address" value="true" ${email_address}>${request.user.email} (sequencing request owner)<input type="hidden" name="email_address" value="true">
+ <input type="checkbox" name="email_address" value="true" ${email_address}>${request.user.email | h} (sequencing request owner)<input type="hidden" name="email_address" value="true"></div><div class="form-row"><label>Additional email addresses:</label>
- <textarea name="additional_email_addresses" rows="3" cols="40">${emails}</textarea>
+ <textarea name="additional_email_addresses" rows="3" cols="40">${emails | h}</textarea><div class="toolParamHelp" style="clear: both;">
Enter one email address per line
</div>
diff -r 13d43b327511d46e836398fa09330722acccd419 -r 172f91ec31ef89d0f0eaa162bab5cfdf90866c22 templates/webapps/galaxy/requests/common/find_samples.mako
--- a/templates/webapps/galaxy/requests/common/find_samples.mako
+++ b/templates/webapps/galaxy/requests/common/find_samples.mako
@@ -72,7 +72,7 @@
%if samples:
%for sample in samples:
<div class="form-row">
- Sample: <b>${sample.name}</b> | Barcode: ${sample.bar_code}<br/>
+ Sample: <b>${sample.name | h}</b> | Barcode: ${sample.bar_code | h}<br/>
%if sample.request.is_new or not sample.state:
State: Unsubmitted<br/>
%else:
@@ -85,10 +85,10 @@
%>
Datasets: <a href="${h.url_for( controller='requests_common', action='view_sample_datasets', cntrller=cntrller, external_service_id=trans.security.encode_id( external_service.id ), sample_id=trans.security.encode_id( sample.id ) )}">${len( sample.datasets )}</a><br/>
%if is_admin:
- <i>User: ${sample.request.user.email}</i>
+ <i>User: ${sample.request.user.email | h}</i>
%endif
<div class="toolParamHelp" style="clear: both;">
- <a href="${h.url_for( controller='requests_common', action='view_request', cntrller=cntrller, id=trans.security.encode_id( sample.request.id ) )}">Sequencing request: ${sample.request.name} | Type: ${sample.request.type.name} | State: ${sample.request.state}</a>
+ <a href="${h.url_for( controller='requests_common', action='view_request', cntrller=cntrller, id=trans.security.encode_id( sample.request.id ) )}">Sequencing request: ${sample.request.name | h} | Type: ${sample.request.type.name} | State: ${sample.request.state}</a></div></div><br/>
diff -r 13d43b327511d46e836398fa09330722acccd419 -r 172f91ec31ef89d0f0eaa162bab5cfdf90866c22 templates/webapps/galaxy/requests/common/view_request.mako
--- a/templates/webapps/galaxy/requests/common/view_request.mako
+++ b/templates/webapps/galaxy/requests/common/view_request.mako
@@ -58,7 +58,7 @@
${render_samples_messages(request, is_admin, is_submitted, message, status)}
<div class="toolForm">
- <div class="toolFormTitle">Sequencing request "${request.name}"</div>
+ <div class="toolFormTitle">Sequencing request "${request.name | h}"</div><div class="toolFormBody"><div class="form-row"><label>Current state:</label>
@@ -67,12 +67,12 @@
</div><div class="form-row"><label>Description:</label>
- ${request.desc}
+ ${request.desc | h}
<div style="clear: both"></div></div><div class="form-row"><label>User:</label>
- ${request.user.email}
+ ${request.user.email | h}
<div style="clear: both"></div></div><div class="form-row">
@@ -94,7 +94,7 @@
%><div class="form-row"><label>${field_label}:</label>
- ${field_value}
+ ${field_value | h}
</div><div style="clear: both"></div>
%endfor
@@ -116,7 +116,7 @@
else:
emails = ''
%>
- ${emails}
+ ${emails | h}
<div style="clear: both"></div></div><div class="form-row">
diff -r 13d43b327511d46e836398fa09330722acccd419 -r 172f91ec31ef89d0f0eaa162bab5cfdf90866c22 templates/webapps/galaxy/requests/common/view_request_history.mako
--- a/templates/webapps/galaxy/requests/common/view_request_history.mako
+++ b/templates/webapps/galaxy/requests/common/view_request_history.mako
@@ -36,7 +36,7 @@
${render_msg( message, status )}
%endif
-<h3>History of sequencing request "${request.name}"</h3>
+<h3>History of sequencing request "${request.name | h}"</h3><div class="toolForm"><table class="grid">
@@ -52,7 +52,7 @@
<tr><td><b>${event.state}</b></td><td>${time_ago( event.update_time )}</td>
- <td>${event.comment}</td>
+ <td>${event.comment | h}</td></tr>
%endfor
</tbody>
diff -r 13d43b327511d46e836398fa09330722acccd419 -r 172f91ec31ef89d0f0eaa162bab5cfdf90866c22 templates/webapps/galaxy/requests/common/view_sample.mako
--- a/templates/webapps/galaxy/requests/common/view_sample.mako
+++ b/templates/webapps/galaxy/requests/common/view_sample.mako
@@ -6,7 +6,7 @@
%if external_service:
<p><div class="toolForm">
- <div class="toolFormTitle">Available External Service Actions for ${sample.name} at ${external_service.name}</div>
+ <div class="toolFormTitle">Available External Service Actions for ${sample.name | h} at ${external_service.name | h}</div><div class="toolFormBody"><div class="toolMenu">
%for item in external_service.actions:
@@ -25,7 +25,7 @@
<div class="form-row"><div class="toolSectionList"><div class="toolSectionTitle">
- <span>${external_service_group.label}</span>
+ <span>${external_service_group.label | h}</span></div><div class="toolSectionBody"><div class="toolSectionBg">
@@ -54,7 +54,7 @@
target = 'galaxy_main'
%><div class="toolTitle">
- <a href="${external_service_action.get_action_access_link( trans )}" target="${target}">${external_service_action.label}</a>
+ <a href="${external_service_action.get_action_access_link( trans )}" target="${target}">${external_service_action.label | h}</a></div></%def>
@@ -75,38 +75,38 @@
%endif
<div class="toolForm">
- <div class="toolFormTitle">Sample "${sample.name}"</div>
+ <div class="toolFormTitle">Sample "${sample.name | h}"</div><div class="toolFormBody"><div class="form-row"><label>Name:</label>
- ${sample.name}
+ ${sample.name | h}
<div style="clear: both"></div></div><div class="form-row"><label>Description:</label>
- ${sample.desc}
+ ${sample.desc | h}
<div style="clear: both"></div></div><div class="form-row"><label>Barcode:</label>
- ${sample.bar_code}
+ ${sample.bar_code | h}
<div style="clear: both"></div></div>
%if sample.library:
<div class="form-row"><label>Library:</label>
- ${sample.library.name}
+ ${sample.library.name | h}
<div style="clear: both"></div></div><div class="form-row"><label>Folder:</label>
- ${sample.folder.name}
+ ${sample.folder.name | h}
<div style="clear: both"></div></div>
%endif
<div class="form-row"><label>Request:</label>
- ${sample.request.name}
+ ${sample.request.name | h}
<div style="clear: both"></div></div></div>
diff -r 13d43b327511d46e836398fa09330722acccd419 -r 172f91ec31ef89d0f0eaa162bab5cfdf90866c22 templates/webapps/galaxy/requests/common/view_sample_history.mako
--- a/templates/webapps/galaxy/requests/common/view_sample_history.mako
+++ b/templates/webapps/galaxy/requests/common/view_sample_history.mako
@@ -12,7 +12,7 @@
${render_msg( message, status )}
%endif
-<h3>History of sample "${sample.name}"</h3>
+<h3>History of sample "${sample.name | h}"</h3><div class="toolForm"><table class="grid">
@@ -27,10 +27,10 @@
<tbody>
%for event in sample.events:
<tr>
- <td><b>${event.state.name}</b></td>
- <td>${event.state.desc}</td>
+ <td><b>${event.state.name | h}</b></td>
+ <td>${event.state.desc | h}</td><td>${time_ago( event.update_time )}</td>
- <td>${event.comment}</td>
+ <td>${event.comment | h}</td></tr>
%endfor
</tbody>
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0
2 new commits in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/0273de7467e0/
Changeset: 0273de7467e0
User: dan
Date: 2014-12-03 16:35:35+00:00
Summary: DatasetMatcher should check to see if hda is of the correct format before attempting to filter on e.g. metadata attributes (that may not exist for a non-expected format).
Affected #: 1 file
diff -r 87ef26ad1876d0d6162eb4b6e7c93c8d69fbc4d6 -r 0273de7467e0f42a56ffa018c5fb9a53a6396e76 lib/galaxy/tools/parameters/dataset_matcher.py
--- a/lib/galaxy/tools/parameters/dataset_matcher.py
+++ b/lib/galaxy/tools/parameters/dataset_matcher.py
@@ -39,27 +39,30 @@
return state_valid and ( not check_security or self.__can_access_dataset( dataset ) )
def valid_hda_match( self, hda, check_implicit_conversions=True, check_security=False ):
- """ Return False of this parameter can not be matched to a the supplied
+ """ Return False of this parameter can not be matched to the supplied
HDA, otherwise return a description of the match (either a
HdaDirectMatch describing a direct match or a HdaImplicitMatch
describing an implicit conversion.)
"""
+ rval = False
+ formats = self.param.formats
+ if hda.datatype.matches_any( formats ):
+ rval = HdaDirectMatch( hda )
+ else:
+ if not check_implicit_conversions:
+ return False
+ target_ext, converted_dataset = hda.find_conversion_destination( formats )
+ if target_ext:
+ if converted_dataset:
+ hda = converted_dataset
+ if check_security and not self.__can_access_dataset( hda.dataset ):
+ return False
+ rval = HdaImplicitMatch( hda, target_ext )
+ else:
+ return False
if self.filter( hda ):
return False
- formats = self.param.formats
- if hda.datatype.matches_any( formats ):
- return HdaDirectMatch( hda )
- if not check_implicit_conversions:
- return False
- target_ext, converted_dataset = hda.find_conversion_destination( formats )
- if target_ext:
- original_hda = hda
- if converted_dataset:
- hda = converted_dataset
- if check_security and not self.__can_access_dataset( hda.dataset ):
- return False
- return HdaImplicitMatch( hda, target_ext, original_hda )
- return False
+ return rval
def hda_match( self, hda, check_implicit_conversions=True, ensure_visible=True ):
""" If HDA is accessible, return information about whether it could
https://bitbucket.org/galaxy/galaxy-central/commits/13d43b327511/
Changeset: 13d43b327511
Branch: next-stable
User: dan
Date: 2014-12-03 16:35:35+00:00
Summary: DatasetMatcher should check to see if hda is of the correct format before attempting to filter on e.g. metadata attributes (that may not exist for a non-expected format).
Affected #: 1 file
diff -r f05ed31c16741b5c1a4a43c73697f7ca9a6919d8 -r 13d43b327511d46e836398fa09330722acccd419 lib/galaxy/tools/parameters/dataset_matcher.py
--- a/lib/galaxy/tools/parameters/dataset_matcher.py
+++ b/lib/galaxy/tools/parameters/dataset_matcher.py
@@ -39,27 +39,30 @@
return state_valid and ( not check_security or self.__can_access_dataset( dataset ) )
def valid_hda_match( self, hda, check_implicit_conversions=True, check_security=False ):
- """ Return False of this parameter can not be matched to a the supplied
+ """ Return False of this parameter can not be matched to the supplied
HDA, otherwise return a description of the match (either a
HdaDirectMatch describing a direct match or a HdaImplicitMatch
describing an implicit conversion.)
"""
+ rval = False
+ formats = self.param.formats
+ if hda.datatype.matches_any( formats ):
+ rval = HdaDirectMatch( hda )
+ else:
+ if not check_implicit_conversions:
+ return False
+ target_ext, converted_dataset = hda.find_conversion_destination( formats )
+ if target_ext:
+ if converted_dataset:
+ hda = converted_dataset
+ if check_security and not self.__can_access_dataset( hda.dataset ):
+ return False
+ rval = HdaImplicitMatch( hda, target_ext )
+ else:
+ return False
if self.filter( hda ):
return False
- formats = self.param.formats
- if hda.datatype.matches_any( formats ):
- return HdaDirectMatch( hda )
- if not check_implicit_conversions:
- return False
- target_ext, converted_dataset = hda.find_conversion_destination( formats )
- if target_ext:
- original_hda = hda
- if converted_dataset:
- hda = converted_dataset
- if check_security and not self.__can_access_dataset( hda.dataset ):
- return False
- return HdaImplicitMatch( hda, target_ext, original_hda )
- return False
+ return rval
def hda_match( self, hda, check_implicit_conversions=True, ensure_visible=True ):
""" If HDA is accessible, return information about whether it could
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0
3 new commits in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/b2df443a12d6/
Changeset: b2df443a12d6
Branch: next-stable
User: dannon
Date: 2014-12-03 14:21:54+00:00
Summary: Bump NO_OUTPUT_TIMEOUT to 60m; Bjoern said it's causing issues w/ some tools for being too short.
Affected #: 1 file
diff -r eb9d9ab34d23456d58f291b782b42724a83f711e -r b2df443a12d6a721da2a58b56491fbed08ebc4d9 lib/tool_shed/util/basic_util.py
--- a/lib/tool_shed/util/basic_util.py
+++ b/lib/tool_shed/util/basic_util.py
@@ -16,7 +16,7 @@
CHUNK_SIZE = 2**20 # 1Mb
INSTALLATION_LOG = 'INSTALLATION.log'
# Set no activity timeout to 20 minutes.
-NO_OUTPUT_TIMEOUT = 1200.0
+NO_OUTPUT_TIMEOUT = 3600.0
MAXDIFFSIZE = 8000
MAX_DISPLAY_SIZE = 32768
https://bitbucket.org/galaxy/galaxy-central/commits/81d5a494d274/
Changeset: 81d5a494d274
Branch: next-stable
User: dannon
Date: 2014-12-03 14:23:14+00:00
Summary: Pep8 tool_shed/util/basic_util
Affected #: 1 file
diff -r b2df443a12d6a721da2a58b56491fbed08ebc4d9 -r 81d5a494d274918192fe92bd3ac9217bcb22ef2c lib/tool_shed/util/basic_util.py
--- a/lib/tool_shed/util/basic_util.py
+++ b/lib/tool_shed/util/basic_util.py
@@ -13,7 +13,7 @@
log = logging.getLogger( __name__ )
-CHUNK_SIZE = 2**20 # 1Mb
+CHUNK_SIZE = 2**20 # 1Mb
INSTALLATION_LOG = 'INSTALLATION.log'
# Set no activity timeout to 20 minutes.
NO_OUTPUT_TIMEOUT = 3600.0
@@ -47,6 +47,7 @@
RUN service postgresql start && service apache2 start && ./run.sh --daemon && sleep 120 && python ./scripts/api/install_tool_shed_repositories.py --api admin -l http://localhost:8080 --url ${tool_shed_url} -o ${repository_owner} --name ${repository_name} --tool-deps --repository-deps --panel-section-name 'Docker'
'''
+
def evaluate_template( text, install_environment ):
"""
Substitute variables defined in XML blocks from dependencies file. The value of the received
@@ -56,6 +57,7 @@
"""
return Template( text ).safe_substitute( get_env_var_values( install_environment ) )
+
def get_env_var_values( install_environment ):
"""
Return a dictionary of values, some of which enable substitution of reserved words for the values.
@@ -72,6 +74,7 @@
env_var_dict[ '__is64bit__' ] = sys.maxsize > 2**32
return env_var_dict
+
def get_file_type_str( changeset_revision, file_type ):
if file_type == 'zip':
file_type_str = '%s.zip' % changeset_revision
@@ -83,6 +86,7 @@
file_type_str = ''
return file_type_str
+
def move_file( current_dir, source, destination, rename_to=None ):
source_path = os.path.abspath( os.path.join( current_dir, source ) )
source_file = os.path.basename( source_path )
@@ -97,6 +101,7 @@
os.makedirs( destination_directory )
shutil.move( source_path, destination_path )
+
def remove_dir( dir ):
"""Attempt to remove a directory from disk."""
if dir:
@@ -106,6 +111,7 @@
except:
pass
+
def size_string( raw_text, size=MAX_DISPLAY_SIZE ):
"""Return a subset of a string (up to MAX_DISPLAY_SIZE) translated to a safe string for display in a browser."""
if raw_text and len( raw_text ) >= size:
@@ -113,11 +119,13 @@
raw_text = '%s%s' % ( raw_text[ 0:size ], large_str )
return raw_text or ''
+
def stringify( list ):
if list:
return ','.join( list )
return ''
+
def strip_path( fpath ):
"""Attempt to strip the path from a file name."""
if not fpath:
@@ -128,6 +136,7 @@
file_name = fpath
return file_name
+
def to_html_string( text ):
"""Translates the characters in text to an html string"""
if text:
https://bitbucket.org/galaxy/galaxy-central/commits/f05ed31c1674/
Changeset: f05ed31c1674
Branch: next-stable
User: dannon
Date: 2014-12-03 14:24:44+00:00
Summary: Fix size_string; this would have thrown an exception on being called due to an unimported 'util'.
Affected #: 1 file
diff -r 81d5a494d274918192fe92bd3ac9217bcb22ef2c -r f05ed31c16741b5c1a4a43c73697f7ca9a6919d8 lib/tool_shed/util/basic_util.py
--- a/lib/tool_shed/util/basic_util.py
+++ b/lib/tool_shed/util/basic_util.py
@@ -4,7 +4,7 @@
import sys
from string import Template
-from galaxy.util import unicodify
+from galaxy.util import unicodify, nice_size
from galaxy import eggs
@@ -115,7 +115,7 @@
def size_string( raw_text, size=MAX_DISPLAY_SIZE ):
"""Return a subset of a string (up to MAX_DISPLAY_SIZE) translated to a safe string for display in a browser."""
if raw_text and len( raw_text ) >= size:
- large_str = '\nFile contents truncated because file size is larger than maximum viewing size of %s\n' % util.nice_size( size )
+ large_str = '\nFile contents truncated because file size is larger than maximum viewing size of %s\n' % nice_size( size )
raw_text = '%s%s' % ( raw_text[ 0:size ], large_str )
return raw_text or ''
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0
commit/galaxy-central: jmchilton: Improvements to test/api/test_workflow_extraction.py.
by commits-noreply@bitbucket.org 03 Dec '14
by commits-noreply@bitbucket.org 03 Dec '14
03 Dec '14
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/87ef26ad1876/
Changeset: 87ef26ad1876
User: jmchilton
Date: 2014-12-03 03:17:25+00:00
Summary: Improvements to test/api/test_workflow_extraction.py.
Fill out the dataset collection parameter test and add a new test for a workflow that includes subcollection mapping. Move toward orchestrating jobs in this file via a high-level YAML description of steps and test data as well as some higher-level methods for testing various stuff about extracted workflows (step counts, input types, tools used, connected-ness, etc...).
Allow ordering jobs index API by create_time instead of update_time.
Affected #: 4 files
diff -r a734cbf4bd368198e2c813b5ea61e807f9a1af33 -r 87ef26ad1876d0d6162eb4b6e7c93c8d69fbc4d6 lib/galaxy/webapps/galaxy/api/jobs.py
--- a/lib/galaxy/webapps/galaxy/api/jobs.py
+++ b/lib/galaxy/webapps/galaxy/api/jobs.py
@@ -73,9 +73,11 @@
raise exceptions.ObjectAttributeInvalidException()
out = []
- for job in query.order_by(
- trans.app.model.Job.update_time.desc()
- ).all():
+ if kwd.get( 'order_by' ) == 'create_time':
+ order_by = trans.app.model.Job.create_time.desc()
+ else:
+ order_by = trans.app.model.Job.update_time.desc()
+ for job in query.order_by( order_by ).all():
out.append( self.encode_all_ids( trans, job.to_dict( 'collection' ), True ) )
return out
diff -r a734cbf4bd368198e2c813b5ea61e807f9a1af33 -r 87ef26ad1876d0d6162eb4b6e7c93c8d69fbc4d6 test/api/helpers.py
--- a/test/api/helpers.py
+++ b/test/api/helpers.py
@@ -76,7 +76,10 @@
return run_response.json()["outputs"][0]
def wait_for_history( self, history_id, assert_ok=False, timeout=DEFAULT_HISTORY_TIMEOUT ):
- wait_on_state( lambda: self.galaxy_interactor.get( "histories/%s" % history_id ), assert_ok=assert_ok, timeout=timeout )
+ return wait_on_state( lambda: self.galaxy_interactor.get( "histories/%s" % history_id ), assert_ok=assert_ok, timeout=timeout )
+
+ def wait_for_job( self, job_id, assert_ok=False, timeout=DEFAULT_HISTORY_TIMEOUT ):
+ return wait_on_state( lambda: self.galaxy_interactor.get( "jobs/%s" % job_id ), assert_ok=assert_ok, timeout=timeout )
def new_history( self, **kwds ):
name = kwds.get( "name", "API Test History" )
@@ -296,6 +299,12 @@
)
return self.__create( payload )
+ def create_list_of_pairs_in_history( self, history_id, **kwds ):
+ pair1 = self.create_pair_in_history( history_id, **kwds ).json()["id"]
+ #pair2 = self.create_pair_in_history( history_id, **kwds ).json()["id"]
+ #pair3 = self.create_pair_in_history( history_id, **kwds ).json()["id"]
+ return self.create_list_from_pairs( history_id, [ pair1 ] )
+
def create_pair_in_history( self, history_id, **kwds ):
payload = self.create_pair_payload(
history_id,
@@ -375,13 +384,13 @@
response = state_func()
assert response.status_code == 200, "Failed to fetch state update while waiting."
state = response.json()[ "state" ]
- if state not in [ "running", "queued", "new" ]:
+ if state not in [ "running", "queued", "new", "ready" ]:
if assert_ok:
assert state == "ok", "Final state - %s - not okay." % state
return state
else:
return None
- wait_on( get_state, desc="state", timeout=timeout)
+ return wait_on( get_state, desc="state", timeout=timeout)
def wait_on( function, desc, timeout=5 ):
diff -r a734cbf4bd368198e2c813b5ea61e807f9a1af33 -r 87ef26ad1876d0d6162eb4b6e7c93c8d69fbc4d6 test/api/test_workflow_extraction.py
--- a/test/api/test_workflow_extraction.py
+++ b/test/api/test_workflow_extraction.py
@@ -1,8 +1,12 @@
+from collections import namedtuple
+import functools
from json import dumps, loads
import operator
from .helpers import skip_without_tool
+from .helpers import wait_on_state
from .test_workflows import BaseWorkflowsApiTestCase
+import yaml
class WorkflowExtractionApiTestCase( BaseWorkflowsApiTestCase ):
@@ -110,27 +114,147 @@
@skip_without_tool( "collection_paired_test" )
def test_extract_workflows_with_dataset_collections( self ):
- hdca = self.dataset_collection_populator.create_pair_in_history( self.history_id ).json()
- hdca_id = hdca[ "id" ]
- inputs = {
- "f1": dict( src="hdca", id=hdca_id )
- }
- run_output = self.dataset_populator.run_tool(
- tool_id="collection_paired_test",
- inputs=inputs,
- history_id=self.history_id,
- )
- job_id = run_output[ "jobs" ][ 0 ][ "id" ]
- self.dataset_populator.wait_for_history( self.history_id, assert_ok=True )
+ jobs_summary = self._run_jobs("""
+steps:
+ - label: text_input1
+ type: input_collection
+ - tool_id: collection_paired_test
+ state:
+ f1:
+ $link: text_input1
+test_data:
+ text_input1:
+ type: paired
+""")
+ job_id = self._job_id_for_tool( jobs_summary.jobs, "collection_paired_test" )
downloaded_workflow = self._extract_and_download_workflow(
- dataset_collection_ids=[ hdca[ "hid" ] ],
+ dataset_collection_ids=[ jobs_summary.inputs["text_input1"]["hid"] ],
job_ids=[ job_id ],
)
- collection_steps = self._get_steps_of_type( downloaded_workflow, "data_collection_input", expected_len=1 )
- collection_step = collection_steps[ 0 ]
+ self.__check_workflow(
+ downloaded_workflow,
+ step_count=2,
+ verify_connected=True,
+ data_input_count=0,
+ data_collection_input_count=1,
+ tool_ids=["collection_paired_test"]
+ )
+
+ collection_step = self._get_steps_of_type( downloaded_workflow, "data_collection_input", expected_len=1 )[ 0 ]
collection_step_state = loads( collection_step[ "tool_state" ] )
self.assertEquals( collection_step_state[ "collection_type" ], u"paired" )
+ def test_subcollection_mapping( self ):
+ jobs_summary = self._run_jobs("""
+steps:
+ - label: text_input1
+ type: input_collection
+ - label: noop
+ tool_id: cat1
+ state:
+ input1:
+ $link: text_input1
+ - tool_id: cat_collection
+ state:
+ input1:
+ $link: noop#out_file1
+test_data:
+ text_input1:
+ type: "list:paired"
+ """)
+ job1_id = self._job_id_for_tool( jobs_summary.jobs, "cat1" )
+ job2_id = self._job_id_for_tool( jobs_summary.jobs, "cat_collection" )
+ downloaded_workflow = self._extract_and_download_workflow(
+ dataset_collection_ids=[ jobs_summary.inputs["text_input1"]["hid"] ],
+ job_ids=[ job1_id, job2_id ],
+ )
+ print jobs_summary.inputs["text_input1"]
+ self.__check_workflow(
+ downloaded_workflow,
+ step_count=3,
+ verify_connected=True,
+ data_input_count=0,
+ data_collection_input_count=1,
+ tool_ids=["cat_collection", "cat1"],
+ )
+
+ collection_step = self._get_steps_of_type( downloaded_workflow, "data_collection_input", expected_len=1 )[ 0 ]
+ collection_step_state = loads( collection_step[ "tool_state" ] )
+ self.assertEquals( collection_step_state[ "collection_type" ], u"list:paired" )
+
+ def _run_jobs( self, jobs_yaml ):
+ history_id = self.history_id
+ workflow_id = self._upload_yaml_workflow(
+ jobs_yaml
+ )
+ jobs_descriptions = yaml.load( jobs_yaml )
+ test_data = jobs_descriptions["test_data"]
+
+ label_map = {}
+ inputs = {}
+ for key, value in test_data.items():
+ if isinstance( value, dict ):
+ elements_data = value.get( "elements", [] )
+ elements = []
+ for element_data in elements_data:
+ identifier = element_data[ "identifier" ]
+ content = element_data["content"]
+ elements.append( ( identifier, content ) )
+ collection_type = value["type"]
+ if collection_type == "list:paired":
+ hdca = self.dataset_collection_populator.create_list_of_pairs_in_history( history_id ).json()
+ elif collection_type == "list":
+ hdca = self.dataset_collection_populator.create_list_in_history( history_id, contents=elements ).json()
+ else:
+ hdca = self.dataset_collection_populator.create_pair_in_history( history_id, contents=elements ).json()
+ label_map[key] = self._ds_entry( hdca )
+ inputs[key] = hdca
+ else:
+ hda = self.dataset_populator.new_dataset( history_id, content=value )
+ label_map[key] = self._ds_entry( hda )
+ inputs[key] = hda
+ workflow_request = dict(
+ history="hist_id=%s" % history_id,
+ workflow_id=workflow_id,
+ )
+ workflow_request[ "inputs" ] = dumps( label_map )
+ workflow_request[ "inputs_by" ] = 'name'
+ self.dataset_populator.wait_for_history( history_id, assert_ok=True )
+ url = "workflows/%s/usage" % ( workflow_id )
+ invocation_response = self._post( url, data=workflow_request )
+ self._assert_status_code_is( invocation_response, 200 )
+ invocation = invocation_response.json()
+ invocation_id = invocation[ "id" ]
+ # Wait for workflow to become fully scheduled and then for all jobs
+ # complete.
+ self.wait_for_invocation( workflow_id, invocation_id )
+ self.dataset_populator.wait_for_history( history_id, assert_ok=True )
+ jobs = self._history_jobs( history_id )
+ return RunJobsSummary(
+ history_id=history_id,
+ workflow_id=workflow_id,
+ inputs=inputs,
+ jobs=jobs,
+ )
+
+ def wait_for_invocation( self, workflow_id, invocation_id ):
+ url = "workflows/%s/usage/%s" % ( workflow_id, invocation_id )
+ return wait_on_state( lambda: self._get( url ) )
+
+ def _history_jobs( self, history_id ):
+ return self._get("jobs", { "history_id": history_id, "order_by": "create_time" } ).json()
+
+ def _job_id_for_tool( self, jobs, tool_id ):
+ return self._job_for_tool( jobs, tool_id )[ "id" ]
+
+ def _job_for_tool( self, jobs, tool_id ):
+ tool_jobs = filter( lambda j: j["tool_id"] == tool_id, jobs )
+ if not tool_jobs:
+ assert False, "Failed to find job for tool %s" % tool_id
+ # if len( tool_jobs ) > 1:
+ # assert False, "Found multiple jobs for tool %s" % tool_id
+ return tool_jobs[ -1 ]
+
def __run_random_lines_mapped_over_pair( self, history_id ):
hdca = self.dataset_collection_populator.create_pair_in_history( history_id, contents=["1 2 3\n4 5 6", "7 8 9\n10 11 10"] ).json()
hdca_id = hdca[ "id" ]
@@ -266,3 +390,45 @@
job_id = run_output1[ "jobs" ][ 0 ][ "id" ]
self.dataset_populator.wait_for_history( history_id, assert_ok=True, timeout=20 )
return implicit_hdca, job_id
+
+ def __check_workflow(
+ self,
+ workflow,
+ step_count=None,
+ verify_connected=False,
+ data_input_count=None,
+ data_collection_input_count=None,
+ tool_ids=None,
+ ):
+ steps = workflow[ 'steps' ]
+
+ if step_count is not None:
+ assert len( steps ) == step_count
+ if verify_connected:
+ self.__assert_connected( workflow, steps )
+ if tool_ids is not None:
+ tool_steps = self._get_steps_of_type( workflow, "tool" )
+ found_steps = set(map(operator.itemgetter("tool_id"), tool_steps))
+ expected_steps = set(tool_ids)
+ assert found_steps == expected_steps
+ if data_input_count is not None:
+ self._get_steps_of_type( workflow, "data_input", expected_len=data_input_count )
+ if data_collection_input_count is not None:
+ self._get_steps_of_type( workflow, "data_collection_input", expected_len=data_collection_input_count )
+
+ def __assert_connected( self, workflow, steps ):
+ disconnected_inputs = []
+
+ for key, value in steps.items():
+ if value[ 'type' ] == "tool":
+ input_connections = value[ "input_connections" ]
+ if not input_connections:
+ disconnected_inputs.append( value )
+
+ if disconnected_inputs:
+ template = "%d step(s_ disconnected in extracted workflow - disconnectect steps are %s - workflow is %s"
+ message = template % ( len( disconnected_inputs ), disconnected_inputs, workflow )
+ raise AssertionError( message )
+
+
+RunJobsSummary = namedtuple('RunJobsSummary', ['history_id', 'workflow_id', 'inputs', 'jobs'])
diff -r a734cbf4bd368198e2c813b5ea61e807f9a1af33 -r 87ef26ad1876d0d6162eb4b6e7c93c8d69fbc4d6 test/api/test_workflows.py
--- a/test/api/test_workflows.py
+++ b/test/api/test_workflows.py
@@ -95,6 +95,12 @@
workflow_inputs = workflow_show_resposne.json()[ "inputs" ]
return workflow_inputs
+ def _invocation_details( self, workflow_id, invocation_id ):
+ invocation_details_response = self._get( "workflows/%s/usage/%s" % ( workflow_id, invocation_id ) )
+ self._assert_status_code_is( invocation_details_response, 200 )
+ invocation_details = invocation_details_response.json()
+ return invocation_details
+
# Workflow API TODO:
# - Allow history_id as param to workflow run action. (hist_id)
@@ -530,12 +536,6 @@
self._assert_status_code_is( step_response, 200 )
self._assert_has_keys( step_response.json(), "id", "order_index" )
- def _invocation_details( self, workflow_id, invocation_id ):
- invocation_details_response = self._get( "workflows/%s/usage/%s" % ( workflow_id, invocation_id ) )
- self._assert_status_code_is( invocation_details_response, 200 )
- invocation_details = invocation_details_response.json()
- return invocation_details
-
def _invocation_step_details( self, workflow_id, invocation_id, step_id ):
invocation_step_response = self._get( "workflows/%s/usage/%s/steps/%s" % ( workflow_id, invocation_id, step_id ) )
self._assert_status_code_is( invocation_step_response, 200 )
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0
commit/galaxy-central: jgoecks: Merge next-stable to default
by commits-noreply@bitbucket.org 02 Dec '14
by commits-noreply@bitbucket.org 02 Dec '14
02 Dec '14
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/a734cbf4bd36/
Changeset: a734cbf4bd36
User: jgoecks
Date: 2014-12-02 18:31:09+00:00
Summary: Merge next-stable to default
Affected #: 3 files
diff -r 447e69511115f2e2d5a13d8bbe2282cf0c94c5db -r a734cbf4bd368198e2c813b5ea61e807f9a1af33 client/galaxy/scripts/viz/trackster/slotting.js
--- a/client/galaxy/scripts/viz/trackster/slotting.js
+++ b/client/galaxy/scripts/viz/trackster/slotting.js
@@ -138,7 +138,6 @@
// Feature is slotted; if feature now has larger start/end coordinates,
// update drawing coordinates.
if (feature[1] < slotted_info.feature[1] || slotted_info.feature[2] < feature[2]) {
- console.log(feature[3], slotted_info.slot, this._find_slot(this._get_draw_coords(feature)));
// Feature has changed (e.g. a single read now has its pair), so recalculate its
// drawing coordinates.
var old_draw_coords = this._get_draw_coords(slotted_info.feature),
diff -r 447e69511115f2e2d5a13d8bbe2282cf0c94c5db -r a734cbf4bd368198e2c813b5ea61e807f9a1af33 static/scripts/packed/viz/trackster/slotting.js
--- a/static/scripts/packed/viz/trackster/slotting.js
+++ b/static/scripts/packed/viz/trackster/slotting.js
@@ -1,1 +1,1 @@
-define(["libs/underscore"],function(c){var f=c.extend;var d=2,b=5;var a=function(h,g){this.slot=h;this.feature=g};var e=function(j,i,g,h){this.slots={};this.start_end_dct={};this.w_scale=j;this.mode=i;this.include_label=(i==="Pack");this.max_rows=g;this.measureText=h};f(e.prototype,{_get_draw_coords:function(j){var h=Math.floor(j[1]*this.w_scale),i=Math.ceil(j[2]*this.w_scale),g=j[3],k;if(g!==undefined&&this.include_label){var l=this.measureText(g).width+(d+b);if(h-l>=0){h-=l;k="left"}else{i+=l;k="right"}}return[h,i]},_find_slot:function(j){var o=j[0],n=j[1];for(var l=0;l<=this.max_rows;l++){var p=false,m=this.start_end_dct[l];if(m!==undefined){for(var g=0,h=m.length;g<h;g++){var i=m[g];if(n>i[0]&&o<i[1]){p=true;break}}}if(!p){return l}}return -1},slot_features:function(h){var q=this.start_end_dct,v=[],m=0,x,l;for(var o=0,t=h.length;o<t;o++){x=h[o];l=x[0];var g=this.slots[l];if(g){if(x[1]<g.feature[1]||g.feature[2]<x[2]){console.log(x[3],g.slot,this._find_slot(this._get_draw_coords(x)));var s=this._get_draw_coords(g.feature),p=this._get_draw_coords(x),j=this.start_end_dct[g.slot];for(var n=0;n<j.length;n++){var w=j[n];if(w[0]===s[0]&&w[1]===s[1]){j[n]=p}}}m=Math.max(m,this.slots[l].slot)}else{v.push(o)}}for(var o=0,t=v.length;o<t;o++){x=h[v[o]];l=x[0];var r=this._get_draw_coords(x);var u=this._find_slot(r);if(u>=0){if(q[u]===undefined){q[u]=[]}q[u].push(r);this.slots[l]=new a(u,x);m=Math.max(m,u)}}return m+1}});return{FeatureSlotter:e}});
\ No newline at end of file
+define(["libs/underscore"],function(c){var f=c.extend;var d=2,b=5;var a=function(h,g){this.slot=h;this.feature=g};var e=function(j,i,g,h){this.slots={};this.start_end_dct={};this.w_scale=j;this.mode=i;this.include_label=(i==="Pack");this.max_rows=g;this.measureText=h};f(e.prototype,{_get_draw_coords:function(j){var h=Math.floor(j[1]*this.w_scale),i=Math.ceil(j[2]*this.w_scale),g=j[3],k;if(g!==undefined&&this.include_label){var l=this.measureText(g).width+(d+b);if(h-l>=0){h-=l;k="left"}else{i+=l;k="right"}}return[h,i]},_find_slot:function(j){var o=j[0],n=j[1];for(var l=0;l<=this.max_rows;l++){var p=false,m=this.start_end_dct[l];if(m!==undefined){for(var g=0,h=m.length;g<h;g++){var i=m[g];if(n>i[0]&&o<i[1]){p=true;break}}}if(!p){return l}}return -1},slot_features:function(h){var q=this.start_end_dct,v=[],m=0,x,l;for(var o=0,t=h.length;o<t;o++){x=h[o];l=x[0];var g=this.slots[l];if(g){if(x[1]<g.feature[1]||g.feature[2]<x[2]){var s=this._get_draw_coords(g.feature),p=this._get_draw_coords(x),j=this.start_end_dct[g.slot];for(var n=0;n<j.length;n++){var w=j[n];if(w[0]===s[0]&&w[1]===s[1]){j[n]=p}}}m=Math.max(m,this.slots[l].slot)}else{v.push(o)}}for(var o=0,t=v.length;o<t;o++){x=h[v[o]];l=x[0];var r=this._get_draw_coords(x);var u=this._find_slot(r);if(u>=0){if(q[u]===undefined){q[u]=[]}q[u].push(r);this.slots[l]=new a(u,x);m=Math.max(m,u)}}return m+1}});return{FeatureSlotter:e}});
\ No newline at end of file
diff -r 447e69511115f2e2d5a13d8bbe2282cf0c94c5db -r a734cbf4bd368198e2c813b5ea61e807f9a1af33 static/scripts/viz/trackster/slotting.js
--- a/static/scripts/viz/trackster/slotting.js
+++ b/static/scripts/viz/trackster/slotting.js
@@ -138,7 +138,6 @@
// Feature is slotted; if feature now has larger start/end coordinates,
// update drawing coordinates.
if (feature[1] < slotted_info.feature[1] || slotted_info.feature[2] < feature[2]) {
- console.log(feature[3], slotted_info.slot, this._find_slot(this._get_draw_coords(feature)));
// Feature has changed (e.g. a single read now has its pair), so recalculate its
// drawing coordinates.
var old_draw_coords = this._get_draw_coords(slotted_info.feature),
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0
commit/galaxy-central: jgoecks: Remove debugging statement.
by commits-noreply@bitbucket.org 02 Dec '14
by commits-noreply@bitbucket.org 02 Dec '14
02 Dec '14
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/eb9d9ab34d23/
Changeset: eb9d9ab34d23
Branch: next-stable
User: jgoecks
Date: 2014-12-02 18:30:19+00:00
Summary: Remove debugging statement.
Affected #: 3 files
diff -r 1a2ef4a380ff35ca7f97ca2c50bab474400c6275 -r eb9d9ab34d23456d58f291b782b42724a83f711e client/galaxy/scripts/viz/trackster/slotting.js
--- a/client/galaxy/scripts/viz/trackster/slotting.js
+++ b/client/galaxy/scripts/viz/trackster/slotting.js
@@ -138,7 +138,6 @@
// Feature is slotted; if feature now has larger start/end coordinates,
// update drawing coordinates.
if (feature[1] < slotted_info.feature[1] || slotted_info.feature[2] < feature[2]) {
- console.log(feature[3], slotted_info.slot, this._find_slot(this._get_draw_coords(feature)));
// Feature has changed (e.g. a single read now has its pair), so recalculate its
// drawing coordinates.
var old_draw_coords = this._get_draw_coords(slotted_info.feature),
diff -r 1a2ef4a380ff35ca7f97ca2c50bab474400c6275 -r eb9d9ab34d23456d58f291b782b42724a83f711e static/scripts/packed/viz/trackster/slotting.js
--- a/static/scripts/packed/viz/trackster/slotting.js
+++ b/static/scripts/packed/viz/trackster/slotting.js
@@ -1,1 +1,1 @@
-define(["libs/underscore"],function(c){var f=c.extend;var d=2,b=5;var a=function(h,g){this.slot=h;this.feature=g};var e=function(j,i,g,h){this.slots={};this.start_end_dct={};this.w_scale=j;this.mode=i;this.include_label=(i==="Pack");this.max_rows=g;this.measureText=h};f(e.prototype,{_get_draw_coords:function(j){var h=Math.floor(j[1]*this.w_scale),i=Math.ceil(j[2]*this.w_scale),g=j[3],k;if(g!==undefined&&this.include_label){var l=this.measureText(g).width+(d+b);if(h-l>=0){h-=l;k="left"}else{i+=l;k="right"}}return[h,i]},_find_slot:function(j){var o=j[0],n=j[1];for(var l=0;l<=this.max_rows;l++){var p=false,m=this.start_end_dct[l];if(m!==undefined){for(var g=0,h=m.length;g<h;g++){var i=m[g];if(n>i[0]&&o<i[1]){p=true;break}}}if(!p){return l}}return -1},slot_features:function(h){var q=this.start_end_dct,v=[],m=0,x,l;for(var o=0,t=h.length;o<t;o++){x=h[o];l=x[0];var g=this.slots[l];if(g){if(x[1]<g.feature[1]||g.feature[2]<x[2]){console.log(x[3],g.slot,this._find_slot(this._get_draw_coords(x)));var s=this._get_draw_coords(g.feature),p=this._get_draw_coords(x),j=this.start_end_dct[g.slot];for(var n=0;n<j.length;n++){var w=j[n];if(w[0]===s[0]&&w[1]===s[1]){j[n]=p}}}m=Math.max(m,this.slots[l].slot)}else{v.push(o)}}for(var o=0,t=v.length;o<t;o++){x=h[v[o]];l=x[0];var r=this._get_draw_coords(x);var u=this._find_slot(r);if(u>=0){if(q[u]===undefined){q[u]=[]}q[u].push(r);this.slots[l]=new a(u,x);m=Math.max(m,u)}}return m+1}});return{FeatureSlotter:e}});
\ No newline at end of file
+define(["libs/underscore"],function(c){var f=c.extend;var d=2,b=5;var a=function(h,g){this.slot=h;this.feature=g};var e=function(j,i,g,h){this.slots={};this.start_end_dct={};this.w_scale=j;this.mode=i;this.include_label=(i==="Pack");this.max_rows=g;this.measureText=h};f(e.prototype,{_get_draw_coords:function(j){var h=Math.floor(j[1]*this.w_scale),i=Math.ceil(j[2]*this.w_scale),g=j[3],k;if(g!==undefined&&this.include_label){var l=this.measureText(g).width+(d+b);if(h-l>=0){h-=l;k="left"}else{i+=l;k="right"}}return[h,i]},_find_slot:function(j){var o=j[0],n=j[1];for(var l=0;l<=this.max_rows;l++){var p=false,m=this.start_end_dct[l];if(m!==undefined){for(var g=0,h=m.length;g<h;g++){var i=m[g];if(n>i[0]&&o<i[1]){p=true;break}}}if(!p){return l}}return -1},slot_features:function(h){var q=this.start_end_dct,v=[],m=0,x,l;for(var o=0,t=h.length;o<t;o++){x=h[o];l=x[0];var g=this.slots[l];if(g){if(x[1]<g.feature[1]||g.feature[2]<x[2]){var s=this._get_draw_coords(g.feature),p=this._get_draw_coords(x),j=this.start_end_dct[g.slot];for(var n=0;n<j.length;n++){var w=j[n];if(w[0]===s[0]&&w[1]===s[1]){j[n]=p}}}m=Math.max(m,this.slots[l].slot)}else{v.push(o)}}for(var o=0,t=v.length;o<t;o++){x=h[v[o]];l=x[0];var r=this._get_draw_coords(x);var u=this._find_slot(r);if(u>=0){if(q[u]===undefined){q[u]=[]}q[u].push(r);this.slots[l]=new a(u,x);m=Math.max(m,u)}}return m+1}});return{FeatureSlotter:e}});
\ No newline at end of file
diff -r 1a2ef4a380ff35ca7f97ca2c50bab474400c6275 -r eb9d9ab34d23456d58f291b782b42724a83f711e static/scripts/viz/trackster/slotting.js
--- a/static/scripts/viz/trackster/slotting.js
+++ b/static/scripts/viz/trackster/slotting.js
@@ -138,7 +138,6 @@
// Feature is slotted; if feature now has larger start/end coordinates,
// update drawing coordinates.
if (feature[1] < slotted_info.feature[1] || slotted_info.feature[2] < feature[2]) {
- console.log(feature[3], slotted_info.slot, this._find_slot(this._get_draw_coords(feature)));
// Feature has changed (e.g. a single read now has its pair), so recalculate its
// drawing coordinates.
var old_draw_coords = this._get_draw_coords(slotted_info.feature),
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/447e69511115/
Changeset: 447e69511115
User: guerler
Date: 2014-12-02 17:05:53+00:00
Summary: Merge
Affected #: 0 files
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0
3 new commits in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/98a6cad91c3a/
Changeset: 98a6cad91c3a
Branch: next-stable
User: guerler
Date: 2014-12-01 04:40:38+00:00
Summary: ToolForm: Add drill down element
Affected #: 25 files
diff -r 20e0db2511e555b9a168a96dee1ff75180aabbdf -r 98a6cad91c3ac3825c7f954a0c697c6706ad1d73 client/galaxy/scripts/mvc/tools/tools-form.js
--- a/client/galaxy/scripts/mvc/tools/tools-form.js
+++ b/client/galaxy/scripts/mvc/tools/tools-form.js
@@ -211,7 +211,7 @@
this.tree.matchModel(new_model, function(input_id, node) {
var input = self.input_list[input_id];
if (input && input.options) {
- if (JSON.stringify(input.options) != JSON.stringify(node.options)) {
+ if (!_.isEqual(input.options, node.options)) {
// backup new options
input.options = node.options;
@@ -223,6 +223,9 @@
case 'data':
new_options = input.options;
break;
+ case 'drill_down':
+ new_options = input.options;
+ break;
default:
for (var i in node.options) {
var opt = node.options[i];
diff -r 20e0db2511e555b9a168a96dee1ff75180aabbdf -r 98a6cad91c3ac3825c7f954a0c697c6706ad1d73 client/galaxy/scripts/mvc/tools/tools-section.js
--- a/client/galaxy/scripts/mvc/tools/tools-section.js
+++ b/client/galaxy/scripts/mvc/tools/tools-section.js
@@ -337,7 +337,12 @@
input_def.searchable = true;
field = this._fieldSelect(input_def);
break;
-
+
+ // drill down field
+ case 'drill_down':
+ field = this._fieldDrilldown(input_def);
+ break;
+
// field not found
default:
// flag
@@ -417,6 +422,20 @@
});
},
+ /** Drill down options field
+ */
+ _fieldDrilldown : function (input_def) {
+ var self = this;
+ return new Ui.Drilldown.View({
+ id : 'field-' + input_def.id,
+ data : input_def.options,
+ display : input_def.display,
+ onchange : function() {
+ self.app.refresh();
+ }
+ });
+ },
+
/** Text input field
*/
_fieldText : function(input_def) {
diff -r 20e0db2511e555b9a168a96dee1ff75180aabbdf -r 98a6cad91c3ac3825c7f954a0c697c6706ad1d73 client/galaxy/scripts/mvc/tools/tools-select-content.js
--- a/client/galaxy/scripts/mvc/tools/tools-select-content.js
+++ b/client/galaxy/scripts/mvc/tools/tools-select-content.js
@@ -90,6 +90,11 @@
// update options
this.update(options.data);
+ // set initial value
+ if (this.options.value !== undefined) {
+ this.value(this.options.value);
+ }
+
// refresh view
this.refresh();
diff -r 20e0db2511e555b9a168a96dee1ff75180aabbdf -r 98a6cad91c3ac3825c7f954a0c697c6706ad1d73 client/galaxy/scripts/mvc/ui/ui-drilldown.js
--- /dev/null
+++ b/client/galaxy/scripts/mvc/ui/ui-drilldown.js
@@ -0,0 +1,102 @@
+// dependencies
+define(['utils/utils', 'mvc/ui/ui-options'], function(Utils, Options) {
+
+/**
+ * This class creates/wraps a drill down element.
+ */
+var View = Options.Base.extend({
+ // initialize
+ initialize: function(options) {
+ this.display = options.display || 'checkbox';
+ options.multiple = (this.display == 'checkbox');
+ Options.Base.prototype.initialize.call(this, options);
+ },
+
+ /** Template for input field
+ */
+ _templateOption: function(name, value, selected) {
+ return '<div>' +
+ '<input name="' + this.options.id + '" class="ui-option" type="' + this.display + '" value="' + value + '">' +
+ Utils.sanitize(name) +
+ '<div/>';
+ },
+
+ /** Template to create options tree
+ */
+ _templateOptions: function(data, current) {
+ // link this
+ var self = this;
+
+ // attach show/hide event
+ function attachEvents($button, $subgroup) {
+ function setVisibility (visible) {
+ if (visible) {
+ $subgroup.fadeIn('fast')
+ $button.removeClass('toggle-expand');
+ $button.addClass('toggle');
+ $button.is_expanded = true;
+ } else {
+ $subgroup.hide();
+ $button.removeClass('toggle');
+ $button.addClass('toggle-expand');
+ $button.is_expanded = false;
+ }
+ };
+ $button.on('click', function() {
+ setVisibility(!$button.is_expanded);
+ });
+ }
+
+ // recursive function which iterates through options
+ function iterate ($tmpl, data) {
+ for (i in data) {
+ // current option level in hierarchy
+ var level = data[i];
+
+ // check for options
+ var has_options = level.options.length > 0;
+
+ // build template
+ var $group = $('<div/>');
+ if (has_options) {
+ // create button and add flag
+ var $button = $('<span class="ui-drilldown-button form-toggle icon-button toggle-expand" style="position: relative; top: 2px;"/>');
+
+ // add expand group
+ var $buttongroup = $('<div/>');
+ $buttongroup.append($button);
+ $buttongroup.append(self._templateOption(level.name, level.value));
+ $group.append($buttongroup);
+
+ // add sub group
+ var $subgroup = $('<div style="display: none; margin-left: 25px;"/>');
+ iterate($subgroup, level.options);
+ $group.append($subgroup);
+
+ // attach click event to collapse/expand hierarchy
+ attachEvents($button, $subgroup);
+ } else {
+ $group.append(self._templateOption(level.name, level.value));
+ }
+ $tmpl.append($group);
+ }
+ }
+
+ // iterate through options and create dom
+ var $tmpl = $('<div/>');
+ iterate($tmpl, data);
+ return $tmpl;
+ },
+
+ /** Template for drill down view
+ */
+ _template: function(options) {
+ return '<div class="ui-options drilldown-container" id="' + options.id + '"/>';
+ }
+});
+
+return {
+ View: View
+}
+
+});
diff -r 20e0db2511e555b9a168a96dee1ff75180aabbdf -r 98a6cad91c3ac3825c7f954a0c697c6706ad1d73 client/galaxy/scripts/mvc/ui/ui-misc.js
--- a/client/galaxy/scripts/mvc/ui/ui-misc.js
+++ b/client/galaxy/scripts/mvc/ui/ui-misc.js
@@ -1,6 +1,6 @@
// dependencies
-define(['utils/utils', 'mvc/ui/ui-select-default', 'mvc/ui/ui-slider', 'mvc/ui/ui-options', 'mvc/ui/ui-button-menu', 'mvc/ui/ui-modal'],
- function(Utils, Select, Slider, Options, ButtonMenu, Modal) {
+define(['utils/utils', 'mvc/ui/ui-select-default', 'mvc/ui/ui-slider', 'mvc/ui/ui-options', 'mvc/ui/ui-drilldown', 'mvc/ui/ui-button-menu', 'mvc/ui/ui-modal'],
+ function(Utils, Select, Slider, Options, Drilldown, ButtonMenu, Modal) {
/**
* This class contains backbone wrappers for basic ui elements such as Images, Labels, Buttons, Input fields etc.
@@ -339,7 +339,6 @@
var Input = Backbone.View.extend({
// options
optionsDefault: {
- value : '',
type : 'text',
placeholder : '',
disabled : false,
@@ -356,6 +355,11 @@
// create new element
this.setElement(this._template(this.options));
+ // set initial value
+ if (this.options.value !== undefined) {
+ this.value(this.options.value);
+ }
+
// disable input field
if (this.options.disabled) {
this.$el.prop('disabled', true);
@@ -395,18 +399,18 @@
// plugin
var Hidden = Backbone.View.extend({
- // options
- optionsDefault: {
- value : ''
- },
-
// initialize
initialize : function(options) {
// configure options
- this.options = Utils.merge(options, this.optionsDefault);
+ this.options = options;
// create new element
this.setElement(this._template(this.options));
+
+ // set initial value
+ if (this.options.value !== undefined) {
+ this.value(this.options.value);
+ }
},
// value
@@ -441,6 +445,7 @@
Searchbox : Searchbox,
Select : Select,
Hidden : Hidden,
- Slider : Slider
+ Slider : Slider,
+ Drilldown : Drilldown
}
});
diff -r 20e0db2511e555b9a168a96dee1ff75180aabbdf -r 98a6cad91c3ac3825c7f954a0c697c6706ad1d73 client/galaxy/scripts/mvc/ui/ui-options.js
--- a/client/galaxy/scripts/mvc/ui/ui-options.js
+++ b/client/galaxy/scripts/mvc/ui/ui-options.js
@@ -2,7 +2,7 @@
define(['utils/utils'], function(Utils) {
/** Base class for options based ui elements **/
-var OptionsBase = Backbone.View.extend({
+var Base = Backbone.View.extend({
// initialize
initialize: function(options) {
// options
@@ -56,16 +56,19 @@
var current = this._getValue();
// remove all options
- this.$el.find('.ui-option').remove();
+ this.$options.empty();
- // add new options
- for (var key in options) {
- // load option template
- var $option = $(this._templateOption(options[key]));
- $option.addClass('ui-option');
-
- // append to dom
- this.$options.append($option);
+ // add new options using single option templates or full template
+ if (this._templateOptions) {
+ // rebuild options using full template
+ this.$options.append(this._templateOptions(options));
+ } else {
+ // rebuild options using single option templates
+ for (var key in options) {
+ var $option = $(this._templateOption(options[key]));
+ $option.addClass('ui-option');
+ this.$options.append($option);
+ }
}
// add change events
@@ -82,6 +85,29 @@
this.value(current);
},
+ /** Return/Set current value
+ */
+ value: function (new_value) {
+ // check if its an array
+ if (typeof new_value === 'string') {
+ new_value = [new_value];
+ }
+
+ // set new value
+ if (new_value !== undefined) {
+ // reset selection
+ this.$el.find('input').prop('checked', false);
+
+ // update to new selection
+ for (var i in new_value) {
+ this.$el.find('input[value="' + new_value[i] + '"]').first().prop('checked', true);
+ };
+ }
+
+ // get and return value
+ return this._getValue();
+ },
+
/** Check if selected value exists (or any if multiple)
*/
exists: function(value) {
@@ -198,46 +224,6 @@
*/
_messageHide: function() {
this.$message.hide();
- }
-});
-
-/** Radio button field **/
-var Radio = {};
-Radio.View = OptionsBase.extend({
- // initialize
- initialize: function(options) {
- OptionsBase.prototype.initialize.call(this, options);
- },
-
- /** Return/Set current value
- */
- value: function (new_val) {
- // check if its an array
- if (typeof new_val === 'string') {
- new_val = [new_val];
- }
-
- // set new value
- if (new_val !== undefined) {
- // reset selection
- this.$el.find('input').prop('checked', false);
-
- // update to new selection
- for (var i in new_val) {
- this.$el.find('input[value="' + new_val[i] + '"]').prop('checked', true);
- };
- }
-
- // get and return value
- return this._getValue();
- },
-
- /** Template for options
- */
- _templateOption: function(pair) {
- return '<div>' +
- '<input type="radio" name="' + this.options.id + '" value="' + pair.value + '"/>' + pair.label + '<br>' +
- '</div>';
},
/** Main template function
@@ -247,16 +233,33 @@
}
});
+/** Radio button field **/
+var Radio = {};
+Radio.View = Base.extend({
+ // initialize
+ initialize: function(options) {
+ Base.prototype.initialize.call(this, options);
+ },
+
+ /** Template for a single option
+ */
+ _templateOption: function(pair) {
+ return '<div>' +
+ '<input type="radio" name="' + this.options.id + '" value="' + pair.value + '"/>' + pair.label + '<br>' +
+ '</div>';
+ }
+});
+
/** Checkbox options field **/
var Checkbox = {};
-Checkbox.View = Radio.View.extend({
+Checkbox.View = Base.extend({
// initialize
initialize: function(options) {
options.multiple = true;
- Radio.View.prototype.initialize.call(this, options);
+ Base.prototype.initialize.call(this, options);
},
- /** Template for options
+ /** Template for a single option
*/
_templateOption: function(pair) {
return '<div>' +
@@ -267,27 +270,27 @@
/** Radio button options field styled as classic buttons **/
var RadioButton = {};
-RadioButton.View = OptionsBase.extend({
+RadioButton.View = Base.extend({
// initialize
initialize: function(options) {
- OptionsBase.prototype.initialize.call(this, options);
+ Base.prototype.initialize.call(this, options);
},
/** Return/Set current value
*/
- value: function (new_val) {
+ value: function (new_value) {
// set new value
- if (new_val !== undefined) {
+ if (new_value !== undefined) {
this.$el.find('input').prop('checked', false);
this.$el.find('label').removeClass('active');
- this.$el.find('[value="' + new_val + '"]').prop('checked', true).closest('label').addClass('active');
+ this.$el.find('[value="' + new_value + '"]').prop('checked', true).closest('label').addClass('active');
}
// get and return value
return this._getValue();
},
- /** Template for options
+ /** Template for a single option
*/
_templateOption: function(pair) {
var tmpl = '<label class="btn btn-default">';
@@ -307,6 +310,7 @@
});
return {
+ Base : Base,
Radio : Radio,
RadioButton : RadioButton,
Checkbox : Checkbox
diff -r 20e0db2511e555b9a168a96dee1ff75180aabbdf -r 98a6cad91c3ac3825c7f954a0c697c6706ad1d73 client/galaxy/scripts/mvc/ui/ui-select-default.js
--- a/client/galaxy/scripts/mvc/ui/ui-select-default.js
+++ b/client/galaxy/scripts/mvc/ui/ui-select-default.js
@@ -41,6 +41,11 @@
// refresh
this.update(this.options.data);
+ // set initial value
+ if (this.options.value !== undefined) {
+ this.value(this.options.value);
+ }
+
// show/hide
if (!this.options.visible) {
this.hide();
diff -r 20e0db2511e555b9a168a96dee1ff75180aabbdf -r 98a6cad91c3ac3825c7f954a0c697c6706ad1d73 client/galaxy/scripts/mvc/ui/ui-slider.js
--- a/client/galaxy/scripts/mvc/ui/ui-slider.js
+++ b/client/galaxy/scripts/mvc/ui/ui-slider.js
@@ -5,7 +5,6 @@
var View = Backbone.View.extend({
// options
optionsDefault: {
- value : '',
min : null,
max : null,
step : null,
@@ -49,6 +48,11 @@
// link text input field
this.$text = this.$el.find('#text');
+ // set initial value
+ if (this.options.value !== undefined) {
+ this.value(this.options.value);
+ }
+
// add text field event
this.$text.on('change', function () {
self.value($(this).val());
diff -r 20e0db2511e555b9a168a96dee1ff75180aabbdf -r 98a6cad91c3ac3825c7f954a0c697c6706ad1d73 lib/galaxy/tools/parameters/basic.py
--- a/lib/galaxy/tools/parameters/basic.py
+++ b/lib/galaxy/tools/parameters/basic.py
@@ -1606,19 +1606,20 @@
"""
return self.filtered.keys()
- def to_dict( self, trans, view='collection', value_mapper=None ):
+ def to_dict( self, trans, view='collection', value_mapper=None, context={} ):
# skip SelectToolParameter (the immediate parent) bc we need to get options in a different way here
d = ToolParameter.to_dict( self, trans )
options = []
try:
- options = self.get_options( trans, {} )
+ options = self.get_options( trans, context )
except KeyError:
# will sometimes error if self.is_dynamic and self.filtered
# bc we dont/cant fill out other_values above ({})
pass
-
d[ 'options' ] = options
+ d[ 'display' ] = self.display
+ d[ 'is_dynamic' ] = self.is_dynamic
return d
diff -r 20e0db2511e555b9a168a96dee1ff75180aabbdf -r 98a6cad91c3ac3825c7f954a0c697c6706ad1d73 static/scripts/mvc/tools/tools-form.js
--- a/static/scripts/mvc/tools/tools-form.js
+++ b/static/scripts/mvc/tools/tools-form.js
@@ -211,7 +211,7 @@
this.tree.matchModel(new_model, function(input_id, node) {
var input = self.input_list[input_id];
if (input && input.options) {
- if (JSON.stringify(input.options) != JSON.stringify(node.options)) {
+ if (!_.isEqual(input.options, node.options)) {
// backup new options
input.options = node.options;
@@ -223,6 +223,9 @@
case 'data':
new_options = input.options;
break;
+ case 'drill_down':
+ new_options = input.options;
+ break;
default:
for (var i in node.options) {
var opt = node.options[i];
diff -r 20e0db2511e555b9a168a96dee1ff75180aabbdf -r 98a6cad91c3ac3825c7f954a0c697c6706ad1d73 static/scripts/mvc/tools/tools-section.js
--- a/static/scripts/mvc/tools/tools-section.js
+++ b/static/scripts/mvc/tools/tools-section.js
@@ -337,7 +337,12 @@
input_def.searchable = true;
field = this._fieldSelect(input_def);
break;
-
+
+ // drill down field
+ case 'drill_down':
+ field = this._fieldDrilldown(input_def);
+ break;
+
// field not found
default:
// flag
@@ -417,6 +422,20 @@
});
},
+ /** Drill down options field
+ */
+ _fieldDrilldown : function (input_def) {
+ var self = this;
+ return new Ui.Drilldown.View({
+ id : 'field-' + input_def.id,
+ data : input_def.options,
+ display : input_def.display,
+ onchange : function() {
+ self.app.refresh();
+ }
+ });
+ },
+
/** Text input field
*/
_fieldText : function(input_def) {
diff -r 20e0db2511e555b9a168a96dee1ff75180aabbdf -r 98a6cad91c3ac3825c7f954a0c697c6706ad1d73 static/scripts/mvc/tools/tools-select-content.js
--- a/static/scripts/mvc/tools/tools-select-content.js
+++ b/static/scripts/mvc/tools/tools-select-content.js
@@ -90,6 +90,11 @@
// update options
this.update(options.data);
+ // set initial value
+ if (this.options.value !== undefined) {
+ this.value(this.options.value);
+ }
+
// refresh view
this.refresh();
diff -r 20e0db2511e555b9a168a96dee1ff75180aabbdf -r 98a6cad91c3ac3825c7f954a0c697c6706ad1d73 static/scripts/mvc/ui/ui-drilldown.js
--- /dev/null
+++ b/static/scripts/mvc/ui/ui-drilldown.js
@@ -0,0 +1,102 @@
+// dependencies
+define(['utils/utils', 'mvc/ui/ui-options'], function(Utils, Options) {
+
+/**
+ * This class creates/wraps a drill down element.
+ */
+var View = Options.Base.extend({
+ // initialize
+ initialize: function(options) {
+ this.display = options.display || 'checkbox';
+ options.multiple = (this.display == 'checkbox');
+ Options.Base.prototype.initialize.call(this, options);
+ },
+
+ /** Template for input field
+ */
+ _templateOption: function(name, value, selected) {
+ return '<div>' +
+ '<input name="' + this.options.id + '" class="ui-option" type="' + this.display + '" value="' + value + '">' +
+ Utils.sanitize(name) +
+ '<div/>';
+ },
+
+ /** Template to create options tree
+ */
+ _templateOptions: function(data, current) {
+ // link this
+ var self = this;
+
+ // attach show/hide event
+ function attachEvents($button, $subgroup) {
+ function setVisibility (visible) {
+ if (visible) {
+ $subgroup.fadeIn('fast')
+ $button.removeClass('toggle-expand');
+ $button.addClass('toggle');
+ $button.is_expanded = true;
+ } else {
+ $subgroup.hide();
+ $button.removeClass('toggle');
+ $button.addClass('toggle-expand');
+ $button.is_expanded = false;
+ }
+ };
+ $button.on('click', function() {
+ setVisibility(!$button.is_expanded);
+ });
+ }
+
+ // recursive function which iterates through options
+ function iterate ($tmpl, data) {
+ for (i in data) {
+ // current option level in hierarchy
+ var level = data[i];
+
+ // check for options
+ var has_options = level.options.length > 0;
+
+ // build template
+ var $group = $('<div/>');
+ if (has_options) {
+ // create button and add flag
+ var $button = $('<span class="ui-drilldown-button form-toggle icon-button toggle-expand" style="position: relative; top: 2px;"/>');
+
+ // add expand group
+ var $buttongroup = $('<div/>');
+ $buttongroup.append($button);
+ $buttongroup.append(self._templateOption(level.name, level.value));
+ $group.append($buttongroup);
+
+ // add sub group
+ var $subgroup = $('<div style="display: none; margin-left: 25px;"/>');
+ iterate($subgroup, level.options);
+ $group.append($subgroup);
+
+ // attach click event to collapse/expand hierarchy
+ attachEvents($button, $subgroup);
+ } else {
+ $group.append(self._templateOption(level.name, level.value));
+ }
+ $tmpl.append($group);
+ }
+ }
+
+ // iterate through options and create dom
+ var $tmpl = $('<div/>');
+ iterate($tmpl, data);
+ return $tmpl;
+ },
+
+ /** Template for drill down view
+ */
+ _template: function(options) {
+ return '<div class="ui-options drilldown-container" id="' + options.id + '"/>';
+ }
+});
+
+return {
+ View: View
+}
+
+});
diff -r 20e0db2511e555b9a168a96dee1ff75180aabbdf -r 98a6cad91c3ac3825c7f954a0c697c6706ad1d73 static/scripts/mvc/ui/ui-misc.js
--- a/static/scripts/mvc/ui/ui-misc.js
+++ b/static/scripts/mvc/ui/ui-misc.js
@@ -1,6 +1,6 @@
// dependencies
-define(['utils/utils', 'mvc/ui/ui-select-default', 'mvc/ui/ui-slider', 'mvc/ui/ui-options', 'mvc/ui/ui-button-menu', 'mvc/ui/ui-modal'],
- function(Utils, Select, Slider, Options, ButtonMenu, Modal) {
+define(['utils/utils', 'mvc/ui/ui-select-default', 'mvc/ui/ui-slider', 'mvc/ui/ui-options', 'mvc/ui/ui-drilldown', 'mvc/ui/ui-button-menu', 'mvc/ui/ui-modal'],
+ function(Utils, Select, Slider, Options, Drilldown, ButtonMenu, Modal) {
/**
* This class contains backbone wrappers for basic ui elements such as Images, Labels, Buttons, Input fields etc.
@@ -339,7 +339,6 @@
var Input = Backbone.View.extend({
// options
optionsDefault: {
- value : '',
type : 'text',
placeholder : '',
disabled : false,
@@ -356,6 +355,11 @@
// create new element
this.setElement(this._template(this.options));
+ // set initial value
+ if (this.options.value !== undefined) {
+ this.value(this.options.value);
+ }
+
// disable input field
if (this.options.disabled) {
this.$el.prop('disabled', true);
@@ -395,18 +399,18 @@
// plugin
var Hidden = Backbone.View.extend({
- // options
- optionsDefault: {
- value : ''
- },
-
// initialize
initialize : function(options) {
// configure options
- this.options = Utils.merge(options, this.optionsDefault);
+ this.options = options;
// create new element
this.setElement(this._template(this.options));
+
+ // set initial value
+ if (this.options.value !== undefined) {
+ this.value(this.options.value);
+ }
},
// value
@@ -441,6 +445,7 @@
Searchbox : Searchbox,
Select : Select,
Hidden : Hidden,
- Slider : Slider
+ Slider : Slider,
+ Drilldown : Drilldown
}
});
diff -r 20e0db2511e555b9a168a96dee1ff75180aabbdf -r 98a6cad91c3ac3825c7f954a0c697c6706ad1d73 static/scripts/mvc/ui/ui-options.js
--- a/static/scripts/mvc/ui/ui-options.js
+++ b/static/scripts/mvc/ui/ui-options.js
@@ -2,7 +2,7 @@
define(['utils/utils'], function(Utils) {
/** Base class for options based ui elements **/
-var OptionsBase = Backbone.View.extend({
+var Base = Backbone.View.extend({
// initialize
initialize: function(options) {
// options
@@ -56,16 +56,19 @@
var current = this._getValue();
// remove all options
- this.$el.find('.ui-option').remove();
+ this.$options.empty();
- // add new options
- for (var key in options) {
- // load option template
- var $option = $(this._templateOption(options[key]));
- $option.addClass('ui-option');
-
- // append to dom
- this.$options.append($option);
+ // add new options using single option templates or full template
+ if (this._templateOptions) {
+ // rebuild options using full template
+ this.$options.append(this._templateOptions(options));
+ } else {
+ // rebuild options using single option templates
+ for (var key in options) {
+ var $option = $(this._templateOption(options[key]));
+ $option.addClass('ui-option');
+ this.$options.append($option);
+ }
}
// add change events
@@ -82,6 +85,29 @@
this.value(current);
},
+ /** Return/Set current value
+ */
+ value: function (new_value) {
+ // check if its an array
+ if (typeof new_value === 'string') {
+ new_value = [new_value];
+ }
+
+ // set new value
+ if (new_value !== undefined) {
+ // reset selection
+ this.$el.find('input').prop('checked', false);
+
+ // update to new selection
+ for (var i in new_value) {
+ this.$el.find('input[value="' + new_value[i] + '"]').first().prop('checked', true);
+ };
+ }
+
+ // get and return value
+ return this._getValue();
+ },
+
/** Check if selected value exists (or any if multiple)
*/
exists: function(value) {
@@ -198,46 +224,6 @@
*/
_messageHide: function() {
this.$message.hide();
- }
-});
-
-/** Radio button field **/
-var Radio = {};
-Radio.View = OptionsBase.extend({
- // initialize
- initialize: function(options) {
- OptionsBase.prototype.initialize.call(this, options);
- },
-
- /** Return/Set current value
- */
- value: function (new_val) {
- // check if its an array
- if (typeof new_val === 'string') {
- new_val = [new_val];
- }
-
- // set new value
- if (new_val !== undefined) {
- // reset selection
- this.$el.find('input').prop('checked', false);
-
- // update to new selection
- for (var i in new_val) {
- this.$el.find('input[value="' + new_val[i] + '"]').prop('checked', true);
- };
- }
-
- // get and return value
- return this._getValue();
- },
-
- /** Template for options
- */
- _templateOption: function(pair) {
- return '<div>' +
- '<input type="radio" name="' + this.options.id + '" value="' + pair.value + '"/>' + pair.label + '<br>' +
- '</div>';
},
/** Main template function
@@ -247,16 +233,33 @@
}
});
+/** Radio button field **/
+var Radio = {};
+Radio.View = Base.extend({
+ // initialize
+ initialize: function(options) {
+ Base.prototype.initialize.call(this, options);
+ },
+
+ /** Template for a single option
+ */
+ _templateOption: function(pair) {
+ return '<div>' +
+ '<input type="radio" name="' + this.options.id + '" value="' + pair.value + '"/>' + pair.label + '<br>' +
+ '</div>';
+ }
+});
+
/** Checkbox options field **/
var Checkbox = {};
-Checkbox.View = Radio.View.extend({
+Checkbox.View = Base.extend({
// initialize
initialize: function(options) {
options.multiple = true;
- Radio.View.prototype.initialize.call(this, options);
+ Base.prototype.initialize.call(this, options);
},
- /** Template for options
+ /** Template for a single option
*/
_templateOption: function(pair) {
return '<div>' +
@@ -267,27 +270,27 @@
/** Radio button options field styled as classic buttons **/
var RadioButton = {};
-RadioButton.View = OptionsBase.extend({
+RadioButton.View = Base.extend({
// initialize
initialize: function(options) {
- OptionsBase.prototype.initialize.call(this, options);
+ Base.prototype.initialize.call(this, options);
},
/** Return/Set current value
*/
- value: function (new_val) {
+ value: function (new_value) {
// set new value
- if (new_val !== undefined) {
+ if (new_value !== undefined) {
this.$el.find('input').prop('checked', false);
this.$el.find('label').removeClass('active');
- this.$el.find('[value="' + new_val + '"]').prop('checked', true).closest('label').addClass('active');
+ this.$el.find('[value="' + new_value + '"]').prop('checked', true).closest('label').addClass('active');
}
// get and return value
return this._getValue();
},
- /** Template for options
+ /** Template for a single option
*/
_templateOption: function(pair) {
var tmpl = '<label class="btn btn-default">';
@@ -307,6 +310,7 @@
});
return {
+ Base : Base,
Radio : Radio,
RadioButton : RadioButton,
Checkbox : Checkbox
diff -r 20e0db2511e555b9a168a96dee1ff75180aabbdf -r 98a6cad91c3ac3825c7f954a0c697c6706ad1d73 static/scripts/mvc/ui/ui-select-default.js
--- a/static/scripts/mvc/ui/ui-select-default.js
+++ b/static/scripts/mvc/ui/ui-select-default.js
@@ -41,6 +41,11 @@
// refresh
this.update(this.options.data);
+ // set initial value
+ if (this.options.value !== undefined) {
+ this.value(this.options.value);
+ }
+
// show/hide
if (!this.options.visible) {
this.hide();
diff -r 20e0db2511e555b9a168a96dee1ff75180aabbdf -r 98a6cad91c3ac3825c7f954a0c697c6706ad1d73 static/scripts/mvc/ui/ui-slider.js
--- a/static/scripts/mvc/ui/ui-slider.js
+++ b/static/scripts/mvc/ui/ui-slider.js
@@ -5,7 +5,6 @@
var View = Backbone.View.extend({
// options
optionsDefault: {
- value : '',
min : null,
max : null,
step : null,
@@ -49,6 +48,11 @@
// link text input field
this.$text = this.$el.find('#text');
+ // set initial value
+ if (this.options.value !== undefined) {
+ this.value(this.options.value);
+ }
+
// add text field event
this.$text.on('change', function () {
self.value($(this).val());
diff -r 20e0db2511e555b9a168a96dee1ff75180aabbdf -r 98a6cad91c3ac3825c7f954a0c697c6706ad1d73 static/scripts/packed/mvc/tools/tools-form.js
--- a/static/scripts/packed/mvc/tools/tools-form.js
+++ b/static/scripts/packed/mvc/tools/tools-form.js
@@ -1,1 +1,1 @@
-define(["utils/utils","utils/deferred","mvc/ui/ui-portlet","mvc/ui/ui-misc","mvc/citation/citation-model","mvc/citation/citation-view","mvc/tools","mvc/tools/tools-template","mvc/tools/tools-content","mvc/tools/tools-section","mvc/tools/tools-tree","mvc/tools/tools-jobs"],function(i,j,h,m,k,a,e,d,f,l,c,g){var b=Backbone.View.extend({container:"body",initialize:function(o){console.debug(o);var n=this;var p=parent.Galaxy;if(p&&p.modal){this.modal=p.modal}else{this.modal=new m.Modal.View()}if(p&&p.currUser){this.is_admin=p.currUser.get("is_admin")}else{this.is_admin=false}this.options=o;this.deferred=new j();this.setElement("<div/>");$(this.container).append(this.$el);this.tree=new c(this);this.job_handler=new g(this);this.content=new f(this);this._buildForm(o)},message:function(n){$(this.container).empty();$(this.container).append(n)},reset:function(){for(var n in this.element_list){this.element_list[n].reset()}},rebuild:function(){this.tree.refresh();console.debug("tools-form::rebuild() - Rebuilding data structures.")},refresh:function(){if(this.is_dynamic){var n=this;this.deferred.reset();this.deferred.execute(function(){n._updateModel()})}},_buildModel:function(){var n=this;var o=galaxy_config.root+"api/tools/"+this.options.id+"/build?";if(this.options.job_id){o+="job_id="+this.options.job_id}else{if(this.options.dataset_id){o+="dataset_id="+this.options.dataset_id}else{var p=top.location.href;var q=p.indexOf("?");if(p.indexOf("tool_id=")!=-1&&q!==-1){o+=p.slice(q+1)}}}i.request({type:"GET",url:o,success:function(r){n.options=$.extend(n.options,r);n.model=r;n.inputs=r.inputs;console.debug("tools-form::initialize() - Initial tool model ready.");console.debug(r);n._buildForm()},error:function(r){console.debug("tools-form::initialize() - Initial tool model request failed.");console.debug(r)}})},_updateModel:function(){var n=this;var o=this.tree.finalize({data:function(r){if(r.values.length>0&&r.values[0]&&r.values[0].src==="hda"){return n.content.get({id:r.values[0].id,src:"hda"}).id_uncoded}return null}});console.debug("tools-form::_refreshForm() - Refreshing states.");console.debug(o);function q(u){for(var s in n.input_list){var t=n.field_list[s];var r=n.input_list[s];if(r.is_dynamic&&t.wait&&t.unwait){if(u){t.wait()}else{t.unwait()}}}}q(true);var p=this.deferred.register();i.request({type:"GET",url:galaxy_config.root+"api/tools/"+this.options.id+"/build",data:o,success:function(r){n._updateForm(r);q(false);n.deferred.done(p);console.debug("tools-form::_refreshForm() - States refreshed.");console.debug(r)},error:function(r){n.deferred.done(p);console.debug("tools-form::_refreshForm() - Refresh request failed.");console.debug(r)}})},_updateForm:function(n){var o=this;this.tree.matchModel(n,function(q,u){var p=o.input_list[q];if(p&&p.options){if(JSON.stringify(p.options)!=JSON.stringify(u.options)){p.options=u.options;var v=o.field_list[q];if(v.update){var t=[];switch(p.type){case"data":t=p.options;break;default:for(var s in u.options){var r=u.options[s];if(r.length>2){t.push({label:r[0],value:r[1]})}}}v.update(t);v.trigger("change");console.debug("Updating options for "+q)}}}})},_buildForm:function(p){var o=this;this.field_list={};this.input_list={};this.element_list={};this.model=p;this.inputs=p.inputs;var s=new m.ButtonMenu({icon:"fa-gear",tooltip:"Click to see a list of options."});if(p.biostar_url){s.addMenu({icon:"fa-question-circle",title:"Question?",tooltip:"Ask a question about this tool (Biostar)",onclick:function(){window.open(o.options.biostar_url+"/p/new/post/")}});s.addMenu({icon:"fa-search",title:"Search",tooltip:"Search help for this tool (Biostar)",onclick:function(){window.open(o.options.biostar_url+"/t/"+o.options.id+"/")}})}s.addMenu({icon:"fa-share",title:"Share",tooltip:"Share this tool",onclick:function(){prompt("Copy to clipboard: Ctrl+C, Enter",window.location.origin+galaxy_config.root+"root?tool_id="+o.options.id)}});if(this.is_admin){s.addMenu({icon:"fa-download",title:"Download",tooltip:"Download this tool",onclick:function(){window.location.href=galaxy_config.root+"api/tools/"+o.options.id+"/download"}})}this.section=new l.View(o,{inputs:this.inputs,cls:"ui-table-plain"});if(this.incompatible){this.$el.hide();$("#tool-form-classic").show();return}this.portlet=new h.View({icon:"fa-wrench",title:"<b>"+this.model.name+"</b> "+this.model.description,cls:"ui-portlet-slim",operations:{menu:s},buttons:{execute:new m.Button({icon:"fa-check",tooltip:"Execute the tool",title:"Execute",cls:"btn btn-primary",floating:"clear",onclick:function(){o.job_handler.submit()}})}});this.$el.empty();this.$el.append(this.portlet.$el);if(p.help!=""){this.$el.append(d.help(p.help))}if(p.citations){var r=$("<div/>");var n=new k.ToolCitationCollection();n.tool_id=p.id;var q=new a.CitationListView({el:r,collection:n});q.render();n.fetch();this.$el.append(r)}this.portlet.append(this.section.$el);this.rebuild()}});return{View:b}});
\ No newline at end of file
+define(["utils/utils","utils/deferred","mvc/ui/ui-portlet","mvc/ui/ui-misc","mvc/citation/citation-model","mvc/citation/citation-view","mvc/tools","mvc/tools/tools-template","mvc/tools/tools-content","mvc/tools/tools-section","mvc/tools/tools-tree","mvc/tools/tools-jobs"],function(i,j,h,m,k,a,e,d,f,l,c,g){var b=Backbone.View.extend({container:"body",initialize:function(o){console.debug(o);var n=this;var p=parent.Galaxy;if(p&&p.modal){this.modal=p.modal}else{this.modal=new m.Modal.View()}if(p&&p.currUser){this.is_admin=p.currUser.get("is_admin")}else{this.is_admin=false}this.options=o;this.deferred=new j();this.setElement("<div/>");$(this.container).append(this.$el);this.tree=new c(this);this.job_handler=new g(this);this.content=new f(this);this._buildForm(o)},message:function(n){$(this.container).empty();$(this.container).append(n)},reset:function(){for(var n in this.element_list){this.element_list[n].reset()}},rebuild:function(){this.tree.refresh();console.debug("tools-form::rebuild() - Rebuilding data structures.")},refresh:function(){if(this.is_dynamic){var n=this;this.deferred.reset();this.deferred.execute(function(){n._updateModel()})}},_buildModel:function(){var n=this;var o=galaxy_config.root+"api/tools/"+this.options.id+"/build?";if(this.options.job_id){o+="job_id="+this.options.job_id}else{if(this.options.dataset_id){o+="dataset_id="+this.options.dataset_id}else{var p=top.location.href;var q=p.indexOf("?");if(p.indexOf("tool_id=")!=-1&&q!==-1){o+=p.slice(q+1)}}}i.request({type:"GET",url:o,success:function(r){n.options=$.extend(n.options,r);n.model=r;n.inputs=r.inputs;console.debug("tools-form::initialize() - Initial tool model ready.");console.debug(r);n._buildForm()},error:function(r){console.debug("tools-form::initialize() - Initial tool model request failed.");console.debug(r)}})},_updateModel:function(){var n=this;var o=this.tree.finalize({data:function(r){if(r.values.length>0&&r.values[0]&&r.values[0].src==="hda"){return n.content.get({id:r.values[0].id,src:"hda"}).id_uncoded}return null}});console.debug("tools-form::_refreshForm() - Refreshing states.");console.debug(o);function q(u){for(var s in n.input_list){var t=n.field_list[s];var r=n.input_list[s];if(r.is_dynamic&&t.wait&&t.unwait){if(u){t.wait()}else{t.unwait()}}}}q(true);var p=this.deferred.register();i.request({type:"GET",url:galaxy_config.root+"api/tools/"+this.options.id+"/build",data:o,success:function(r){n._updateForm(r);q(false);n.deferred.done(p);console.debug("tools-form::_refreshForm() - States refreshed.");console.debug(r)},error:function(r){n.deferred.done(p);console.debug("tools-form::_refreshForm() - Refresh request failed.");console.debug(r)}})},_updateForm:function(n){var o=this;this.tree.matchModel(n,function(q,u){var p=o.input_list[q];if(p&&p.options){if(!_.isEqual(p.options,u.options)){p.options=u.options;var v=o.field_list[q];if(v.update){var t=[];switch(p.type){case"data":t=p.options;break;case"drill_down":t=p.options;break;default:for(var s in u.options){var r=u.options[s];if(r.length>2){t.push({label:r[0],value:r[1]})}}}v.update(t);v.trigger("change");console.debug("Updating options for "+q)}}}})},_buildForm:function(p){var o=this;this.field_list={};this.input_list={};this.element_list={};this.model=p;this.inputs=p.inputs;var s=new m.ButtonMenu({icon:"fa-gear",tooltip:"Click to see a list of options."});if(p.biostar_url){s.addMenu({icon:"fa-question-circle",title:"Question?",tooltip:"Ask a question about this tool (Biostar)",onclick:function(){window.open(o.options.biostar_url+"/p/new/post/")}});s.addMenu({icon:"fa-search",title:"Search",tooltip:"Search help for this tool (Biostar)",onclick:function(){window.open(o.options.biostar_url+"/t/"+o.options.id+"/")}})}s.addMenu({icon:"fa-share",title:"Share",tooltip:"Share this tool",onclick:function(){prompt("Copy to clipboard: Ctrl+C, Enter",window.location.origin+galaxy_config.root+"root?tool_id="+o.options.id)}});if(this.is_admin){s.addMenu({icon:"fa-download",title:"Download",tooltip:"Download this tool",onclick:function(){window.location.href=galaxy_config.root+"api/tools/"+o.options.id+"/download"}})}this.section=new l.View(o,{inputs:this.inputs,cls:"ui-table-plain"});if(this.incompatible){this.$el.hide();$("#tool-form-classic").show();return}this.portlet=new h.View({icon:"fa-wrench",title:"<b>"+this.model.name+"</b> "+this.model.description,cls:"ui-portlet-slim",operations:{menu:s},buttons:{execute:new m.Button({icon:"fa-check",tooltip:"Execute the tool",title:"Execute",cls:"btn btn-primary",floating:"clear",onclick:function(){o.job_handler.submit()}})}});this.$el.empty();this.$el.append(this.portlet.$el);if(p.help!=""){this.$el.append(d.help(p.help))}if(p.citations){var r=$("<div/>");var n=new k.ToolCitationCollection();n.tool_id=p.id;var q=new a.CitationListView({el:r,collection:n});q.render();n.fetch();this.$el.append(r)}this.portlet.append(this.section.$el);this.rebuild()}});return{View:b}});
\ No newline at end of file
diff -r 20e0db2511e555b9a168a96dee1ff75180aabbdf -r 98a6cad91c3ac3825c7f954a0c697c6706ad1d73 static/scripts/packed/mvc/tools/tools-section.js
--- a/static/scripts/packed/mvc/tools/tools-section.js
+++ b/static/scripts/packed/mvc/tools/tools-section.js
@@ -1,1 +1,1 @@
-define(["utils/utils","mvc/ui/ui-table","mvc/ui/ui-misc","mvc/tools/tools-repeat","mvc/tools/tools-select-content","mvc/tools/tools-input"],function(d,b,g,c,a,e){var f=Backbone.View.extend({initialize:function(i,h){this.app=i;this.inputs=h.inputs;h.cls_tr="section-row";this.table=new b.View(h);this.setElement(this.table.$el);this.render()},render:function(){this.table.delAll();for(var h in this.inputs){this._add(this.inputs[h])}},_add:function(j){var i=this;var h=jQuery.extend(true,{},j);h.id=j.id=d.uuid();this.app.input_list[h.id]=h;var k=h.type;switch(k){case"conditional":this._addConditional(h);break;case"repeat":this._addRepeat(h);break;default:this._addRow(h)}},_addConditional:function(h){var j=this;h.test_param.id=h.id;var m=this._addRow(h.test_param);m.options.onchange=function(t){var p=j.app.tree.matchCase(h,t);for(var r in h.cases){var w=h.cases[r];var u=h.id+"-section-"+r;var o=j.table.get(u);var v=false;for(var q in w.inputs){var s=w.inputs[q].type;if(s&&s!=="hidden"){v=true;break}}if(r==p&&v){o.fadeIn("fast")}else{o.hide()}}j.app.refresh()};for(var l in h.cases){var k=h.id+"-section-"+l;var n=new f(this.app,{inputs:h.cases[l].inputs,cls:"ui-table-plain"});n.$el.addClass("ui-table-form-section");this.table.add(n.$el);this.table.append(k)}m.trigger("change")},_addRepeat:function(o){var r=this;var p=0;function m(i,t){var s=o.id+"-section-"+(p++);var u=null;if(t){u=function(){k.del(s);k.retitle(o.title);r.app.rebuild();r.app.refresh()}}var v=new f(r.app,{inputs:i,cls:"ui-table-plain"});k.add({id:s,title:o.title,$el:v.$el,ondel:u});k.retitle(o.title)}var k=new c.View({title_new:o.title,max:o.max,onnew:function(){m(o.inputs,true);r.app.rebuild();r.app.refresh()}});var h=o.min;var q=_.size(o.cache);for(var l=0;l<Math.max(q,h);l++){var n=null;if(l<q){n=o.cache[l]}else{n=o.inputs}m(n,l>=h)}var j=new e(this.app,{label:o.title,help:o.help,field:k});j.$el.addClass("ui-table-form-section");this.table.add(j.$el);this.table.append(o.id)},_addRow:function(h){var k=h.id;var i=this._createField(h);if(h.is_dynamic){this.app.is_dynamic=true}this.app.field_list[k]=i;var j=new e(this.app,{label:h.label,optional:h.optional,help:h.help,field:i});this.app.element_list[k]=j;this.table.add(j.$el);this.table.append(k);return i},_createField:function(h){var i=null;switch(h.type){case"text":i=this._fieldText(h);break;case"select":i=this._fieldSelect(h);break;case"data":i=this._fieldData(h);break;case"data_column":i=this._fieldSelect(h);break;case"hidden":i=this._fieldHidden(h);break;case"integer":i=this._fieldSlider(h);break;case"float":i=this._fieldSlider(h);break;case"boolean":i=this._fieldBoolean(h);break;case"genomebuild":h.searchable=true;i=this._fieldSelect(h);break;default:this.app.incompatible=true;if(h.options){i=this._fieldSelect(h)}else{i=this._fieldText(h)}console.debug("tools-form::_addRow() : Auto matched field type ("+h.type+").")}if(h.value!==undefined){i.value(h.value)}return i},_fieldData:function(h){var i=this;return new a.View(this.app,{id:"field-"+h.id,extensions:h.extensions,multiple:h.multiple,data:h.options,onchange:function(){i.app.refresh()}})},_fieldSelect:function(h){var k=[];for(var l in h.options){var m=h.options[l];k.push({label:m[0],value:m[1]})}var n=g.Select;switch(h.display){case"checkboxes":n=g.Checkbox;break;case"radio":n=g.Radio;break}var j=this;return new n.View({id:"field-"+h.id,data:k,multiple:h.multiple,searchable:h.searchable,onchange:function(){j.app.refresh()}})},_fieldText:function(h){var i=this;return new g.Input({id:"field-"+h.id,area:h.area,onchange:function(){i.app.refresh()}})},_fieldSlider:function(h){return new g.Slider.View({id:"field-"+h.id,precise:h.type=="float",min:h.min,max:h.max})},_fieldHidden:function(h){return new g.Hidden({id:"field-"+h.id})},_fieldBoolean:function(h){return new g.RadioButton.View({id:"field-"+h.id,data:[{label:"Yes",value:"true"},{label:"No",value:"false"}]})}});return{View:f}});
\ No newline at end of file
+define(["utils/utils","mvc/ui/ui-table","mvc/ui/ui-misc","mvc/tools/tools-repeat","mvc/tools/tools-select-content","mvc/tools/tools-input"],function(d,b,g,c,a,e){var f=Backbone.View.extend({initialize:function(i,h){this.app=i;this.inputs=h.inputs;h.cls_tr="section-row";this.table=new b.View(h);this.setElement(this.table.$el);this.render()},render:function(){this.table.delAll();for(var h in this.inputs){this._add(this.inputs[h])}},_add:function(j){var i=this;var h=jQuery.extend(true,{},j);h.id=j.id=d.uuid();this.app.input_list[h.id]=h;var k=h.type;switch(k){case"conditional":this._addConditional(h);break;case"repeat":this._addRepeat(h);break;default:this._addRow(h)}},_addConditional:function(h){var j=this;h.test_param.id=h.id;var m=this._addRow(h.test_param);m.options.onchange=function(t){var p=j.app.tree.matchCase(h,t);for(var r in h.cases){var w=h.cases[r];var u=h.id+"-section-"+r;var o=j.table.get(u);var v=false;for(var q in w.inputs){var s=w.inputs[q].type;if(s&&s!=="hidden"){v=true;break}}if(r==p&&v){o.fadeIn("fast")}else{o.hide()}}j.app.refresh()};for(var l in h.cases){var k=h.id+"-section-"+l;var n=new f(this.app,{inputs:h.cases[l].inputs,cls:"ui-table-plain"});n.$el.addClass("ui-table-form-section");this.table.add(n.$el);this.table.append(k)}m.trigger("change")},_addRepeat:function(o){var r=this;var p=0;function m(i,t){var s=o.id+"-section-"+(p++);var u=null;if(t){u=function(){k.del(s);k.retitle(o.title);r.app.rebuild();r.app.refresh()}}var v=new f(r.app,{inputs:i,cls:"ui-table-plain"});k.add({id:s,title:o.title,$el:v.$el,ondel:u});k.retitle(o.title)}var k=new c.View({title_new:o.title,max:o.max,onnew:function(){m(o.inputs,true);r.app.rebuild();r.app.refresh()}});var h=o.min;var q=_.size(o.cache);for(var l=0;l<Math.max(q,h);l++){var n=null;if(l<q){n=o.cache[l]}else{n=o.inputs}m(n,l>=h)}var j=new e(this.app,{label:o.title,help:o.help,field:k});j.$el.addClass("ui-table-form-section");this.table.add(j.$el);this.table.append(o.id)},_addRow:function(h){var k=h.id;var i=this._createField(h);if(h.is_dynamic){this.app.is_dynamic=true}this.app.field_list[k]=i;var j=new e(this.app,{label:h.label,optional:h.optional,help:h.help,field:i});this.app.element_list[k]=j;this.table.add(j.$el);this.table.append(k);return i},_createField:function(h){var i=null;switch(h.type){case"text":i=this._fieldText(h);break;case"select":i=this._fieldSelect(h);break;case"data":i=this._fieldData(h);break;case"data_column":i=this._fieldSelect(h);break;case"hidden":i=this._fieldHidden(h);break;case"integer":i=this._fieldSlider(h);break;case"float":i=this._fieldSlider(h);break;case"boolean":i=this._fieldBoolean(h);break;case"genomebuild":h.searchable=true;i=this._fieldSelect(h);break;case"drill_down":i=this._fieldDrilldown(h);break;default:this.app.incompatible=true;if(h.options){i=this._fieldSelect(h)}else{i=this._fieldText(h)}console.debug("tools-form::_addRow() : Auto matched field type ("+h.type+").")}if(h.value!==undefined){i.value(h.value)}return i},_fieldData:function(h){var i=this;return new a.View(this.app,{id:"field-"+h.id,extensions:h.extensions,multiple:h.multiple,data:h.options,onchange:function(){i.app.refresh()}})},_fieldSelect:function(h){var k=[];for(var l in h.options){var m=h.options[l];k.push({label:m[0],value:m[1]})}var n=g.Select;switch(h.display){case"checkboxes":n=g.Checkbox;break;case"radio":n=g.Radio;break}var j=this;return new n.View({id:"field-"+h.id,data:k,multiple:h.multiple,searchable:h.searchable,onchange:function(){j.app.refresh()}})},_fieldDrilldown:function(h){var i=this;return new g.Drilldown.View({id:"field-"+h.id,data:h.options,display:h.display,onchange:function(){i.app.refresh()}})},_fieldText:function(h){var i=this;return new g.Input({id:"field-"+h.id,area:h.area,onchange:function(){i.app.refresh()}})},_fieldSlider:function(h){return new g.Slider.View({id:"field-"+h.id,precise:h.type=="float",min:h.min,max:h.max})},_fieldHidden:function(h){return new g.Hidden({id:"field-"+h.id})},_fieldBoolean:function(h){return new g.RadioButton.View({id:"field-"+h.id,data:[{label:"Yes",value:"true"},{label:"No",value:"false"}]})}});return{View:f}});
\ No newline at end of file
diff -r 20e0db2511e555b9a168a96dee1ff75180aabbdf -r 98a6cad91c3ac3825c7f954a0c697c6706ad1d73 static/scripts/packed/mvc/tools/tools-select-content.js
--- a/static/scripts/packed/mvc/tools/tools-select-content.js
+++ b/static/scripts/packed/mvc/tools/tools-select-content.js
@@ -1,1 +1,1 @@
-define(["utils/utils","mvc/ui/ui-misc","mvc/ui/ui-tabs","mvc/tools/tools-template"],function(c,e,b,a){var d=Backbone.View.extend({initialize:function(k,g){this.app=k;this.options=g;var f=this;this.setElement("<div/>");this.list={};var j=[];if(!g.multiple){this.current="single"}else{this.current="multiple"}if(!g.multiple){j.push({icon:"fa-file-o",label:"Single dataset",value:"single"});this.select_single=new e.Select.View({onchange:function(){f.trigger("change")}});this.list.single={field:this.select_single,type:"hda"}}j.push({icon:"fa-files-o",label:"Multiple datasets",value:"multiple"});this.select_multiple=new e.Select.View({multiple:true,onchange:function(){f.trigger("change")}});this.list.multiple={field:this.select_multiple,type:"hda"};j.push({icon:"fa-folder-o",label:"List of datasets",value:"collection"});this.select_collection=new e.Select.View({onchange:function(){f.trigger("change")}});this.list.collection={field:this.select_collection,type:"hdca"};this.button_type=new e.RadioButton.View({value:this.current,data:j,onchange:function(i){f.current=i;f.refresh();f.trigger("change")}});this.$batch=$(a.batchMode());this.$el.append(c.wrap(this.button_type.$el));for(var h in this.list){this.$el.append(this.list[h].field.$el)}this.$el.append(this.$batch);this.update(g.data);this.refresh();this.on("change",function(){if(g.onchange){g.onchange(f.value())}})},wait:function(){for(var f in this.list){this.list[f].field.wait()}},unwait:function(){for(var f in this.list){this.list[f].field.unwait()}},update:function(g){var l=[];for(var j in g.hda){var k=g.hda[j];l.push({label:k.hid+": "+k.name,value:k.id})}var f=[];for(var j in g.hdca){var h=g.hdca[j];f.push({label:h.hid+": "+h.name,value:h.id})}this.select_single&&this.select_single.update(l);this.select_multiple.update(l);this.select_collection.update(f);this.app.content.add(g)},value:function(m){if(m&&m.values){try{var l=[];for(var h in m.values){l.push(m.values[h].id)}if(m&&m.values.length>0&&m.values[0].src=="hcda"){this.current="collection";this.select_collection.value(l[0])}else{if(l.length>1||this.options.multiple){this.current="multiple";this.select_multiple.value(l)}else{this.current="single";this.select_single.value(l[0])}}this.refresh();var g=this._select();if(!g.validate()){g.value(g.first())}}catch(k){console.debug("tools-select-content::value() - Skipped.")}}var j=this._select().value();if(!(j instanceof Array)){j=[j]}var f={batch:!this.options.multiple&&this.current!="single",values:[]};for(var h in j){f.values.push({id:j[h],src:this.list[this.current].type})}return f},validate:function(){return this._select().validate()},refresh:function(){for(var g in this.list){var f=this.list[g].field.$el;if(this.current==g){f.show()}else{f.hide()}}if(this.current!="single"&&!this.options.multiple){this.$batch.show()}else{this.$batch.hide()}},_select:function(){return this.list[this.current].field}});return{View:d}});
\ No newline at end of file
+define(["utils/utils","mvc/ui/ui-misc","mvc/ui/ui-tabs","mvc/tools/tools-template"],function(c,e,b,a){var d=Backbone.View.extend({initialize:function(k,g){this.app=k;this.options=g;var f=this;this.setElement("<div/>");this.list={};var j=[];if(!g.multiple){this.current="single"}else{this.current="multiple"}if(!g.multiple){j.push({icon:"fa-file-o",label:"Single dataset",value:"single"});this.select_single=new e.Select.View({onchange:function(){f.trigger("change")}});this.list.single={field:this.select_single,type:"hda"}}j.push({icon:"fa-files-o",label:"Multiple datasets",value:"multiple"});this.select_multiple=new e.Select.View({multiple:true,onchange:function(){f.trigger("change")}});this.list.multiple={field:this.select_multiple,type:"hda"};j.push({icon:"fa-folder-o",label:"List of datasets",value:"collection"});this.select_collection=new e.Select.View({onchange:function(){f.trigger("change")}});this.list.collection={field:this.select_collection,type:"hdca"};this.button_type=new e.RadioButton.View({value:this.current,data:j,onchange:function(i){f.current=i;f.refresh();f.trigger("change")}});this.$batch=$(a.batchMode());this.$el.append(c.wrap(this.button_type.$el));for(var h in this.list){this.$el.append(this.list[h].field.$el)}this.$el.append(this.$batch);this.update(g.data);if(this.options.value!==undefined){this.value(this.options.value)}this.refresh();this.on("change",function(){if(g.onchange){g.onchange(f.value())}})},wait:function(){for(var f in this.list){this.list[f].field.wait()}},unwait:function(){for(var f in this.list){this.list[f].field.unwait()}},update:function(g){var l=[];for(var j in g.hda){var k=g.hda[j];l.push({label:k.hid+": "+k.name,value:k.id})}var f=[];for(var j in g.hdca){var h=g.hdca[j];f.push({label:h.hid+": "+h.name,value:h.id})}this.select_single&&this.select_single.update(l);this.select_multiple.update(l);this.select_collection.update(f);this.app.content.add(g)},value:function(m){if(m&&m.values){try{var l=[];for(var h in m.values){l.push(m.values[h].id)}if(m&&m.values.length>0&&m.values[0].src=="hcda"){this.current="collection";this.select_collection.value(l[0])}else{if(l.length>1||this.options.multiple){this.current="multiple";this.select_multiple.value(l)}else{this.current="single";this.select_single.value(l[0])}}this.refresh();var g=this._select();if(!g.validate()){g.value(g.first())}}catch(k){console.debug("tools-select-content::value() - Skipped.")}}var j=this._select().value();if(!(j instanceof Array)){j=[j]}var f={batch:!this.options.multiple&&this.current!="single",values:[]};for(var h in j){f.values.push({id:j[h],src:this.list[this.current].type})}return f},validate:function(){return this._select().validate()},refresh:function(){for(var g in this.list){var f=this.list[g].field.$el;if(this.current==g){f.show()}else{f.hide()}}if(this.current!="single"&&!this.options.multiple){this.$batch.show()}else{this.$batch.hide()}},_select:function(){return this.list[this.current].field}});return{View:d}});
\ No newline at end of file
diff -r 20e0db2511e555b9a168a96dee1ff75180aabbdf -r 98a6cad91c3ac3825c7f954a0c697c6706ad1d73 static/scripts/packed/mvc/ui/ui-drilldown.js
--- /dev/null
+++ b/static/scripts/packed/mvc/ui/ui-drilldown.js
@@ -0,0 +1,1 @@
+define(["utils/utils","mvc/ui/ui-options"],function(b,a){var c=a.Base.extend({initialize:function(d){this.display=d.display||"checkbox";d.multiple=(this.display=="checkbox");a.Base.prototype.initialize.call(this,d)},_templateOption:function(d,f,e){return'<div><input name="'+this.options.id+'" class="ui-option" type="'+this.display+'" value="'+f+'">'+b.sanitize(d)+"<div/>"},_templateOptions:function(g,h){var e=this;function f(l,m){function k(n){if(n){m.fadeIn("fast");l.removeClass("toggle-expand");l.addClass("toggle");l.is_expanded=true}else{m.hide();l.removeClass("toggle");l.addClass("toggle-expand");l.is_expanded=false}}l.on("click",function(){k(!l.is_expanded)})}function d(q,o){for(i in o){var r=o[i];var m=r.options.length>0;var l=$("<div/>");if(m){var n=$('<span class="ui-drilldown-button form-toggle icon-button toggle-expand" style="position: relative; top: 2px;"/>');var k=$("<div/>");k.append(n);k.append(e._templateOption(r.name,r.value));l.append(k);var p=$('<div style="display: none; margin-left: 25px;"/>');d(p,r.options);l.append(p);f(n,p)}else{l.append(e._templateOption(r.name,r.value))}q.append(l)}}var j=$("<div/>");d(j,g);return j},_template:function(d){return'<div class="ui-options drilldown-container" id="'+d.id+'"/>'}});return{View:c}});
\ No newline at end of file
diff -r 20e0db2511e555b9a168a96dee1ff75180aabbdf -r 98a6cad91c3ac3825c7f954a0c697c6706ad1d73 static/scripts/packed/mvc/ui/ui-misc.js
--- a/static/scripts/packed/mvc/ui/ui-misc.js
+++ b/static/scripts/packed/mvc/ui/ui-misc.js
@@ -1,1 +1,1 @@
-define(["utils/utils","mvc/ui/ui-select-default","mvc/ui/ui-slider","mvc/ui/ui-options","mvc/ui/ui-button-menu","mvc/ui/ui-modal"],function(k,b,e,n,p,l){var d=Backbone.View.extend({optionsDefault:{url:"",cls:""},initialize:function(q){this.options=k.merge(q,this.optionsDefault);this.setElement(this._template(this.options))},_template:function(q){return'<img class="ui-image '+q.cls+'" src="'+q.url+'"/>'}});var j=Backbone.View.extend({optionsDefault:{title:"",cls:""},initialize:function(q){this.options=k.merge(q,this.optionsDefault);this.setElement(this._template(this.options))},title:function(q){this.$el.html(q)},_template:function(q){return'<label class="ui-label '+q.cls+'">'+q.title+"</label>"},value:function(){return options.title}});var c=Backbone.View.extend({optionsDefault:{floating:"right",icon:"",tooltip:"",placement:"bottom",title:"",cls:""},initialize:function(q){this.options=k.merge(q,this.optionsDefault);this.setElement(this._template(this.options));$(this.el).tooltip({title:q.tooltip,placement:"bottom"})},_template:function(q){return'<div><span class="fa '+q.icon+'" class="ui-icon"/> '+q.title+"</div>"}});var g=Backbone.View.extend({optionsDefault:{id:null,title:"",floating:"right",cls:"ui-button btn btn-default",icon:""},initialize:function(q){this.options=k.merge(q,this.optionsDefault);this.setElement(this._template(this.options));$(this.el).on("click",function(){$(".tooltip").hide();if(q.onclick){q.onclick()}});$(this.el).tooltip({title:q.tooltip,placement:"bottom"})},_template:function(q){var r='<button id="'+q.id+'" type="submit" style="float: '+q.floating+';" type="button" class="'+q.cls+'">';if(q.icon){r+='<i class="icon fa '+q.icon+'"></i> '}r+=q.title+"</button>";return r}});var h=Backbone.View.extend({optionsDefault:{id:null,title:"",floating:"right",cls:"ui-button-icon",icon:"",tooltip:"",onclick:null},initialize:function(r){this.options=k.merge(r,this.optionsDefault);this.setElement(this._template(this.options));this.$button=this.$el.find(".button");var q=this;$(this.el).on("click",function(){$(".tooltip").hide();if(r.onclick&&!q.disabled){r.onclick()}});$(this.el).tooltip({title:r.tooltip,placement:"bottom"})},disable:function(){this.$button.addClass("disabled");this.disabled=true},enable:function(){this.$button.removeClass("disabled");this.disabled=false},_template:function(q){var r="";if(q.title){r="width: auto;"}var s='<div id="'+q.id+'" style="float: '+q.floating+"; "+r+'" class="'+q.cls+'">';if(q.title){s+='<div class="button"><i class="icon fa '+q.icon+'"/> <span class="title">'+q.title+"</span></div>"}else{s+='<i class="icon fa '+q.icon+'"/>'}s+="</div>";return s}});var f=Backbone.View.extend({optionsDefault:{title:"",cls:""},initialize:function(q){this.options=k.merge(q,this.optionsDefault);this.setElement(this._template(this.options));$(this.el).on("click",q.onclick)},_template:function(q){return'<div><a href="javascript:void(0)" class="ui-anchor '+q.cls+'">'+q.title+"</a></div>"}});var m=Backbone.View.extend({optionsDefault:{message:"",status:"info",persistent:false},initialize:function(q){this.options=k.merge(q,this.optionsDefault);this.setElement("<div></div>")},update:function(r){this.options=k.merge(r,this.optionsDefault);if(r.message!=""){this.$el.html(this._template(this.options));this.$el.find(".alert").append(r.message);this.$el.fadeIn();if(!r.persistent){var q=this;window.setTimeout(function(){if(q.$el.is(":visible")){q.$el.fadeOut()}else{q.$el.hide()}},3000)}}else{this.$el.fadeOut()}},_template:function(q){return'<div class="ui-message alert alert-'+q.status+'"/>'}});var a=Backbone.View.extend({optionsDefault:{onclick:null,searchword:""},initialize:function(r){this.options=k.merge(r,this.optionsDefault);this.setElement(this._template(this.options));var q=this;if(this.options.onclick){this.$el.on("submit",function(t){var s=q.$el.find("#search");q.options.onclick(s.val())})}},_template:function(q){return'<div class="ui-search"><form onsubmit="return false;"><input id="search" class="form-control input-sm" type="text" name="search" placeholder="Search..." value="'+q.searchword+'"><button type="submit" class="btn search-btn"><i class="fa fa-search"></i></button></form></div>'}});var i=Backbone.View.extend({optionsDefault:{value:"",type:"text",placeholder:"",disabled:false,visible:true,cls:"",area:false},initialize:function(r){this.options=k.merge(r,this.optionsDefault);this.setElement(this._template(this.options));if(this.options.disabled){this.$el.prop("disabled",true)}if(!this.options.visible){this.$el.hide()}var q=this;this.$el.on("input",function(){if(q.options.onchange){q.options.onchange(q.$el.val())}})},value:function(q){if(q!==undefined){this.$el.val(q)}return this.$el.val()},_template:function(q){if(q.area){return'<textarea id="'+q.id+'" class="ui-textarea '+q.cls+'"></textarea>'}else{return'<input id="'+q.id+'" type="'+q.type+'" value="'+q.value+'" placeholder="'+q.placeholder+'" class="ui-input '+q.cls+'">'}}});var o=Backbone.View.extend({optionsDefault:{value:""},initialize:function(q){this.options=k.merge(q,this.optionsDefault);this.setElement(this._template(this.options))},value:function(q){if(q!==undefined){this.$el.val(q)}return this.$el.val()},_template:function(q){return'<hidden id="'+q.id+'" value="'+q.value+'"/>'}});return{Anchor:f,Button:g,ButtonIcon:h,ButtonMenu:p,Icon:c,Image:d,Input:i,Label:j,Message:m,Modal:l,RadioButton:n.RadioButton,Checkbox:n.Checkbox,Radio:n.Radio,Searchbox:a,Select:b,Hidden:o,Slider:e}});
\ No newline at end of file
+define(["utils/utils","mvc/ui/ui-select-default","mvc/ui/ui-slider","mvc/ui/ui-options","mvc/ui/ui-drilldown","mvc/ui/ui-button-menu","mvc/ui/ui-modal"],function(k,b,e,o,l,q,m){var d=Backbone.View.extend({optionsDefault:{url:"",cls:""},initialize:function(r){this.options=k.merge(r,this.optionsDefault);this.setElement(this._template(this.options))},_template:function(r){return'<img class="ui-image '+r.cls+'" src="'+r.url+'"/>'}});var j=Backbone.View.extend({optionsDefault:{title:"",cls:""},initialize:function(r){this.options=k.merge(r,this.optionsDefault);this.setElement(this._template(this.options))},title:function(r){this.$el.html(r)},_template:function(r){return'<label class="ui-label '+r.cls+'">'+r.title+"</label>"},value:function(){return options.title}});var c=Backbone.View.extend({optionsDefault:{floating:"right",icon:"",tooltip:"",placement:"bottom",title:"",cls:""},initialize:function(r){this.options=k.merge(r,this.optionsDefault);this.setElement(this._template(this.options));$(this.el).tooltip({title:r.tooltip,placement:"bottom"})},_template:function(r){return'<div><span class="fa '+r.icon+'" class="ui-icon"/> '+r.title+"</div>"}});var g=Backbone.View.extend({optionsDefault:{id:null,title:"",floating:"right",cls:"ui-button btn btn-default",icon:""},initialize:function(r){this.options=k.merge(r,this.optionsDefault);this.setElement(this._template(this.options));$(this.el).on("click",function(){$(".tooltip").hide();if(r.onclick){r.onclick()}});$(this.el).tooltip({title:r.tooltip,placement:"bottom"})},_template:function(r){var s='<button id="'+r.id+'" type="submit" style="float: '+r.floating+';" type="button" class="'+r.cls+'">';if(r.icon){s+='<i class="icon fa '+r.icon+'"></i> '}s+=r.title+"</button>";return s}});var h=Backbone.View.extend({optionsDefault:{id:null,title:"",floating:"right",cls:"ui-button-icon",icon:"",tooltip:"",onclick:null},initialize:function(s){this.options=k.merge(s,this.optionsDefault);this.setElement(this._template(this.options));this.$button=this.$el.find(".button");var r=this;$(this.el).on("click",function(){$(".tooltip").hide();if(s.onclick&&!r.disabled){s.onclick()}});$(this.el).tooltip({title:s.tooltip,placement:"bottom"})},disable:function(){this.$button.addClass("disabled");this.disabled=true},enable:function(){this.$button.removeClass("disabled");this.disabled=false},_template:function(r){var s="";if(r.title){s="width: auto;"}var t='<div id="'+r.id+'" style="float: '+r.floating+"; "+s+'" class="'+r.cls+'">';if(r.title){t+='<div class="button"><i class="icon fa '+r.icon+'"/> <span class="title">'+r.title+"</span></div>"}else{t+='<i class="icon fa '+r.icon+'"/>'}t+="</div>";return t}});var f=Backbone.View.extend({optionsDefault:{title:"",cls:""},initialize:function(r){this.options=k.merge(r,this.optionsDefault);this.setElement(this._template(this.options));$(this.el).on("click",r.onclick)},_template:function(r){return'<div><a href="javascript:void(0)" class="ui-anchor '+r.cls+'">'+r.title+"</a></div>"}});var n=Backbone.View.extend({optionsDefault:{message:"",status:"info",persistent:false},initialize:function(r){this.options=k.merge(r,this.optionsDefault);this.setElement("<div></div>")},update:function(s){this.options=k.merge(s,this.optionsDefault);if(s.message!=""){this.$el.html(this._template(this.options));this.$el.find(".alert").append(s.message);this.$el.fadeIn();if(!s.persistent){var r=this;window.setTimeout(function(){if(r.$el.is(":visible")){r.$el.fadeOut()}else{r.$el.hide()}},3000)}}else{this.$el.fadeOut()}},_template:function(r){return'<div class="ui-message alert alert-'+r.status+'"/>'}});var a=Backbone.View.extend({optionsDefault:{onclick:null,searchword:""},initialize:function(s){this.options=k.merge(s,this.optionsDefault);this.setElement(this._template(this.options));var r=this;if(this.options.onclick){this.$el.on("submit",function(u){var t=r.$el.find("#search");r.options.onclick(t.val())})}},_template:function(r){return'<div class="ui-search"><form onsubmit="return false;"><input id="search" class="form-control input-sm" type="text" name="search" placeholder="Search..." value="'+r.searchword+'"><button type="submit" class="btn search-btn"><i class="fa fa-search"></i></button></form></div>'}});var i=Backbone.View.extend({optionsDefault:{type:"text",placeholder:"",disabled:false,visible:true,cls:"",area:false},initialize:function(s){this.options=k.merge(s,this.optionsDefault);this.setElement(this._template(this.options));if(this.options.value!==undefined){this.value(this.options.value)}if(this.options.disabled){this.$el.prop("disabled",true)}if(!this.options.visible){this.$el.hide()}var r=this;this.$el.on("input",function(){if(r.options.onchange){r.options.onchange(r.$el.val())}})},value:function(r){if(r!==undefined){this.$el.val(r)}return this.$el.val()},_template:function(r){if(r.area){return'<textarea id="'+r.id+'" class="ui-textarea '+r.cls+'"></textarea>'}else{return'<input id="'+r.id+'" type="'+r.type+'" value="'+r.value+'" placeholder="'+r.placeholder+'" class="ui-input '+r.cls+'">'}}});var p=Backbone.View.extend({initialize:function(r){this.options=r;this.setElement(this._template(this.options));if(this.options.value!==undefined){this.value(this.options.value)}},value:function(r){if(r!==undefined){this.$el.val(r)}return this.$el.val()},_template:function(r){return'<hidden id="'+r.id+'" value="'+r.value+'"/>'}});return{Anchor:f,Button:g,ButtonIcon:h,ButtonMenu:q,Icon:c,Image:d,Input:i,Label:j,Message:n,Modal:m,RadioButton:o.RadioButton,Checkbox:o.Checkbox,Radio:o.Radio,Searchbox:a,Select:b,Hidden:p,Slider:e,Drilldown:l}});
\ No newline at end of file
diff -r 20e0db2511e555b9a168a96dee1ff75180aabbdf -r 98a6cad91c3ac3825c7f954a0c697c6706ad1d73 static/scripts/packed/mvc/ui/ui-options.js
--- a/static/scripts/packed/mvc/ui/ui-options.js
+++ b/static/scripts/packed/mvc/ui/ui-options.js
@@ -1,1 +1,1 @@
-define(["utils/utils"],function(b){var a=Backbone.View.extend({initialize:function(g){this.optionsDefault={value:[],visible:true,data:[],id:b.uuid(),errorText:"No data available.",waitText:"Please wait..."};this.options=b.merge(g,this.optionsDefault);this.setElement("<div/>");this.$message=$("<div/>");this.$options=$(this._template(g));this.$el.append(this.$message);this.$el.append(this.$options);if(!this.options.visible){this.$el.hide()}this.update(this.options.data);if(this.options.value){this.value(this.options.value)}var f=this;this.on("change",function(){f._change()})},update:function(g){var j=this._getValue();this.$el.find(".ui-option").remove();for(var h in g){var i=$(this._templateOption(g[h]));i.addClass("ui-option");this.$options.append(i)}var f=this;this.$el.find("input").on("change",function(){f.value(f._getValue());f._change()});this._refresh();this.value(j)},exists:function(g){if(typeof g==="string"){g=[g]}for(var f in g){if(this.$el.find('input[value="'+g[f]+'"]').length>0){return true}}return false},first:function(){var f=this.$el.find("input");if(f.length>0){return f.val()}else{return undefined}},validate:function(){var g=this.value();if(!(g instanceof Array)){g=[g]}for(var f in g){if([null,"null",undefined].indexOf(g[f])>-1){return false}}return true},wait:function(){if(this._size()==0){this._messageShow(this.options.waitText,"info");this.$options.hide()}},unwait:function(){this._messageHide();this._refresh()},_change:function(){if(this.options.onchange){this.options.onchange(this._getValue())}},_refresh:function(){if(this._size()==0){this._messageShow(this.options.errorText,"danger");this.$options.hide()}else{this._messageHide();this.$options.css("display","inline-block")}},_getValue:function(){var g=this.$el.find(":checked");if(g.length==0){return"null"}if(this.options.multiple){var f=[];g.each(function(){f.push($(this).val())});return f}else{return g.val()}},_size:function(){return this.$el.find(".ui-option").length},_messageShow:function(g,f){this.$message.show();this.$message.removeClass();this.$message.addClass("ui-message alert alert-"+f);this.$message.html(g)},_messageHide:function(){this.$message.hide()}});var d={};d.View=a.extend({initialize:function(f){a.prototype.initialize.call(this,f)},value:function(f){if(typeof f==="string"){f=[f]}if(f!==undefined){this.$el.find("input").prop("checked",false);for(var g in f){this.$el.find('input[value="'+f[g]+'"]').prop("checked",true)}}return this._getValue()},_templateOption:function(f){return'<div><input type="radio" name="'+this.options.id+'" value="'+f.value+'"/>'+f.label+"<br></div>"},_template:function(){return'<div class="ui-options"/>'}});var c={};c.View=d.View.extend({initialize:function(f){f.multiple=true;d.View.prototype.initialize.call(this,f)},_templateOption:function(f){return'<div><input type="checkbox" name="'+this.options.id+'" value="'+f.value+'"/>'+f.label+"<br></div>"}});var e={};e.View=a.extend({initialize:function(f){a.prototype.initialize.call(this,f)},value:function(f){if(f!==undefined){this.$el.find("input").prop("checked",false);this.$el.find("label").removeClass("active");this.$el.find('[value="'+f+'"]').prop("checked",true).closest("label").addClass("active")}return this._getValue()},_templateOption:function(g){var f='<label class="btn btn-default">';if(g.icon){f+='<i class="fa '+g.icon+'"/>'}f+='<input type="radio" name="'+this.options.id+'" value="'+g.value+'">'+g.label+"</label>";return f},_template:function(){return'<div class="btn-group ui-radiobutton" data-toggle="buttons"/>'}});return{Radio:d,RadioButton:e,Checkbox:c}});
\ No newline at end of file
+define(["utils/utils"],function(b){var a=Backbone.View.extend({initialize:function(g){this.optionsDefault={value:[],visible:true,data:[],id:b.uuid(),errorText:"No data available.",waitText:"Please wait..."};this.options=b.merge(g,this.optionsDefault);this.setElement("<div/>");this.$message=$("<div/>");this.$options=$(this._template(g));this.$el.append(this.$message);this.$el.append(this.$options);if(!this.options.visible){this.$el.hide()}this.update(this.options.data);if(this.options.value){this.value(this.options.value)}var f=this;this.on("change",function(){f._change()})},update:function(g){var j=this._getValue();this.$options.empty();if(this._templateOptions){this.$options.append(this._templateOptions(g))}else{for(var h in g){var i=$(this._templateOption(g[h]));i.addClass("ui-option");this.$options.append(i)}}var f=this;this.$el.find("input").on("change",function(){f.value(f._getValue());f._change()});this._refresh();this.value(j)},value:function(g){if(typeof g==="string"){g=[g]}if(g!==undefined){this.$el.find("input").prop("checked",false);for(var f in g){this.$el.find('input[value="'+g[f]+'"]').first().prop("checked",true)}}return this._getValue()},exists:function(g){if(typeof g==="string"){g=[g]}for(var f in g){if(this.$el.find('input[value="'+g[f]+'"]').length>0){return true}}return false},first:function(){var f=this.$el.find("input");if(f.length>0){return f.val()}else{return undefined}},validate:function(){var g=this.value();if(!(g instanceof Array)){g=[g]}for(var f in g){if([null,"null",undefined].indexOf(g[f])>-1){return false}}return true},wait:function(){if(this._size()==0){this._messageShow(this.options.waitText,"info");this.$options.hide()}},unwait:function(){this._messageHide();this._refresh()},_change:function(){if(this.options.onchange){this.options.onchange(this._getValue())}},_refresh:function(){if(this._size()==0){this._messageShow(this.options.errorText,"danger");this.$options.hide()}else{this._messageHide();this.$options.css("display","inline-block")}},_getValue:function(){var g=this.$el.find(":checked");if(g.length==0){return"null"}if(this.options.multiple){var f=[];g.each(function(){f.push($(this).val())});return f}else{return g.val()}},_size:function(){return this.$el.find(".ui-option").length},_messageShow:function(g,f){this.$message.show();this.$message.removeClass();this.$message.addClass("ui-message alert alert-"+f);this.$message.html(g)},_messageHide:function(){this.$message.hide()},_template:function(){return'<div class="ui-options"/>'}});var d={};d.View=a.extend({initialize:function(f){a.prototype.initialize.call(this,f)},_templateOption:function(f){return'<div><input type="radio" name="'+this.options.id+'" value="'+f.value+'"/>'+f.label+"<br></div>"}});var c={};c.View=a.extend({initialize:function(f){f.multiple=true;a.prototype.initialize.call(this,f)},_templateOption:function(f){return'<div><input type="checkbox" name="'+this.options.id+'" value="'+f.value+'"/>'+f.label+"<br></div>"}});var e={};e.View=a.extend({initialize:function(f){a.prototype.initialize.call(this,f)},value:function(f){if(f!==undefined){this.$el.find("input").prop("checked",false);this.$el.find("label").removeClass("active");this.$el.find('[value="'+f+'"]').prop("checked",true).closest("label").addClass("active")}return this._getValue()},_templateOption:function(g){var f='<label class="btn btn-default">';if(g.icon){f+='<i class="fa '+g.icon+'"/>'}f+='<input type="radio" name="'+this.options.id+'" value="'+g.value+'">'+g.label+"</label>";return f},_template:function(){return'<div class="btn-group ui-radiobutton" data-toggle="buttons"/>'}});return{Base:a,Radio:d,RadioButton:e,Checkbox:c}});
\ No newline at end of file
diff -r 20e0db2511e555b9a168a96dee1ff75180aabbdf -r 98a6cad91c3ac3825c7f954a0c697c6706ad1d73 static/scripts/packed/mvc/ui/ui-select-default.js
--- a/static/scripts/packed/mvc/ui/ui-select-default.js
+++ b/static/scripts/packed/mvc/ui/ui-select-default.js
@@ -1,1 +1,1 @@
-define(["utils/utils"],function(a){var b=Backbone.View.extend({optionsDefault:{id:"",cls:"",empty:"No data available",visible:true,wait:false,multiple:false,searchable:false},initialize:function(d){this.options=a.merge(d,this.optionsDefault);this.setElement(this._template(this.options));this.$select=this.$el.find(".select");this.$icon=this.$el.find(".icon");this.$button=this.$el.find(".button");if(this.options.multiple){this.$select.prop("multiple",true);this.$select.addClass("ui-select-multiple");this.$icon.remove()}else{this.$el.addClass("ui-select")}this.update(this.options.data);if(!this.options.visible){this.hide()}if(this.options.wait){this.wait()}else{this.show()}var c=this;this.$select.on("change",function(){c._change()});this.on("change",function(){c._change()})},value:function(c){if(c!==undefined){this.$select.val(c)}return this.$select.val()},first:function(){var c=this.$select.find("option");if(c.length>0){return c.val()}else{return undefined}},validate:function(){var d=this.value();if(!(d instanceof Array)){d=[d]}for(var c in d){if([null,"null",undefined].indexOf(d[c])>-1){return false}}return true},text:function(){return this.$select.find("option:selected").text()},show:function(){this.unwait();this.$select.show();this.$el.show()},hide:function(){this.$el.hide()},wait:function(){this.$icon.removeClass();this.$icon.addClass("fa fa-spinner fa-spin")},unwait:function(){this.$icon.removeClass();this.$icon.addClass("fa fa-caret-down")},disabled:function(){return this.$select.is(":disabled")},enable:function(){this.$select.prop("disabled",false)},disable:function(){this.$select.prop("disabled",true)},add:function(c){this.$select.append(this._templateOption(c));this._refresh()},del:function(c){this.$select.find("option[value="+c+"]").remove();this.$select.trigger("change");this._refresh()},update:function(c){var e=this.$select.val();this.$select.find("option").remove();for(var d in c){this.$select.append(this._templateOption(c[d]))}this._refresh();this.$select.val(e);if(!this.$select.val()){this.$select.val(this.first())}if(this.options.searchable){this.$button.hide();this.$select.select2("destroy");this.$select.select2()}},setOnChange:function(c){this.options.onchange=c},exists:function(c){return this.$select.find('option[value="'+c+'"]').length>0},_change:function(){if(this.options.onchange){this.options.onchange(this.$select.val())}},_refresh:function(){this.$select.find("option[value=null]").remove();var c=this.$select.find("option").length;if(c==0){this.disable();this.$select.append(this._templateOption({value:"null",label:this.options.empty}))}else{this.enable()}},_templateOption:function(c){return'<option value="'+c.value+'">'+c.label+"</option>"},_template:function(c){return'<div id="'+c.id+'"><select id="select" class="select '+c.cls+" "+c.id+'"></select><div class="button"><i class="icon"/></div></div>'}});return{View:b}});
\ No newline at end of file
+define(["utils/utils"],function(a){var b=Backbone.View.extend({optionsDefault:{id:"",cls:"",empty:"No data available",visible:true,wait:false,multiple:false,searchable:false},initialize:function(d){this.options=a.merge(d,this.optionsDefault);this.setElement(this._template(this.options));this.$select=this.$el.find(".select");this.$icon=this.$el.find(".icon");this.$button=this.$el.find(".button");if(this.options.multiple){this.$select.prop("multiple",true);this.$select.addClass("ui-select-multiple");this.$icon.remove()}else{this.$el.addClass("ui-select")}this.update(this.options.data);if(this.options.value!==undefined){this.value(this.options.value)}if(!this.options.visible){this.hide()}if(this.options.wait){this.wait()}else{this.show()}var c=this;this.$select.on("change",function(){c._change()});this.on("change",function(){c._change()})},value:function(c){if(c!==undefined){this.$select.val(c)}return this.$select.val()},first:function(){var c=this.$select.find("option");if(c.length>0){return c.val()}else{return undefined}},validate:function(){var d=this.value();if(!(d instanceof Array)){d=[d]}for(var c in d){if([null,"null",undefined].indexOf(d[c])>-1){return false}}return true},text:function(){return this.$select.find("option:selected").text()},show:function(){this.unwait();this.$select.show();this.$el.show()},hide:function(){this.$el.hide()},wait:function(){this.$icon.removeClass();this.$icon.addClass("fa fa-spinner fa-spin")},unwait:function(){this.$icon.removeClass();this.$icon.addClass("fa fa-caret-down")},disabled:function(){return this.$select.is(":disabled")},enable:function(){this.$select.prop("disabled",false)},disable:function(){this.$select.prop("disabled",true)},add:function(c){this.$select.append(this._templateOption(c));this._refresh()},del:function(c){this.$select.find("option[value="+c+"]").remove();this.$select.trigger("change");this._refresh()},update:function(c){var e=this.$select.val();this.$select.find("option").remove();for(var d in c){this.$select.append(this._templateOption(c[d]))}this._refresh();this.$select.val(e);if(!this.$select.val()){this.$select.val(this.first())}if(this.options.searchable){this.$button.hide();this.$select.select2("destroy");this.$select.select2()}},setOnChange:function(c){this.options.onchange=c},exists:function(c){return this.$select.find('option[value="'+c+'"]').length>0},_change:function(){if(this.options.onchange){this.options.onchange(this.$select.val())}},_refresh:function(){this.$select.find("option[value=null]").remove();var c=this.$select.find("option").length;if(c==0){this.disable();this.$select.append(this._templateOption({value:"null",label:this.options.empty}))}else{this.enable()}},_templateOption:function(c){return'<option value="'+c.value+'">'+c.label+"</option>"},_template:function(c){return'<div id="'+c.id+'"><select id="select" class="select '+c.cls+" "+c.id+'"></select><div class="button"><i class="icon"/></div></div>'}});return{View:b}});
\ No newline at end of file
diff -r 20e0db2511e555b9a168a96dee1ff75180aabbdf -r 98a6cad91c3ac3825c7f954a0c697c6706ad1d73 static/scripts/packed/mvc/ui/ui-slider.js
--- a/static/scripts/packed/mvc/ui/ui-slider.js
+++ b/static/scripts/packed/mvc/ui/ui-slider.js
@@ -1,1 +1,1 @@
-define(["utils/utils"],function(a){var b=Backbone.View.extend({optionsDefault:{value:"",min:null,max:null,step:null,precise:false,split:10000},initialize:function(d){var c=this;this.options=a.merge(d,this.optionsDefault);this.setElement(this._template(this.options));this.useslider=this.options.max!==null&&this.options.min!==null&&this.options.max>this.options.min;if(this.options.step===null){this.options.step=1;if(this.options.precise&&this.useslider){this.options.step=(this.options.max-this.options.min)/this.options.split}}if(this.useslider){this.$slider=this.$el.find("#slider");this.$slider.slider(this.options);this.$slider.on("slide",function(f,g){c.value(g.value)})}else{this.$el.find(".ui-form-slider-text").css("width","100%")}this.$text=this.$el.find("#text");this.$text.on("change",function(){c.value($(this).val())});var e=[];this.$text.on("keyup",function(f){e[f.which]=false});this.$text.on("keydown",function(g){var f=g.which;e[f]=true;if(!(f==8||f==9||f==13||f==37||f==39||(f>=48&&f<=57)||(f==190&&$(this).val().indexOf(".")==-1&&c.options.precise)||(f==189&&$(this).val().indexOf("-")==-1)||e[91]||e[17])){event.preventDefault()}})},value:function(c){if(c!==undefined){if(isNaN(c)){c=0}if(this.options.max!==null){c=Math.min(c,this.options.max)}if(this.options.min!==null){c=Math.max(c,this.options.min)}if(this.options.onchange){this.options.onchange(c)}this.$slider&&this.$slider.slider("value",c);this.$text.val(c)}return this.$text.val()},_template:function(c){return'<div id="'+c.id+'" class="ui-form-slider"><input id="text" type="text" class="ui-form-slider-text"/><div id="slider" class="ui-form-slider-element"/></div>'}});return{View:b}});
\ No newline at end of file
+define(["utils/utils"],function(a){var b=Backbone.View.extend({optionsDefault:{min:null,max:null,step:null,precise:false,split:10000},initialize:function(d){var c=this;this.options=a.merge(d,this.optionsDefault);this.setElement(this._template(this.options));this.useslider=this.options.max!==null&&this.options.min!==null&&this.options.max>this.options.min;if(this.options.step===null){this.options.step=1;if(this.options.precise&&this.useslider){this.options.step=(this.options.max-this.options.min)/this.options.split}}if(this.useslider){this.$slider=this.$el.find("#slider");this.$slider.slider(this.options);this.$slider.on("slide",function(f,g){c.value(g.value)})}else{this.$el.find(".ui-form-slider-text").css("width","100%")}this.$text=this.$el.find("#text");if(this.options.value!==undefined){this.value(this.options.value)}this.$text.on("change",function(){c.value($(this).val())});var e=[];this.$text.on("keyup",function(f){e[f.which]=false});this.$text.on("keydown",function(g){var f=g.which;e[f]=true;if(!(f==8||f==9||f==13||f==37||f==39||(f>=48&&f<=57)||(f==190&&$(this).val().indexOf(".")==-1&&c.options.precise)||(f==189&&$(this).val().indexOf("-")==-1)||e[91]||e[17])){event.preventDefault()}})},value:function(c){if(c!==undefined){if(isNaN(c)){c=0}if(this.options.max!==null){c=Math.min(c,this.options.max)}if(this.options.min!==null){c=Math.max(c,this.options.min)}if(this.options.onchange){this.options.onchange(c)}this.$slider&&this.$slider.slider("value",c);this.$text.val(c)}return this.$text.val()},_template:function(c){return'<div id="'+c.id+'" class="ui-form-slider"><input id="text" type="text" class="ui-form-slider-text"/><div id="slider" class="ui-form-slider-element"/></div>'}});return{View:b}});
\ No newline at end of file
https://bitbucket.org/galaxy/galaxy-central/commits/8fefb0715524/
Changeset: 8fefb0715524
Branch: next-stable
User: guerler
Date: 2014-12-01 05:21:40+00:00
Summary: ToolForm: Fix select2 value selection
Affected #: 9 files
diff -r 98a6cad91c3ac3825c7f954a0c697c6706ad1d73 -r 8fefb07155242c59a263a785cfef8e0b46560781 client/galaxy/scripts/mvc/ui/ui-drilldown.js
--- a/client/galaxy/scripts/mvc/ui/ui-drilldown.js
+++ b/client/galaxy/scripts/mvc/ui/ui-drilldown.js
@@ -23,7 +23,7 @@
/** Template to create options tree
*/
- _templateOptions: function(data, current) {
+ _templateOptions: function(options) {
// link this
var self = this;
@@ -48,10 +48,10 @@
}
// recursive function which iterates through options
- function iterate ($tmpl, data) {
- for (i in data) {
+ function iterate ($tmpl, options) {
+ for (i in options) {
// current option level in hierarchy
- var level = data[i];
+ var level = options[i];
// check for options
var has_options = level.options.length > 0;
@@ -84,7 +84,7 @@
// iterate through options and create dom
var $tmpl = $('<div/>');
- iterate($tmpl, data);
+ iterate($tmpl, options);
return $tmpl;
},
diff -r 98a6cad91c3ac3825c7f954a0c697c6706ad1d73 -r 8fefb07155242c59a263a785cfef8e0b46560781 client/galaxy/scripts/mvc/ui/ui-options.js
--- a/client/galaxy/scripts/mvc/ui/ui-options.js
+++ b/client/galaxy/scripts/mvc/ui/ui-options.js
@@ -7,7 +7,6 @@
initialize: function(options) {
// options
this.optionsDefault = {
- value : [],
visible : true,
data : [],
id : Utils.uuid(),
@@ -38,7 +37,7 @@
this.update(this.options.data);
// set initial value
- if (this.options.value) {
+ if (this.options.value !== undefined) {
this.value(this.options.value);
}
@@ -88,13 +87,13 @@
/** Return/Set current value
*/
value: function (new_value) {
- // check if its an array
- if (typeof new_value === 'string') {
- new_value = [new_value];
- }
-
- // set new value
+ // set new value if provided
if (new_value !== undefined) {
+ // check if its an array
+ if (!(new_value instanceof Array)) {
+ new_value = [new_value];
+ }
+
// reset selection
this.$el.find('input').prop('checked', false);
@@ -111,12 +110,14 @@
/** Check if selected value exists (or any if multiple)
*/
exists: function(value) {
- if (typeof value === 'string') {
- value = [value];
- }
- for (var i in value) {
- if (this.$el.find('input[value="' + value[i] + '"]').length > 0) {
- return true;
+ if (value !== undefined) {
+ if (!(value instanceof Array)) {
+ value = [value];
+ }
+ for (var i in value) {
+ if (this.$el.find('input[value="' + value[i] + '"]').length > 0) {
+ return true;
+ }
}
}
return false;
diff -r 98a6cad91c3ac3825c7f954a0c697c6706ad1d73 -r 8fefb07155242c59a263a785cfef8e0b46560781 client/galaxy/scripts/mvc/ui/ui-select-default.js
--- a/client/galaxy/scripts/mvc/ui/ui-select-default.js
+++ b/client/galaxy/scripts/mvc/ui/ui-select-default.js
@@ -75,6 +75,9 @@
value : function (new_value) {
if (new_value !== undefined) {
this.$select.val(new_value);
+ if (this.$select.select2) {
+ this.$select.select2('val', new_value);
+ }
}
return this.$select.val();
},
diff -r 98a6cad91c3ac3825c7f954a0c697c6706ad1d73 -r 8fefb07155242c59a263a785cfef8e0b46560781 static/scripts/mvc/ui/ui-drilldown.js
--- a/static/scripts/mvc/ui/ui-drilldown.js
+++ b/static/scripts/mvc/ui/ui-drilldown.js
@@ -23,7 +23,7 @@
/** Template to create options tree
*/
- _templateOptions: function(data, current) {
+ _templateOptions: function(options) {
// link this
var self = this;
@@ -48,10 +48,10 @@
}
// recursive function which iterates through options
- function iterate ($tmpl, data) {
- for (i in data) {
+ function iterate ($tmpl, options) {
+ for (i in options) {
// current option level in hierarchy
- var level = data[i];
+ var level = options[i];
// check for options
var has_options = level.options.length > 0;
@@ -84,7 +84,7 @@
// iterate through options and create dom
var $tmpl = $('<div/>');
- iterate($tmpl, data);
+ iterate($tmpl, options);
return $tmpl;
},
diff -r 98a6cad91c3ac3825c7f954a0c697c6706ad1d73 -r 8fefb07155242c59a263a785cfef8e0b46560781 static/scripts/mvc/ui/ui-options.js
--- a/static/scripts/mvc/ui/ui-options.js
+++ b/static/scripts/mvc/ui/ui-options.js
@@ -7,7 +7,6 @@
initialize: function(options) {
// options
this.optionsDefault = {
- value : [],
visible : true,
data : [],
id : Utils.uuid(),
@@ -38,7 +37,7 @@
this.update(this.options.data);
// set initial value
- if (this.options.value) {
+ if (this.options.value !== undefined) {
this.value(this.options.value);
}
@@ -88,13 +87,13 @@
/** Return/Set current value
*/
value: function (new_value) {
- // check if its an array
- if (typeof new_value === 'string') {
- new_value = [new_value];
- }
-
- // set new value
+ // set new value if provided
if (new_value !== undefined) {
+ // check if its an array
+ if (!(new_value instanceof Array)) {
+ new_value = [new_value];
+ }
+
// reset selection
this.$el.find('input').prop('checked', false);
@@ -111,12 +110,14 @@
/** Check if selected value exists (or any if multiple)
*/
exists: function(value) {
- if (typeof value === 'string') {
- value = [value];
- }
- for (var i in value) {
- if (this.$el.find('input[value="' + value[i] + '"]').length > 0) {
- return true;
+ if (value !== undefined) {
+ if (!(value instanceof Array)) {
+ value = [value];
+ }
+ for (var i in value) {
+ if (this.$el.find('input[value="' + value[i] + '"]').length > 0) {
+ return true;
+ }
}
}
return false;
diff -r 98a6cad91c3ac3825c7f954a0c697c6706ad1d73 -r 8fefb07155242c59a263a785cfef8e0b46560781 static/scripts/mvc/ui/ui-select-default.js
--- a/static/scripts/mvc/ui/ui-select-default.js
+++ b/static/scripts/mvc/ui/ui-select-default.js
@@ -75,6 +75,9 @@
value : function (new_value) {
if (new_value !== undefined) {
this.$select.val(new_value);
+ if (this.$select.select2) {
+ this.$select.select2('val', new_value);
+ }
}
return this.$select.val();
},
diff -r 98a6cad91c3ac3825c7f954a0c697c6706ad1d73 -r 8fefb07155242c59a263a785cfef8e0b46560781 static/scripts/packed/mvc/ui/ui-drilldown.js
--- a/static/scripts/packed/mvc/ui/ui-drilldown.js
+++ b/static/scripts/packed/mvc/ui/ui-drilldown.js
@@ -1,1 +1,1 @@
-define(["utils/utils","mvc/ui/ui-options"],function(b,a){var c=a.Base.extend({initialize:function(d){this.display=d.display||"checkbox";d.multiple=(this.display=="checkbox");a.Base.prototype.initialize.call(this,d)},_templateOption:function(d,f,e){return'<div><input name="'+this.options.id+'" class="ui-option" type="'+this.display+'" value="'+f+'">'+b.sanitize(d)+"<div/>"},_templateOptions:function(g,h){var e=this;function f(l,m){function k(n){if(n){m.fadeIn("fast");l.removeClass("toggle-expand");l.addClass("toggle");l.is_expanded=true}else{m.hide();l.removeClass("toggle");l.addClass("toggle-expand");l.is_expanded=false}}l.on("click",function(){k(!l.is_expanded)})}function d(q,o){for(i in o){var r=o[i];var m=r.options.length>0;var l=$("<div/>");if(m){var n=$('<span class="ui-drilldown-button form-toggle icon-button toggle-expand" style="position: relative; top: 2px;"/>');var k=$("<div/>");k.append(n);k.append(e._templateOption(r.name,r.value));l.append(k);var p=$('<div style="display: none; margin-left: 25px;"/>');d(p,r.options);l.append(p);f(n,p)}else{l.append(e._templateOption(r.name,r.value))}q.append(l)}}var j=$("<div/>");d(j,g);return j},_template:function(d){return'<div class="ui-options drilldown-container" id="'+d.id+'"/>'}});return{View:c}});
\ No newline at end of file
+define(["utils/utils","mvc/ui/ui-options"],function(b,a){var c=a.Base.extend({initialize:function(d){this.display=d.display||"checkbox";d.multiple=(this.display=="checkbox");a.Base.prototype.initialize.call(this,d)},_templateOption:function(d,f,e){return'<div><input name="'+this.options.id+'" class="ui-option" type="'+this.display+'" value="'+f+'">'+b.sanitize(d)+"<div/>"},_templateOptions:function(f){var e=this;function g(k,l){function j(m){if(m){l.fadeIn("fast");k.removeClass("toggle-expand");k.addClass("toggle");k.is_expanded=true}else{l.hide();k.removeClass("toggle");k.addClass("toggle-expand");k.is_expanded=false}}k.on("click",function(){j(!k.is_expanded)})}function d(p,k){for(i in k){var q=k[i];var m=q.options.length>0;var l=$("<div/>");if(m){var n=$('<span class="ui-drilldown-button form-toggle icon-button toggle-expand" style="position: relative; top: 2px;"/>');var j=$("<div/>");j.append(n);j.append(e._templateOption(q.name,q.value));l.append(j);var o=$('<div style="display: none; margin-left: 25px;"/>');d(o,q.options);l.append(o);g(n,o)}else{l.append(e._templateOption(q.name,q.value))}p.append(l)}}var h=$("<div/>");d(h,f);return h},_template:function(d){return'<div class="ui-options drilldown-container" id="'+d.id+'"/>'}});return{View:c}});
\ No newline at end of file
diff -r 98a6cad91c3ac3825c7f954a0c697c6706ad1d73 -r 8fefb07155242c59a263a785cfef8e0b46560781 static/scripts/packed/mvc/ui/ui-options.js
--- a/static/scripts/packed/mvc/ui/ui-options.js
+++ b/static/scripts/packed/mvc/ui/ui-options.js
@@ -1,1 +1,1 @@
-define(["utils/utils"],function(b){var a=Backbone.View.extend({initialize:function(g){this.optionsDefault={value:[],visible:true,data:[],id:b.uuid(),errorText:"No data available.",waitText:"Please wait..."};this.options=b.merge(g,this.optionsDefault);this.setElement("<div/>");this.$message=$("<div/>");this.$options=$(this._template(g));this.$el.append(this.$message);this.$el.append(this.$options);if(!this.options.visible){this.$el.hide()}this.update(this.options.data);if(this.options.value){this.value(this.options.value)}var f=this;this.on("change",function(){f._change()})},update:function(g){var j=this._getValue();this.$options.empty();if(this._templateOptions){this.$options.append(this._templateOptions(g))}else{for(var h in g){var i=$(this._templateOption(g[h]));i.addClass("ui-option");this.$options.append(i)}}var f=this;this.$el.find("input").on("change",function(){f.value(f._getValue());f._change()});this._refresh();this.value(j)},value:function(g){if(typeof g==="string"){g=[g]}if(g!==undefined){this.$el.find("input").prop("checked",false);for(var f in g){this.$el.find('input[value="'+g[f]+'"]').first().prop("checked",true)}}return this._getValue()},exists:function(g){if(typeof g==="string"){g=[g]}for(var f in g){if(this.$el.find('input[value="'+g[f]+'"]').length>0){return true}}return false},first:function(){var f=this.$el.find("input");if(f.length>0){return f.val()}else{return undefined}},validate:function(){var g=this.value();if(!(g instanceof Array)){g=[g]}for(var f in g){if([null,"null",undefined].indexOf(g[f])>-1){return false}}return true},wait:function(){if(this._size()==0){this._messageShow(this.options.waitText,"info");this.$options.hide()}},unwait:function(){this._messageHide();this._refresh()},_change:function(){if(this.options.onchange){this.options.onchange(this._getValue())}},_refresh:function(){if(this._size()==0){this._messageShow(this.options.errorText,"danger");this.$options.hide()}else{this._messageHide();this.$options.css("display","inline-block")}},_getValue:function(){var g=this.$el.find(":checked");if(g.length==0){return"null"}if(this.options.multiple){var f=[];g.each(function(){f.push($(this).val())});return f}else{return g.val()}},_size:function(){return this.$el.find(".ui-option").length},_messageShow:function(g,f){this.$message.show();this.$message.removeClass();this.$message.addClass("ui-message alert alert-"+f);this.$message.html(g)},_messageHide:function(){this.$message.hide()},_template:function(){return'<div class="ui-options"/>'}});var d={};d.View=a.extend({initialize:function(f){a.prototype.initialize.call(this,f)},_templateOption:function(f){return'<div><input type="radio" name="'+this.options.id+'" value="'+f.value+'"/>'+f.label+"<br></div>"}});var c={};c.View=a.extend({initialize:function(f){f.multiple=true;a.prototype.initialize.call(this,f)},_templateOption:function(f){return'<div><input type="checkbox" name="'+this.options.id+'" value="'+f.value+'"/>'+f.label+"<br></div>"}});var e={};e.View=a.extend({initialize:function(f){a.prototype.initialize.call(this,f)},value:function(f){if(f!==undefined){this.$el.find("input").prop("checked",false);this.$el.find("label").removeClass("active");this.$el.find('[value="'+f+'"]').prop("checked",true).closest("label").addClass("active")}return this._getValue()},_templateOption:function(g){var f='<label class="btn btn-default">';if(g.icon){f+='<i class="fa '+g.icon+'"/>'}f+='<input type="radio" name="'+this.options.id+'" value="'+g.value+'">'+g.label+"</label>";return f},_template:function(){return'<div class="btn-group ui-radiobutton" data-toggle="buttons"/>'}});return{Base:a,Radio:d,RadioButton:e,Checkbox:c}});
\ No newline at end of file
+define(["utils/utils"],function(b){var a=Backbone.View.extend({initialize:function(g){this.optionsDefault={visible:true,data:[],id:b.uuid(),errorText:"No data available.",waitText:"Please wait..."};this.options=b.merge(g,this.optionsDefault);this.setElement("<div/>");this.$message=$("<div/>");this.$options=$(this._template(g));this.$el.append(this.$message);this.$el.append(this.$options);if(!this.options.visible){this.$el.hide()}this.update(this.options.data);if(this.options.value!==undefined){this.value(this.options.value)}var f=this;this.on("change",function(){f._change()})},update:function(g){var j=this._getValue();this.$options.empty();if(this._templateOptions){this.$options.append(this._templateOptions(g))}else{for(var h in g){var i=$(this._templateOption(g[h]));i.addClass("ui-option");this.$options.append(i)}}var f=this;this.$el.find("input").on("change",function(){f.value(f._getValue());f._change()});this._refresh();this.value(j)},value:function(g){if(g!==undefined){if(!(g instanceof Array)){g=[g]}this.$el.find("input").prop("checked",false);for(var f in g){this.$el.find('input[value="'+g[f]+'"]').first().prop("checked",true)}}return this._getValue()},exists:function(g){if(g!==undefined){if(!(g instanceof Array)){g=[g]}for(var f in g){if(this.$el.find('input[value="'+g[f]+'"]').length>0){return true}}}return false},first:function(){var f=this.$el.find("input");if(f.length>0){return f.val()}else{return undefined}},validate:function(){var g=this.value();if(!(g instanceof Array)){g=[g]}for(var f in g){if([null,"null",undefined].indexOf(g[f])>-1){return false}}return true},wait:function(){if(this._size()==0){this._messageShow(this.options.waitText,"info");this.$options.hide()}},unwait:function(){this._messageHide();this._refresh()},_change:function(){if(this.options.onchange){this.options.onchange(this._getValue())}},_refresh:function(){if(this._size()==0){this._messageShow(this.options.errorText,"danger");this.$options.hide()}else{this._messageHide();this.$options.css("display","inline-block")}},_getValue:function(){var g=this.$el.find(":checked");if(g.length==0){return"null"}if(this.options.multiple){var f=[];g.each(function(){f.push($(this).val())});return f}else{return g.val()}},_size:function(){return this.$el.find(".ui-option").length},_messageShow:function(g,f){this.$message.show();this.$message.removeClass();this.$message.addClass("ui-message alert alert-"+f);this.$message.html(g)},_messageHide:function(){this.$message.hide()},_template:function(){return'<div class="ui-options"/>'}});var d={};d.View=a.extend({initialize:function(f){a.prototype.initialize.call(this,f)},_templateOption:function(f){return'<div><input type="radio" name="'+this.options.id+'" value="'+f.value+'"/>'+f.label+"<br></div>"}});var c={};c.View=a.extend({initialize:function(f){f.multiple=true;a.prototype.initialize.call(this,f)},_templateOption:function(f){return'<div><input type="checkbox" name="'+this.options.id+'" value="'+f.value+'"/>'+f.label+"<br></div>"}});var e={};e.View=a.extend({initialize:function(f){a.prototype.initialize.call(this,f)},value:function(f){if(f!==undefined){this.$el.find("input").prop("checked",false);this.$el.find("label").removeClass("active");this.$el.find('[value="'+f+'"]').prop("checked",true).closest("label").addClass("active")}return this._getValue()},_templateOption:function(g){var f='<label class="btn btn-default">';if(g.icon){f+='<i class="fa '+g.icon+'"/>'}f+='<input type="radio" name="'+this.options.id+'" value="'+g.value+'">'+g.label+"</label>";return f},_template:function(){return'<div class="btn-group ui-radiobutton" data-toggle="buttons"/>'}});return{Base:a,Radio:d,RadioButton:e,Checkbox:c}});
\ No newline at end of file
diff -r 98a6cad91c3ac3825c7f954a0c697c6706ad1d73 -r 8fefb07155242c59a263a785cfef8e0b46560781 static/scripts/packed/mvc/ui/ui-select-default.js
--- a/static/scripts/packed/mvc/ui/ui-select-default.js
+++ b/static/scripts/packed/mvc/ui/ui-select-default.js
@@ -1,1 +1,1 @@
-define(["utils/utils"],function(a){var b=Backbone.View.extend({optionsDefault:{id:"",cls:"",empty:"No data available",visible:true,wait:false,multiple:false,searchable:false},initialize:function(d){this.options=a.merge(d,this.optionsDefault);this.setElement(this._template(this.options));this.$select=this.$el.find(".select");this.$icon=this.$el.find(".icon");this.$button=this.$el.find(".button");if(this.options.multiple){this.$select.prop("multiple",true);this.$select.addClass("ui-select-multiple");this.$icon.remove()}else{this.$el.addClass("ui-select")}this.update(this.options.data);if(this.options.value!==undefined){this.value(this.options.value)}if(!this.options.visible){this.hide()}if(this.options.wait){this.wait()}else{this.show()}var c=this;this.$select.on("change",function(){c._change()});this.on("change",function(){c._change()})},value:function(c){if(c!==undefined){this.$select.val(c)}return this.$select.val()},first:function(){var c=this.$select.find("option");if(c.length>0){return c.val()}else{return undefined}},validate:function(){var d=this.value();if(!(d instanceof Array)){d=[d]}for(var c in d){if([null,"null",undefined].indexOf(d[c])>-1){return false}}return true},text:function(){return this.$select.find("option:selected").text()},show:function(){this.unwait();this.$select.show();this.$el.show()},hide:function(){this.$el.hide()},wait:function(){this.$icon.removeClass();this.$icon.addClass("fa fa-spinner fa-spin")},unwait:function(){this.$icon.removeClass();this.$icon.addClass("fa fa-caret-down")},disabled:function(){return this.$select.is(":disabled")},enable:function(){this.$select.prop("disabled",false)},disable:function(){this.$select.prop("disabled",true)},add:function(c){this.$select.append(this._templateOption(c));this._refresh()},del:function(c){this.$select.find("option[value="+c+"]").remove();this.$select.trigger("change");this._refresh()},update:function(c){var e=this.$select.val();this.$select.find("option").remove();for(var d in c){this.$select.append(this._templateOption(c[d]))}this._refresh();this.$select.val(e);if(!this.$select.val()){this.$select.val(this.first())}if(this.options.searchable){this.$button.hide();this.$select.select2("destroy");this.$select.select2()}},setOnChange:function(c){this.options.onchange=c},exists:function(c){return this.$select.find('option[value="'+c+'"]').length>0},_change:function(){if(this.options.onchange){this.options.onchange(this.$select.val())}},_refresh:function(){this.$select.find("option[value=null]").remove();var c=this.$select.find("option").length;if(c==0){this.disable();this.$select.append(this._templateOption({value:"null",label:this.options.empty}))}else{this.enable()}},_templateOption:function(c){return'<option value="'+c.value+'">'+c.label+"</option>"},_template:function(c){return'<div id="'+c.id+'"><select id="select" class="select '+c.cls+" "+c.id+'"></select><div class="button"><i class="icon"/></div></div>'}});return{View:b}});
\ No newline at end of file
+define(["utils/utils"],function(a){var b=Backbone.View.extend({optionsDefault:{id:"",cls:"",empty:"No data available",visible:true,wait:false,multiple:false,searchable:false},initialize:function(d){this.options=a.merge(d,this.optionsDefault);this.setElement(this._template(this.options));this.$select=this.$el.find(".select");this.$icon=this.$el.find(".icon");this.$button=this.$el.find(".button");if(this.options.multiple){this.$select.prop("multiple",true);this.$select.addClass("ui-select-multiple");this.$icon.remove()}else{this.$el.addClass("ui-select")}this.update(this.options.data);if(this.options.value!==undefined){this.value(this.options.value)}if(!this.options.visible){this.hide()}if(this.options.wait){this.wait()}else{this.show()}var c=this;this.$select.on("change",function(){c._change()});this.on("change",function(){c._change()})},value:function(c){if(c!==undefined){this.$select.val(c);if(this.$select.select2){this.$select.select2("val",c)}}return this.$select.val()},first:function(){var c=this.$select.find("option");if(c.length>0){return c.val()}else{return undefined}},validate:function(){var d=this.value();if(!(d instanceof Array)){d=[d]}for(var c in d){if([null,"null",undefined].indexOf(d[c])>-1){return false}}return true},text:function(){return this.$select.find("option:selected").text()},show:function(){this.unwait();this.$select.show();this.$el.show()},hide:function(){this.$el.hide()},wait:function(){this.$icon.removeClass();this.$icon.addClass("fa fa-spinner fa-spin")},unwait:function(){this.$icon.removeClass();this.$icon.addClass("fa fa-caret-down")},disabled:function(){return this.$select.is(":disabled")},enable:function(){this.$select.prop("disabled",false)},disable:function(){this.$select.prop("disabled",true)},add:function(c){this.$select.append(this._templateOption(c));this._refresh()},del:function(c){this.$select.find("option[value="+c+"]").remove();this.$select.trigger("change");this._refresh()},update:function(c){var e=this.$select.val();this.$select.find("option").remove();for(var d in c){this.$select.append(this._templateOption(c[d]))}this._refresh();this.$select.val(e);if(!this.$select.val()){this.$select.val(this.first())}if(this.options.searchable){this.$button.hide();this.$select.select2("destroy");this.$select.select2()}},setOnChange:function(c){this.options.onchange=c},exists:function(c){return this.$select.find('option[value="'+c+'"]').length>0},_change:function(){if(this.options.onchange){this.options.onchange(this.$select.val())}},_refresh:function(){this.$select.find("option[value=null]").remove();var c=this.$select.find("option").length;if(c==0){this.disable();this.$select.append(this._templateOption({value:"null",label:this.options.empty}))}else{this.enable()}},_templateOption:function(c){return'<option value="'+c.value+'">'+c.label+"</option>"},_template:function(c){return'<div id="'+c.id+'"><select id="select" class="select '+c.cls+" "+c.id+'"></select><div class="button"><i class="icon"/></div></div>'}});return{View:b}});
\ No newline at end of file
https://bitbucket.org/galaxy/galaxy-central/commits/1a2ef4a380ff/
Changeset: 1a2ef4a380ff
Branch: next-stable
User: guerler
Date: 2014-12-01 06:18:16+00:00
Summary: ToolForm: Add baseurl, fix dynamic drill down options
Affected #: 7 files
diff -r 8fefb07155242c59a263a785cfef8e0b46560781 -r 1a2ef4a380ff35ca7f97ca2c50bab474400c6275 client/galaxy/scripts/mvc/tools/tools-section.js
--- a/client/galaxy/scripts/mvc/tools/tools-section.js
+++ b/client/galaxy/scripts/mvc/tools/tools-section.js
@@ -342,6 +342,11 @@
case 'drill_down':
field = this._fieldDrilldown(input_def);
break;
+
+ // base url field
+ case 'baseurl':
+ field = this._fieldHidden(input_def);
+ break;
// field not found
default:
diff -r 8fefb07155242c59a263a785cfef8e0b46560781 -r 1a2ef4a380ff35ca7f97ca2c50bab474400c6275 client/galaxy/scripts/mvc/ui/ui-drilldown.js
--- a/client/galaxy/scripts/mvc/ui/ui-drilldown.js
+++ b/client/galaxy/scripts/mvc/ui/ui-drilldown.js
@@ -16,8 +16,7 @@
*/
_templateOption: function(name, value, selected) {
return '<div>' +
- '<input name="' + this.options.id + '" class="ui-option" type="' + this.display + '" value="' + value + '">' +
- Utils.sanitize(name) +
+ '<input name="' + this.options.id + '" class="ui-option" type="' + this.display + '" value="' + value + '">' + name +
'<div/>';
},
diff -r 8fefb07155242c59a263a785cfef8e0b46560781 -r 1a2ef4a380ff35ca7f97ca2c50bab474400c6275 lib/galaxy/tools/parameters/basic.py
--- a/lib/galaxy/tools/parameters/basic.py
+++ b/lib/galaxy/tools/parameters/basic.py
@@ -650,6 +650,11 @@
def get_label( self ):
# BaseURLToolParameters are ultimately "hidden" parameters
return None
+
+ def to_dict( self, trans, view='collection', value_mapper=None ):
+ d = super( BaseURLToolParameter, self ).to_dict( trans )
+ d['value'] = self.get_value( trans )
+ return d
DEFAULT_VALUE_MAP = lambda x: x
@@ -1606,13 +1611,13 @@
"""
return self.filtered.keys()
- def to_dict( self, trans, view='collection', value_mapper=None, context={} ):
+ def to_dict( self, trans, view='collection', value_mapper=None, other_values={} ):
# skip SelectToolParameter (the immediate parent) bc we need to get options in a different way here
d = ToolParameter.to_dict( self, trans )
options = []
try:
- options = self.get_options( trans, context )
+ options = self.get_options( trans=trans, other_values=other_values )
except KeyError:
# will sometimes error if self.is_dynamic and self.filtered
# bc we dont/cant fill out other_values above ({})
diff -r 8fefb07155242c59a263a785cfef8e0b46560781 -r 1a2ef4a380ff35ca7f97ca2c50bab474400c6275 static/scripts/mvc/tools/tools-section.js
--- a/static/scripts/mvc/tools/tools-section.js
+++ b/static/scripts/mvc/tools/tools-section.js
@@ -342,6 +342,11 @@
case 'drill_down':
field = this._fieldDrilldown(input_def);
break;
+
+ // base url field
+ case 'baseurl':
+ field = this._fieldHidden(input_def);
+ break;
// field not found
default:
diff -r 8fefb07155242c59a263a785cfef8e0b46560781 -r 1a2ef4a380ff35ca7f97ca2c50bab474400c6275 static/scripts/mvc/ui/ui-drilldown.js
--- a/static/scripts/mvc/ui/ui-drilldown.js
+++ b/static/scripts/mvc/ui/ui-drilldown.js
@@ -16,8 +16,7 @@
*/
_templateOption: function(name, value, selected) {
return '<div>' +
- '<input name="' + this.options.id + '" class="ui-option" type="' + this.display + '" value="' + value + '">' +
- Utils.sanitize(name) +
+ '<input name="' + this.options.id + '" class="ui-option" type="' + this.display + '" value="' + value + '">' + name +
'<div/>';
},
diff -r 8fefb07155242c59a263a785cfef8e0b46560781 -r 1a2ef4a380ff35ca7f97ca2c50bab474400c6275 static/scripts/packed/mvc/tools/tools-section.js
--- a/static/scripts/packed/mvc/tools/tools-section.js
+++ b/static/scripts/packed/mvc/tools/tools-section.js
@@ -1,1 +1,1 @@
-define(["utils/utils","mvc/ui/ui-table","mvc/ui/ui-misc","mvc/tools/tools-repeat","mvc/tools/tools-select-content","mvc/tools/tools-input"],function(d,b,g,c,a,e){var f=Backbone.View.extend({initialize:function(i,h){this.app=i;this.inputs=h.inputs;h.cls_tr="section-row";this.table=new b.View(h);this.setElement(this.table.$el);this.render()},render:function(){this.table.delAll();for(var h in this.inputs){this._add(this.inputs[h])}},_add:function(j){var i=this;var h=jQuery.extend(true,{},j);h.id=j.id=d.uuid();this.app.input_list[h.id]=h;var k=h.type;switch(k){case"conditional":this._addConditional(h);break;case"repeat":this._addRepeat(h);break;default:this._addRow(h)}},_addConditional:function(h){var j=this;h.test_param.id=h.id;var m=this._addRow(h.test_param);m.options.onchange=function(t){var p=j.app.tree.matchCase(h,t);for(var r in h.cases){var w=h.cases[r];var u=h.id+"-section-"+r;var o=j.table.get(u);var v=false;for(var q in w.inputs){var s=w.inputs[q].type;if(s&&s!=="hidden"){v=true;break}}if(r==p&&v){o.fadeIn("fast")}else{o.hide()}}j.app.refresh()};for(var l in h.cases){var k=h.id+"-section-"+l;var n=new f(this.app,{inputs:h.cases[l].inputs,cls:"ui-table-plain"});n.$el.addClass("ui-table-form-section");this.table.add(n.$el);this.table.append(k)}m.trigger("change")},_addRepeat:function(o){var r=this;var p=0;function m(i,t){var s=o.id+"-section-"+(p++);var u=null;if(t){u=function(){k.del(s);k.retitle(o.title);r.app.rebuild();r.app.refresh()}}var v=new f(r.app,{inputs:i,cls:"ui-table-plain"});k.add({id:s,title:o.title,$el:v.$el,ondel:u});k.retitle(o.title)}var k=new c.View({title_new:o.title,max:o.max,onnew:function(){m(o.inputs,true);r.app.rebuild();r.app.refresh()}});var h=o.min;var q=_.size(o.cache);for(var l=0;l<Math.max(q,h);l++){var n=null;if(l<q){n=o.cache[l]}else{n=o.inputs}m(n,l>=h)}var j=new e(this.app,{label:o.title,help:o.help,field:k});j.$el.addClass("ui-table-form-section");this.table.add(j.$el);this.table.append(o.id)},_addRow:function(h){var k=h.id;var i=this._createField(h);if(h.is_dynamic){this.app.is_dynamic=true}this.app.field_list[k]=i;var j=new e(this.app,{label:h.label,optional:h.optional,help:h.help,field:i});this.app.element_list[k]=j;this.table.add(j.$el);this.table.append(k);return i},_createField:function(h){var i=null;switch(h.type){case"text":i=this._fieldText(h);break;case"select":i=this._fieldSelect(h);break;case"data":i=this._fieldData(h);break;case"data_column":i=this._fieldSelect(h);break;case"hidden":i=this._fieldHidden(h);break;case"integer":i=this._fieldSlider(h);break;case"float":i=this._fieldSlider(h);break;case"boolean":i=this._fieldBoolean(h);break;case"genomebuild":h.searchable=true;i=this._fieldSelect(h);break;case"drill_down":i=this._fieldDrilldown(h);break;default:this.app.incompatible=true;if(h.options){i=this._fieldSelect(h)}else{i=this._fieldText(h)}console.debug("tools-form::_addRow() : Auto matched field type ("+h.type+").")}if(h.value!==undefined){i.value(h.value)}return i},_fieldData:function(h){var i=this;return new a.View(this.app,{id:"field-"+h.id,extensions:h.extensions,multiple:h.multiple,data:h.options,onchange:function(){i.app.refresh()}})},_fieldSelect:function(h){var k=[];for(var l in h.options){var m=h.options[l];k.push({label:m[0],value:m[1]})}var n=g.Select;switch(h.display){case"checkboxes":n=g.Checkbox;break;case"radio":n=g.Radio;break}var j=this;return new n.View({id:"field-"+h.id,data:k,multiple:h.multiple,searchable:h.searchable,onchange:function(){j.app.refresh()}})},_fieldDrilldown:function(h){var i=this;return new g.Drilldown.View({id:"field-"+h.id,data:h.options,display:h.display,onchange:function(){i.app.refresh()}})},_fieldText:function(h){var i=this;return new g.Input({id:"field-"+h.id,area:h.area,onchange:function(){i.app.refresh()}})},_fieldSlider:function(h){return new g.Slider.View({id:"field-"+h.id,precise:h.type=="float",min:h.min,max:h.max})},_fieldHidden:function(h){return new g.Hidden({id:"field-"+h.id})},_fieldBoolean:function(h){return new g.RadioButton.View({id:"field-"+h.id,data:[{label:"Yes",value:"true"},{label:"No",value:"false"}]})}});return{View:f}});
\ No newline at end of file
+define(["utils/utils","mvc/ui/ui-table","mvc/ui/ui-misc","mvc/tools/tools-repeat","mvc/tools/tools-select-content","mvc/tools/tools-input"],function(d,b,g,c,a,e){var f=Backbone.View.extend({initialize:function(i,h){this.app=i;this.inputs=h.inputs;h.cls_tr="section-row";this.table=new b.View(h);this.setElement(this.table.$el);this.render()},render:function(){this.table.delAll();for(var h in this.inputs){this._add(this.inputs[h])}},_add:function(j){var i=this;var h=jQuery.extend(true,{},j);h.id=j.id=d.uuid();this.app.input_list[h.id]=h;var k=h.type;switch(k){case"conditional":this._addConditional(h);break;case"repeat":this._addRepeat(h);break;default:this._addRow(h)}},_addConditional:function(h){var j=this;h.test_param.id=h.id;var m=this._addRow(h.test_param);m.options.onchange=function(t){var p=j.app.tree.matchCase(h,t);for(var r in h.cases){var w=h.cases[r];var u=h.id+"-section-"+r;var o=j.table.get(u);var v=false;for(var q in w.inputs){var s=w.inputs[q].type;if(s&&s!=="hidden"){v=true;break}}if(r==p&&v){o.fadeIn("fast")}else{o.hide()}}j.app.refresh()};for(var l in h.cases){var k=h.id+"-section-"+l;var n=new f(this.app,{inputs:h.cases[l].inputs,cls:"ui-table-plain"});n.$el.addClass("ui-table-form-section");this.table.add(n.$el);this.table.append(k)}m.trigger("change")},_addRepeat:function(o){var r=this;var p=0;function m(i,t){var s=o.id+"-section-"+(p++);var u=null;if(t){u=function(){k.del(s);k.retitle(o.title);r.app.rebuild();r.app.refresh()}}var v=new f(r.app,{inputs:i,cls:"ui-table-plain"});k.add({id:s,title:o.title,$el:v.$el,ondel:u});k.retitle(o.title)}var k=new c.View({title_new:o.title,max:o.max,onnew:function(){m(o.inputs,true);r.app.rebuild();r.app.refresh()}});var h=o.min;var q=_.size(o.cache);for(var l=0;l<Math.max(q,h);l++){var n=null;if(l<q){n=o.cache[l]}else{n=o.inputs}m(n,l>=h)}var j=new e(this.app,{label:o.title,help:o.help,field:k});j.$el.addClass("ui-table-form-section");this.table.add(j.$el);this.table.append(o.id)},_addRow:function(h){var k=h.id;var i=this._createField(h);if(h.is_dynamic){this.app.is_dynamic=true}this.app.field_list[k]=i;var j=new e(this.app,{label:h.label,optional:h.optional,help:h.help,field:i});this.app.element_list[k]=j;this.table.add(j.$el);this.table.append(k);return i},_createField:function(h){var i=null;switch(h.type){case"text":i=this._fieldText(h);break;case"select":i=this._fieldSelect(h);break;case"data":i=this._fieldData(h);break;case"data_column":i=this._fieldSelect(h);break;case"hidden":i=this._fieldHidden(h);break;case"integer":i=this._fieldSlider(h);break;case"float":i=this._fieldSlider(h);break;case"boolean":i=this._fieldBoolean(h);break;case"genomebuild":h.searchable=true;i=this._fieldSelect(h);break;case"drill_down":i=this._fieldDrilldown(h);break;case"baseurl":i=this._fieldHidden(h);break;default:this.app.incompatible=true;if(h.options){i=this._fieldSelect(h)}else{i=this._fieldText(h)}console.debug("tools-form::_addRow() : Auto matched field type ("+h.type+").")}if(h.value!==undefined){i.value(h.value)}return i},_fieldData:function(h){var i=this;return new a.View(this.app,{id:"field-"+h.id,extensions:h.extensions,multiple:h.multiple,data:h.options,onchange:function(){i.app.refresh()}})},_fieldSelect:function(h){var k=[];for(var l in h.options){var m=h.options[l];k.push({label:m[0],value:m[1]})}var n=g.Select;switch(h.display){case"checkboxes":n=g.Checkbox;break;case"radio":n=g.Radio;break}var j=this;return new n.View({id:"field-"+h.id,data:k,multiple:h.multiple,searchable:h.searchable,onchange:function(){j.app.refresh()}})},_fieldDrilldown:function(h){var i=this;return new g.Drilldown.View({id:"field-"+h.id,data:h.options,display:h.display,onchange:function(){i.app.refresh()}})},_fieldText:function(h){var i=this;return new g.Input({id:"field-"+h.id,area:h.area,onchange:function(){i.app.refresh()}})},_fieldSlider:function(h){return new g.Slider.View({id:"field-"+h.id,precise:h.type=="float",min:h.min,max:h.max})},_fieldHidden:function(h){return new g.Hidden({id:"field-"+h.id})},_fieldBoolean:function(h){return new g.RadioButton.View({id:"field-"+h.id,data:[{label:"Yes",value:"true"},{label:"No",value:"false"}]})}});return{View:f}});
\ No newline at end of file
diff -r 8fefb07155242c59a263a785cfef8e0b46560781 -r 1a2ef4a380ff35ca7f97ca2c50bab474400c6275 static/scripts/packed/mvc/ui/ui-drilldown.js
--- a/static/scripts/packed/mvc/ui/ui-drilldown.js
+++ b/static/scripts/packed/mvc/ui/ui-drilldown.js
@@ -1,1 +1,1 @@
-define(["utils/utils","mvc/ui/ui-options"],function(b,a){var c=a.Base.extend({initialize:function(d){this.display=d.display||"checkbox";d.multiple=(this.display=="checkbox");a.Base.prototype.initialize.call(this,d)},_templateOption:function(d,f,e){return'<div><input name="'+this.options.id+'" class="ui-option" type="'+this.display+'" value="'+f+'">'+b.sanitize(d)+"<div/>"},_templateOptions:function(f){var e=this;function g(k,l){function j(m){if(m){l.fadeIn("fast");k.removeClass("toggle-expand");k.addClass("toggle");k.is_expanded=true}else{l.hide();k.removeClass("toggle");k.addClass("toggle-expand");k.is_expanded=false}}k.on("click",function(){j(!k.is_expanded)})}function d(p,k){for(i in k){var q=k[i];var m=q.options.length>0;var l=$("<div/>");if(m){var n=$('<span class="ui-drilldown-button form-toggle icon-button toggle-expand" style="position: relative; top: 2px;"/>');var j=$("<div/>");j.append(n);j.append(e._templateOption(q.name,q.value));l.append(j);var o=$('<div style="display: none; margin-left: 25px;"/>');d(o,q.options);l.append(o);g(n,o)}else{l.append(e._templateOption(q.name,q.value))}p.append(l)}}var h=$("<div/>");d(h,f);return h},_template:function(d){return'<div class="ui-options drilldown-container" id="'+d.id+'"/>'}});return{View:c}});
\ No newline at end of file
+define(["utils/utils","mvc/ui/ui-options"],function(b,a){var c=a.Base.extend({initialize:function(d){this.display=d.display||"checkbox";d.multiple=(this.display=="checkbox");a.Base.prototype.initialize.call(this,d)},_templateOption:function(d,f,e){return'<div><input name="'+this.options.id+'" class="ui-option" type="'+this.display+'" value="'+f+'">'+d+"<div/>"},_templateOptions:function(f){var e=this;function g(k,l){function j(m){if(m){l.fadeIn("fast");k.removeClass("toggle-expand");k.addClass("toggle");k.is_expanded=true}else{l.hide();k.removeClass("toggle");k.addClass("toggle-expand");k.is_expanded=false}}k.on("click",function(){j(!k.is_expanded)})}function d(p,k){for(i in k){var q=k[i];var m=q.options.length>0;var l=$("<div/>");if(m){var n=$('<span class="ui-drilldown-button form-toggle icon-button toggle-expand" style="position: relative; top: 2px;"/>');var j=$("<div/>");j.append(n);j.append(e._templateOption(q.name,q.value));l.append(j);var o=$('<div style="display: none; margin-left: 25px;"/>');d(o,q.options);l.append(o);g(n,o)}else{l.append(e._templateOption(q.name,q.value))}p.append(l)}}var h=$("<div/>");d(h,f);return h},_template:function(d){return'<div class="ui-options drilldown-container" id="'+d.id+'"/>'}});return{View:c}});
\ No newline at end of file
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0