PageRenderTime 14ms CodeModel.GetById 12ms app.highlight 0ms RepoModel.GetById 1ms app.codeStats 1ms

/templates/requests/common/view_sample_datasets.mako

https://bitbucket.org/cistrome/cistrome-harvard/
Mako | 49 lines | 41 code | 6 blank | 2 comment | 5 complexity | 5a51f6676e991e7bb8bdeb6544eaef76 MD5 | raw file
 1<%inherit file="/base.mako"/>
 2<%namespace file="/message.mako" import="render_msg" />
 3<%namespace file="/requests/common/common.mako" import="render_sample_datasets" />
 4<%namespace file="/requests/common/common.mako" import="common_javascripts" />
 5
 6<%def name="javascripts()">
 7   ${parent.javascripts()}
 8   ${common_javascripts()}
 9</%def>
10
11<%
12    is_admin = cntrller == 'requests_admin' and trans.user_is_admin()
13    is_complete = sample.request.is_complete
14    is_submitted = sample.request.is_submitted
15    can_select_datasets = is_admin and ( is_complete or is_submitted )
16    can_transfer_datasets = is_admin and sample.untransferred_dataset_files and sample.library and sample.folder
17%>
18
19<br/><br/>
20
21<ul class="manage-table-actions">
22    %if can_transfer_datasets:
23        <li><a class="action-button" href="${h.url_for( controller='requests_admin', action='manage_datasets', cntrller=cntrller, sample_id=trans.security.encode_id( sample.id ) )}">Manage selected datasets</a></li>
24    %endif
25    <li><a class="action-button" id="sample-${sample.id}-popup" class="menubutton">Dataset Actions</a></li>
26    <div popupmenu="sample-${sample.id}-popup">
27        %if can_select_datasets:
28            <li><a class="action-button" href="${h.url_for( controller='requests_admin', action='select_datasets_to_transfer', cntrller=cntrller, request_id=trans.security.encode_id( sample.request.id ), sample_id=trans.security.encode_id( sample.id ) )}">Select more datasets</a></li>
29        %endif
30        <li><a class="action-button" href="${h.url_for( controller='library_common', action='browse_library', cntrller=cntrller, id=trans.security.encode_id( sample.library.id ) )}">View target Data Library</a></li>
31        <li><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></li>
32    </div>
33</ul>
34
35%if message:
36    ${render_msg( message, status )}
37%endif
38
39%if sample and sample_datasets:
40    ## The list of sample_datasets may not be the same as sample.datasets because it may be
41    ## filtered by a transfer_status value.  The value of title changes based on this filter.
42    ${render_sample_datasets( cntrller, sample, sample_datasets, title )}
43%else:
44    %if transfer_status:
45        No datasets with status "${transfer_status}" belong to this sample
46    %else:
47        No datasets have been selected for this sample.
48    %endif
49%endif