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