Files
galaxy/templates/tool_form.tmpl
T
James Taylor d31c43ef31 1) Workflow changes
- Workflows have a simple database representation (StoredWorkflow)
   - Workflow step parameters can be manipulated
   - Workflows can be saved and loaded
   - Many improvements to workflow editing interface

2) General interface cleanup

   - Styles for the overall layout have been moved from the index page to
     CSS files, colors for layout backgrounds and borders and such can now
     be configured in the colors.ini file
   - Styles and javascript code for dialogs and popupmenus (code is currently
     in the workflow editor but will be moved out after more testing)
2007-10-30 05:44:08 +00:00

151 lines
5.6 KiB
Cheetah

<!-- -->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
#from galaxy.util.expressions import ExpressionContext
<html>
<head>
<title>Galaxy</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<link href="$h.url_for('/static/style/base.css')" rel="stylesheet" type="text/css" />
<script type='text/javascript' src="/static/scripts/jquery.js"> </script>
<script type="text/javascript">
jQuery( function() {
jQuery( "select[@refresh_on_change='true']").change( function() {
jQuery( "#tool_form" ).submit();
});
});
</script>
</head>
<body>
## #if $getVar( 'error_message', None )
## <div class="errormessagesmall">$error_message</div>
## <p></p>
## #end if
#def do_inputs( $inputs, $tool_state, $errors, $prefix, $context=None )
#set $context = ExpressionContext( $tool_state, $context )
#for $input_index, $input in enumerate( $inputs.itervalues() )
#if $input.type == "repeat"
<div class="repeat-group">
<div class="form-title-row"><b>${input.title_plural}</b></div>
#set repeat_state = $tool_state[$input.name]
#for i in range( len( $repeat_state ) ):
<div class="repeat-group-item">
#if $input.name in errors
#set rep_errors = $errors[$input.name][$i]
#else
#set rep_errors = dict()
#end if
<div class="form-title-row"><b>${input.title} ${i + 1}</b></div>
$do_inputs( $input.inputs, $repeat_state[$i], $rep_errors, $prefix + $input.name + "_" + str(i) + "|", $context )
<div class="form-row"><input type="submit" name="${prefix}${input.name}_${i}_remove" value="Remove ${input.title} ${i+1}"></div>
</div>
#end for
<div class="form-row"><input type="submit" name="${prefix}${input.name}_add" value="Add new ${input.title}"></div>
</div>
#elif $input.type == "conditional"
#set group_state = $tool_state[$input.name]
#set group_errors = $errors.get( $input.name, {} )
#set current_case = $group_state['__current_case__']
#set prefix = $prefix + $input.name + "|"
$row_for_param( $prefix, $input.test_param, $group_state, $group_errors, $context )
$do_inputs( $input.cases[$current_case].inputs, $group_state, $group_errors, $prefix, $context )
#else
$row_for_param( $prefix, $input, $tool_state, $errors, $context )
#end if
#end for
#end def
#def row_for_param( $prefix, $param, $parent_state, $parent_errors, $context )
#if $parent_errors.has_key( $param.name ):
#set cls = "form-row form-row-error"
#else
#set cls = "form-row"
#end if
<div class="$cls">
<label>
${param.get_label()}:
</label>
#set field = $param.get_html_field( $caller, $parent_state[ $param.name ], $context )
#set $field.refresh_on_change = $param.refresh_on_change
<div style="float: left; width: 250px; margin-right: 10px;">$field.get_html( $prefix )</div>
#if $parent_errors.has_key( $param.name ):
<div style="float: left; color: red; font-weight: bold; padding-top: 1px; padding-bottom: 3px;">
<div style="width: 300px;"><img style="vertical-align: middle;" src="$h.url_for('/static/style/error_small.png')">&nbsp;<span style="vertical-align: middle;">$parent_errors[$param.name]</span></div>
</div>
#elif $param.help
##<div class="toolParamHelp" style="float: right;">$param.help</div>
#end if
#if $param.help
<div class="toolParamHelp" style="clear: both;">
$param.help
</div>
#end if
<div style="clear: both"></div>
</div>
#end def
<div class="toolForm" id="$tool.id">
#if $tool.has_multiple_pages
<div class="toolFormTitle">$tool.name (step #echo $tool_state.page+1 # of $tool.npages)</div>
#else
<div class="toolFormTitle">$tool.name</div>
#end if
<div class="toolFormBody">
<form id="tool_form" name="tool_form" action="$h.url_for( $tool.action )" enctype="$tool.enctype" target="$tool.target" method="$tool.method">
<input type="hidden" name="tool_id" value="$tool.id">
<input type="hidden" name="tool_state" value="$util.object_to_string( $tool_state.encode( $tool, $app ) )">
#if $tool.display_by_page[$tool_state.page]
$caller.fill_template_string( $tool.display_by_page[$tool_state.page], context=$tool.get_param_html_map( $caller, $tool_state.page, $tool_state.inputs ) )
<input type="submit" class="primary-button" name="runtool_btn" value="Execute">
#else
<div style="display: none;">
#if $tool_state.page == $tool.last_page
<input type="submit" class="primary-button" name="runtool_btn" value="Execute">
#else
<input type="submit" class="primary-button" name="runtool_btn" value="Next step">
#end if
</div>
$do_inputs( $tool.inputs_by_page[ $tool_state.page ], $tool_state.inputs, $errors, "" )
<div class="form-row">
#if $tool_state.page == $tool.last_page
<input type="submit" class="primary-button" name="runtool_btn" value="Execute">
#else
<input type="submit" class="primary-button" name="runtool_btn" value="Next step">
#end if
</div>
#end if
</form>
</div>
</div>
#if $tool.help
<div class="toolHelp">
<div class="toolHelpBody">
#if $tool.has_multiple_pages
$tool.help_by_page[$tool_state.page]
#else
$tool.help
#end if
</div>
</div>
#end if
</body>
</html>