PageRenderTime 828ms CodeModel.GetById 618ms app.highlight 10ms RepoModel.GetById 0ms app.codeStats 199ms

/templates/admin/library/ldda_permissions.mako

https://bitbucket.org/ialbert/galaxy-genetrack
Mako | 62 lines | 57 code | 5 blank | 0 comment | 3 complexity | 8bfed5c03ae56747e56ad06a82fbe68c MD5 | raw file
 1<%inherit file="/base.mako"/>
 2<%namespace file="/message.mako" import="render_msg" />
 3<%namespace file="/dataset/security_common.mako" import="render_permission_form" />
 4<% from galaxy import util %>
 5
 6<%
 7    roles = trans.app.model.Role.filter( trans.app.model.Role.table.c.deleted==False ).order_by( trans.app.model.Role.table.c.name ).all()
 8    lddas = util.listify( ldda )
 9    if len( lddas ) > 1:
10        name_str = '%d selected datasets' % len( lddas )
11    else:
12        name_str = ldda.name
13%>
14
15<br/><br/>
16<ul class="manage-table-actions">
17    <li>
18        <a class="action-button" href="${h.url_for( controller='admin', action='browse_library', id=library_id )}"><span>Browse this data library</span></a>
19    </li>
20</ul>
21
22%if msg:
23    ${render_msg( msg, messagetype )}
24%endif
25
26%if len( lddas ) > 1:
27    <div class="toolFormTitle">Manage the following selected datasets</div>
28    <p/>
29    <table cellspacing="0" cellpadding="5" border="0" width="100%" class="libraryTitle">
30        %for ldd_assoc in lddas:
31            <tr>
32                <td>
33                    <div class="rowTitle">
34                        <span class="historyItemTitle"><b>${ldd_assoc.name}</b></span>
35                        <a id="ldda-${ldd_assoc.id}-popup" class="popup-arrow" style="display: none;">&#9660;</a>
36                    </div>
37                    <div popupmenu="ldd_assoc-${ldd_assoc.id}-popup">
38                        <a class="action-button" href="${h.url_for( controller='admin', action='library_dataset', id=ldd_assoc.library_dataset_id, library_id=library_id )}">Manage this dataset's versions</a>
39                    </div>
40                </td>
41                <td>
42                    %if ldd_assoc == ldd_assoc.library_dataset.library_dataset_dataset_association:
43                        <i>This is the latest version of this library dataset</i>
44                    %else:
45                        <font color="red"><i>This is an expired version of this library dataset</i></font>
46                    %endif
47                </td>
48            </tr>
49        %endfor
50    </table>
51    <p/>
52%else:
53    %if ldda == ldda.library_dataset.library_dataset_dataset_association:
54        <b><i>This is the latest version of this library dataset</i></b>
55    %else:
56        <font color="red"><b><i>This is an expired version of this library dataset</i></b></font>
57    %endif
58    <p/>
59%endif
60
61<% ldda_ids = ",".join( [ str( d.id ) for d in lddas ] ) %>
62${render_permission_form( lddas[0], name_str, h.url_for( controller='admin', action='library_dataset_dataset_association', library_id=library_id, folder_id=lddas[0].library_dataset.folder.id, id=ldda_ids, permissions=True ), roles )}