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