PageRenderTime 30ms CodeModel.GetById 22ms app.highlight 2ms RepoModel.GetById 2ms app.codeStats 0ms

/templates/library/common/ldda_permissions.mako

https://bitbucket.org/cistrome/cistrome-harvard/
Mako | 60 lines | 53 code | 5 blank | 2 comment | 3 complexity | 6a30c4e7bae3d99c2f7fca86715ea62c 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
 5<%
 6    if len( lddas ) > 1:
 7        name_str = '%d selected datasets' % len( lddas )
 8    else:
 9        ldda = lddas[0]
10        name_str = ldda.name
11%>
12
13<br/><br/>
14<ul class="manage-table-actions">
15    <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 this data library</span></a></li>
16</ul>
17
18%if message:
19    ${render_msg( message, status )}
20%endif
21
22%if len( lddas ) > 1:
23    <div class="toolFormTitle">Manage the following selected datasets</div>
24    <p/>
25    <table cellspacing="0" cellpadding="5" border="0" width="100%" class="libraryTitle">
26        %for ldd_assoc in lddas:
27            <tr>
28                <td>
29                    <div class="rowTitle">
30                        <span class="historyItemTitle"><b>${ldd_assoc.name}</b></span>
31                        <a id="ldda-${ldd_assoc.id}-popup" class="popup-arrow" style="display: none;">&#9660;</a>
32                    </div>
33                    <div popupmenu="ldd_assoc-${ldd_assoc.id}-popup">
34                        <a class="action-button" href="${h.url_for( controller='library_common', action='library_dataset_info', id=trans.security.encode_id( ldd_assoc.library_dataset_id ), library_id=library_id )}">Manage this dataset's versions</a>
35                    </div>
36                </td>
37                <td>
38                    %if ldd_assoc == ldd_assoc.library_dataset.library_dataset_dataset_association:
39                        <i>This is the latest version of this library dataset</i>
40                    %else:
41                        <font color="red"><i>This is an expired version of this library dataset</i></font>
42                    %endif
43                </td>
44            </tr>
45        %endfor
46    </table>
47    <p/>
48%else:
49    %if ldda == ldda.library_dataset.library_dataset_dataset_association:
50        <b><i>This is the latest version of this library dataset</i></b>
51    %else:
52        <font color="red"><b><i>This is an expired version of this library dataset</i></b></font>
53    %endif
54    <p/>
55%endif
56
57<% ldda_ids = ",".join( [ trans.security.encode_id( d.id ) for d in lddas ] ) %>
58## LIBRARY_ACCESS is a special permission that is set only at the library level,
59## and DATASET_MANAGE_PERMISSIONS is inherited to the dataset from the ldda.
60${render_permission_form( lddas[0], name_str, h.url_for( controller='library_common', action='ldda_permissions', cntrller=cntrller, library_id=library_id, folder_id=trans.security.encode_id( lddas[0].library_dataset.folder.id ), id=ldda_ids, show_deleted=show_deleted ), roles, do_not_render=[ 'LIBRARY_ACCESS', 'DATASET_MANAGE_PERMISSIONS' ] )}