galaxy-central / templates / show_params.mako

Full commit
<%inherit file="/base.mako"/>
<% from galaxy.util import nice_size %>

    .inherit {
        border: 1px solid #bbb;
        padding: 15px;
        text-align: center;
        background-color: #eee;

<%def name="inputs_recursive( input_params, param_values, depth=1 )">
    %for input_index, input in enumerate( input_params.itervalues() ):
        %if in param_values:
            %if input.type == "repeat":
                %for i in range( len(param_values[]) ):
                    ${ inputs_recursive(input.inputs, param_values[][i], depth=depth+1) }
            %elif input.type == "conditional":
                <% current_case = param_values[]['__current_case__'] %>
                    ${ inputs_recursive_indent( text=input.test_param.label, depth=depth )}
                    <!-- Get the value of the current Conditonal parameter -->
                ${ inputs_recursive(input.cases[current_case].inputs, param_values[], depth=depth+1) }
            %elif getattr(input, "label", None):
                    ${inputs_recursive_indent( text=input.label, depth=depth )}
            ## Parameter does not have a stored value.
                    # Get parameter label.  
                    if input.type == "conditional":
                        label = input.test_param.label
                        label = input.label
                ${inputs_recursive_indent( text=label, depth=depth )}
                <td><em>not used (parameter was added after this job was run)</em></td>

 ## function to add a indentation depending on the depth in a <tr>
<%def name="inputs_recursive_indent( text, depth )">
    <td style="padding-left: ${ ( depth - 1 ) * 10 }px">

<table class="tabletip">
        <tr><th colspan="2" style="font-size: 120%;">
            % if tool:
                Tool: ${}
            % else:
                Unknown Tool
            % endif
        <tr><td>Created:</td><td>${hda.create_time.strftime("%b %d, %Y")}</td></tr>
        ##      <tr><td>Copied from another history?</td><td>${hda.source_library_dataset}</td></tr>
        <tr><td>Tool Version:</td><td>${hda.tool_version}</td></tr>
        <tr><td>Tool Standard Output:</td><td><a href="${h.url_for( controller='dataset', action='stdout')}">stdout</a></td></tr>
        <tr><td>Tool Standard Error:</td><td><a href="${h.url_for( controller='dataset', action='stderr')}">stderr</a></td></tr>
        <tr><td>Tool Exit Code:</td><td>${job.exit_code}</td></tr>
        %if trans.user_is_admin() or
            <tr><td>Full Path:</td><td>${hda.file_name}</td></tr>
<br />
<table class="tabletip">
            <th>Input Parameter</th>
        % if params_objects and tool:
            ${ inputs_recursive(tool.inputs, params_objects, depth=1) }
        % else:
            <tr><td colspan="2">No parameters.</td></tr>
        % endif

    <h3>Inheritance Chain</h3>
    <div class="inherit" style="background-color: #fff; font-weight:bold;">${}</div>

    % for dep in inherit_chain:
    <div style="font-size: 36px; text-align: center;">&uarr;</div>
    <div class="inherit">${dep[0].name}<br/>${dep[1]}</div>
    % endfor