PageRenderTime 18ms CodeModel.GetById 15ms app.highlight 1ms RepoModel.GetById 1ms app.codeStats 0ms

/templates/requests/common/view_sample.mako

https://bitbucket.org/cistrome/cistrome-harvard/
Mako | 122 lines | 115 code | 7 blank | 0 comment | 6 complexity | 98dd860b23e9b03e0f608aacb25c77c1 MD5 | raw file
  1<%inherit file="/base.mako"/>
  2<%namespace file="/message.mako" import="render_msg" />
  3<%namespace file="/common/template_common.mako" import="render_template_fields" />
  4
  5<%def name="render_external_service_actions( external_service )">
  6%if external_service:
  7    <p>
  8        <div class="toolForm">
  9            <div class="toolFormTitle">Available External Service Actions for ${sample.name} at ${external_service.name}</div>
 10            <div class="toolFormBody">
 11                    <div class="toolMenu">
 12                        %for item in external_service.actions:
 13                            ${ render_external_service_action_group( item ) }
 14                        %endfor
 15                    </div>
 16            </div>
 17        </div>
 18    </p>
 19%endif
 20</%def>
 21
 22<%def name="render_external_service_action_group( external_service_group )">
 23    %if external_service_group.has_action():
 24        %if external_service_group.label:
 25            <div class="form-row">
 26                <div class="toolSectionList">
 27                    <div class="toolSectionTitle">
 28                        <span>${external_service_group.label}</span>
 29                    </div>
 30                    <div class="toolSectionBody">
 31                        <div class="toolSectionBg">
 32        %endif
 33                        %for item in external_service_group:
 34                            %if isinstance( item, list ):
 35                                ${ render_external_service_action_group( item ) }
 36                            %else:
 37                                ${ render_external_service_action( item ) }
 38                            %endif
 39                        %endfor
 40        %if external_service_group.label:
 41                        </div>
 42                    </div>
 43                </div>
 44            </div>
 45        %endif
 46    %endif
 47</%def>
 48
 49<%def name="render_external_service_action( external_service_action )">
 50    <%
 51        if hasattr( external_service_action.action, 'target' ):
 52            target = external_service_action.action.target
 53        else:
 54            target = 'galaxy_main'
 55    %>
 56    <div class="toolTitle">
 57        <a href="${external_service_action.get_action_access_link( trans )}" target="${target}">${external_service_action.label}</a>
 58    </div>
 59</%def>
 60
 61<br/><br/>
 62<ul class="manage-table-actions">
 63    <li><a class="action-button" id="sample-${sample.id}-popup" class="menubutton">Sample Actions</a></li>
 64    <div popupmenu="sample-${sample.id}-popup">
 65        <a class="action-button" href="${h.url_for( controller='requests_common', action='view_request', cntrller=cntrller, id=trans.security.encode_id( sample.request.id ) )}">Browse this request</a>
 66        %if sample.runs:
 67            <a class="action-button" href="${h.url_for( controller='requests_common', action='edit_template', cntrller=cntrller, item_type='sample', form_type=trans.app.model.FormDefinition.types.RUN_DETAILS_TEMPLATE, sample_id=trans.security.encode_id( sample.id ) )}">Edit template</a>
 68            <a class="action-button" href="${h.url_for( controller='requests_common', action='delete_template', cntrller=cntrller, item_type='sample', form_type=trans.app.model.FormDefinition.types.RUN_DETAILS_TEMPLATE, sample_id=trans.security.encode_id( sample.id ) )}">Unuse template</a>
 69        %endif
 70    </div>
 71</ul>
 72
 73%if message:
 74    ${render_msg( message, status )}
 75%endif
 76
 77<div class="toolForm">
 78    <div class="toolFormTitle">Sample "${sample.name}"</div>
 79    <div class="toolFormBody">
 80        <div class="form-row">
 81            <label>Name:</label>
 82            ${sample.name}
 83            <div style="clear: both"></div>
 84        </div>
 85        <div class="form-row">
 86            <label>Description:</label>
 87            ${sample.desc}
 88            <div style="clear: both"></div>
 89        </div>
 90        <div class="form-row">
 91            <label>Barcode:</label>
 92            ${sample.bar_code}
 93            <div style="clear: both"></div>
 94        </div>
 95        %if sample.library:
 96            <div class="form-row">
 97                <label>Library:</label>
 98                ${sample.library.name}
 99                <div style="clear: both"></div>
100            </div>
101            <div class="form-row">
102                <label>Folder:</label>
103                ${sample.folder.name}
104                <div style="clear: both"></div>
105            </div>
106        %endif
107        <div class="form-row">
108            <label>Request:</label>
109            ${sample.request.name}
110            <div style="clear: both"></div>
111        </div>
112    </div>
113</div>
114
115%if widgets:
116    ${render_template_fields( cntrller=cntrller, item_type='sample', widgets=widgets, widget_fields_have_contents=widget_fields_have_contents, sample_id=trans.security.encode_id( sample.id ), editable=False )}
117%endif
118%if external_services:
119    %for external_service in external_services:
120        ${ render_external_service_actions( external_service ) }
121    %endfor
122%endif