PageRenderTime 43ms CodeModel.GetById 27ms RepoModel.GetById 1ms app.codeStats 0ms

/templates/history/view.mako

https://bitbucket.org/cistrome/cistrome-harvard/
Mako | 126 lines | 107 code | 15 blank | 4 comment | 8 complexity | a8174a7d1a4710dfb9bd0d302cf5b1a8 MD5 | raw file
  1. <%inherit file="/webapps/galaxy/base_panels.mako"/>
  2. <%namespace file="/display_common.mako" import="get_history_link, get_controller_name" />
  3. <%namespace file="/root/history_common.mako" import="render_dataset" />
  4. <%namespace file="/tagging_common.mako" import="render_individual_tagging_element, render_community_tagging_element" />
  5. <%def name="javascripts()">
  6. ${parent.javascripts()}
  7. ${h.js( "galaxy.base", "jquery", "json2", "jstorage" )}
  8. <script type="text/javascript">
  9. $(function() {
  10. init_history_items( $("div.historyItemWrapper"), false, "nochanges" );
  11. });
  12. </script>
  13. </%def>
  14. <%def name="stylesheets()">
  15. ${parent.stylesheets()}
  16. ${h.css( "history", "autocomplete_tagging" )}
  17. <style type="text/css">
  18. .historyItemContainer {
  19. padding-right: 3px;
  20. border-right-style: solid;
  21. border-right-color: #66AA66;
  22. }
  23. .page-body
  24. {
  25. padding: 10px;
  26. float: left;
  27. width: 65%;
  28. }
  29. .page-meta
  30. {
  31. float: right;
  32. width: 27%;
  33. padding: 0.5em;
  34. margin: 0.25em;
  35. vertical-align: text-top;
  36. border: 2px solid #DDDDDD;
  37. border-top: 4px solid #DDDDDD;
  38. }
  39. </style>
  40. <style>
  41. .historyItemBody {
  42. display: none;
  43. }
  44. </style>
  45. <noscript>
  46. <style>
  47. .historyItemBody {
  48. display: block;
  49. }
  50. </style>
  51. </noscript>
  52. </%def>
  53. <%def name="init()">
  54. <%
  55. self.has_left_panel=False
  56. self.has_right_panel=False
  57. self.message_box_visible=False
  58. %>
  59. </%def>
  60. <%def name="center_panel()">
  61. ## Get URL to other histories owned by user that owns this history.
  62. <%
  63. ##TODO: is there a better way to create this URL? Can't use 'f-username' as a key b/c it's not a valid identifier.
  64. href_to_published_histories = h.url_for( controller='/history', action='list_published')
  65. if history.user is not None:
  66. href_to_user_histories = h.url_for( controller='/history', action='list_published', xxx=history.user.username).replace( 'xxx', 'f-username')
  67. else:
  68. href_to_user_histories = h.url_for( controller='/history', action='list_published' )##should this instead be be None or empty string?
  69. %>
  70. <div class="unified-panel-header" unselectable="on">
  71. </div>
  72. <div class="unified-panel-body">
  73. <div style="overflow: auto; height: 100%;">
  74. ## Render view of history.
  75. <div id="top-links" class="historyLinks" style="padding: 0px 0px 5px 0px">
  76. <a href="${h.url_for( action='imp', id=trans.security.encode_id(history.id) )}">import and start using history</a> |
  77. <a href="${get_history_link( history )}">${_('refresh')}</a>
  78. %if show_deleted:
  79. | <a href="${h.url_for( id=trans.security.encode_id(history.id), show_deleted=False )}">${_('hide deleted')}</a>
  80. %else:
  81. | <a href="${h.url_for( id=trans.security.encode_id(history.id), show_deleted=True )}">${_('show deleted')}</a>
  82. %endif
  83. | <a href="#" class="toggle">collapse all</a>
  84. </div>
  85. <div id="history-name-area" class="historyLinks" style="color: gray; font-weight: bold; padding: 0px 0px 5px 0px">
  86. <div id="history-name">${history.get_display_name()}</div>
  87. </div>
  88. %if history.deleted:
  89. <div class="warningmessagesmall">
  90. ${_('You are currently viewing a deleted history!')}
  91. </div>
  92. <p></p>
  93. %endif
  94. %if not datasets:
  95. <div class="infomessagesmall" id="emptyHistoryMessage">
  96. %else:
  97. ## Render requested datasets, ordered from newest to oldest
  98. %for data in datasets:
  99. %if data.visible:
  100. <div class="historyItemContainer visible-right-border" id="historyItemContainer-${data.id}">
  101. ${render_dataset( data, data.hid, show_deleted_on_refresh = show_deleted, for_editing=False )}
  102. </div>
  103. %endif
  104. %endfor
  105. <div class="infomessagesmall" id="emptyHistoryMessage" style="display:none;">
  106. %endif
  107. ${_("Your history is empty. Click 'Get Data' on the left pane to start")}
  108. </div>
  109. </div>
  110. </div>
  111. </%def>