/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. if len( lddas ) > 1:
  6. name_str = '%d selected datasets' % len( lddas )
  7. else:
  8. ldda = lddas[0]
  9. name_str = ldda.name
  10. %>
  11. <br/><br/>
  12. <ul class="manage-table-actions">
  13. <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>
  14. </ul>
  15. %if message:
  16. ${render_msg( message, status )}
  17. %endif
  18. %if len( lddas ) > 1:
  19. <div class="toolFormTitle">Manage the following selected datasets</div>
  20. <p/>
  21. <table cellspacing="0" cellpadding="5" border="0" width="100%" class="libraryTitle">
  22. %for ldd_assoc in lddas:
  23. <tr>
  24. <td>
  25. <div class="rowTitle">
  26. <span class="historyItemTitle"><b>${ldd_assoc.name}</b></span>
  27. <a id="ldda-${ldd_assoc.id}-popup" class="popup-arrow" style="display: none;">&#9660;</a>
  28. </div>
  29. <div popupmenu="ldd_assoc-${ldd_assoc.id}-popup">
  30. <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>
  31. </div>
  32. </td>
  33. <td>
  34. %if ldd_assoc == ldd_assoc.library_dataset.library_dataset_dataset_association:
  35. <i>This is the latest version of this library dataset</i>
  36. %else:
  37. <font color="red"><i>This is an expired version of this library dataset</i></font>
  38. %endif
  39. </td>
  40. </tr>
  41. %endfor
  42. </table>
  43. <p/>
  44. %else:
  45. %if ldda == ldda.library_dataset.library_dataset_dataset_association:
  46. <b><i>This is the latest version of this library dataset</i></b>
  47. %else:
  48. <font color="red"><b><i>This is an expired version of this library dataset</i></b></font>
  49. %endif
  50. <p/>
  51. %endif
  52. <% ldda_ids = ",".join( [ trans.security.encode_id( d.id ) for d in lddas ] ) %>
  53. ## LIBRARY_ACCESS is a special permission that is set only at the library level,
  54. ## and DATASET_MANAGE_PERMISSIONS is inherited to the dataset from the ldda.
  55. ${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' ] )}