/templates/history/display.mako

https://bitbucket.org/cistrome/cistrome-harvard/ · Mako · 84 lines · 74 code · 7 blank · 3 comment · 6 complexity · 7901bc5615d3743d64702325015dedcb MD5 · raw file

  1. <%inherit file="/display_base.mako"/>
  2. <%namespace file="/root/history_common.mako" import="render_dataset" />
  3. ## Set vars so that there's no need to change the code below.
  4. <%
  5. history = published_item
  6. datasets = published_item_data
  7. %>
  8. <%def name="javascripts()">
  9. ${parent.javascripts()}
  10. </%def>
  11. <%def name="stylesheets()">
  12. ${parent.stylesheets()}
  13. ${h.css( "history" )}
  14. <style type="text/css">
  15. .historyItemBody {
  16. display: none;
  17. }
  18. .column {
  19. float: left;
  20. padding: 10px;
  21. margin: 20px;
  22. background: #666;
  23. border: 5px solid #ccc;
  24. width: 300px;
  25. }
  26. </style>
  27. <noscript>
  28. <style>
  29. .historyItemBody {
  30. display: block;
  31. }
  32. </style>
  33. </noscript>
  34. </%def>
  35. <%def name="render_item_links( history )">
  36. <a
  37. href="${h.url_for( controller='/history', action='imp', id=trans.security.encode_id(history.id) )}"
  38. class="icon-button import"
  39. ## Needed to overwide initial width so that link is floated left appropriately.
  40. style="width: 100%"
  41. title="Import history">Import history</a>
  42. </%def>
  43. <%def name="render_item( history, datasets )">
  44. %if history.deleted:
  45. <div class="warningmessagesmall">
  46. ${_('You are currently viewing a deleted history!')}
  47. </div>
  48. <p></p>
  49. %endif
  50. %if not datasets:
  51. <div class="infomessagesmall" id="emptyHistoryMessage">
  52. %else:
  53. ## Render requested datasets, ordered from newest to oldest, including annotations.
  54. <table class="annotated-item">
  55. <tr><th>Dataset</th><th class="annotation">Annotation</th></tr>
  56. %for data in datasets:
  57. <tr>
  58. %if data.visible:
  59. <td>
  60. <div class="historyItemContainer visible-right-border" id="historyItemContainer-${data.id}">
  61. ${render_dataset( data, data.hid, show_deleted_on_refresh = show_deleted, for_editing=False )}
  62. </div>
  63. </td>
  64. <td class="annotation">
  65. %if hasattr( data, "annotation") and data.annotation is not None:
  66. ${data.annotation}
  67. %endif
  68. </td>
  69. %endif
  70. </tr>
  71. %endfor
  72. </table>
  73. <div class="infomessagesmall" id="emptyHistoryMessage" style="display:none;">
  74. %endif
  75. ${_("This history is empty.")}
  76. </div>
  77. </%def>