PageRenderTime 5ms CodeModel.GetById 1ms app.highlight 1ms RepoModel.GetById 1ms app.codeStats 0ms

/templates/common/select_template.mako

https://bitbucket.org/cistrome/cistrome-harvard/
Mako | 76 lines | 72 code | 4 blank | 0 comment | 3 complexity | 07e15219a3074c35c4a37e57b2c78e37 MD5 | raw file
 1<%inherit file="/base.mako"/>
 2<%namespace file="/message.mako" import="render_msg" />
 3
 4<%
 5    in_library = form_type == trans.model.FormDefinition.types.LIBRARY_INFO_TEMPLATE
 6    in_sample_tracking = form_type == trans.model.FormDefinition.types.RUN_DETAILS_TEMPLATE
 7    if in_library:
 8        # If rendering for a library folder or dataset, inheritance is set by the user, while
 9        # rendering for a RequestType, the template is always available to samples.
10        from galaxy.web.form_builder import CheckboxField
11        inheritable_check_box = CheckboxField( 'inheritable' )
12%>
13
14<br/><br/>
15<ul class="manage-table-actions">
16    %if in_library:
17        <li><a class="action-button" href="${h.url_for( controller='library_common', action='browse_library', cntrller=cntrller, id=library_id, use_panels=use_panels, show_deleted=show_deleted )}"><span>Browse the data library</span></a></li>
18    %elif in_sample_tracking:
19        <li><a class="action-button" href="${h.url_for( controller='request_type', action='view_request_type', id=request_type_id )}"><span>Browse the configuration</span></a></li>
20    %endif
21</ul>
22
23%if message:
24    ${render_msg( message, status )}
25%endif
26
27<div class="toolForm">
28    <div class="toolFormTitle">Select a template for the ${item_desc} '${util.unicodify( item_name )}'</div>
29    <div class="toolFormBody">
30        %if form_type == trans.model.FormDefinition.types.LIBRARY_INFO_TEMPLATE:
31            <form id="select_template" name="select_template" action="${h.url_for( controller='library_common', action='add_template', cntrller=cntrller, item_type=item_type, form_type=trans.model.FormDefinition.types.LIBRARY_INFO_TEMPLATE, library_id=library_id, folder_id=folder_id, ldda_id=ldda_id, use_panels=use_panels, show_deleted=show_deleted )}" method="post" >
32        %elif form_type == trans.model.FormDefinition.types.RUN_DETAILS_TEMPLATE:
33            <form id="select_template" name="select_template" action="${h.url_for( controller='request_type', action='add_template', cntrller=cntrller, item_type=item_type, form_type=trans.model.FormDefinition.types.RUN_DETAILS_TEMPLATE, request_type_id=request_type_id, sample_id=sample_id )}" method="post">
34        %endif
35            <div class="form-row">
36                <label>Template:</label>
37                ${form_id_select_field.get_html()}
38            </div>
39            % if form_type == trans.model.FormDefinition.types.LIBRARY_INFO_TEMPLATE and item_type in [ 'library', 'folder' ]:
40                <div class="form-row">
41                    %if inheritable_checked:
42                        <% inheritable_check_box.checked = True %>
43                    %endif
44                    ${inheritable_check_box.get_html()}
45                    <label for="inheritable" style="display:inline;">Inherit template to contained folders and datasets?</label>
46                    <div class="toolParamHelp" style="clear: both;">
47                        Check if you want this template to be used by other folders and datasets contained within this ${item_desc}
48                    </div>
49                </div>
50            %endif
51            <div class="form-row">
52                <input type="submit" name="add_template_button" value="Use this template"/>
53            </div>
54        </form>
55    </div>
56</div>
57<p/>
58%if form_id_select_field.get_selected( return_label=True, return_value=True ) != ('Select one', 'none'):
59    <div class="toolForm">
60        <div class="toolFormTitle">Layout of selected template</div>
61        <div class="toolFormBody">
62            <div class="form-row">
63                %for i, field in enumerate( widgets ):
64                    <div class="form-row">
65                        <label>${field[ 'label' ]}</label>
66                        ${field[ 'widget' ].get_html( disabled=True )}
67                        <div class="toolParamHelp" style="clear: both;">
68                            ${field[ 'helptext' ]}
69                        </div>
70                        <div style="clear: both"></div>
71                    </div>
72                %endfor 
73            </div>
74        </div>
75    </div>
76%endif